Make WordPress Core


Ignore:
Timestamp:
12/17/2018 03:35:21 PM (8 years ago)
Author:
desrosj
Message:

Block Editor: Update @wordpress dependencies to match Gutenberg 4.5.1.

  • Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
  • Upgrades React from 16.5.2 to 16.6.3.
  • Adds a missing wp-date dependency to the editor script.
  • Updates changed dependencies in script-loader.php.
  • Fixes undefined notices in some blocks.
  • Removes incorrect gutenberg textdomain.

Merges [43891], [43903], and [43919] to trunk.

Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/script-loader.php

    r44261 r44262  
    7575 */
    7676function wp_default_packages_vendor( &$scripts ) {
     77        global $wp_locale;
     78
    7779        $dev_suffix = wp_scripts_get_suffix( 'dev' );
    7880
    7981        $vendor_scripts = array(
    80                 'react',
     82                'react'     => array( 'wp-polyfill' ),
    8183                'react-dom' => array( 'react' ),
    8284                'moment',
    … …  
    101103
    102104        $scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) );
    103         did_action( 'init' ) && $scripts->add_data(
     105        did_action( 'init' ) && $scripts->add_inline_script(
    104106                'wp-polyfill',
    105                 'data',
    106107                wp_get_script_polyfill(
    107108                        $scripts,
    … …  
    111112                                'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
    112113                                'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
     114                        ),
     115                        'after'
     116                )
     117        );
     118
     119        did_action( 'init' ) && $scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );
     120
     121        did_action( 'init' ) && $scripts->add_inline_script(
     122                'moment',
     123                sprintf(
     124                        "moment.locale( '%s', %s );",
     125                        get_user_locale(),
     126                        wp_json_encode(
     127                                array(
     128                                        'months'         => array_values( $wp_locale->month ),
     129                                        'monthsShort'    => array_values( $wp_locale->month_abbrev ),
     130                                        'weekdays'       => array_values( $wp_locale->weekday ),
     131                                        'weekdaysShort'  => array_values( $wp_locale->weekday_abbrev ),
     132                                        'week'           => array(
     133                                                'dow' => (int) get_option( 'start_of_week', 0 ),
     134                                        ),
     135                                        'longDateFormat' => array(
     136                                                'LT'   => get_option( 'time_format', __( 'g:i a', 'default' ) ),
     137                                                'LTS'  => null,
     138                                                'L'    => null,
     139                                                'LL'   => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
     140                                                'LLL'  => __( 'F j, Y g:i a', 'default' ),
     141                                                'LLLL' => null,
     142                                        ),
     143                                )
    113144                        )
    114                 )
    115         );
    116 
    117         did_action( 'init' ) && $scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );
     145                ),
     146                'after'
     147        );
    118148}
    119149
    … …  
    184214                        'wp-element',
    185215                        'wp-hooks',
     216                        'wp-html-entities',
    186217                        'wp-i18n',
    187218                        'wp-is-shallow-equal',
    … …  
    202233                        'wp-core-data',
    203234                        'wp-data',
     235                        'wp-date',
    204236                        'wp-editor',
    205237                        'wp-element',
    … …  
    220252                        'wp-api-fetch',
    221253                        'wp-compose',
    222                         'wp-deprecated',
    223254                        'wp-dom',
    224255                        'wp-element',
    … …  
    234265                'compose'                            => array(
    235266                        'lodash',
    236                         'wp-deprecated',
    237267                        'wp-element',
    238268                        'wp-is-shallow-equal',
    … …  
    243273                        'lodash',
    244274                        'wp-compose',
    245                         'wp-deprecated',
    246275                        'wp-element',
    247276                        'wp-is-shallow-equal',
    … …  
    273302                        'wp-i18n',
    274303                        'wp-keycodes',
     304                        'wp-notices',
    275305                        'wp-nux',
    276306                        'wp-plugins',
    … …  
    345375                'nux'                                => array(
    346376                        'wp-element',
     377                        'lodash',
    347378                        'wp-components',
    348379                        'wp-compose',
    349380                        'wp-data',
    350                         'wp-deprecated',
    351381                        'wp-i18n',
    352382                        'wp-polyfill',
    … …  
    357387                'rich-text'                          => array(
    358388                        'lodash',
    359                         'wp-blocks',
    360389                        'wp-data',
    361                         'wp-deprecated',
    362390                        'wp-escape-html',
    363391                        'wp-polyfill',
    … …  
    18531881
    18541882        /*
    1855          * Translators: If there are characters in your language that are not supported
    1856          * by Noto Serif, translate this to 'off'. Do not translate into your own language.
     1883         * Translators: Use this to specify the proper Google Font name and variants
     1884         * to load that is supported by your language. Do not translate.
     1885         * Set to 'off' to disable loading.
    18571886         */
    1858         if ( 'off' !== _x( 'on', 'Noto Serif font: on or off' ) ) {
    1859                 $fonts_url = 'https://fonts.googleapis.com/css?family=Noto+Serif%3A400%2C400i%2C700%2C700i';
     1887        $font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
     1888        if ( 'off' !== $font_family ) {
     1889                $fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
    18601890        }
    18611891        $styles->add( 'wp-editor-font', $fonts_url );
Note: See TracChangeset for help on using the changeset viewer.