mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes: - Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279 - Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063 - Template mode: - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057 - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026 - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076 - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315 - Update the title area https://github.com/WordPress/gutenberg/pull/32037 - Widgets Screen: - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757 - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991 - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212 - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262 - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260 - - Block Widgets in the customizer: - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140 - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072 - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175 - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259 - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005 - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 - Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006 - Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 - Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070 - Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102 - Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152 - Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159 - Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160 - Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190 - Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200 - Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229 - Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245 - Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266 - Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305 - Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343 - Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135 Props nosolosw, noisysocks. See #52991. git-svn-id: https://develop.svn.wordpress.org/trunk@51051 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
2402
package-lock.json
generated
2402
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
114
package.json
114
package.json
@@ -24,11 +24,11 @@
|
||||
"last 2 Opera versions"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@wordpress/custom-templated-path-webpack-plugin": "2.0.4",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "3.1.3",
|
||||
"@wordpress/e2e-test-utils": "5.2.0",
|
||||
"@wordpress/library-export-default-webpack-plugin": "2.0.4",
|
||||
"@wordpress/scripts": "16.1.0",
|
||||
"@wordpress/custom-templated-path-webpack-plugin": "2.0.5",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "3.1.4",
|
||||
"@wordpress/e2e-test-utils": "5.3.0",
|
||||
"@wordpress/library-export-default-webpack-plugin": "2.0.5",
|
||||
"@wordpress/scripts": "16.1.1",
|
||||
"autoprefixer": "^9.8.6",
|
||||
"chalk": "4.1.1",
|
||||
"check-node-version": "4.1.0",
|
||||
@@ -77,58 +77,58 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "7.10.1",
|
||||
"@wordpress/a11y": "3.1.0",
|
||||
"@wordpress/annotations": "2.1.0",
|
||||
"@wordpress/api-fetch": "5.1.0",
|
||||
"@wordpress/autop": "3.1.0",
|
||||
"@wordpress/blob": "3.1.0",
|
||||
"@wordpress/block-directory": "2.1.2",
|
||||
"@wordpress/block-editor": "6.1.0",
|
||||
"@wordpress/block-library": "3.2.1",
|
||||
"@wordpress/block-serialization-default-parser": "4.1.0",
|
||||
"@wordpress/blocks": "9.1.0",
|
||||
"@wordpress/components": "14.1.0",
|
||||
"@wordpress/compose": "4.1.0",
|
||||
"@wordpress/core-data": "3.1.1",
|
||||
"@wordpress/customize-widgets": "1.0.1",
|
||||
"@wordpress/data": "5.1.0",
|
||||
"@wordpress/data-controls": "2.1.0",
|
||||
"@wordpress/date": "4.1.0",
|
||||
"@wordpress/deprecated": "3.1.0",
|
||||
"@wordpress/dom": "3.1.0",
|
||||
"@wordpress/dom-ready": "3.1.0",
|
||||
"@wordpress/edit-post": "4.1.2",
|
||||
"@wordpress/edit-widgets": "2.1.2",
|
||||
"@wordpress/editor": "10.1.1",
|
||||
"@wordpress/element": "3.1.0",
|
||||
"@wordpress/escape-html": "2.1.0",
|
||||
"@wordpress/format-library": "2.1.0",
|
||||
"@wordpress/hooks": "3.1.0",
|
||||
"@wordpress/html-entities": "3.1.0",
|
||||
"@wordpress/i18n": "4.1.0",
|
||||
"@wordpress/icons": "4.0.0",
|
||||
"@wordpress/interface": "3.1.0",
|
||||
"@wordpress/is-shallow-equal": "4.1.0",
|
||||
"@wordpress/keyboard-shortcuts": "2.1.0",
|
||||
"@wordpress/keycodes": "3.1.0",
|
||||
"@wordpress/list-reusable-blocks": "2.1.0",
|
||||
"@wordpress/media-utils": "2.1.0",
|
||||
"@wordpress/notices": "3.1.0",
|
||||
"@wordpress/nux": "4.1.0",
|
||||
"@wordpress/plugins": "3.1.0",
|
||||
"@wordpress/primitives": "2.1.0",
|
||||
"@wordpress/priority-queue": "2.1.0",
|
||||
"@wordpress/redux-routine": "4.1.0",
|
||||
"@wordpress/reusable-blocks": "2.1.1",
|
||||
"@wordpress/rich-text": "4.1.0",
|
||||
"@wordpress/server-side-render": "2.1.0",
|
||||
"@wordpress/shortcode": "3.1.0",
|
||||
"@wordpress/token-list": "2.1.0",
|
||||
"@wordpress/url": "3.1.0",
|
||||
"@wordpress/viewport": "3.1.0",
|
||||
"@wordpress/warning": "2.1.0",
|
||||
"@wordpress/widgets": "1.1.1",
|
||||
"@wordpress/wordcount": "3.1.0",
|
||||
"@wordpress/a11y": "3.1.1",
|
||||
"@wordpress/annotations": "2.1.1",
|
||||
"@wordpress/api-fetch": "5.1.1",
|
||||
"@wordpress/autop": "3.1.1",
|
||||
"@wordpress/blob": "3.1.1",
|
||||
"@wordpress/block-directory": "2.1.3",
|
||||
"@wordpress/block-editor": "6.1.1",
|
||||
"@wordpress/block-library": "3.2.2",
|
||||
"@wordpress/block-serialization-default-parser": "4.1.1",
|
||||
"@wordpress/blocks": "9.1.1",
|
||||
"@wordpress/components": "14.1.1",
|
||||
"@wordpress/compose": "4.1.1",
|
||||
"@wordpress/core-data": "3.1.2",
|
||||
"@wordpress/customize-widgets": "1.0.2",
|
||||
"@wordpress/data": "5.1.1",
|
||||
"@wordpress/data-controls": "2.1.1",
|
||||
"@wordpress/date": "4.1.1",
|
||||
"@wordpress/deprecated": "3.1.1",
|
||||
"@wordpress/dom": "3.1.1",
|
||||
"@wordpress/dom-ready": "3.1.1",
|
||||
"@wordpress/edit-post": "4.1.3",
|
||||
"@wordpress/edit-widgets": "2.1.3",
|
||||
"@wordpress/editor": "10.1.2",
|
||||
"@wordpress/element": "3.1.1",
|
||||
"@wordpress/escape-html": "2.1.1",
|
||||
"@wordpress/format-library": "2.1.1",
|
||||
"@wordpress/hooks": "3.1.1",
|
||||
"@wordpress/html-entities": "3.1.1",
|
||||
"@wordpress/i18n": "4.1.1",
|
||||
"@wordpress/icons": "4.0.1",
|
||||
"@wordpress/interface": "3.1.1",
|
||||
"@wordpress/is-shallow-equal": "4.1.1",
|
||||
"@wordpress/keyboard-shortcuts": "2.1.1",
|
||||
"@wordpress/keycodes": "3.1.1",
|
||||
"@wordpress/list-reusable-blocks": "2.1.1",
|
||||
"@wordpress/media-utils": "2.1.1",
|
||||
"@wordpress/notices": "3.1.1",
|
||||
"@wordpress/nux": "4.1.1",
|
||||
"@wordpress/plugins": "3.1.1",
|
||||
"@wordpress/primitives": "2.1.1",
|
||||
"@wordpress/priority-queue": "2.1.1",
|
||||
"@wordpress/redux-routine": "4.1.1",
|
||||
"@wordpress/reusable-blocks": "2.1.2",
|
||||
"@wordpress/rich-text": "4.1.1",
|
||||
"@wordpress/server-side-render": "2.1.1",
|
||||
"@wordpress/shortcode": "3.1.1",
|
||||
"@wordpress/token-list": "2.1.1",
|
||||
"@wordpress/url": "3.1.1",
|
||||
"@wordpress/viewport": "3.1.1",
|
||||
"@wordpress/warning": "2.1.1",
|
||||
"@wordpress/widgets": "1.1.2",
|
||||
"@wordpress/wordcount": "3.1.1",
|
||||
"backbone": "1.4.0",
|
||||
"clipboard": "2.0.8",
|
||||
"core-js-url-browser": "3.6.4",
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
* @return string Filtered block content.
|
||||
*/
|
||||
function wp_render_elements_support( $block_content, $block ) {
|
||||
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
|
||||
$link_color = null;
|
||||
if ( ! empty( $block['attrs'] ) ) {
|
||||
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
|
||||
}
|
||||
|
||||
/*
|
||||
* For now we only care about link color.
|
||||
|
||||
@@ -13,16 +13,22 @@
|
||||
* @return string Rendered block.
|
||||
*/
|
||||
function render_block_core_legacy_widget( $attributes ) {
|
||||
global $wp_widget_factory;
|
||||
|
||||
if ( isset( $attributes['id'] ) ) {
|
||||
$sidebar_id = gutenberg_find_widgets_sidebar( $attributes['id'] );
|
||||
return gutenberg_render_widget( $attributes['id'], $sidebar_id );
|
||||
$sidebar_id = wp_find_widgets_sidebar( $attributes['id'] );
|
||||
return wp_render_widget( $attributes['id'], $sidebar_id );
|
||||
}
|
||||
|
||||
if ( ! isset( $attributes['idBase'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$widget_object = gutenberg_get_widget_object( $attributes['idBase'] );
|
||||
if ( method_exists( $wp_widget_factory, 'get_widget_object' ) ) {
|
||||
$widget_object = $wp_widget_factory->get_widget_object( $attributes['idBase'] );
|
||||
} else {
|
||||
$widget_object = gutenberg_get_widget_object( $attributes['idBase'] );
|
||||
}
|
||||
|
||||
if ( ! $widget_object ) {
|
||||
return '';
|
||||
@@ -44,25 +50,21 @@ function render_block_core_legacy_widget( $attributes ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the 'core/legacy-widget' block.
|
||||
* On application init this does two things:
|
||||
*
|
||||
* - Registers the 'core/legacy-widget' block.
|
||||
* - Intercepts any request with legacy-widget-preview in the query param and,
|
||||
* if set, renders a page containing a preview of the requested Legacy Widget
|
||||
* block.
|
||||
*/
|
||||
function register_block_core_legacy_widget() {
|
||||
function init_legacy_widget_block() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/legacy-widget',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_legacy_widget',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'init', 'register_block_core_legacy_widget', 20 );
|
||||
|
||||
/**
|
||||
* Intercepts any request with legacy-widget-preview in the query param and, if
|
||||
* set, renders a page containing a preview of the requested Legacy Widget
|
||||
* block.
|
||||
*/
|
||||
function handle_legacy_widget_preview_iframe() {
|
||||
if ( empty( $_GET['legacy-widget-preview'] ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -108,4 +110,4 @@ function handle_legacy_widget_preview_iframe() {
|
||||
exit;
|
||||
}
|
||||
|
||||
add_action( 'init', 'handle_legacy_widget_preview_iframe', 21 );
|
||||
add_action( 'init', 'init_legacy_widget_block' );
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"color": {
|
||||
"gradients": true
|
||||
},
|
||||
"__unstablePasteTextInline": true
|
||||
"__unstablePasteTextInline": true,
|
||||
"__experimentalSelector": "ol,ul"
|
||||
},
|
||||
"editorStyle": "wp-block-list-editor",
|
||||
"style": "wp-block-list"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
function render_block_core_query_loop( $attributes, $content, $block ) {
|
||||
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
|
||||
|
||||
$query_args = build_query_vars_from_query_block( $block, $page );
|
||||
// Override the custom query with the global query if needed.
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
function render_block_core_query_pagination_next( $attributes, $content, $block ) {
|
||||
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
|
||||
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
$default_label = __( 'Next Page »', 'gutenberg' );
|
||||
$default_label = __( 'Next Page »' );
|
||||
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
||||
$content = '';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
function render_block_core_query_pagination_numbers( $attributes, $content, $block ) {
|
||||
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
|
||||
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
function render_block_core_query_pagination_previous( $attributes, $content, $block ) {
|
||||
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
|
||||
$page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ];
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
$default_label = __( '« Previous Page', 'gutenberg' );
|
||||
$default_label = __( '« Previous Page' );
|
||||
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
|
||||
$content = '';
|
||||
// Check if the pagination is for Query that inherits the global context
|
||||
|
||||
@@ -21,7 +21,7 @@ function render_block_core_social_link( $attributes, $content, $block ) {
|
||||
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
|
||||
$label = ( isset( $attributes['label'] ) ) ? $attributes['label'] : sprintf(
|
||||
/* translators: %1$s: Social-network name. %2$s: URL. */
|
||||
__( '%1$s: %2$s', 'gutenberg' ),
|
||||
__( '%1$s: %2$s' ),
|
||||
block_core_social_link_get_name( $service ),
|
||||
$url
|
||||
);
|
||||
|
||||
@@ -609,6 +609,28 @@ class WP_Theme_JSON {
|
||||
return $selector . '{' . $declaration_block . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that appends a sub-selector to a existing one.
|
||||
*
|
||||
* Given the compounded $selector "h1, h2, h3"
|
||||
* and the $to_append selector ".some-class" the result will be
|
||||
* "h1.some-class, h2.some-class, h3.some-class".
|
||||
*
|
||||
* @param string $selector Original selector.
|
||||
* @param string $to_append Selector to append.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function append_to_selector( $selector, $to_append ) {
|
||||
$new_selectors = array();
|
||||
$selectors = explode( ',', $selector );
|
||||
foreach ( $selectors as $sel ) {
|
||||
$new_selectors[] = $sel . $to_append;
|
||||
}
|
||||
|
||||
return implode( ',', $new_selectors );
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a settings array, it returns the generated rulesets
|
||||
* for the preset classes.
|
||||
@@ -633,7 +655,7 @@ class WP_Theme_JSON {
|
||||
foreach ( $values as $value ) {
|
||||
foreach ( $preset['classes'] as $class ) {
|
||||
$stylesheet .= self::to_ruleset(
|
||||
$selector . '.has-' . $value['slug'] . '-' . $class['class_suffix'],
|
||||
self::append_to_selector( $selector, '.has-' . $value['slug'] . '-' . $class['class_suffix'] ),
|
||||
array(
|
||||
array(
|
||||
'name' => $class['property_name'],
|
||||
|
||||
@@ -310,7 +310,6 @@ function _unhook_block_registration() {
|
||||
remove_action( 'init', 'register_block_core_loginout' );
|
||||
remove_action( 'init', 'register_block_core_latest_comments' );
|
||||
remove_action( 'init', 'register_block_core_latest_posts' );
|
||||
remove_action( 'init', 'register_block_core_legacy_widget', 20 );
|
||||
remove_action( 'init', 'register_block_core_post_author' );
|
||||
remove_action( 'init', 'register_block_core_post_content' );
|
||||
remove_action( 'init', 'register_block_core_post_date' );
|
||||
@@ -334,5 +333,6 @@ function _unhook_block_registration() {
|
||||
remove_action( 'init', 'register_block_core_social_link' );
|
||||
remove_action( 'init', 'register_block_core_tag_cloud' );
|
||||
remove_action( 'init', 'register_core_block_types_from_metadata' );
|
||||
remove_action( 'init', 'init_legacy_widget_block' );
|
||||
}
|
||||
tests_add_filter( 'init', '_unhook_block_registration', 1000 );
|
||||
|
||||
@@ -619,6 +619,28 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
|
||||
$this->assertEqualSetsWithIndex( $expected, $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that appends a sub-selector to a existing one.
|
||||
*
|
||||
* Given the compounded $selector "h1, h2, h3"
|
||||
* and the $to_append selector ".some-class" the result will be
|
||||
* "h1.some-class, h2.some-class, h3.some-class".
|
||||
*
|
||||
* @param string $selector Original selector.
|
||||
* @param string $to_append Selector to append.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function append_to_selector( $selector, $to_append ) {
|
||||
$new_selectors = array();
|
||||
$selectors = explode( ',', $selector );
|
||||
foreach ( $selectors as $sel ) {
|
||||
$new_selectors[] = $sel . $to_append;
|
||||
}
|
||||
|
||||
return implode( ',', $new_selectors );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 52991
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user