Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.

This includes:

**Various**

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

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

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

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

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/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
This commit is contained in:
Riad Benguella
2021-06-15 08:50:26 +00:00
parent 15c8c705bc
commit 0068f2646c
20 changed files with 1243 additions and 1077 deletions

View File

@@ -170,7 +170,7 @@ class WP_Test_Block_Editor extends WP_UnitTestCase {
function test_get_default_block_editor_settings() {
$settings = get_default_block_editor_settings();
$this->assertCount( 17, $settings );
$this->assertCount( 16, $settings );
$this->assertFalse( $settings['alignWide'] );
$this->assertInternalType( 'array', $settings['allowedMimeTypes'] );
$this->assertTrue( $settings['allowedBlockTypes'] );
@@ -265,6 +265,14 @@ class WP_Test_Block_Editor extends WP_UnitTestCase {
$settings['imageSizes']
);
$this->assertInternalType( 'int', $settings['maxUploadFileSize'] );
}
/**
* @ticket 53397
*/
function test_get_legacy_widget_block_editor_settings() {
$settings = get_legacy_widget_block_editor_settings();
$this->assertCount( 1, $settings );
$this->assertSameSets(
array(
'archives',

View File

@@ -64,12 +64,137 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
$this->assertSameSetsWithIndex( $expected, $actual );
}
function test_get_settings_presets_are_keyed_by_origin() {
$core_origin = new WP_Theme_JSON(
array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'palette' => array(
array(
'slug' => 'white',
'color' => 'white',
),
),
),
'invalid/key' => 'value',
'blocks' => array(
'core/group' => array(
'color' => array(
'palette' => array(
array(
'slug' => 'white',
'color' => 'white',
),
),
),
),
),
),
),
'core'
);
$no_origin = new WP_Theme_JSON(
array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'palette' => array(
array(
'slug' => 'black',
'color' => 'black',
),
),
),
'invalid/key' => 'value',
'blocks' => array(
'core/group' => array(
'color' => array(
'palette' => array(
array(
'slug' => 'black',
'color' => 'black',
),
),
),
),
),
),
)
);
$actual_core = $core_origin->get_raw_data();
$actual_no_origin = $no_origin->get_raw_data();
$expected_core = array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'palette' => array(
'core' => array(
array(
'slug' => 'white',
'color' => 'white',
),
),
),
),
'blocks' => array(
'core/group' => array(
'color' => array(
'palette' => array(
'core' => array(
array(
'slug' => 'white',
'color' => 'white',
),
),
),
),
),
),
),
);
$expected_no_origin = array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'palette' => array(
'theme' => array(
array(
'slug' => 'black',
'color' => 'black',
),
),
),
),
'blocks' => array(
'core/group' => array(
'color' => array(
'palette' => array(
'theme' => array(
array(
'slug' => 'black',
'color' => 'black',
),
),
),
),
),
),
),
);
$this->assertEqualSetsWithIndex( $expected_core, $actual_core );
$this->assertEqualSetsWithIndex( $expected_no_origin, $actual_no_origin );
}
function test_get_stylesheet() {
$theme_json = new WP_Theme_JSON(
array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'color' => array(
'text' => 'value',
'palette' => array(
array(
@@ -78,8 +203,20 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
),
),
),
'misc' => 'value',
'blocks' => array(
'typography' => array(
'fontFamilies' => array(
array(
'slug' => 'small',
'fontFamily' => '14px',
),
array(
'slug' => 'big',
'fontFamily' => '41px',
),
),
),
'misc' => 'value',
'blocks' => array(
'core/group' => array(
'custom' => array(
'base-font' => 16,
@@ -265,7 +402,8 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
),
),
),
)
),
'core'
);
$this->assertSame(
@@ -278,35 +416,37 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
* @ticket 52991
*/
public function test_merge_incoming_data() {
$initial = array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'custom' => false,
'palette' => array(
array(
'slug' => 'red',
'color' => 'red',
$theme_json = new WP_Theme_JSON(
array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
'settings' => array(
'color' => array(
'custom' => false,
'palette' => array(
array(
'slug' => 'red',
'color' => 'red',
),
array(
'slug' => 'green',
'color' => 'green',
),
),
array(
'slug' => 'green',
'color' => 'green',
),
'blocks' => array(
'core/paragraph' => array(
'color' => array(
'custom' => false,
),
),
),
),
'blocks' => array(
'core/paragraph' => array(
'color' => array(
'custom' => false,
),
'styles' => array(
'typography' => array(
'fontSize' => '12',
),
),
),
'styles' => array(
'typography' => array(
'fontSize' => '12',
),
),
)
);
$add_new_block = array(
@@ -436,31 +576,29 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
'custom' => true,
'customGradient' => true,
'palette' => array(
array(
'slug' => 'red',
'color' => 'red',
),
array(
'slug' => 'green',
'color' => 'green',
),
array(
'slug' => 'blue',
'color' => 'blue',
'theme' => array(
array(
'slug' => 'blue',
'color' => 'blue',
),
),
),
'gradients' => array(
array(
'slug' => 'gradient',
'gradient' => 'gradient',
'theme' => array(
array(
'slug' => 'gradient',
'gradient' => 'gradient',
),
),
),
),
'typography' => array(
'fontSizes' => array(
array(
'slug' => 'fontSize',
'size' => 'fontSize',
'theme' => array(
array(
'slug' => 'fontSize',
'size' => 'fontSize',
),
),
),
),
@@ -502,7 +640,6 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
),
);
$theme_json = new WP_Theme_JSON( $initial );
$theme_json->merge( new WP_Theme_JSON( $add_new_block ) );
$theme_json->merge( new WP_Theme_JSON( $add_key_in_settings ) );
$theme_json->merge( new WP_Theme_JSON( $update_key_in_settings ) );

View File

@@ -110,15 +110,17 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
array(
'color' => array(
'palette' => array(
array(
'slug' => 'light',
'name' => 'Jasny',
'color' => '#f5f7f9',
),
array(
'slug' => 'dark',
'name' => 'Ciemny',
'color' => '#000',
'theme' => array(
array(
'slug' => 'light',
'name' => 'Jasny',
'color' => '#f5f7f9',
),
array(
'slug' => 'dark',
'name' => 'Ciemny',
'color' => '#000',
),
),
),
'custom' => false,
@@ -127,10 +129,12 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
'core/paragraph' => array(
'color' => array(
'palette' => array(
array(
'slug' => 'light',
'name' => 'Jasny',
'color' => '#f5f7f9',
'theme' => array(
array(
'slug' => 'light',
'name' => 'Jasny',
'color' => '#f5f7f9',
),
),
),
),