Skip to content

Commit

Permalink
Block Editor: Update the WordPress packages with the fixes for 5.8 be…
Browse files Browse the repository at this point in the history
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51149 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
youknowriad committed Jun 15, 2021
1 parent 03c6de2 commit 167eed6
Show file tree
Hide file tree
Showing 20 changed files with 1,250 additions and 1,084 deletions.
1,687 changes: 840 additions & 847 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,56 @@
},
"dependencies": {
"@wordpress/a11y": "3.1.1",
"@wordpress/annotations": "2.1.1",
"@wordpress/annotations": "2.1.2",
"@wordpress/api-fetch": "5.1.1",
"@wordpress/autop": "3.1.1",
"@wordpress/blob": "3.1.1",
"@wordpress/block-directory": "2.1.5",
"@wordpress/block-editor": "6.1.3",
"@wordpress/block-library": "3.2.4",
"@wordpress/block-directory": "2.1.7",
"@wordpress/block-editor": "6.1.4",
"@wordpress/block-library": "3.2.6",
"@wordpress/block-serialization-default-parser": "4.1.1",
"@wordpress/blocks": "9.1.3",
"@wordpress/components": "14.1.2",
"@wordpress/compose": "4.1.1",
"@wordpress/core-data": "3.1.4",
"@wordpress/customize-widgets": "1.0.4",
"@wordpress/data": "5.1.1",
"@wordpress/data-controls": "2.1.1",
"@wordpress/blocks": "9.1.4",
"@wordpress/components": "14.1.3",
"@wordpress/compose": "4.1.2",
"@wordpress/core-data": "3.1.6",
"@wordpress/customize-widgets": "1.0.6",
"@wordpress/data": "5.1.2",
"@wordpress/data-controls": "2.1.2",
"@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.5",
"@wordpress/edit-widgets": "2.1.5",
"@wordpress/editor": "10.1.4",
"@wordpress/edit-post": "4.1.7",
"@wordpress/edit-widgets": "2.1.7",
"@wordpress/editor": "10.1.6",
"@wordpress/element": "3.1.1",
"@wordpress/escape-html": "2.1.1",
"@wordpress/format-library": "2.1.3",
"@wordpress/format-library": "2.1.4",
"@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.2",
"@wordpress/interface": "3.1.3",
"@wordpress/is-shallow-equal": "4.1.1",
"@wordpress/keyboard-shortcuts": "2.1.1",
"@wordpress/keyboard-shortcuts": "2.1.2",
"@wordpress/keycodes": "3.1.1",
"@wordpress/list-reusable-blocks": "2.1.2",
"@wordpress/list-reusable-blocks": "2.1.3",
"@wordpress/media-utils": "2.1.1",
"@wordpress/notices": "3.1.1",
"@wordpress/nux": "4.1.2",
"@wordpress/plugins": "3.1.1",
"@wordpress/notices": "3.1.2",
"@wordpress/nux": "4.1.3",
"@wordpress/plugins": "3.1.2",
"@wordpress/primitives": "2.1.1",
"@wordpress/priority-queue": "2.1.1",
"@wordpress/redux-routine": "4.1.1",
"@wordpress/reusable-blocks": "2.1.4",
"@wordpress/rich-text": "4.1.1",
"@wordpress/server-side-render": "2.1.3",
"@wordpress/reusable-blocks": "2.1.6",
"@wordpress/rich-text": "4.1.2",
"@wordpress/server-side-render": "2.1.4",
"@wordpress/shortcode": "3.1.1",
"@wordpress/token-list": "2.1.1",
"@wordpress/url": "3.1.1",
"@wordpress/viewport": "3.1.1",
"@wordpress/viewport": "3.1.2",
"@wordpress/warning": "2.1.1",
"@wordpress/widgets": "1.1.4",
"@wordpress/widgets": "1.1.6",
"@wordpress/wordcount": "3.1.1",
"backbone": "1.4.0",
"clipboard": "2.0.8",
Expand Down
5 changes: 4 additions & 1 deletion src/wp-admin/widgets-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
);
block_editor_rest_api_preload( $preload_paths, $block_editor_context );

