Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync packages for WP 6.1 Beta 2 #3342

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,718 changes: 890 additions & 828 deletions package-lock.json

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
],
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
"@wordpress/babel-preset-default": "7.1.1",
"@wordpress/dependency-extraction-webpack-plugin": "4.0.2",
"@wordpress/e2e-test-utils": "8.1.1",
"@wordpress/scripts": "24.1.2",
"@wordpress/babel-preset-default": "7.2.0",
"@wordpress/dependency-extraction-webpack-plugin": "4.1.0",
"@wordpress/e2e-test-utils": "8.2.0",
"@wordpress/scripts": "24.2.0",
"autoprefixer": "^9.8.8",
"chalk": "5.0.1",
"check-node-version": "4.2.1",
Expand Down Expand Up @@ -76,62 +76,62 @@
"webpack-livereload-plugin": "3.0.2"
},
"dependencies": {
"@wordpress/a11y": "3.17.1",
"@wordpress/annotations": "2.17.2",
"@wordpress/api-fetch": "6.14.1",
"@wordpress/autop": "3.17.1",
"@wordpress/blob": "3.17.1",
"@wordpress/block-directory": "3.15.2",
"@wordpress/block-editor": "10.0.2",
"@wordpress/block-library": "7.14.2",
"@wordpress/block-serialization-default-parser": "4.17.1",
"@wordpress/blocks": "11.16.2",
"@wordpress/components": "21.0.2",
"@wordpress/compose": "5.15.2",
"@wordpress/core-data": "5.0.2",
"@wordpress/customize-widgets": "3.14.2",
"@wordpress/data": "7.1.2",
"@wordpress/data-controls": "2.17.2",
"@wordpress/date": "4.17.1",
"@wordpress/deprecated": "3.17.1",
"@wordpress/dom": "3.17.2",
"@wordpress/dom-ready": "3.17.1",
"@wordpress/edit-post": "6.14.2",
"@wordpress/edit-site": "4.14.2",
"@wordpress/edit-widgets": "4.14.2",
"@wordpress/editor": "12.16.2",
"@wordpress/element": "4.15.1",
"@wordpress/escape-html": "2.17.1",
"@wordpress/format-library": "3.15.2",
"@wordpress/hooks": "3.17.1",
"@wordpress/html-entities": "3.17.1",
"@wordpress/i18n": "4.17.1",
"@wordpress/icons": "9.8.1",
"@wordpress/interface": "4.16.2",
"@wordpress/is-shallow-equal": "4.17.1",
"@wordpress/keyboard-shortcuts": "3.15.2",
"@wordpress/keycodes": "3.17.1",
"@wordpress/list-reusable-blocks": "3.15.2",
"@wordpress/media-utils": "4.8.1",
"@wordpress/notices": "3.17.2",
"@wordpress/nux": "5.15.2",
"@wordpress/plugins": "4.15.2",
"@wordpress/preferences": "2.9.2",
"@wordpress/preferences-persistence": "1.9.1",
"@wordpress/primitives": "3.15.1",
"@wordpress/priority-queue": "2.17.2",
"@wordpress/redux-routine": "4.17.1",
"@wordpress/reusable-blocks": "3.15.2",
"@wordpress/rich-text": "5.15.2",
"@wordpress/server-side-render": "3.15.2",
"@wordpress/shortcode": "3.17.1",
"@wordpress/style-engine": "1.0.1",
"@wordpress/token-list": "2.17.1",
"@wordpress/url": "3.18.1",
"@wordpress/viewport": "4.15.2",
"@wordpress/warning": "2.17.1",
"@wordpress/widgets": "2.15.2",
"@wordpress/wordcount": "3.17.1",
"@wordpress/a11y": "3.18.0",
"@wordpress/annotations": "2.18.0",
"@wordpress/api-fetch": "6.15.0",
"@wordpress/autop": "3.18.0",
"@wordpress/blob": "3.18.0",
"@wordpress/block-directory": "3.16.0",
"@wordpress/block-editor": "10.1.0",
"@wordpress/block-library": "7.15.0",
"@wordpress/block-serialization-default-parser": "4.18.0",
"@wordpress/blocks": "11.17.0",
"@wordpress/components": "21.1.0",
"@wordpress/compose": "5.16.0",
"@wordpress/core-data": "5.1.0",
"@wordpress/customize-widgets": "3.15.0",
"@wordpress/data": "7.2.0",
"@wordpress/data-controls": "2.18.0",
"@wordpress/date": "4.18.0",
"@wordpress/deprecated": "3.18.0",
"@wordpress/dom": "3.18.0",
"@wordpress/dom-ready": "3.18.0",
"@wordpress/edit-post": "6.15.0",
"@wordpress/edit-site": "4.15.0",
"@wordpress/edit-widgets": "4.15.0",
"@wordpress/editor": "12.17.0",
"@wordpress/element": "4.16.0",
"@wordpress/escape-html": "2.18.0",
"@wordpress/format-library": "3.16.0",
"@wordpress/hooks": "3.18.0",
"@wordpress/html-entities": "3.18.0",
"@wordpress/i18n": "4.18.0",
"@wordpress/icons": "9.9.0",
"@wordpress/interface": "4.17.0",
"@wordpress/is-shallow-equal": "4.18.0",
"@wordpress/keyboard-shortcuts": "3.16.0",
"@wordpress/keycodes": "3.18.0",
"@wordpress/list-reusable-blocks": "3.16.0",
"@wordpress/media-utils": "4.9.0",
"@wordpress/notices": "3.18.0",
"@wordpress/nux": "5.16.0",
"@wordpress/plugins": "4.16.0",
"@wordpress/preferences": "2.10.0",
"@wordpress/preferences-persistence": "1.10.0",
"@wordpress/primitives": "3.16.0",
"@wordpress/priority-queue": "2.18.0",
"@wordpress/redux-routine": "4.18.0",
"@wordpress/reusable-blocks": "3.16.0",
"@wordpress/rich-text": "5.16.0",
"@wordpress/server-side-render": "3.16.0",
"@wordpress/shortcode": "3.18.0",
"@wordpress/style-engine": "1.1.0",
"@wordpress/token-list": "2.18.0",
"@wordpress/url": "3.19.0",
"@wordpress/viewport": "4.16.0",
"@wordpress/warning": "2.18.0",
"@wordpress/widgets": "2.16.0",
"@wordpress/wordcount": "3.18.0",
"backbone": "1.4.1",
"clipboard": "2.0.10",
"core-js-url-browser": "3.6.4",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/wp-includes/blocks/avatar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "core/avatar",
"title": "Avatar",
"category": "theme",
"description": "Add a user's avatar.",
"description": "Add a users avatar.",
"textdomain": "default",
"attributes": {
"userId": {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/blocks-json.php

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion src/wp-includes/blocks/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,32 @@ function render_block_core_calendar( $attributes ) {
}
}

$color_block_styles = array();

// Text color.
$preset_text_color = array_key_exists( 'textColor', $attributes ) ? "var:preset|color|{$attributes['textColor']}" : null;
$custom_text_color = _wp_array_get( $attributes, array( 'style', 'color', 'text' ), null );
$color_block_styles['text'] = $preset_text_color ? $preset_text_color : $custom_text_color;

// Background Color.
$preset_background_color = array_key_exists( 'backgroundColor', $attributes ) ? "var:preset|color|{$attributes['backgroundColor']}" : null;
$custom_background_color = _wp_array_get( $attributes, array( 'style', 'color', 'background' ), null );
$color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color;

// Generate color styles and classes.
$styles = gutenberg_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ockham The prefix should be changed to wp_ instead of gutenberg_.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I missed that one. I'll fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sidenote, I don't quite understand how this ended up here. The relevant GB PR (WordPress/gutenberg#42029) was only merged after GB 14.1 was released, and we didn't cherry-pick it to the wp/6.1 branch. In fact, the relevant code is absent from that file in Gutenberg's wp/6.1 branch 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the script picked up the wrong package version(s): For @wordpress/block-library, I see 7.15.0.

But the wp-6.1 tag points to 7.14.3.

I think we had a similar issue before with #3154, but I'm not 100% sure what @gziolo did to fix it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I forgot to specify the dist-tag. Note to future self:

npm run sync-gutenberg-packages -- --dist-tag=wp-6.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Re-syncing now.)

$inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style="%s"', esc_attr( $styles['css'] ) );
$classnames = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] );

