mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
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:
@@ -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.
|
||||
@@ -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'];
|
||||
@@ -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'] );
|
||||
|
||||
Reference in New Issue
Block a user