Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.

This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella
2021-11-08 14:26:27 +00:00
parent 7bbee20833
commit fdb2dacc19
72 changed files with 4977 additions and 3997 deletions

View File

@@ -187,10 +187,22 @@ function get_default_block_editor_settings() {
}
}
// These styles are used if the "no theme styles" options is triggered or on
// themes without their own editor styles.
$default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css';
if ( file_exists( $default_editor_styles_file ) ) {
$default_editor_styles = array(
array( 'css' => file_get_contents( $default_editor_styles_file ) ),
);
} else {
$default_editor_styles = array();
}
$editor_settings = array(
'alignWide' => get_theme_support( 'align-wide' ),
'allowedBlockTypes' => true,
'allowedMimeTypes' => get_allowed_mime_types(),
'defaultEditorStyles' => $default_editor_styles,
'blockCategories' => get_default_block_categories(),
'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),
'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ),
@@ -464,22 +476,12 @@ function block_editor_rest_api_preload( array $preload_paths, $block_editor_cont
*
* @global array $editor_styles
*
* @return array An array of theme styles for the block editor. Includes default font family
* style and theme stylesheets.
* @return array An array of theme styles for the block editor.
*/
function get_block_editor_theme_styles() {
global $editor_styles;
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$styles = array(
array(
'css' => 'body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif }',
'__unstableType' => 'core',
),
);
} else {
$styles = array();
}
$styles = array();
if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
foreach ( $editor_styles as $style ) {