@wordpress/editor 13.0.0 → 13.2.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/LICENSE.md +1 -1
- package/build/components/editor-help/index.native.js +10 -8
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/post-author/select.js +1 -0
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-excerpt/index.js +1 -0
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -0
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-template/index.js +1 -0
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/provider/index.native.js +2 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +16 -8
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +11 -9
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/post-author/select.js +1 -0
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +1 -0
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -0
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-template/index.js +1 -0
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +2 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +17 -9
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-style/style-rtl.css +3 -3
- package/build-style/style.css +3 -3
- package/package.json +29 -29
- package/src/components/editor-help/index.native.js +17 -26
- package/src/components/page-attributes/test/order.js +2 -0
- package/src/components/post-author/select.js +1 -0
- package/src/components/post-excerpt/index.js +1 -0
- package/src/components/post-format/index.js +1 -0
- package/src/components/post-preview-button/test/index.js +2 -0
- package/src/components/post-publish-button/test/index.js +2 -0
- package/src/components/post-saved-state/test/index.js +2 -0
- package/src/components/post-slug/test/index.js +3 -5
- package/src/components/post-template/index.js +1 -0
- package/src/components/provider/index.native.js +1 -0
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/hooks/custom-sources-backwards-compatibility.js +16 -13
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
* @param {string} hex - the hexadecimal value to convert
|
|
60
60
|
* @return {string} comma separated rgb values
|
|
61
61
|
*/
|
|
62
|
-
/**
|
|
63
|
-
* Breakpoint mixins
|
|
64
|
-
*/
|
|
65
62
|
/**
|
|
66
63
|
* Long content fade mixin
|
|
67
64
|
*
|
|
68
65
|
* Creates a fading overlay to signify that the content is longer
|
|
69
66
|
* than the space allows.
|
|
70
67
|
*/
|
|
68
|
+
/**
|
|
69
|
+
* Breakpoint mixins
|
|
70
|
+
*/
|
|
71
71
|
/**
|
|
72
72
|
* Focus styles.
|
|
73
73
|
*/
|
package/build-style/style.css
CHANGED
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
* @param {string} hex - the hexadecimal value to convert
|
|
60
60
|
* @return {string} comma separated rgb values
|
|
61
61
|
*/
|
|
62
|
-
/**
|
|
63
|
-
* Breakpoint mixins
|
|
64
|
-
*/
|
|
65
62
|
/**
|
|
66
63
|
* Long content fade mixin
|
|
67
64
|
*
|
|
68
65
|
* Creates a fading overlay to signify that the content is longer
|
|
69
66
|
* than the space allows.
|
|
70
67
|
*/
|
|
68
|
+
/**
|
|
69
|
+
* Breakpoint mixins
|
|
70
|
+
*/
|
|
71
71
|
/**
|
|
72
72
|
* Focus styles.
|
|
73
73
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,33 +31,33 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^11.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/components": "^23.
|
|
40
|
-
"@wordpress/compose": "^6.
|
|
41
|
-
"@wordpress/core-data": "^6.
|
|
42
|
-
"@wordpress/data": "^8.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
52
|
-
"@wordpress/keycodes": "^3.
|
|
53
|
-
"@wordpress/media-utils": "^4.
|
|
54
|
-
"@wordpress/notices": "^3.
|
|
55
|
-
"@wordpress/preferences": "^3.
|
|
56
|
-
"@wordpress/reusable-blocks": "^4.
|
|
57
|
-
"@wordpress/rich-text": "^6.
|
|
58
|
-
"@wordpress/server-side-render": "^4.
|
|
59
|
-
"@wordpress/url": "^3.
|
|
60
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.25.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.22.0",
|
|
36
|
+
"@wordpress/blob": "^3.25.0",
|
|
37
|
+
"@wordpress/block-editor": "^11.2.0",
|
|
38
|
+
"@wordpress/blocks": "^12.2.0",
|
|
39
|
+
"@wordpress/components": "^23.2.0",
|
|
40
|
+
"@wordpress/compose": "^6.2.0",
|
|
41
|
+
"@wordpress/core-data": "^6.2.0",
|
|
42
|
+
"@wordpress/data": "^8.2.0",
|
|
43
|
+
"@wordpress/date": "^4.25.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.25.0",
|
|
45
|
+
"@wordpress/dom": "^3.25.0",
|
|
46
|
+
"@wordpress/element": "^5.2.0",
|
|
47
|
+
"@wordpress/hooks": "^3.25.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.25.0",
|
|
49
|
+
"@wordpress/i18n": "^4.25.0",
|
|
50
|
+
"@wordpress/icons": "^9.16.0",
|
|
51
|
+
"@wordpress/keyboard-shortcuts": "^4.2.0",
|
|
52
|
+
"@wordpress/keycodes": "^3.25.0",
|
|
53
|
+
"@wordpress/media-utils": "^4.16.0",
|
|
54
|
+
"@wordpress/notices": "^3.25.0",
|
|
55
|
+
"@wordpress/preferences": "^3.2.0",
|
|
56
|
+
"@wordpress/reusable-blocks": "^4.2.0",
|
|
57
|
+
"@wordpress/rich-text": "^6.2.0",
|
|
58
|
+
"@wordpress/server-side-render": "^4.2.0",
|
|
59
|
+
"@wordpress/url": "^3.26.0",
|
|
60
|
+
"@wordpress/wordcount": "^3.25.0",
|
|
61
61
|
"classnames": "^2.3.1",
|
|
62
62
|
"date-fns": "^2.28.0",
|
|
63
63
|
"escape-html": "^1.0.3",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "204c880ff65295768e9695dfee6c7a9fee1fdd05"
|
|
78
78
|
}
|
|
@@ -57,7 +57,7 @@ const HELP_TOPICS = [
|
|
|
57
57
|
},
|
|
58
58
|
];
|
|
59
59
|
|
|
60
|
-
function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
60
|
+
function EditorHelpTopics( { close, isVisible, onClose, showSupport } ) {
|
|
61
61
|
const { postType } = useSelect( ( select ) => ( {
|
|
62
62
|
postType: select( editorStore ).getEditedPostAttribute( 'type' ),
|
|
63
63
|
} ) );
|
|
@@ -67,6 +67,20 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
67
67
|
? __( 'How to edit your page' )
|
|
68
68
|
: __( 'How to edit your post' );
|
|
69
69
|
|
|
70
|
+
const supportSection = (
|
|
71
|
+
<>
|
|
72
|
+
<HelpSectionTitle>{ __( 'Get support' ) }</HelpSectionTitle>
|
|
73
|
+
<HelpGetSupportButton
|
|
74
|
+
title={ __( 'Contact support' ) }
|
|
75
|
+
onPress={ requestContactCustomerSupport }
|
|
76
|
+
/>
|
|
77
|
+
<HelpGetSupportButton
|
|
78
|
+
title={ __( 'More support options' ) }
|
|
79
|
+
onPress={ requestGotoCustomerSupportOptions }
|
|
80
|
+
/>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
|
|
70
84
|
return (
|
|
71
85
|
<BottomSheet
|
|
72
86
|
isVisible={ isVisible }
|
|
@@ -153,31 +167,8 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
153
167
|
);
|
|
154
168
|
}
|
|
155
169
|
) }
|
|
156
|
-
{
|
|
157
|
-
|
|
158
|
-
{ __( 'Get support' ) }
|
|
159
|
-
</HelpSectionTitle>
|
|
160
|
-
}
|
|
161
|
-
{
|
|
162
|
-
<HelpGetSupportButton
|
|
163
|
-
title={ __(
|
|
164
|
-
'Contact support'
|
|
165
|
-
) }
|
|
166
|
-
onPress={
|
|
167
|
-
requestContactCustomerSupport
|
|
168
|
-
}
|
|
169
|
-
/>
|
|
170
|
-
}
|
|
171
|
-
{
|
|
172
|
-
<HelpGetSupportButton
|
|
173
|
-
title={ __(
|
|
174
|
-
'More support options'
|
|
175
|
-
) }
|
|
176
|
-
onPress={
|
|
177
|
-
requestGotoCustomerSupportOptions
|
|
178
|
-
}
|
|
179
|
-
/>
|
|
180
|
-
}
|
|
170
|
+
{ showSupport &&
|
|
171
|
+
supportSection }
|
|
181
172
|
</PanelBody>
|
|
182
173
|
</ScrollView>
|
|
183
174
|
);
|
|
@@ -9,6 +9,8 @@ import userEvent from '@testing-library/user-event';
|
|
|
9
9
|
*/
|
|
10
10
|
import { PageAttributesOrder } from '../order';
|
|
11
11
|
|
|
12
|
+
jest.useFakeTimers();
|
|
13
|
+
|
|
12
14
|
describe( 'PageAttributesOrder', () => {
|
|
13
15
|
/**
|
|
14
16
|
* When starting to type inside the spinbutton, select the current value
|
|
@@ -15,6 +15,7 @@ function PostExcerpt( { excerpt, onUpdateExcerpt } ) {
|
|
|
15
15
|
return (
|
|
16
16
|
<div className="editor-post-excerpt">
|
|
17
17
|
<TextareaControl
|
|
18
|
+
__nextHasNoMarginBottom
|
|
18
19
|
label={ __( 'Write an excerpt (optional)' ) }
|
|
19
20
|
className="editor-post-excerpt__textarea"
|
|
20
21
|
onChange={ ( value ) => onUpdateExcerpt( value ) }
|
|
@@ -9,6 +9,8 @@ import userEvent from '@testing-library/user-event';
|
|
|
9
9
|
*/
|
|
10
10
|
import { PostPublishButton } from '../';
|
|
11
11
|
|
|
12
|
+
jest.useFakeTimers();
|
|
13
|
+
|
|
12
14
|
describe( 'PostPublishButton', () => {
|
|
13
15
|
describe( 'aria-disabled', () => {
|
|
14
16
|
it( 'should be true if post is currently saving', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { act, render, screen } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -11,9 +11,7 @@ import { PostSlug } from '../';
|
|
|
11
11
|
|
|
12
12
|
describe( 'PostSlug', () => {
|
|
13
13
|
it( 'should update slug with sanitized input', async () => {
|
|
14
|
-
const user = userEvent.setup(
|
|
15
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
16
|
-
} );
|
|
14
|
+
const user = userEvent.setup();
|
|
17
15
|
const onUpdateSlug = jest.fn();
|
|
18
16
|
|
|
19
17
|
render( <PostSlug postSlug="index" onUpdateSlug={ onUpdateSlug } /> );
|
|
@@ -21,7 +19,7 @@ describe( 'PostSlug', () => {
|
|
|
21
19
|
const input = screen.getByRole( 'textbox', { name: 'Slug' } );
|
|
22
20
|
await user.clear( input );
|
|
23
21
|
await user.type( input, 'Foo Bar-Baz 9!' );
|
|
24
|
-
input.blur();
|
|
22
|
+
act( () => input.blur() );
|
|
25
23
|
|
|
26
24
|
expect( onUpdateSlug ).toHaveBeenCalledWith( 'foo-bar-baz-9' );
|
|
27
25
|
} );
|
|
@@ -338,6 +338,7 @@ class NativeEditorProvider extends Component {
|
|
|
338
338
|
isVisible={ this.state.isHelpVisible }
|
|
339
339
|
onClose={ () => this.setState( { isHelpVisible: false } ) }
|
|
340
340
|
close={ () => this.setState( { isHelpVisible: false } ) }
|
|
341
|
+
showSupport={ capabilities?.supportSection === true }
|
|
341
342
|
/>
|
|
342
343
|
</>
|
|
343
344
|
);
|
|
@@ -135,7 +135,6 @@ function useBlockEditorSettings( settings, hasTemplate ) {
|
|
|
135
135
|
Object.entries( settings ).filter( ( [ key ] ) =>
|
|
136
136
|
[
|
|
137
137
|
'__experimentalBlockDirectory',
|
|
138
|
-
'__experimentalBlockInspectorTabs',
|
|
139
138
|
'__experimentalDiscussionSettings',
|
|
140
139
|
'__experimentalFeatures',
|
|
141
140
|
'__experimentalPreferredStyleVariations',
|
|
@@ -143,6 +142,7 @@ function useBlockEditorSettings( settings, hasTemplate ) {
|
|
|
143
142
|
'__unstableGalleryWithImageBlocks',
|
|
144
143
|
'alignWide',
|
|
145
144
|
'allowedBlockTypes',
|
|
145
|
+
'blockInspectorTabs',
|
|
146
146
|
'bodyPlaceholder',
|
|
147
147
|
'canLockBlocks',
|
|
148
148
|
'codeEditingEnabled',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { mapValues, isEmpty } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -70,18 +70,17 @@ const createWithMetaAttributeSource = ( metaAttributes ) =>
|
|
|
70
70
|
attributes={ mergedAttributes }
|
|
71
71
|
setAttributes={ ( nextAttributes ) => {
|
|
72
72
|
const nextMeta = Object.fromEntries(
|
|
73
|
-
Object.entries(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
( value, key ) => metaAttributes[ key ]
|
|
73
|
+
Object.entries( nextAttributes ?? {} )
|
|
74
|
+
.filter(
|
|
75
|
+
// Filter to intersection of keys between the updated
|
|
76
|
+
// attributes and those with an associated meta key.
|
|
77
|
+
( [ key ] ) => key in metaAttributes
|
|
79
78
|
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
.map( ( [ attributeKey, value ] ) => [
|
|
80
|
+
// Rename the keys to the expected meta key name.
|
|
81
|
+
metaAttributes[ attributeKey ],
|
|
82
|
+
value,
|
|
83
|
+
] )
|
|
85
84
|
);
|
|
86
85
|
|
|
87
86
|
if ( ! isEmpty( nextMeta ) ) {
|
|
@@ -108,7 +107,11 @@ const createWithMetaAttributeSource = ( metaAttributes ) =>
|
|
|
108
107
|
function shimAttributeSource( settings ) {
|
|
109
108
|
/** @type {WPMetaAttributeMapping} */
|
|
110
109
|
const metaAttributes = mapValues(
|
|
111
|
-
|
|
110
|
+
Object.fromEntries(
|
|
111
|
+
Object.entries( settings.attributes ?? {} ).filter(
|
|
112
|
+
( [ , { source } ] ) => source === 'meta'
|
|
113
|
+
)
|
|
114
|
+
),
|
|
112
115
|
'meta'
|
|
113
116
|
);
|
|
114
117
|
if ( ! isEmpty( metaAttributes ) ) {
|