Make WordPress Core


Ignore:
Timestamp:
04/15/2021 02:41:38 PM (5 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages to use with WordPress 5.8

In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r50703 r50761  
    15061506
    15071507    $styles->add(
     1508        'wp-reset-editor-styles',
     1509        "/wp-includes/css/dist/block-library/reset$suffix.css",
     1510        array( 'common', 'forms' ) // Make sure the reset is loaded after the default WP Admin styles.
     1511    );
     1512
     1513    $styles->add(
     1514        'wp-editor-classic-layout-styles',
     1515        "/wp-includes/css/dist/edit-post/classic$suffix.css",
     1516        array()
     1517    );
     1518
     1519    $wp_edit_blocks_dependencies = array(
     1520        'wp-components',
     1521        'wp-editor',
     1522        // This need to be added before the block library styles,
     1523        // The block library styles override the "reset" styles.
     1524        'wp-reset-editor-styles',
     1525        'wp-block-library',
     1526        'wp-reusable-blocks',
     1527
     1528        // This dependency shouldn't be added for themes with theme.json support
     1529        // It's here for backward compatibility only.
     1530        // A check should be added here when theme.json is backported to Core.
     1531        'wp-editor-classic-layout-styles',
     1532    );
     1533    global $editor_styles;
     1534    if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) {
     1535        // Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken.
     1536        $wp_edit_blocks_dependencies[] = 'wp-block-library-theme';
     1537    }
     1538
     1539    $styles->add(
    15081540        'wp-edit-blocks',
    15091541        "/wp-includes/css/dist/block-library/editor$suffix.css",
    1510         array(
    1511             'wp-components',
    1512             'wp-editor',
    1513             'wp-block-library',
    1514             // Always include visual styles so the editor never appears broken.
    1515             'wp-block-library-theme',
    1516         )
     1542        $wp_edit_blocks_dependencies
    15171543    );
    15181544
     
    15341560            'wp-block-editor',
    15351561            'wp-nux',
     1562            'wp-reusable-blocks',
    15361563        ),
    15371564        'format-library'       => array(),
    15381565        'list-reusable-blocks' => array( 'wp-components' ),
     1566        'reusable-blocks'      => array( 'wp-components' ),
    15391567        'nux'                  => array( 'wp-components' ),
    15401568    );
     
    15811609        'wp-jquery-ui-dialog',
    15821610        // Package styles.
     1611        'wp-reset-editor-styles',
     1612        'wp-editor-classic-layout-styles',
    15831613        'wp-block-library-theme',
    15841614        'wp-edit-blocks',
     
    15911621        'wp-format-library',
    15921622        'wp-list-reusable-blocks',
     1623        'wp-reusable-blocks',
    15931624        'wp-nux',
    15941625        // Deprecated CSS.
Note: See TracChangeset for help on using the changeset viewer.