Make WordPress Core


Ignore:
Timestamp:
11/21/2018 03:08:01 PM (6 years ago)
Author:
danielbachhuber
Message:

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

Updates packages: annotations,
api-fetch,
block-library,
blocks,
components,
core-data,
data,
dom, edit-post,
editor,
format-library,
jest-console,
jest-preset-default,
keycodes,
html-entities,
list-reusable-blocks,
notices,
nux,
rich-text,
scripts,
token-list, url,
viewport

Fixes undefined notices in some blocks. Removes incorrect 'gutenberg' textdomain too.

See #45145

File:
1 edited

Legend:

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

    r43914 r43919  
    7575 */
    7676function wp_default_packages_vendor( &$scripts ) {
     77    global $wp_locale;
     78
    7779    $dev_suffix = wp_scripts_get_suffix( 'dev' );
    7880
     
    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',
    113             )
     114            ),
     115            'after'
    114116        )
    115117    );
    116118
    117119    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                )
     144            )
     145        ),
     146        'after'
     147    );
    118148}
    119149
     
    222252            'wp-api-fetch',
    223253            'wp-compose',
    224             'wp-deprecated',
    225254            'wp-dom',
    226255            'wp-element',
     
    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',
     
    356387        'rich-text' => array(
    357388            'lodash',
    358             'wp-blocks',
    359389            'wp-data',
    360390            'wp-escape-html',
     
    16891719
    16901720    /*
    1691      * Translators: If there are characters in your language that are not supported
    1692      * by Noto Serif, translate this to 'off'. Do not translate into your own language.
     1721     * Translators: Use this to specify the proper Google Font name and variants
     1722     * to load that is supported by your language. Do not translate.
     1723     * Set to 'off' to disable loading.
    16931724     */
    1694     if ( 'off' !== _x( 'on', 'Noto Serif font: on or off' ) ) {
    1695         $fonts_url = 'https://fonts.googleapis.com/css?family=Noto+Serif%3A400%2C400i%2C700%2C700i';
     1725    $font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
     1726    if ( 'off' !== $font_family ) {
     1727        $fonts_url  =  'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
    16961728    }
    16971729    $styles->add( 'wp-editor-font', $fonts_url );
Note: See TracChangeset for help on using the changeset viewer.