@wordpress/edit-post 5.0.3 → 5.0.7
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/header/fullscreen-mode-close/index.js +19 -3
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/layout/index.native.js +5 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +1 -4
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +18 -7
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/template/index.js +5 -2
- package/build/components/sidebar/template/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +2 -1
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/editor.js +11 -3
- package/build/editor.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +19 -4
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +5 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +1 -4
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +19 -8
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/template/index.js +5 -2
- package/build-module/components/sidebar/template/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +2 -1
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/editor.js +11 -3
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +5 -0
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +18 -36
- package/build-style/style.css +18 -36
- package/package.json +22 -22
- package/src/components/header/fullscreen-mode-close/index.js +37 -15
- package/src/components/layout/index.native.js +7 -1
- package/src/components/meta-boxes/index.js +2 -9
- package/src/components/preferences-modal/index.js +30 -21
- package/src/components/preferences-modal/style.scss +6 -40
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +79 -36
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/src/components/sidebar/template/index.js +5 -3
- package/src/components/sidebar/template-summary/index.js +1 -1
- package/src/components/sidebar/template-summary/style.scss +2 -1
- package/src/components/visual-editor/style.scss +4 -5
- package/src/editor.js +15 -2
- package/src/hooks/validate-multiple-use/index.js +1 -1
- package/src/index.js +3 -0
|
@@ -7,12 +7,17 @@ import { get } from 'lodash';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
Icon,
|
|
13
|
+
__unstableMotion as motion,
|
|
14
|
+
} from '@wordpress/components';
|
|
11
15
|
import { __ } from '@wordpress/i18n';
|
|
12
16
|
import { addQueryArgs } from '@wordpress/url';
|
|
13
17
|
import { wordpress } from '@wordpress/icons';
|
|
14
18
|
import { store as editorStore } from '@wordpress/editor';
|
|
15
19
|
import { store as coreStore } from '@wordpress/core-data';
|
|
20
|
+
import { useReducedMotion } from '@wordpress/compose';
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
23
|
* Internal dependencies
|
|
@@ -44,15 +49,26 @@ function FullscreenModeClose( { showTooltip, icon, href } ) {
|
|
|
44
49
|
[]
|
|
45
50
|
);
|
|
46
51
|
|
|
52
|
+
const disableMotion = useReducedMotion();
|
|
53
|
+
|
|
47
54
|
if ( ! isActive || ! postType ) {
|
|
48
55
|
return null;
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
let buttonIcon = <Icon size="36px" icon={ wordpress } />;
|
|
52
59
|
|
|
60
|
+
const effect = {
|
|
61
|
+
expand: {
|
|
62
|
+
scale: 1.7,
|
|
63
|
+
borderRadius: 0,
|
|
64
|
+
transition: { type: 'tween', duration: '0.2' },
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
53
68
|
if ( siteIconUrl ) {
|
|
54
69
|
buttonIcon = (
|
|
55
|
-
<img
|
|
70
|
+
<motion.img
|
|
71
|
+
variants={ ! disableMotion && effect }
|
|
56
72
|
alt={ __( 'Site Icon' ) }
|
|
57
73
|
className="edit-post-fullscreen-mode-close_site-icon"
|
|
58
74
|
src={ siteIconUrl }
|
|
@@ -70,19 +86,25 @@ function FullscreenModeClose( { showTooltip, icon, href } ) {
|
|
|
70
86
|
}
|
|
71
87
|
|
|
72
88
|
return (
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
href
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
<motion.div whileHover="expand">
|
|
90
|
+
<Button
|
|
91
|
+
className="edit-post-fullscreen-mode-close has-icon"
|
|
92
|
+
href={
|
|
93
|
+
href ??
|
|
94
|
+
addQueryArgs( 'edit.php', {
|
|
95
|
+
post_type: postType.slug,
|
|
96
|
+
} )
|
|
97
|
+
}
|
|
98
|
+
label={ get(
|
|
99
|
+
postType,
|
|
100
|
+
[ 'labels', 'view_items' ],
|
|
101
|
+
__( 'Back' )
|
|
102
|
+
) }
|
|
103
|
+
showTooltip={ showTooltip }
|
|
104
|
+
>
|
|
105
|
+
{ buttonIcon }
|
|
106
|
+
</Button>
|
|
107
|
+
</motion.div>
|
|
86
108
|
);
|
|
87
109
|
}
|
|
88
110
|
|
|
@@ -91,7 +91,13 @@ class Layout extends Component {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
renderHTML() {
|
|
94
|
-
|
|
94
|
+
const { globalStyles } = this.props;
|
|
95
|
+
return (
|
|
96
|
+
<HTMLTextInput
|
|
97
|
+
parentHeight={ this.state.rootViewHeight }
|
|
98
|
+
style={ globalStyles }
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
renderVisual() {
|
|
@@ -19,22 +19,15 @@ import { store as editPostStore } from '../../store';
|
|
|
19
19
|
|
|
20
20
|
export default function MetaBoxes( { location } ) {
|
|
21
21
|
const registry = useRegistry();
|
|
22
|
-
const {
|
|
23
|
-
metaBoxes,
|
|
24
|
-
isVisible,
|
|
25
|
-
areMetaBoxesInitialized,
|
|
26
|
-
isEditorReady,
|
|
27
|
-
} = useSelect(
|
|
22
|
+
const { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(
|
|
28
23
|
( select ) => {
|
|
29
24
|
const { __unstableIsEditorReady } = select( editorStore );
|
|
30
25
|
const {
|
|
31
|
-
isMetaBoxLocationVisible,
|
|
32
26
|
getMetaBoxesPerLocation,
|
|
33
27
|
areMetaBoxesInitialized: _areMetaBoxesInitialized,
|
|
34
28
|
} = select( editPostStore );
|
|
35
29
|
return {
|
|
36
30
|
metaBoxes: getMetaBoxesPerLocation( location ),
|
|
37
|
-
isVisible: isMetaBoxLocationVisible( location ),
|
|
38
31
|
areMetaBoxesInitialized: _areMetaBoxesInitialized(),
|
|
39
32
|
isEditorReady: __unstableIsEditorReady(),
|
|
40
33
|
};
|
|
@@ -60,7 +53,7 @@ export default function MetaBoxes( { location } ) {
|
|
|
60
53
|
{ map( metaBoxes, ( { id } ) => (
|
|
61
54
|
<MetaBoxVisibility key={ id } id={ id } />
|
|
62
55
|
) ) }
|
|
63
|
-
|
|
56
|
+
<MetaBoxesArea location={ location } />
|
|
64
57
|
</>
|
|
65
58
|
);
|
|
66
59
|
}
|
|
@@ -13,12 +13,14 @@ import {
|
|
|
13
13
|
__experimentalItemGroup as ItemGroup,
|
|
14
14
|
__experimentalItem as Item,
|
|
15
15
|
__experimentalHStack as HStack,
|
|
16
|
+
__experimentalText as Text,
|
|
16
17
|
__experimentalTruncate as Truncate,
|
|
17
18
|
FlexItem,
|
|
18
19
|
Modal,
|
|
19
20
|
TabPanel,
|
|
20
21
|
Button,
|
|
21
22
|
Card,
|
|
23
|
+
CardHeader,
|
|
22
24
|
CardBody,
|
|
23
25
|
} from '@wordpress/components';
|
|
24
26
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
@@ -325,10 +327,10 @@ export default function PreferencesModal() {
|
|
|
325
327
|
);
|
|
326
328
|
} else {
|
|
327
329
|
modalContent = (
|
|
328
|
-
<
|
|
329
|
-
<
|
|
330
|
-
<
|
|
331
|
-
<
|
|
330
|
+
<NavigatorProvider initialPath="/">
|
|
331
|
+
<NavigatorScreen path="/">
|
|
332
|
+
<Card isBorderless size="small">
|
|
333
|
+
<CardBody>
|
|
332
334
|
<ItemGroup>
|
|
333
335
|
{ tabs.map( ( tab ) => {
|
|
334
336
|
return (
|
|
@@ -358,12 +360,21 @@ export default function PreferencesModal() {
|
|
|
358
360
|
);
|
|
359
361
|
} ) }
|
|
360
362
|
</ItemGroup>
|
|
361
|
-
</
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
363
|
+
</CardBody>
|
|
364
|
+
</Card>
|
|
365
|
+
</NavigatorScreen>
|
|
366
|
+
{ sections.map( ( section ) => {
|
|
367
|
+
return (
|
|
368
|
+
<NavigatorScreen
|
|
369
|
+
key={ `${ section.name }-menu` }
|
|
370
|
+
path={ section.name }
|
|
371
|
+
>
|
|
372
|
+
<Card isBorderless size="large">
|
|
373
|
+
<CardHeader
|
|
374
|
+
isBorderless={ false }
|
|
375
|
+
justify="left"
|
|
376
|
+
size="small"
|
|
377
|
+
gap="6"
|
|
367
378
|
>
|
|
368
379
|
<NavigationButton
|
|
369
380
|
path="/"
|
|
@@ -374,17 +385,15 @@ export default function PreferencesModal() {
|
|
|
374
385
|
aria-label={ __(
|
|
375
386
|
'Navigate to the previous view'
|
|
376
387
|
) }
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
</CardBody>
|
|
387
|
-
</Card>
|
|
388
|
+
/>
|
|
389
|
+
<Text size="16">{ section.tabLabel }</Text>
|
|
390
|
+
</CardHeader>
|
|
391
|
+
<CardBody>{ section.content }</CardBody>
|
|
392
|
+
</Card>
|
|
393
|
+
</NavigatorScreen>
|
|
394
|
+
);
|
|
395
|
+
} ) }
|
|
396
|
+
</NavigatorProvider>
|
|
388
397
|
);
|
|
389
398
|
}
|
|
390
399
|
return (
|
|
@@ -14,7 +14,7 @@ $vertical-tabs-width: 160px;
|
|
|
14
14
|
height: 70%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Clears spacing to flush fit the
|
|
17
|
+
// Clears spacing to flush fit the navigator component to the modal edges.
|
|
18
18
|
@media (max-width: #{ ($break-medium - 1) }) {
|
|
19
19
|
.components-modal__content {
|
|
20
20
|
padding: 0;
|
|
@@ -23,45 +23,10 @@ $vertical-tabs-width: 160px;
|
|
|
23
23
|
content: none;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
max-height: 100%;
|
|
31
|
-
overflow-y: auto;
|
|
32
|
-
color: $black;
|
|
33
|
-
|
|
34
|
-
> * {
|
|
35
|
-
// Matches spacing cleared from the modal content element.
|
|
36
|
-
padding: $grid-unit-30 $grid-unit-40;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.components-navigation__menu {
|
|
40
|
-
margin: 0;
|
|
41
|
-
|
|
42
|
-
.components-navigation__item {
|
|
43
|
-
& > button {
|
|
44
|
-
padding: 3px $grid-unit-20;
|
|
45
|
-
height: $grid-unit-60;
|
|
46
|
-
// Aligns button text instead of button box.
|
|
47
|
-
margin: 0 #{-$grid-unit-20};
|
|
48
|
-
width: calc(#{$grid-unit-40} + 100%);
|
|
49
|
-
&:focus {
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
.components-navigation__menu-title-heading {
|
|
55
|
-
border-bottom: 1px solid $gray-300;
|
|
56
|
-
padding-left: 0;
|
|
57
|
-
padding-right: 0;
|
|
58
|
-
}
|
|
59
|
-
.components-navigation__back-button {
|
|
60
|
-
padding-left: 0;
|
|
61
|
-
}
|
|
62
|
-
.edit-post-preferences-modal__custom-fields-confirmation-button {
|
|
63
|
-
width: auto;
|
|
64
|
-
}
|
|
26
|
+
// Keep the navigator component from overflowing the modal content area
|
|
27
|
+
// to ensure that sticky position elements stick where intended.
|
|
28
|
+
.components-navigator-provider {
|
|
29
|
+
height: 100%;
|
|
65
30
|
}
|
|
66
31
|
}
|
|
67
32
|
|
|
@@ -102,6 +67,7 @@ $vertical-tabs-width: 160px;
|
|
|
102
67
|
&__section-title {
|
|
103
68
|
font-size: 0.9rem;
|
|
104
69
|
font-weight: 600;
|
|
70
|
+
margin-top: 0;
|
|
105
71
|
}
|
|
106
72
|
|
|
107
73
|
&__option {
|
|
@@ -40,16 +40,17 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
40
40
|
onRequestClose={[Function]}
|
|
41
41
|
title="Preferences"
|
|
42
42
|
>
|
|
43
|
-
<
|
|
44
|
-
|
|
43
|
+
<NavigatorProvider
|
|
44
|
+
initialPath="/"
|
|
45
45
|
>
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
<NavigatorScreen
|
|
47
|
+
path="/"
|
|
48
|
+
>
|
|
49
|
+
<Card
|
|
50
|
+
isBorderless={true}
|
|
51
|
+
size="small"
|
|
49
52
|
>
|
|
50
|
-
<
|
|
51
|
-
path="/"
|
|
52
|
-
>
|
|
53
|
+
<CardBody>
|
|
53
54
|
<ItemGroup>
|
|
54
55
|
<NavigationButton
|
|
55
56
|
as={
|
|
@@ -169,10 +170,22 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
169
170
|
</HStack>
|
|
170
171
|
</NavigationButton>
|
|
171
172
|
</ItemGroup>
|
|
172
|
-
</
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
</CardBody>
|
|
174
|
+
</Card>
|
|
175
|
+
</NavigatorScreen>
|
|
176
|
+
<NavigatorScreen
|
|
177
|
+
key="general-menu"
|
|
178
|
+
path="general"
|
|
179
|
+
>
|
|
180
|
+
<Card
|
|
181
|
+
isBorderless={true}
|
|
182
|
+
size="large"
|
|
183
|
+
>
|
|
184
|
+
<CardHeader
|
|
185
|
+
gap="6"
|
|
186
|
+
isBorderless={false}
|
|
187
|
+
justify="left"
|
|
188
|
+
size="small"
|
|
176
189
|
>
|
|
177
190
|
<NavigationButton
|
|
178
191
|
aria-label="Navigate to the previous view"
|
|
@@ -188,12 +201,14 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
188
201
|
}
|
|
189
202
|
isBack={true}
|
|
190
203
|
path="/"
|
|
204
|
+
/>
|
|
205
|
+
<Text
|
|
206
|
+
size="16"
|
|
191
207
|
>
|
|
192
|
-
Back
|
|
193
|
-
</NavigationButton>
|
|
194
|
-
<h2>
|
|
195
208
|
General
|
|
196
|
-
</
|
|
209
|
+
</Text>
|
|
210
|
+
</CardHeader>
|
|
211
|
+
<CardBody>
|
|
197
212
|
<Section
|
|
198
213
|
description="Customize options related to the block editor interface and editing flow."
|
|
199
214
|
title="Appearance"
|
|
@@ -224,10 +239,22 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
224
239
|
label="Display block breadcrumbs"
|
|
225
240
|
/>
|
|
226
241
|
</Section>
|
|
227
|
-
</
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
242
|
+
</CardBody>
|
|
243
|
+
</Card>
|
|
244
|
+
</NavigatorScreen>
|
|
245
|
+
<NavigatorScreen
|
|
246
|
+
key="blocks-menu"
|
|
247
|
+
path="blocks"
|
|
248
|
+
>
|
|
249
|
+
<Card
|
|
250
|
+
isBorderless={true}
|
|
251
|
+
size="large"
|
|
252
|
+
>
|
|
253
|
+
<CardHeader
|
|
254
|
+
gap="6"
|
|
255
|
+
isBorderless={false}
|
|
256
|
+
justify="left"
|
|
257
|
+
size="small"
|
|
231
258
|
>
|
|
232
259
|
<NavigationButton
|
|
233
260
|
aria-label="Navigate to the previous view"
|
|
@@ -243,12 +270,14 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
243
270
|
}
|
|
244
271
|
isBack={true}
|
|
245
272
|
path="/"
|
|
273
|
+
/>
|
|
274
|
+
<Text
|
|
275
|
+
size="16"
|
|
246
276
|
>
|
|
247
|
-
Back
|
|
248
|
-
</NavigationButton>
|
|
249
|
-
<h2>
|
|
250
277
|
Blocks
|
|
251
|
-
</
|
|
278
|
+
</Text>
|
|
279
|
+
</CardHeader>
|
|
280
|
+
<CardBody>
|
|
252
281
|
<Section
|
|
253
282
|
description="Customize how you interact with blocks in the block library and editing canvas."
|
|
254
283
|
title="Block interactions"
|
|
@@ -270,10 +299,22 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
270
299
|
>
|
|
271
300
|
<WithSelect(BlockManager) />
|
|
272
301
|
</Section>
|
|
273
|
-
</
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
302
|
+
</CardBody>
|
|
303
|
+
</Card>
|
|
304
|
+
</NavigatorScreen>
|
|
305
|
+
<NavigatorScreen
|
|
306
|
+
key="panels-menu"
|
|
307
|
+
path="panels"
|
|
308
|
+
>
|
|
309
|
+
<Card
|
|
310
|
+
isBorderless={true}
|
|
311
|
+
size="large"
|
|
312
|
+
>
|
|
313
|
+
<CardHeader
|
|
314
|
+
gap="6"
|
|
315
|
+
isBorderless={false}
|
|
316
|
+
justify="left"
|
|
317
|
+
size="small"
|
|
277
318
|
>
|
|
278
319
|
<NavigationButton
|
|
279
320
|
aria-label="Navigate to the previous view"
|
|
@@ -289,12 +330,14 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
289
330
|
}
|
|
290
331
|
isBack={true}
|
|
291
332
|
path="/"
|
|
333
|
+
/>
|
|
334
|
+
<Text
|
|
335
|
+
size="16"
|
|
292
336
|
>
|
|
293
|
-
Back
|
|
294
|
-
</NavigationButton>
|
|
295
|
-
<h2>
|
|
296
337
|
Panels
|
|
297
|
-
</
|
|
338
|
+
</Text>
|
|
339
|
+
</CardHeader>
|
|
340
|
+
<CardBody>
|
|
298
341
|
<Section
|
|
299
342
|
description="Choose what displays in the panel."
|
|
300
343
|
title="Document settings"
|
|
@@ -339,9 +382,9 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
339
382
|
description="Add extra areas to the editor."
|
|
340
383
|
title="Additional"
|
|
341
384
|
/>
|
|
342
|
-
</
|
|
343
|
-
</
|
|
344
|
-
</
|
|
345
|
-
</
|
|
385
|
+
</CardBody>
|
|
386
|
+
</Card>
|
|
387
|
+
</NavigatorScreen>
|
|
388
|
+
</NavigatorProvider>
|
|
346
389
|
</Modal>
|
|
347
390
|
`;
|
|
@@ -47,13 +47,15 @@ export function TemplatePanel() {
|
|
|
47
47
|
getCurrentPostType,
|
|
48
48
|
} = select( editorStore );
|
|
49
49
|
const { getPostType, getEntityRecords, canUser } = select( coreStore );
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const currentPostType = getCurrentPostType();
|
|
51
|
+
const _isViewable = getPostType( currentPostType )?.viewable ?? false;
|
|
52
52
|
const _supportsTemplateMode =
|
|
53
53
|
select( editorStore ).getEditorSettings().supportsTemplateMode &&
|
|
54
54
|
_isViewable;
|
|
55
55
|
|
|
56
|
-
const wpTemplates = getEntityRecords( 'postType', 'wp_template'
|
|
56
|
+
const wpTemplates = getEntityRecords( 'postType', 'wp_template', {
|
|
57
|
+
post_type: currentPostType,
|
|
58
|
+
} );
|
|
57
59
|
|
|
58
60
|
const newAvailableTemplates = fromPairs(
|
|
59
61
|
( wpTemplates || [] ).map( ( { slug, title } ) => [
|
|
@@ -42,12 +42,11 @@
|
|
|
42
42
|
// Center.
|
|
43
43
|
margin-left: auto;
|
|
44
44
|
margin-right: auto;
|
|
45
|
-
|
|
46
|
-
// Margins between the title and the first block, or appender, do not collapse.
|
|
47
|
-
// However in that support block gap, the first items in post content do not have a top margin.
|
|
48
|
-
// By leveraging the gap variable, with a fallback of zero, we handle both cases.
|
|
49
|
-
margin-bottom: var(--wp--style--block-gap, 0);
|
|
50
45
|
}
|
|
46
|
+
|
|
47
|
+
// Add extra margin at the top, to push down the Title area in the post editor.
|
|
48
|
+
margin-top: 4rem;
|
|
49
|
+
margin-bottom: var(--wp--style--block-gap);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
.edit-post-visual-editor__exit-template-mode {
|
package/src/editor.js
CHANGED
|
@@ -161,9 +161,22 @@ function Editor( {
|
|
|
161
161
|
] );
|
|
162
162
|
|
|
163
163
|
const styles = useMemo( () => {
|
|
164
|
-
|
|
164
|
+
const themeStyles = [];
|
|
165
|
+
const presetStyles = [];
|
|
166
|
+
settings.styles.forEach( ( style ) => {
|
|
167
|
+
if ( ! style.__unstableType || style.__unstableType === 'theme' ) {
|
|
168
|
+
themeStyles.push( style );
|
|
169
|
+
} else {
|
|
170
|
+
presetStyles.push( style );
|
|
171
|
+
}
|
|
172
|
+
} );
|
|
173
|
+
const defaultEditorStyles = [
|
|
174
|
+
...settings.defaultEditorStyles,
|
|
175
|
+
...presetStyles,
|
|
176
|
+
];
|
|
177
|
+
return hasThemeStyles && themeStyles.length
|
|
165
178
|
? settings.styles
|
|
166
|
-
:
|
|
179
|
+
: defaultEditorStyles;
|
|
167
180
|
}, [ settings, hasThemeStyles ] );
|
|
168
181
|
|
|
169
182
|
if ( ! post ) {
|
|
@@ -108,7 +108,7 @@ const withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {
|
|
|
108
108
|
),
|
|
109
109
|
] }
|
|
110
110
|
>
|
|
111
|
-
<strong>{ blockType
|
|
111
|
+
<strong>{ blockType?.title }: </strong>
|
|
112
112
|
{ __( 'This block can only be used once.' ) }
|
|
113
113
|
</Warning>,
|
|
114
114
|
];
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { store as blocksStore } from '@wordpress/blocks';
|
|
4
5
|
import {
|
|
5
6
|
registerCoreBlocks,
|
|
6
7
|
__experimentalRegisterExperimentalCoreBlocks,
|
|
@@ -90,6 +91,7 @@ export function initializeEditor(
|
|
|
90
91
|
dispatch( interfaceStore ).setFeatureDefaults( 'core/edit-post', {
|
|
91
92
|
fixedToolbar: false,
|
|
92
93
|
welcomeGuide: true,
|
|
94
|
+
mobileGalleryWarning: true,
|
|
93
95
|
fullscreenMode: true,
|
|
94
96
|
showIconLabels: false,
|
|
95
97
|
themeStyles: true,
|
|
@@ -97,6 +99,7 @@ export function initializeEditor(
|
|
|
97
99
|
welcomeGuideTemplate: true,
|
|
98
100
|
} );
|
|
99
101
|
|
|
102
|
+
dispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();
|
|
100
103
|
registerCoreBlocks();
|
|
101
104
|
if ( process.env.GUTENBERG_PHASE === 2 ) {
|
|
102
105
|
__experimentalRegisterExperimentalCoreBlocks( {
|