Editor: Update @wordpress npm packages

Update @wordpress npm packages to the latest published versions. This includes
block editor bug fixes for WordPress 5.7 RC 2.

Fixes #52680.


git-svn-id: https://develop.svn.wordpress.org/trunk@50458 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Robert Anderson
2021-03-01 08:23:25 +00:00
parent f0ba66d324
commit 9ca0ce7275
6 changed files with 93 additions and 63 deletions
File diff suppressed because one or more lines are too long
+27 -1
View File
@@ -33,7 +33,12 @@ function render_block_core_social_link( $attributes, $content, $block ) {
}
$icon = block_core_social_link_get_icon( $service );
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'wp-social-link wp-social-link-' . $service . $class_name ) );
$wrapper_attributes = get_block_wrapper_attributes(
array(
'class' => 'wp-social-link wp-social-link-' . $service . $class_name,
'style' => block_core_social_link_get_color_styles( $block->context ),
)
);
return '<li ' . $wrapper_attributes . '><a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( $label ) . '" ' . $attribute . ' class="wp-block-social-link-anchor"> ' . $icon . '</a></li>';
}
@@ -280,3 +285,24 @@ function block_core_social_link_services( $service = '', $field = '' ) {
return $services_data;
}
/**
* Returns CSS styles for icon and icon background colors.
*
* @param array $context Block context passed to Social Link.
*
* @return string Inline CSS styles for link's icon and background colors.
*/
function block_core_social_link_get_color_styles( $context ) {
$styles = array();
if ( array_key_exists( 'iconColorValue', $context ) ) {
$styles[] = 'color: ' . $context['iconColorValue'] . '; ';
}
if ( array_key_exists( 'iconBackgroundColorValue', $context ) ) {
$styles[] = 'background-color: ' . $context['iconBackgroundColorValue'] . '; ';
}
return implode( '', $styles );
}
@@ -17,7 +17,9 @@
}
},
"usesContext": [
"openInNewTab"
"openInNewTab",
"iconColorValue",
"iconBackgroundColorValue"
],
"supports": {
"reusable": false,
@@ -30,7 +30,9 @@
}
},
"providesContext": {
"openInNewTab": "openInNewTab"
"openInNewTab": "openInNewTab",
"iconColorValue": "iconColorValue",
"iconBackgroundColorValue": "iconBackgroundColorValue"
},
"supports": {
"align": [