Skip to content

Commit 80957a6

Browse files
committed
Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes: - Generate babel polyfill dynamically WordPress/gutenberg#31279 - Improve the List View component WordPress/gutenberg#31290 WordPress/gutenberg#32063 - Template mode: - Fix embed dimensions WordPress/gutenberg#32057 - Update the welcome guide WordPress/gutenberg#32055 WordPress/gutenberg#32026 - Don’t display the notice at the same time as the welcome guide WordPress/gutenberg#32076 - Remove MetaBoxes WordPress/gutenberg#32315 - Update the title area WordPress/gutenberg#32037 - Widgets Screen: - Fix unsaved changes WordPress/gutenberg#31757 - Fix toolbar alignment WordPress/gutenberg#31991 - Fix block toolbar position after scroll WordPress/gutenberg#32212 - Fix the visible widget area header WordPress/gutenberg#32262 - Fix legacy widgets preview WordPress/gutenberg#32260 - - Block Widgets in the customizer: - Fix customizer title overlapping block toolbar WordPress/gutenberg#32140 - Fix styling issues WordPress/gutenberg#32072 - Fix escape key events WordPress/gutenberg#32175 - Add preferences menu group label WordPress/gutenberg#32259 - Fix creating and replacing legacy widgets WordPress/gutenberg#32005 - Fix the welcome guide’s image WordPress/gutenberg#32264 WordPress/gutenberg#32302 - Fix Cover to Image transform duotone error WordPress/gutenberg#32006 - Remove filter_var usage from blocks WordPress/gutenberg#32046 - Fix image width for aligned Post Featured Image block WordPress/gutenberg#32070 - Prevent excessive Image block re-rendering WordPress/gutenberg#32102 - Remove gutenberg domain from core blocks WordPress/gutenberg#32152 - Use the block editor context class for the the different settings filters WordPress/gutenberg#32159 - Fix Latest Posts block grid view WordPress/gutenberg#32160 - Fix preset classes generation per block WordPress/gutenberg#32190 - Fix logic to enable custom colors and gradients WordPress/gutenberg#32200 - Update the Site Logo logic to use a dedicated site option WordPress/gutenberg#32229 - Limit the Latest Posts block’s featured image width WordPress/gutenberg#32245 - Remove opacity animation in the canvas. WordPress/gutenberg#32266 - Make the focus style valid CSS WordPress/gutenberg#32305 - Fix theme.json styles for the core/list block WordPress/gutenberg#32343 - Fix PHP notice when calling render_block WordPress/gutenberg#32135 Props nosolosw, noisysocks. See #52991. git-svn-id: https://develop.svn.wordpress.org/trunk@51051 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f71eadf commit 80957a6

File tree

13 files changed

+1049
-1571
lines changed

13 files changed

+1049
-1571
lines changed

package-lock.json

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

