Skip to content

Commit fdb2dac

Browse files
committed
Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us to include the other block editor updates for WordPress 5.9: FSE infrastrucutre, site editor and global styles. Props noisysocks. See #54337. git-svn-id: https://develop.svn.wordpress.org/trunk@52042 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7bbee20 commit fdb2dac

72 files changed

Lines changed: 5058 additions & 4078 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gruntfile.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,9 @@ module.exports = function(grunt) {
15491549
* @ticket 46218
15501550
*/
15511551
grunt.registerTask( 'verify:source-maps', function() {
1552+
const ignoredFiles = [
1553+
'build/wp-includes/js/dist/components.js'
1554+
];
15521555
const files = buildFiles.reduce( ( acc, path ) => {
15531556
// Skip excluded paths and any path that isn't a file.
15541557
if ( '!' === path[0] || '**' !== path.substr( -2 ) ) {
@@ -1563,18 +1566,20 @@ module.exports = function(grunt) {
15631566
'No JavaScript files found in the build directory.'
15641567
);
15651568

1566-
files.forEach( function( file ) {
1567-
const contents = fs.readFileSync( file, {
1568-
encoding: 'utf8',
1569-
} );
1570-
// `data:` URLs are allowed:
1571-
const match = contents.match( /sourceMappingURL=((?!data:).)/ );
1569+
files
1570+
.filter(file => ! ignoredFiles.includes( file) )
1571+
.forEach( function( file ) {
1572+
const contents = fs.readFileSync( file, {
1573+
encoding: 'utf8',
1574+
} );
1575+
// `data:` URLs are allowed:
1576+
const match = contents.match( /sourceMappingURL=((?!data:).)/ );
15721577

1573-
assert(
1574-
match === null,
1575-
`The ${ file } file must not contain a sourceMappingURL.`
1576-
);
1577-
} );
1578+
assert(
1579+
match === null,
1580+
`The ${ file } file must not contain a sourceMappingURL.`
1581+
);
1582+
} );
15781583
} );
15791584

15801585
grunt.registerTask( 'build', function() {

package-lock.json

Lines changed: 3727 additions & 3751 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"last 2 Opera versions"
2525
],
2626
"devDependencies": {
27-
"@wordpress/babel-preset-default": "6.2.1",
28-
"@wordpress/custom-templated-path-webpack-plugin": "2.0.5",
29-
"@wordpress/dependency-extraction-webpack-plugin": "3.1.4",
30-
"@wordpress/e2e-test-utils": "5.4.3",
31-
"@wordpress/library-export-default-webpack-plugin": "2.0.5",
32-
"@wordpress/scripts": "16.1.5",
27+
"@wordpress/babel-preset-default": "6.3.4",
28+
"@wordpress/custom-templated-path-webpack-plugin": "2.1.0",
29+
"@wordpress/dependency-extraction-webpack-plugin": "3.2.1",
30+
"@wordpress/e2e-test-utils": "5.4.6",
31+
"@wordpress/library-export-default-webpack-plugin": "2.2.0",
32+
"@wordpress/scripts": "19.1.0",
3333
"autoprefixer": "^9.8.6",
3434
"chalk": "4.1.1",
3535
"check-node-version": "4.1.0",
@@ -78,58 +78,58 @@
7878
"webpack-livereload-plugin": "2.3.0"
7979
},
8080
"dependencies": {
81-
"@wordpress/a11y": "3.1.2",
82-
"@wordpress/annotations": "2.1.6",
83-
"@wordpress/api-fetch": "5.1.2",
84-
"@wordpress/autop": "3.1.2",
85-
"@wordpress/blob": "3.1.2",
86-
"@wordpress/block-directory": "2.1.21",
87-
"@wordpress/block-editor": "6.1.14",
88-
"@wordpress/block-library": "3.2.19",
89-
"@wordpress/block-serialization-default-parser": "4.1.2",
90-
"@wordpress/blocks": "9.1.8",
91-
"@wordpress/components": "14.1.11",
92-
"@wordpress/compose": "4.1.6",
93-
"@wordpress/core-data": "3.1.12",
94-
"@wordpress/customize-widgets": "1.0.20",
95-
"@wordpress/data": "5.1.6",
96-
"@wordpress/data-controls": "2.1.6",
97-
"@wordpress/date": "4.1.2",
98-
"@wordpress/deprecated": "3.1.2",
99-
"@wordpress/dom": "3.1.5",
100-
"@wordpress/dom-ready": "3.1.2",
101-
"@wordpress/edit-post": "4.1.21",
102-
"@wordpress/edit-widgets": "2.1.21",
103-
"@wordpress/editor": "10.1.17",
104-
"@wordpress/element": "3.1.2",
105-
"@wordpress/escape-html": "2.1.2",
106-
"@wordpress/format-library": "2.1.14",
107-
"@wordpress/hooks": "3.1.1",
108-
"@wordpress/html-entities": "3.1.2",
109-
"@wordpress/i18n": "4.1.2",
110-
"@wordpress/icons": "4.0.3",
111-
"@wordpress/interface": "3.1.12",
112-
"@wordpress/is-shallow-equal": "4.1.1",
113-
"@wordpress/keyboard-shortcuts": "2.1.7",
114-
"@wordpress/keycodes": "3.1.2",
115-
"@wordpress/list-reusable-blocks": "2.1.11",
116-
"@wordpress/media-utils": "2.1.2",
117-
"@wordpress/notices": "3.1.6",
118-
"@wordpress/nux": "4.1.11",
119-
"@wordpress/plugins": "3.1.6",
120-
"@wordpress/primitives": "2.1.2",
121-
"@wordpress/priority-queue": "2.1.2",
122-
"@wordpress/redux-routine": "4.1.2",
123-
"@wordpress/reusable-blocks": "2.1.17",
124-
"@wordpress/rich-text": "4.1.6",
125-
"@wordpress/server-side-render": "2.1.12",
126-
"@wordpress/shortcode": "3.1.2",
127-
"@wordpress/token-list": "2.1.1",
128-
"@wordpress/url": "3.1.2",
129-
"@wordpress/viewport": "3.1.6",
130-
"@wordpress/warning": "2.1.2",
131-
"@wordpress/widgets": "1.1.19",
132-
"@wordpress/wordcount": "3.1.2",
81+
"@wordpress/a11y": "3.2.3",
82+
"@wordpress/annotations": "2.2.6",
83+
"@wordpress/api-fetch": "5.2.5",
84+
"@wordpress/autop": "3.2.2",
85+
"@wordpress/blob": "3.2.1",
86+
"@wordpress/block-directory": "3.0.5",
87+
"@wordpress/block-editor": "8.0.0",
88+
"@wordpress/block-library": "6.0.3",
89+
"@wordpress/block-serialization-default-parser": "4.2.2",
90+
"@wordpress/blocks": "11.1.3",
91+
"@wordpress/components": "19.0.1",
92+
"@wordpress/compose": "5.0.5",
93+
"@wordpress/core-data": "4.0.5",
94+
"@wordpress/customize-widgets": "2.0.5",
95+
"@wordpress/data": "6.1.3",
96+
"@wordpress/data-controls": "2.2.6",
97+
"@wordpress/date": "4.2.2",
98+
"@wordpress/deprecated": "3.2.2",
99+
"@wordpress/dom": "3.2.6",
100+
"@wordpress/dom-ready": "3.2.2",
101+
"@wordpress/edit-post": "5.0.5",
102+
"@wordpress/edit-widgets": "3.1.0",
103+
"@wordpress/editor": "12.0.2",
104+
"@wordpress/element": "4.0.3",
105+
"@wordpress/escape-html": "2.2.2",
106+
"@wordpress/format-library": "3.0.5",
107+
"@wordpress/hooks": "3.2.1",
108+
"@wordpress/html-entities": "3.2.2",
109+
"@wordpress/i18n": "4.2.3",
110+
"@wordpress/icons": "6.1.0",
111+
"@wordpress/interface": "4.1.3",
112+
"@wordpress/is-shallow-equal": "4.2.0",
113+
"@wordpress/keyboard-shortcuts": "3.0.5",
114+
"@wordpress/keycodes": "3.2.3",
115+
"@wordpress/list-reusable-blocks": "3.0.5",
116+
"@wordpress/media-utils": "3.0.4",
117+
"@wordpress/notices": "3.2.6",
118+
"@wordpress/nux": "5.0.5",
119+
"@wordpress/plugins": "4.0.5",
120+
"@wordpress/primitives": "3.0.3",
121+
"@wordpress/priority-queue": "2.2.2",
122+
"@wordpress/redux-routine": "4.2.1",
123+
"@wordpress/reusable-blocks": "3.0.5",
124+
"@wordpress/rich-text": "5.0.5",
125+
"@wordpress/server-side-render": "3.0.5",
126+
"@wordpress/shortcode": "3.2.2",
127+
"@wordpress/token-list": "2.2.1",
128+
"@wordpress/url": "3.3.0",
129+
"@wordpress/viewport": "4.0.5",
130+
"@wordpress/warning": "2.2.2",
131+
"@wordpress/widgets": "2.0.5",
132+
"@wordpress/wordcount": "3.2.2",
133133
"backbone": "1.4.0",
134134
"clipboard": "2.0.8",
135135
"core-js-url-browser": "3.6.4",

src/wp-includes/assets/script-loader-packages.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/wp-includes/block-editor.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,22 @@ function get_default_block_editor_settings() {
187187
}
188188
}
189189

190+
// These styles are used if the "no theme styles" options is triggered or on
191+
// themes without their own editor styles.
192+
$default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';
193+
if ( file_exists( $default_editor_styles_file ) ) {
194+
$default_editor_styles = array(
195+
array( 'css' => file_get_contents( $default_editor_styles_file ) ),
196+
);
197+
} else {
198+
$default_editor_styles = array();
199+
}
200+
190201
$editor_settings = array(
191202
'alignWide' => get_theme_support( 'align-wide' ),
192203
'allowedBlockTypes' => true,
193204
'allowedMimeTypes' => get_allowed_mime_types(),
205+
'defaultEditorStyles' => $default_editor_styles,
194206
'blockCategories' => get_default_block_categories(),
195207
'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),
196208
'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ),
@@ -464,22 +476,12 @@ function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont
464476
*
465477
* @global array $editor_styles
466478
*
467-
* @return array An array of theme styles for the block editor. Includes default font family
468-
* style and theme stylesheets.
479+
* @return array An array of theme styles for the block editor.
469480
*/
470481
function get_block_editor_theme_styles() {
471482
global $editor_styles;
472483

473-
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
474-
$styles = array(
475-
array(
476-
'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
477-
'__unstableType' => 'core',
478-
),
479-
);
480-
} else {
481-
$styles = array();
482-
}
484+
$styles = array();
483485

484486
if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
485487
foreach ( $editor_styles as $style ) {

src/wp-includes/blocks/archives.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ function render_block_core_archives( $attributes ) {
4040

4141
$archives = wp_get_archives( $dropdown_args );
4242

43+
$classnames = esc_attr( $class );
44+
45+
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );
46+
4347
switch ( $dropdown_args['type'] ) {
4448
case 'yearly':
4549
$label = __( 'Select Year' );
@@ -60,13 +64,13 @@ function render_block_core_archives( $attributes ) {
6064

6165
$label = esc_html( $label );
6266

63-
$block_content = '<label class="screen-reader-text" for="' . $dropdown_id . '">' . $title . '</label>
67+
$block_content = '<label for="' . $dropdown_id . '">' . $title . '</label>
6468
<select id="' . $dropdown_id . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
6569
<option value="">' . $label . '</option>' . $archives . '</select>';
6670

6771
return sprintf(
68-
'<div class="%1$s">%2$s</div>',
69-
esc_attr( $class ),
72+
'<div %1$s>%2$s</div>',
73+
$wrapper_attributes,
7074
$block_content
7175
);
7276
}

src/wp-includes/blocks/button/block.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,19 @@
6363
},
6464
"typography": {
6565
"fontSize": true,
66-
"__experimentalFontFamily": true
66+
"__experimentalFontFamily": true,
67+
"__experimentalDefaultControls": {
68+
"fontSize": true
69+
}
6770
},
6871
"reusable": false,
72+
"spacing": {
73+
"__experimentalSkipSerialization": true,
74+
"padding": [ "horizontal", "vertical" ],
75+
"__experimentalDefaultControls": {
76+
"padding": true
77+
}
78+
},
6979
"__experimentalBorder": {
7080
"radius": true,
7181
"__experimentalSkipSerialization": true

src/wp-includes/blocks/buttons/block.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@
66
"description": "Prompt visitors to take action with a group of button-style links.",
77
"keywords": [ "link" ],
88
"textdomain": "default",
9-
"attributes": {
10-
"contentJustification": {
11-
"type": "string"
12-
},
13-
"orientation": {
14-
"type": "string",
15-
"default": "horizontal"
16-
}
17-
},
189
"supports": {
1910
"anchor": true,
20-
"align": [ "wide", "full" ]
11+
"align": [ "wide", "full" ],
12+
"__experimentalExposeControlsToChildren": true,
13+
"spacing": {
14+
"blockGap": true,
15+
"margin": ["top", "bottom" ],
16+
"__experimentalDefaultControls": {
17+
"blockGap": true
18+
}
19+
},
20+
"__experimentalLayout": {
21+
"allowSwitching": false,
22+
"allowInheriting": false,
23+
"default": {
24+
"type": "flex"
25+
}
26+
}
2127
},
2228
"editorStyle": "wp-block-buttons-editor",
2329
"style": "wp-block-buttons"

0 commit comments

Comments
 (0)