$editor_settings = get_block_editor_settings( array(), $block_editor_context );
$editor_settings = get_block_editor_settings(
get_legacy_widget_block_editor_settings(),
$block_editor_context
);

wp_add_inline_script(
'wp-edit-widgets',
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

49 changes: 39 additions & 10 deletions src/wp-includes/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,20 @@ function get_default_block_editor_settings() {
$editor_settings['gradients'] = $gradient_presets;
}

return $editor_settings;
}

/**
* Returns the block editor settings needed to use the Legacy Widget block which
* is not registered by default.
*
* @since 5.8.0
*
* @return array Settings to be used with get_block_editor_settings().
*/
function get_legacy_widget_block_editor_settings() {
$editor_settings = array();

/**
* Filters the list of widget-type IDs that should **not** be offered by the
* Legacy Widget block.
Expand Down Expand Up @@ -296,13 +310,32 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex

$editor_settings['__experimentalFeatures'] = $theme_json->get_settings();
// These settings may need to be updated based on data coming from theme.json sources.
if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
$editor_settings['colors'] = $editor_settings['__experimentalFeatures']['color']['palette'];
unset( $editor_settings['__experimentalFeatures']['color']['palette'] );
if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) {
$colors_by_origin = $settings['__experimentalFeatures']['color']['palette'];
$settings['colors'] = isset( $colors_by_origin['user'] ) ?
$colors_by_origin['user'] : (
isset( $colors_by_origin['theme'] ) ?
$colors_by_origin['theme'] :
$colors_by_origin['core']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) {
$editor_settings['gradients'] = $editor_settings['__experimentalFeatures']['color']['gradients'];
unset( $editor_settings['__experimentalFeatures']['color']['gradients'] );
if ( isset( $settings['__experimentalFeatures']['color']['gradients'] ) ) {
$gradients_by_origin = $settings['__experimentalFeatures']['color']['gradients'];
$settings['gradients'] = isset( $gradients_by_origin['user'] ) ?
$gradients_by_origin['user'] : (
isset( $gradients_by_origin['theme'] ) ?
$gradients_by_origin['theme'] :
$gradients_by_origin['core']
);
}
if ( isset( $settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
$font_sizes_by_origin = $settings['__experimentalFeatures']['typography']['fontSizes'];
$settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ?
$font_sizes_by_origin['user'] : (
isset( $font_sizes_by_origin['theme'] ) ?
$font_sizes_by_origin['theme'] :
$font_sizes_by_origin['core']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) {
$editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom'];
Expand All @@ -312,10 +345,6 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
$editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient'];
unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
$editor_settings['fontSizes'] = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];
unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
$editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-content/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"category": "design",
"description": "Displays the contents of a post or page.",
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"align": [ "wide", "full" ],
"html": false,
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-date/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"default": false
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"html": false,
"color": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-excerpt/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"default": true
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"html": false,
"color": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-featured-image/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"default": false
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"align": [ "left", "right", "center", "wide", "full" ],
"html": false
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"category": "design",
"description": "Displays the title of a post, page, or any other content-type.",
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"attributes": {
"textAlign": {
"type": "string"
Expand Down
5 changes: 4 additions & 1 deletion src/wp-includes/class-wp-customize-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,10 @@ public function enqueue_scripts() {
if ( wp_use_widgets_block_editor() ) {
$block_editor_context = new WP_Block_Editor_Context();

$editor_settings = get_block_editor_settings( array(), $block_editor_context );
$editor_settings = get_block_editor_settings(
get_legacy_widget_block_editor_settings(),
$block_editor_context
);

wp_add_inline_script(
'wp-customize-widgets',
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public static function get_core_data() {

$config = self::read_json_file( __DIR__ . '/theme.json' );
$config = self::translate( $config );
self::$core = new WP_Theme_JSON( $config );
self::$core = new WP_Theme_JSON( $config, 'core' );

return self::$core;
}
Expand Down Expand Up @@ -301,7 +301,7 @@ public static function get_theme_data( $theme_support_data = array() ) {
*
* @since 5.8.0
*
* @param array $settings Existing block editor settings.
* @param array $settings Existing block editor settings.
* Empty array by default.
* @return WP_Theme_JSON
*/
Expand Down
Loading

0 comments on commit 167eed6

Please sign in to comment.