package.json

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"last 2 Opera versions"
2525
],
2626
"devDependencies": {
27-
"@wordpress/custom-templated-path-webpack-plugin": "2.0.4",
28-
"@wordpress/dependency-extraction-webpack-plugin": "3.1.3",
29-
"@wordpress/e2e-test-utils": "5.2.0",
30-
"@wordpress/library-export-default-webpack-plugin": "2.0.4",
31-
"@wordpress/scripts": "16.1.0",
27+
"@wordpress/custom-templated-path-webpack-plugin": "2.0.5",
28+
"@wordpress/dependency-extraction-webpack-plugin": "3.1.4",
29+
"@wordpress/e2e-test-utils": "5.3.0",
30+
"@wordpress/library-export-default-webpack-plugin": "2.0.5",
31+
"@wordpress/scripts": "16.1.1",
3232
"autoprefixer": "^9.8.6",
3333
"chalk": "4.1.1",
3434
"check-node-version": "4.1.0",
@@ -77,58 +77,58 @@
7777
},
7878
"dependencies": {
7979
"@babel/polyfill": "7.10.1",
80-
"@wordpress/a11y": "3.1.0",
81-
"@wordpress/annotations": "2.1.0",
82-
"@wordpress/api-fetch": "5.1.0",
83-
"@wordpress/autop": "3.1.0",
84-
"@wordpress/blob": "3.1.0",
85-
"@wordpress/block-directory": "2.1.2",
86-
"@wordpress/block-editor": "6.1.0",
87-
"@wordpress/block-library": "3.2.1",
88-
"@wordpress/block-serialization-default-parser": "4.1.0",
89-
"@wordpress/blocks": "9.1.0",
90-
"@wordpress/components": "14.1.0",
91-
"@wordpress/compose": "4.1.0",
92-
"@wordpress/core-data": "3.1.1",
93-
"@wordpress/customize-widgets": "1.0.1",
94-
"@wordpress/data": "5.1.0",
95-
"@wordpress/data-controls": "2.1.0",
96-
"@wordpress/date": "4.1.0",
97-
"@wordpress/deprecated": "3.1.0",
98-
"@wordpress/dom": "3.1.0",
99-
"@wordpress/dom-ready": "3.1.0",
100-
"@wordpress/edit-post": "4.1.2",
101-
"@wordpress/edit-widgets": "2.1.2",
102-
"@wordpress/editor": "10.1.1",
103-
"@wordpress/element": "3.1.0",
104-
"@wordpress/escape-html": "2.1.0",
105-
"@wordpress/format-library": "2.1.0",
106-
"@wordpress/hooks": "3.1.0",
107-
"@wordpress/html-entities": "3.1.0",
108-
"@wordpress/i18n": "4.1.0",
109-
"@wordpress/icons": "4.0.0",
110-
"@wordpress/interface": "3.1.0",
111-
"@wordpress/is-shallow-equal": "4.1.0",
112-
"@wordpress/keyboard-shortcuts": "2.1.0",
113-
"@wordpress/keycodes": "3.1.0",
114-
"@wordpress/list-reusable-blocks": "2.1.0",
115-
"@wordpress/media-utils": "2.1.0",
116-
"@wordpress/notices": "3.1.0",
117-
"@wordpress/nux": "4.1.0",
118-
"@wordpress/plugins": "3.1.0",
119-
"@wordpress/primitives": "2.1.0",
120-
"@wordpress/priority-queue": "2.1.0",
121-
"@wordpress/redux-routine": "4.1.0",
122-
"@wordpress/reusable-blocks": "2.1.1",
123-
"@wordpress/rich-text": "4.1.0",
124-
"@wordpress/server-side-render": "2.1.0",
125-
"@wordpress/shortcode": "3.1.0",
126-
"@wordpress/token-list": "2.1.0",
127-
"@wordpress/url": "3.1.0",
128-
"@wordpress/viewport": "3.1.0",
129-
"@wordpress/warning": "2.1.0",
130-
"@wordpress/widgets": "1.1.1",
131-
"@wordpress/wordcount": "3.1.0",
80+
"@wordpress/a11y": "3.1.1",
81+
"@wordpress/annotations": "2.1.1",
82+
"@wordpress/api-fetch": "5.1.1",
83+
"@wordpress/autop": "3.1.1",
84+
"@wordpress/blob": "3.1.1",
85+
"@wordpress/block-directory": "2.1.3",
86+
"@wordpress/block-editor": "6.1.1",
87+
"@wordpress/block-library": "3.2.2",
88+
"@wordpress/block-serialization-default-parser": "4.1.1",
89+
"@wordpress/blocks": "9.1.1",
90+
"@wordpress/components": "14.1.1",
91+
"@wordpress/compose": "4.1.1",
92+
"@wordpress/core-data": "3.1.2",
93+
"@wordpress/customize-widgets": "1.0.2",
94+
"@wordpress/data": "5.1.1",
95+
"@wordpress/data-controls": "2.1.1",
96+
"@wordpress/date": "4.1.1",
97+
"@wordpress/deprecated": "3.1.1",
98+
"@wordpress/dom": "3.1.1",
99+
"@wordpress/dom-ready": "3.1.1",
100+
"@wordpress/edit-post": "4.1.3",
101+
"@wordpress/edit-widgets": "2.1.3",
102+
"@wordpress/editor": "10.1.2",
103+
"@wordpress/element": "3.1.1",
104+
"@wordpress/escape-html": "2.1.1",
105+
"@wordpress/format-library": "2.1.1",
106+
"@wordpress/hooks": "3.1.1",
107+
"@wordpress/html-entities": "3.1.1",
108+
"@wordpress/i18n": "4.1.1",
109+
"@wordpress/icons": "4.0.1",
110+
"@wordpress/interface": "3.1.1",
111+
"@wordpress/is-shallow-equal": "4.1.1",
112+
"@wordpress/keyboard-shortcuts": "2.1.1",
113+
"@wordpress/keycodes": "3.1.1",
114+
"@wordpress/list-reusable-blocks": "2.1.1",
115+
"@wordpress/media-utils": "2.1.1",
116+
"@wordpress/notices": "3.1.1",
117+
"@wordpress/nux": "4.1.1",
118+
"@wordpress/plugins": "3.1.1",
119+
"@wordpress/primitives": "2.1.1",
120+
"@wordpress/priority-queue": "2.1.1",
121+
"@wordpress/redux-routine": "4.1.1",
122+
"@wordpress/reusable-blocks": "2.1.2",
123+
"@wordpress/rich-text": "4.1.1",
124+
"@wordpress/server-side-render": "2.1.1",
125+
"@wordpress/shortcode": "3.1.1",
126+
"@wordpress/token-list": "2.1.1",
127+
"@wordpress/url": "3.1.1",
128+
"@wordpress/viewport": "3.1.1",
129+
"@wordpress/warning": "2.1.1",
130+
"@wordpress/widgets": "1.1.2",
131+
"@wordpress/wordcount": "3.1.1",
132132
"backbone": "1.4.0",
133133
"clipboard": "2.0.8",
134134
"core-js-url-browser": "3.6.4",

src/wp-includes/block-supports/elements.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
* @return string Filtered block content.
1818
*/
1919
function wp_render_elements_support( $block_content, $block ) {
20-
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
20+
$link_color = null;
21+
if ( ! empty( $block['attrs'] ) ) {
22+
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
23+
}
2124

2225
/*
2326
* For now we only care about link color.

src/wp-includes/blocks/legacy-widget.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@
1313
* @return string Rendered block.
1414
*/
1515
function render_block_core_legacy_widget( $attributes ) {
16+
global $wp_widget_factory;
17+
1618
if ( isset( $attributes['id'] ) ) {
17-
$sidebar_id = gutenberg_find_widgets_sidebar( $attributes['id'] );
18-
return gutenberg_render_widget( $attributes['id'], $sidebar_id );
19+
$sidebar_id = wp_find_widgets_sidebar( $attributes['id'] );
20+
return wp_render_widget( $attributes['id'], $sidebar_id );
1921
}
2022

2123
if ( ! isset( $attributes['idBase'] ) ) {
2224
return '';
2325
}
2426

25-
$widget_object = gutenberg_get_widget_object( $attributes['idBase'] );
27+
if ( method_exists( $wp_widget_factory, 'get_widget_object' ) ) {
28+
$widget_object = $wp_widget_factory->get_widget_object( $attributes['idBase'] );
29+
} else {
30+
$widget_object = gutenberg_get_widget_object( $attributes['idBase'] );
31+
}
2632

2733
if ( ! $widget_object ) {
2834
return '';
@@ -44,25 +50,21 @@ function render_block_core_legacy_widget( $attributes ) {
4450
}
4551

4652
/**
47-
* Registers the 'core/legacy-widget' block.
53+
* On application init this does two things:
54+
*
55+
* - Registers the 'core/legacy-widget' block.
56+
* - Intercepts any request with legacy-widget-preview in the query param and,
57+
* if set, renders a page containing a preview of the requested Legacy Widget
58+
* block.
4859
*/
49-
function register_block_core_legacy_widget() {
60+
function init_legacy_widget_block() {
5061
register_block_type_from_metadata(
5162
__DIR__ . '/legacy-widget',
5263
array(
5364
'render_callback' => 'render_block_core_legacy_widget',
5465
)
5566
);
56-
}
57-
58-
add_action( 'init', 'register_block_core_legacy_widget', 20 );
5967

60-
/**
61-
* Intercepts any request with legacy-widget-preview in the query param and, if
62-
* set, renders a page containing a preview of the requested Legacy Widget
63-
* block.
64-
*/
65-
function handle_legacy_widget_preview_iframe() {
6668
if ( empty( $_GET['legacy-widget-preview'] ) ) {
6769
return;
6870
}
@@ -108,4 +110,4 @@ function handle_legacy_widget_preview_iframe() {
108110
exit;
109111
}
110112

111-
add_action( 'init', 'handle_legacy_widget_preview_iframe', 21 );
113+
add_action( 'init', 'init_legacy_widget_block' );

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"color": {
4242
"gradients": true
4343
},
44-
"__unstablePasteTextInline": true
44+
"__unstablePasteTextInline": true,
45+
"__experimentalSelector": "ol,ul"
4546
},
4647
"editorStyle": "wp-block-list-editor",
4748
"style": "wp-block-list"

src/wp-includes/blocks/query-loop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
function render_block_core_query_loop( $attributes, $content, $block ) {
1818
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
19-
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
19+
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
2020

2121
$query_args = build_query_vars_from_query_block( $block, $page );
2222
// Override the custom query with the global query if needed.

src/wp-includes/blocks/query-pagination-next.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*/
1717
function render_block_core_query_pagination_next( $attributes, $content, $block ) {
1818
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
19-
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
19+
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
2020
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
2121

2222
$wrapper_attributes = get_block_wrapper_attributes();
23-
$default_label = __( 'Next Page »', 'gutenberg' );
23+
$default_label = __( 'Next Page »' );
2424
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
2525
$content = '';
2626

src/wp-includes/blocks/query-pagination-numbers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
function render_block_core_query_pagination_numbers( $attributes, $content, $block ) {
1818
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
19-
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
19+
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
2020
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
2121

2222
$wrapper_attributes = get_block_wrapper_attributes();

src/wp-includes/blocks/query-pagination-previous.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
*/
1717
function render_block_core_query_pagination_previous( $attributes, $content, $block ) {
1818
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
19-
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
19+
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
2020

2121
$wrapper_attributes = get_block_wrapper_attributes();
22-
$default_label = __( '« Previous Page', 'gutenberg' );
22+
$default_label = __( '« Previous Page' );
2323
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
2424
$content = '';
2525
// Check if the pagination is for Query that inherits the global context

src/wp-includes/blocks/social-link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function render_block_core_social_link( $attributes, $content, $block ) {
2121
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
2222
$label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : sprintf(
2323
/* translators: %1$s: Social-network name. %2$s: URL. */
24-
__( '%1$s: %2$s', 'gutenberg' ),
24+
__( '%1$s: %2$s' ),
2525
block_core_social_link_get_name( $service ),
2626
$url
2727
);

0 commit comments

Comments
 (0)