Skip to content

Commit

Permalink
Editor: Update WordPress packages published for Gutenberg 10.6
Browse files Browse the repository at this point in the history
It contains several changes in addition to regular update to WordPress packages:
- All newly exposed blocks are now registered on the server.
- Dutone block support was added.
- Border block support was updated.
- New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work.

Props youknowriad.
See #52991.




git-svn-id: https://develop.svn.wordpress.org/trunk@50929 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
gziolo committed May 19, 2021
1 parent a805b90 commit 585f62a
Show file tree
Hide file tree
Showing 89 changed files with 3,725 additions and 1,317 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ module.exports = function(grunt) {
WORKING_DIR + 'wp-{admin,includes}/**/*.js',
WORKING_DIR + 'wp-content/themes/twenty*/**/*.js',
'!' + WORKING_DIR + 'wp-content/themes/twenty*/node_modules/**/*.js',
'!' + WORKING_DIR + 'wp-includes/js/dist/vendor/*.js',
'!' + WORKING_DIR + 'wp-includes/js/dist/**/*.js',
]
}
},
Expand Down
2,665 changes: 1,462 additions & 1,203 deletions package-lock.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"last 2 Opera versions"
],
"devDependencies": {
"@wordpress/custom-templated-path-webpack-plugin": "2.0.3",
"@wordpress/dependency-extraction-webpack-plugin": "3.1.2",
"@wordpress/e2e-test-utils": "5.1.3",
"@wordpress/library-export-default-webpack-plugin": "2.0.3",
"@wordpress/scripts": "15.0.1",
"@wordpress/custom-templated-path-webpack-plugin": "2.0.4",
"@wordpress/dependency-extraction-webpack-plugin": "3.1.3",
"@wordpress/e2e-test-utils": "5.1.4",
"@wordpress/library-export-default-webpack-plugin": "2.0.4",
"@wordpress/scripts": "16.0.0",
"autoprefixer": "^9.8.6",
"chalk": "4.1.0",
"check-node-version": "4.1.0",
Expand Down Expand Up @@ -77,55 +77,55 @@
},
"dependencies": {
"@babel/polyfill": "7.10.1",
"@wordpress/a11y": "2.15.3",
"@wordpress/annotations": "1.25.3",
"@wordpress/api-fetch": "4.0.0",
"@wordpress/autop": "2.12.2",
"@wordpress/blob": "2.13.2",
"@wordpress/block-directory": "1.19.3",
"@wordpress/block-editor": "5.3.3",
"@wordpress/block-library": "2.29.3",
"@wordpress/block-serialization-default-parser": "3.10.2",
"@wordpress/blocks": "8.0.3",
"@wordpress/components": "13.0.3",
"@wordpress/compose": "3.25.3",
"@wordpress/core-data": "2.26.3",
"@wordpress/data": "4.27.3",
"@wordpress/data-controls": "1.21.3",
"@wordpress/date": "3.15.1",
"@wordpress/deprecated": "2.12.3",
"@wordpress/dom": "2.18.0",
"@wordpress/dom-ready": "2.13.2",
"@wordpress/edit-post": "3.27.3",
"@wordpress/editor": "9.26.3",
"@wordpress/element": "2.20.3",
"@wordpress/escape-html": "1.12.2",
"@wordpress/format-library": "1.27.3",
"@wordpress/hooks": "2.12.3",
"@wordpress/html-entities": "2.11.2",
"@wordpress/i18n": "3.20.0",
"@wordpress/icons": "2.10.3",
"@wordpress/interface": "2.0.2",
"@wordpress/is-shallow-equal": "3.1.3",
"@wordpress/keyboard-shortcuts": "1.14.3",
"@wordpress/keycodes": "2.19.3",
"@wordpress/list-reusable-blocks": "1.26.3",
"@wordpress/media-utils": "1.20.3",
"@wordpress/notices": "2.13.3",
"@wordpress/nux": "3.25.3",
"@wordpress/plugins": "2.25.3",
"@wordpress/primitives": "1.12.3",
"@wordpress/priority-queue": "1.11.2",
"@wordpress/redux-routine": "3.14.2",
"@wordpress/reusable-blocks": "1.2.3",
"@wordpress/rich-text": "3.25.3",
"@wordpress/server-side-render": "1.21.3",
"@wordpress/shortcode": "2.13.2",
"@wordpress/token-list": "1.15.3",
"@wordpress/url": "2.22.2",
"@wordpress/viewport": "2.26.3",
"@wordpress/warning": "1.4.2",
"@wordpress/wordcount": "2.15.2",
"@wordpress/a11y": "3.0.0",
"@wordpress/annotations": "2.0.0",
"@wordpress/api-fetch": "5.0.0",
"@wordpress/autop": "3.0.0",
"@wordpress/blob": "3.0.0",
"@wordpress/block-directory": "2.0.0",
"@wordpress/block-editor": "6.0.0",
"@wordpress/block-library": "3.0.0",
"@wordpress/block-serialization-default-parser": "4.0.0",
"@wordpress/blocks": "9.0.0",
"@wordpress/components": "14.0.0",
"@wordpress/compose": "4.0.0",
"@wordpress/core-data": "3.0.0",
"@wordpress/data": "5.0.0",
"@wordpress/data-controls": "2.0.0",
"@wordpress/date": "4.0.0",
"@wordpress/deprecated": "3.0.0",
"@wordpress/dom": "3.0.0",
"@wordpress/dom-ready": "3.0.0",
"@wordpress/edit-post": "4.0.0",
"@wordpress/editor": "10.0.0",
"@wordpress/element": "3.0.0",
"@wordpress/escape-html": "2.0.0",
"@wordpress/format-library": "2.0.0",
"@wordpress/hooks": "3.0.0",
"@wordpress/html-entities": "3.0.0",
"@wordpress/i18n": "4.0.0",
"@wordpress/icons": "3.0.0",
"@wordpress/interface": "3.0.0",
"@wordpress/is-shallow-equal": "4.0.0",
"@wordpress/keyboard-shortcuts": "2.0.0",
"@wordpress/keycodes": "3.0.0",
"@wordpress/list-reusable-blocks": "2.0.0",
"@wordpress/media-utils": "2.0.0",
"@wordpress/notices": "3.0.0",
"@wordpress/nux": "4.0.0",
"@wordpress/plugins": "3.0.0",
"@wordpress/primitives": "2.0.0",
"@wordpress/priority-queue": "2.0.0",
"@wordpress/redux-routine": "4.0.0",
"@wordpress/reusable-blocks": "2.0.0",
"@wordpress/rich-text": "4.0.0",
"@wordpress/server-side-render": "2.0.0",
"@wordpress/shortcode": "3.0.0",
"@wordpress/token-list": "2.0.0",
"@wordpress/url": "3.0.0",
"@wordpress/viewport": "3.0.0",
"@wordpress/warning": "2.0.0",
"@wordpress/wordcount": "3.0.0",
"backbone": "1.4.0",
"clipboard": "2.0.8",
"core-js-url-browser": "3.6.4",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

41 changes: 36 additions & 5 deletions src/wp-includes/block-supports/border.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
function wp_register_border_support( $block_type ) {
// Determine if any border related features are supported.
$has_border_support = block_has_support( $block_type, array( '__experimentalBorder' ) );
$has_border_color_support = block_has_support( $block_type, array( '__experimentalBorder', 'color' ) );
$has_border_color_support = wp_has_border_feature_support( $block_type, 'color' );

// Setup attributes and styles within that if needed.
if ( ! $block_type->attributes ) {
Expand Down Expand Up @@ -60,7 +60,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {

// Border radius.
if (
block_has_support( $block_type, array( '__experimentalBorder', 'radius' ) ) &&
wp_has_border_feature_support( $block_type, 'radius' ) &&
isset( $block_attributes['style']['border']['radius'] )
) {
$border_radius = (int) $block_attributes['style']['border']['radius'];
Expand All @@ -69,7 +69,7 @@ function wp_apply_border_support( $block_type, $block_attributes ) {

// Border style.
if (
block_has_support( $block_type, array( '__experimentalBorder', 'style' ) ) &&
wp_has_border_feature_support( $block_type, 'style' ) &&
isset( $block_attributes['style']['border']['style'] )
) {
$border_style = $block_attributes['style']['border']['style'];
Expand All @@ -78,15 +78,15 @@ function wp_apply_border_support( $block_type, $block_attributes ) {

// Border width.
if (
block_has_support( $block_type, array( '__experimentalBorder', 'width' ) ) &&
wp_has_border_feature_support( $block_type, 'width' ) &&
isset( $block_attributes['style']['border']['width'] )
) {
$border_width = intval( $block_attributes['style']['border']['width'] );
$styles[] = sprintf( 'border-width: %dpx;', $border_width );
}

// Border color.
if ( block_has_support( $block_type, array( '__experimentalBorder', 'color' ) ) ) {
if ( wp_has_border_feature_support( $block_type, 'color' ) ) {
$has_named_border_color = array_key_exists( 'borderColor', $block_attributes );
$has_custom_border_color = isset( $block_attributes['style']['border']['color'] );

Expand Down Expand Up @@ -135,6 +135,37 @@ function wp_skip_border_serialization( $block_type ) {
$border_support['__experimentalSkipSerialization'];
}

/**
* Checks whether the current block type supports the border feature requested.
*
* If the `__experimentalBorder` support flag is a boolean `true` all border
* support features are available. Otherwise, the specific feature's support
* flag nested under `experimentalBorder` must be enabled for the feature
* to be opted into.
*
* @since 5.8.0
* @access private
*
* @param WP_Block_Type $block_type Block type to check for support.
* @param string $feature Name of the feature to check support for.
* @param mixed $default Fallback value for feature support, defaults to false.
*
* @return boolean Whether or not the feature is supported.
*/
function wp_has_border_feature_support( $block_type, $feature, $default = false ) {
// Check if all border support features have been opted into via `"__experimentalBorder": true`.
if (
property_exists( $block_type, 'supports' ) &&
( true === _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), $default ) )
) {
return true;
}

// Check if the specific feature has been opted into individually
// via nested flag under `__experimentalBorder`.
return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default );
}

// Register the block support.
WP_Block_Supports::get_instance()->register(
'border',
Expand Down
Loading

0 comments on commit 585f62a

Please sign in to comment.