// Apply color classes and styles to the calendar.
$calendar = str_replace( '<table', '<table' . $inline_styles, get_calendar( true, false ) );
$calendar = str_replace( 'class="wp-calendar-table', 'class="wp-calendar-table' . $classnames, $calendar );

$wrapper_attributes = get_block_wrapper_attributes();
$output = sprintf(
'<div %1$s>%2$s</div>',
$wrapper_attributes,
get_calendar( true, false )
$calendar
);

// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
Expand Down
9 changes: 9 additions & 0 deletions src/wp-includes/blocks/calendar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
},
"supports": {
"align": true,
"color": {
"link": true,
"__experimentalSkipSerialization": [ "text", "background" ],
"__experimentalDefaultControls": {
"background": true,
"text": true
},
"__experimentalSelector": "table, th"
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/comments-pagination-next/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "core/comments-pagination-next",
"title": "Next Page",
"title": "Comments Next Page",
"category": "theme",
"parent": [ "core/comments-pagination" ],
"description": "Displays the next comment's page link.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "core/comments-pagination-numbers",
"title": "Page Numbers",
"title": "Comments Page Numbers",
"category": "theme",
"parent": [ "core/comments-pagination" ],
"description": "Displays a list of page numbers for comments pagination.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "core/comments-pagination-previous",
"title": "Previous Page",
"title": "Comments Previous Page",
"category": "theme",
"parent": [ "core/comments-pagination" ],
"description": "Displays the previous comment's page link.",
Expand Down
18 changes: 12 additions & 6 deletions src/wp-includes/blocks/embed/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,36 @@
"textdomain": "default",
"attributes": {
"url": {
"type": "string"
"type": "string",
"__experimentalRole": "content"
},
"caption": {
"type": "string",
"source": "html",
"selector": "figcaption"
"selector": "figcaption",
"__experimentalRole": "content"
},
"type": {
"type": "string"
"type": "string",
"__experimentalRole": "content"
},
"providerNameSlug": {
"type": "string"
"type": "string",
"__experimentalRole": "content"
},
"allowResponsive": {
"type": "boolean",
"default": true
},
"responsive": {
"type": "boolean",
"default": false
"default": false,
"__experimentalRole": "content"
},
"previewable": {
"type": "boolean",
"default": true
"default": true,
"__experimentalRole": "content"
}
},
"supports": {
Expand Down
29 changes: 11 additions & 18 deletions src/wp-includes/blocks/post-featured-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
$attr['alt'] = $post_title;
}

if ( ! empty( $attributes['height'] ) ) {
$extra_styles = "height:{$attributes['height']};";
if ( ! empty( $attributes['scale'] ) ) {
$extra_styles .= "object-fit:{$attributes['scale']};";
}
$attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
}

$featured_image = get_the_post_thumbnail( $post_ID, $size_slug, $attr );
if ( ! $featured_image ) {
return '';
}
$wrapper_attributes = get_block_wrapper_attributes();
if ( $is_link ) {
$link_target = $attributes['linkTarget'];
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
Expand All @@ -49,23 +56,9 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
$featured_image = $featured_image . $overlay_markup;
}

$has_width = ! empty( $attributes['width'] );
$has_height = ! empty( $attributes['height'] );
if ( ! $has_height && ! $has_width ) {
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
}

if ( $has_width ) {
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
}

if ( $has_height ) {
$image_styles = "height:{$attributes['height']};";
if ( ! empty( $attributes['scale'] ) ) {
$image_styles .= "object-fit:{$attributes['scale']};";
}
$featured_image = str_replace( 'src=', 'style="' . esc_attr( $image_styles ) . '" src=', $featured_image );
}
$wrapper_attributes = empty( $attributes['width'] )
? get_block_wrapper_attributes()
: get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );

return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
}
Expand Down
23 changes: 23 additions & 0 deletions src/wp-includes/blocks/post-navigation-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
$link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );
$label = '';

