Skip to content
Permalink
Browse files

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


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43919 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
danielbachhuber committed Nov 21, 2018
1 parent 9ee7a34 commit 60ec049c98617a89c658f2ebd25f262b423fa819

Large diffs are not rendered by default.

@@ -51,41 +51,41 @@
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@wordpress/a11y": "^2.0.2",
"@wordpress/annotations": "^1.0.1",
"@wordpress/api-fetch": "^2.2.4",
"@wordpress/annotations": "^1.0.3",
"@wordpress/api-fetch": "^2.2.5",
"@wordpress/autop": "^2.0.2",
"@wordpress/blob": "^2.1.0",
"@wordpress/block-library": "^2.2.4",
"@wordpress/block-library": "^2.2.6",
"@wordpress/block-serialization-default-parser": "^2.0.0",
"@wordpress/blocks": "^6.0.0",
"@wordpress/components": "^6.0.2",
"@wordpress/blocks": "^6.0.2",
"@wordpress/components": "^7.0.1",
"@wordpress/compose": "^3.0.0",
"@wordpress/core-data": "^2.0.13",
"@wordpress/data": "^4.0.0",
"@wordpress/core-data": "^2.0.14",
"@wordpress/data": "^4.0.1",
"@wordpress/date": "^3.0.0",
"@wordpress/deprecated": "^2.0.3",
"@wordpress/dom": "^2.0.6",
"@wordpress/dom": "^2.0.7",
"@wordpress/dom-ready": "^2.0.2",
"@wordpress/edit-post": "^3.0.2",
"@wordpress/editor": "^8.0.0",
"@wordpress/edit-post": "^3.1.1",
"@wordpress/editor": "^9.0.1",
"@wordpress/element": "^2.1.8",
"@wordpress/escape-html": "^1.0.1",
"@wordpress/format-library": "^1.2.2",
"@wordpress/format-library": "^1.2.4",
"@wordpress/hooks": "^2.0.3",
"@wordpress/html-entities": "^2.0.2",
"@wordpress/html-entities": "^2.0.3",
"@wordpress/i18n": "^3.1.0",
"@wordpress/is-shallow-equal": "^1.1.4",
"@wordpress/keycodes": "^2.0.3",
"@wordpress/list-reusable-blocks": "^1.1.12",
"@wordpress/notices": "^1.0.5",
"@wordpress/nux": "^3.0.0",
"@wordpress/keycodes": "^2.0.5",
"@wordpress/list-reusable-blocks": "^1.1.14",
"@wordpress/notices": "^1.1.0",
"@wordpress/nux": "^3.0.2",
"@wordpress/plugins": "^2.0.9",
"@wordpress/redux-routine": "^3.0.3",
"@wordpress/rich-text": "^3.0.0",
"@wordpress/rich-text": "^3.0.2",
"@wordpress/shortcode": "^2.0.2",
"@wordpress/token-list": "^1.0.2",
"@wordpress/url": "^2.3.0",
"@wordpress/viewport": "^2.0.11",
"@wordpress/token-list": "^1.1.0",
"@wordpress/url": "^2.3.1",
"@wordpress/viewport": "^2.0.12",
"@wordpress/wordcount": "^2.0.3",
"element-closest": "^2.0.2",
"formdata-polyfill": "^3.0.12",
@@ -177,6 +177,16 @@
),
),
);
/*
* Set a locale specific default font.
* Translators: Use this to specify the CSS font family for the default font
*/
$locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font' );
$styles[] = array(
'css' => "body { font-family: '$locale_font_family' }",
);
if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
foreach ( $editor_styles as $style ) {
if ( preg_match( '~^(https?:)?//~', $style ) ) {
@@ -32,7 +32,7 @@ function render_block_core_archives( $attributes ) {
$class .= ' wp-block-archives-dropdown';
$dropdown_id = esc_attr( uniqid( 'wp-block-archives-' ) );
$title = __( 'Archives', 'gutenberg' );
$title = __( 'Archives' );
/** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
$dropdown_args = apply_filters(
@@ -50,19 +50,19 @@ function render_block_core_archives( $attributes ) {
switch ( $dropdown_args['type'] ) {
case 'yearly':
$label = __( 'Select Year', 'gutenberg' );
$label = __( 'Select Year' );
break;
case 'monthly':
$label = __( 'Select Month', 'gutenberg' );
$label = __( 'Select Month' );
break;
case 'daily':
$label = __( 'Select Day', 'gutenberg' );
$label = __( 'Select Day' );
break;
case 'weekly':
$label = __( 'Select Week', 'gutenberg' );
$label = __( 'Select Week' );
break;
default:
$label = __( 'Select Post', 'gutenberg' );
$label = __( 'Select Post' );
break;
}
@@ -101,7 +101,7 @@ function render_block_core_archives( $attributes ) {
$block_content = sprintf(
'<div class="%1$s">%2$s</div>',
$classnames,
__( 'No archives to show.', 'gutenberg' )
__( 'No archives to show.' )
);
} else {
@@ -27,7 +27,7 @@ function render_block_core_categories( $attributes ) {
if ( ! empty( $attributes['displayAsDropdown'] ) ) {
$id = 'wp-block-categories-' . $block_id;
$args['id'] = $id;
$args['show_option_none'] = __( 'Select Category', 'gutenberg' );
$args['show_option_none'] = __( 'Select Category' );
$wrapper_markup = '<div class="%1$s">%2$s</div>';
$items_markup = wp_dropdown_categories( $args );
$type = 'dropdown';
@@ -29,7 +29,7 @@
function gutenberg_draft_or_post_title( $post = 0 ) {
$title = get_the_title( $post );
if ( empty( $title ) ) {
$title = __( '(no title)', 'gutenberg' );
$title = __( '(no title)' );
}
return esc_html( $title );
}
@@ -98,7 +98,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
$list_items_markup .= sprintf(
/* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
__( '%1$s on %2$s', 'gutenberg' ),
__( '%1$s on %2$s' ),
$author_markup,
$post_title
);
@@ -119,7 +119,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
}
$class = 'wp-block-latest-comments';
if ( $attributes['align'] ) {
if ( isset( $attributes['align'] ) ) {
$class .= " align{$attributes['align']}";
}
if ( $attributes['displayAvatar'] ) {
@@ -143,7 +143,7 @@ function gutenberg_render_block_core_latest_comments( $attributes = array() ) {
) : sprintf(
'<div class="%1$s">%2$s</div>',
$classnames,
__( 'No comments to show.', 'gutenberg' )
__( 'No comments to show.' )
);
return $block_content;
@@ -13,24 +13,27 @@
* @return string Returns the post content with latest posts added.
*/
function render_block_core_latest_posts( $attributes ) {
$recent_posts = wp_get_recent_posts(
array(
'numberposts' => $attributes['postsToShow'],
'post_status' => 'publish',
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
'category' => $attributes['categories'],
)
$args = array(
'numberposts' => $attributes['postsToShow'],
'post_status' => 'publish',
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
);
if ( isset( $attributes['categories'] ) ) {
$args['categories'] = $attributes['categories'];
}
$recent_posts = wp_get_recent_posts( $args );
$list_items_markup = '';
foreach ( $recent_posts as $post ) {
$post_id = $post['ID'];
$title = get_the_title( $post_id );
if ( ! $title ) {
$title = __( '(Untitled)', 'gutenberg' );
$title = __( '(Untitled)' );
}
$list_items_markup .= sprintf(
'<li><a href="%1$s">%2$s</a>',
@@ -74,6 +74,8 @@ function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) {
* @param WP_Scripts $scripts WP_Scripts object.
*/
function wp_default_packages_vendor( &$scripts ) {
global $wp_locale;
$dev_suffix = wp_scripts_get_suffix( 'dev' );
$vendor_scripts = array(
@@ -100,21 +102,49 @@ function wp_default_packages_vendor( &$scripts ) {
}
$scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) );
did_action( 'init' ) && $scripts->add_data(
did_action( 'init' ) && $scripts->add_inline_script(
'wp-polyfill',
'data',
wp_get_script_polyfill(
$scripts,
array(
'\'fetch\' in window' => 'wp-polyfill-fetch',
'document.contains' => 'wp-polyfill-node-contains',
'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
)
),
'after'
)
);
did_action( 'init' ) && $scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );
did_action( 'init' ) && $scripts->add_inline_script(
'moment',
sprintf(
"moment.locale( '%s', %s );",
get_user_locale(),
wp_json_encode(
array(
'months' => array_values( $wp_locale->month ),
'monthsShort' => array_values( $wp_locale->month_abbrev ),
'weekdays' => array_values( $wp_locale->weekday ),
'weekdaysShort' => array_values( $wp_locale->weekday_abbrev ),
'week' => array(
'dow' => (int) get_option( 'start_of_week', 0 ),
),
'longDateFormat' => array(
'LT' => get_option( 'time_format', __( 'g:i a', 'default' ) ),
'LTS' => null,
'L' => null,
'LL' => get_option( 'date_format', __( 'F j, Y', 'default' ) ),
'LLL' => __( 'F j, Y g:i a', 'default' ),
'LLLL' => null,
),
)
)
),
'after'
);
}
/**
@@ -221,7 +251,6 @@ function wp_default_packages_scripts( &$scripts ) {
'wp-a11y',
'wp-api-fetch',
'wp-compose',
'wp-deprecated',
'wp-dom',
'wp-element',
'wp-hooks',
@@ -272,6 +301,7 @@ function wp_default_packages_scripts( &$scripts ) {
'wp-embed',
'wp-i18n',
'wp-keycodes',
'wp-notices',
'wp-nux',
'wp-plugins',
'wp-polyfill',
@@ -344,6 +374,7 @@ function wp_default_packages_scripts( &$scripts ) {
),
'nux' => array(
'wp-element',
'lodash',
'wp-components',
'wp-compose',
'wp-data',
@@ -355,7 +386,6 @@ function wp_default_packages_scripts( &$scripts ) {
'redux-routine' => array( 'wp-polyfill' ),
'rich-text' => array(
'lodash',
'wp-blocks',
'wp-data',
'wp-escape-html',
'wp-polyfill',
@@ -1688,11 +1718,13 @@ function wp_default_styles( &$styles ) {
$fonts_url = '';
/*
* Translators: If there are characters in your language that are not supported
* by Noto Serif, translate this to 'off'. Do not translate into your own language.
* Translators: Use this to specify the proper Google Font name and variants
* to load that is supported by your language. Do not translate.
* Set to 'off' to disable loading.
*/
if ( 'off' !== _x( 'on', 'Noto Serif font: on or off' ) ) {
$fonts_url = 'https://fonts.googleapis.com/css?family=Noto+Serif%3A400%2C400i%2C700%2C700i';
$font_family = _x( 'Noto Serif:400,400i,700,700i', 'Google Font Name and Variants' );
if ( 'off' !== $font_family ) {
$fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family );
}
$styles->add( 'wp-editor-font', $fonts_url );
@@ -225,6 +225,7 @@ module.exports = function( env = { environment: 'production', watch: false, forc
'deprecated',
'dom-ready',
'redux-routine',
'token-list',
].map( camelCaseDash ) ),
new CustomTemplatedPathPlugin( {
basename( path, data ) {

0 comments on commit 60ec049

Please sign in to comment.
You can’t perform that action at this time.