$arrow_map = array(
'none' => '',
'arrow' => array(
'next' => '→',
'previous' => '←',
),
'chevron' => array(
'next' => '»',
'previous' => '«',
),
);

// If a custom label is provided, make this a link.
// `$label` is used to prepend the provided label, if we want to show the page title as well.
if ( isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ) {
Expand Down Expand Up @@ -71,6 +83,17 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
}
}

// Display arrows.
if ( isset( $attributes['arrow'] ) && ! empty( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] ) {
$arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ];

if ( 'next' === $navigation_type ) {
$format = '%link <span class="wp-block-post-navigation-link__arrow-next is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>';
} else {
$format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span> %link';
}
}

// The dynamic portion of the function name, `$navigation_type`,
// refers to the type of adjacency, 'next' or 'previous'.
$get_link_function = "get_{$navigation_type}_post_link";
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/blocks/post-navigation-link/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"linkLabel": {
"type": "boolean",
"default": false
},
"arrow": {
"type": "string",
"default": "none"
}
},
"supports": {
Expand All @@ -45,5 +49,6 @@
"fontSize": true
}
}
}
},
"style": "wp-block-post-navigation-link"
}
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/site-tagline/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "core/site-tagline",
"title": "Site Tagline",
"category": "theme",
"description": "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
"description": "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if its not displayed in the theme design.",
"keywords": [ "description" ],
"textdomain": "default",
"attributes": {
Expand Down