Editor: Update WordPress packages for 6.0 RC 2

Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 RC 1.

Props zieladam, ndiego, hellofromtonya.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53377


git-svn-id: http://core.svn.wordpress.org/trunk@52966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2022-05-10 14:49:35 +00:00
parent cb2d81f6df
commit 6a989e83f6
35 changed files with 528 additions and 272 deletions

File diff suppressed because one or more lines are too long

View File

@ -22,8 +22,8 @@ function render_block_core_comments_title( $attributes ) {
$show_post_title = ! empty( $attributes['showPostTitle'] ) && $attributes['showPostTitle'];
$show_comments_count = ! empty( $attributes['showCommentsCount'] ) && $attributes['showCommentsCount'];
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
$post_title = $show_post_title ? sprintf( '"%1$s"', get_the_title() ) : null;
$comments_count = number_format_i18n( get_comments_number() );
$comments_count = get_comments_number();
$post_title = '“' . get_the_title() . '”';
$tag_name = 'h2';
if ( isset( $attributes['level'] ) ) {
$tag_name = 'h' . $attributes['level'];
@ -33,28 +33,45 @@ function render_block_core_comments_title( $attributes ) {
return;
}
$single_default_comment_label = $show_post_title ? __( 'Response to' ) : __( 'Response' );
if ( $show_comments_count ) {
$single_default_comment_label = $show_post_title ? __( 'One response to' ) : __( 'One response' );
if ( $show_post_title ) {
if ( '1' === $comments_count ) {
/* translators: %s: Post title. */
$comments_title = sprintf( __( 'One response to %s' ), $post_title );
} else {
$comments_title = sprintf(
/* translators: 1: Number of comments, 2: Post title. */
_n(
'%1$s response to %2$s',
'%1$s responses to %2$s',
$comments_count
),
number_format_i18n( $comments_count ),
$post_title
);
}
} elseif ( '1' === $comments_count ) {
$comments_title = __( 'One response' );
} else {
$comments_title = sprintf(
/* translators: %s: Number of comments. */
_n( '%s responses', '%s responses', $comments_count ),
number_format_i18n( $comments_count )
);
}
} elseif ( $show_post_title ) {
if ( '1' === $comments_count ) {
/* translators: %s: Post title. */
$comments_title = sprintf( __( 'Response to %s' ), $post_title );
} else {
/* translators: %s: Post title. */
$comments_title = sprintf( __( 'Responses to %s' ), $post_title );
}
} elseif ( '1' === $comments_count ) {
$comments_title = __( 'Response' );
} else {
$comments_title = __( 'Responses' );
}
$single_comment_label = ! empty( $attributes['singleCommentLabel'] ) ? $attributes['singleCommentLabel'] : $single_default_comment_label;
$multiple_default_comment_label = $show_post_title ? __( 'Responses to' ) : __( 'Responses' );
if ( $show_comments_count ) {
$multiple_default_comment_label = $show_post_title ? __( 'responses to' ) : __( 'responses' );
}
$multiple_comment_label = ! empty( $attributes['multipleCommentsLabel'] ) ? $attributes['multipleCommentsLabel'] : $multiple_default_comment_label;
$comments_title = '%1$s %2$s %3$s';
$comments_title = sprintf(
$comments_title,
// If there is only one comment, only display the label.
'1' !== $comments_count && $show_comments_count ? $comments_count : null,
'1' === $comments_count ? $single_comment_label : $multiple_comment_label,
$post_title
);
return sprintf(
'<%1$s id="comments" %2$s>%3$s</%1$s>',

View File

@ -12,12 +12,6 @@
"textAlign": {
"type": "string"
},
"singleCommentLabel": {
"type": "string"
},
"multipleCommentsLabel": {
"type": "string"
},
"showPostTitle": {
"type": "boolean",
"default": true

View File

@ -37,11 +37,12 @@ function render_block_core_latest_posts( $attributes ) {
global $post, $block_core_latest_posts_excerpt_length;
$args = array(
'posts_per_page' => $attributes['postsToShow'],
'post_status' => 'publish',
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
'suppress_filters' => false,
'posts_per_page' => $attributes['postsToShow'],
'post_status' => 'publish',
'order' => $attributes['order'],
'orderby' => $attributes['orderBy'],
'ignore_sticky_posts' => true,
'no_found_rows' => true,
);
$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
@ -54,7 +55,12 @@ function render_block_core_latest_posts( $attributes ) {
$args['author'] = $attributes['selectedAuthor'];
}
$recent_posts = get_posts( $args );
$query = new WP_Query;
$recent_posts = $query->query( $args );
if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) {
update_post_thumbnail_cache( $query );
}
$list_items_markup = '';

View File

@ -350,6 +350,41 @@ function block_core_navigation_get_fallback_blocks() {
return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks );
}
/**
* Iterate through all inner blocks recursively and get navigation link block's post IDs.
*
* @param WP_Block_List $inner_blocks Block list class instance.
*
* @return array Array of post IDs.
*/
function block_core_navigation_get_post_ids( $inner_blocks ) {
$post_ids = array_map( 'block_core_navigation_from_block_get_post_ids', iterator_to_array( $inner_blocks ) );
return array_unique( array_merge( ...$post_ids ) );
}
/**
* Get post IDs from a navigation link block instance.
*
* @param WP_Block $block Instance of a block.
*
* @return array Array of post IDs.
*/
function block_core_navigation_from_block_get_post_ids( $block ) {
$post_ids = array();
if ( $block->inner_blocks ) {
$post_ids = block_core_navigation_get_post_ids( $block->inner_blocks );
}
if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) {
if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] ) {
$post_ids[] = $block->attributes['id'];
}
}
return $post_ids;
}
/**
* Renders the `core/navigation` block on server.
*
@ -501,6 +536,11 @@ function render_block_core_navigation( $attributes, $content, $block ) {
$text_decoration ? array( $text_decoration_class ) : array()
);
$post_ids = block_core_navigation_get_post_ids( $inner_blocks );
if ( $post_ids ) {
_prime_post_caches( $post_ids, false, false );
}
$inner_blocks_html = '';
$is_list_open = false;
foreach ( $inner_blocks as $inner_block ) {

View File

@ -39,7 +39,7 @@ function render_block_core_post_author( $attributes, $content, $block ) {
return sprintf( '<div %1$s>', $wrapper_attributes ) .
( ! empty( $attributes['showAvatar'] ) ? '<div class="wp-block-post-author__avatar">' . $avatar . '</div>' : '' ) .
'<div class="wp-block-post-author__content">' .
( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . esc_html( $byline ) . '</p>' : '' ) .
( ! empty( $byline ) ? '<p class="wp-block-post-author__byline">' . wp_kses_post( $byline ) . '</p>' : '' ) .
'<p class="wp-block-post-author__name">' . get_the_author_meta( 'display_name', $author_id ) . '</p>' .
( ! empty( $attributes['showBio'] ) ? '<p class="wp-block-post-author__bio">' . get_the_author_meta( 'user_description', $author_id ) . '</p>' : '' ) .
'</div>' .

View File

@ -24,7 +24,7 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) {
$classes = 'comment-respond'; // See comment further below.
if ( isset( $attributes['textAlign'] ) ) {
$classes .= 'has-text-align-' . $attributes['textAlign'];
$classes .= ' has-text-align-' . $attributes['textAlign'];
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );

View File

@ -130,11 +130,9 @@
margin-top: 0.35em;
}
.wp-block-post-comments-form .comment-reply-title {
align-items: baseline;
display: flex;
justify-content: space-between;
margin-bottom: 0;
}
.wp-block-post-comments-form .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-right: 0.5em;
}

View File

@ -1 +1 @@
.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{align-items:baseline;display:flex;justify-content:space-between;margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller)}
.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}

View File

@ -130,11 +130,9 @@
margin-top: 0.35em;
}
.wp-block-post-comments-form .comment-reply-title {
align-items: baseline;
display: flex;
justify-content: space-between;
margin-bottom: 0;
}
.wp-block-post-comments-form .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-left: 0.5em;
}

View File

@ -1 +1 @@
.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{align-items:baseline;display:flex;justify-content:space-between;margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller)}
.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}

View File

@ -144,6 +144,13 @@
.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
margin-top: 0.35em;
}
.wp-block-post-comments .comment-reply-title {
margin-bottom: 0;
}
.wp-block-post-comments .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-right: 0.5em;
}
.wp-block-post-comments .reply {
font-size: 0.875em;
margin-bottom: 1.4em;

View File

@ -1 +1 @@
.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-top:.5em;margin-left:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{margin-top:1em;margin-bottom:1em;display:block}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}.wp-block-post-comments input[type=submit]{border:none}
.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-top:.5em;margin-left:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{margin-top:1em;margin-bottom:1em;display:block}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}.wp-block-post-comments input[type=submit]{border:none}

View File

@ -144,6 +144,13 @@
.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
margin-top: 0.35em;
}
.wp-block-post-comments .comment-reply-title {
margin-bottom: 0;
}
.wp-block-post-comments .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-left: 0.5em;
}
.wp-block-post-comments .reply {
font-size: 0.875em;
margin-bottom: 1.4em;

View File

@ -1 +1 @@
.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-top:.5em;margin-right:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{margin-top:1em;margin-bottom:1em;display:block}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}.wp-block-post-comments input[type=submit]{border:none}
.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-top:.5em;margin-right:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{margin-top:1em;margin-bottom:1em;display:block}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}.wp-block-post-comments input[type=submit]{border:none}

View File

@ -5,6 +5,32 @@
* @package WordPress
*/
/**
* Determines whether a block list contains a block that uses the featured image.
*
* @param WP_Block_List $inner_blocks Inner block instance.
*
* @return bool Whether the block list contains a block that uses the featured image.
*/
function block_core_post_template_uses_featured_image( $inner_blocks ) {
foreach ( $inner_blocks as $block ) {
if ( 'core/post-featured-image' === $block->name ) {
return true;
}
if (
'core/cover' === $block->name &&
! empty( $block->attributes['useFeaturedImage'] )
) {
return true;
}
if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
return true;
}
}
return false;
}
/**
* Renders the `core/post-template` block on the server.
*
@ -40,6 +66,10 @@ function render_block_core_post_template( $attributes, $content, $block ) {
return '';
}
if ( block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
update_post_thumbnail_cache( $query );
}
$classnames = '';
if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) {
if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) {

View File

@ -2171,6 +2171,13 @@ p.has-background {
.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
margin-top: 0.35em;
}
.wp-block-post-comments .comment-reply-title {
margin-bottom: 0;
}
.wp-block-post-comments .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-right: 0.5em;
}
.wp-block-post-comments .reply {
font-size: 0.875em;
margin-bottom: 1.4em;
@ -2245,13 +2252,11 @@ p.has-background {
margin-top: 0.35em;
}
.wp-block-post-comments-form .comment-reply-title {
align-items: baseline;
display: flex;
justify-content: space-between;
margin-bottom: 0;
}
.wp-block-post-comments-form .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-right: 0.5em;
}
.wp-block-post-excerpt__more-link {

File diff suppressed because one or more lines are too long

View File

@ -2197,6 +2197,13 @@ p.has-background {
.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent {
margin-top: 0.35em;
}
.wp-block-post-comments .comment-reply-title {
margin-bottom: 0;
}
.wp-block-post-comments .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-left: 0.5em;
}
.wp-block-post-comments .reply {
font-size: 0.875em;
margin-bottom: 1.4em;
@ -2271,13 +2278,11 @@ p.has-background {
margin-top: 0.35em;
}
.wp-block-post-comments-form .comment-reply-title {
align-items: baseline;
display: flex;
justify-content: space-between;
margin-bottom: 0;
}
.wp-block-post-comments-form .comment-reply-title :where(small) {
font-size: var(--wp--preset--font-size--medium, smaller);
margin-left: 0.5em;
}
.wp-block-post-excerpt__more-link {

File diff suppressed because one or more lines are too long

View File

@ -14327,30 +14327,29 @@ function isAnimatedString(value) {
return react_spring_shared_esm_is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
}
const react_spring_shared_esm_useOnce = effect => (0,external_React_.useEffect)(effect, emptyDeps);
const emptyDeps = [];
const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect;
const useIsMounted = () => {
const isMounted = (0,external_React_.useRef)(false);
react_spring_shared_esm_useLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
function react_spring_shared_esm_useForceUpdate() {
const update = (0,external_React_.useState)()[1];
const mounted = (0,external_React_.useState)(makeMountedRef)[0];
react_spring_shared_esm_useOnce(mounted.unmount);
const isMounted = useIsMounted();
return () => {
if (mounted.current) {
update({});
if (isMounted.current) {
update(Math.random());
}
};
}
function makeMountedRef() {
const mounted = {
current: true,
unmount: () => () => {
mounted.current = false;
}
};
return mounted;
}
function useMemoOne(getResult, inputs) {
const [initial] = (0,external_React_.useState)(() => ({
inputs,
@ -14397,6 +14396,9 @@ function areInputsEqual(next, prev) {
return true;
}
const react_spring_shared_esm_useOnce = effect => (0,external_React_.useEffect)(effect, emptyDeps);
const emptyDeps = [];
function react_spring_shared_esm_usePrev(value) {
const prevRef = (0,external_React_.useRef)();
(0,external_React_.useEffect)(() => {
@ -14405,8 +14407,6 @@ function react_spring_shared_esm_usePrev(value) {
return prevRef.current;
}
const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect;
;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/react-spring-animated.esm.js
@ -14685,14 +14685,14 @@ const withAnimated = (Component, host) => {
const observer = new PropsObserver(callback, deps);
const observerRef = (0,external_React_.useRef)();
react_spring_shared_esm_useLayoutEffect(() => {
const lastObserver = observerRef.current;
observerRef.current = observer;
react_spring_shared_esm_each(deps, dep => addFluidObserver(dep, observer));
if (lastObserver) {
react_spring_shared_esm_each(lastObserver.deps, dep => removeFluidObserver(dep, lastObserver));
raf.cancel(lastObserver.update);
}
return () => {
if (observerRef.current) {
react_spring_shared_esm_each(observerRef.current.deps, dep => removeFluidObserver(dep, observerRef.current));
raf.cancel(observerRef.current.update);
}
};
});
(0,external_React_.useEffect)(callback, []);
react_spring_shared_esm_useOnce(() => () => {
@ -16920,15 +16920,27 @@ function useTransition(data, props, deps) {
useLayoutEffect(() => {
usedTransitions.current = transitions;
});
useOnce(() => () => {
useOnce(() => {
each(usedTransitions.current, t => {
if (t.expired) {
clearTimeout(t.expirationId);
}
var _t$ctrl$ref;
detachRefs(t.ctrl, ref);
t.ctrl.stop(true);
(_t$ctrl$ref = t.ctrl.ref) == null ? void 0 : _t$ctrl$ref.add(t.ctrl);
const change = changes.get(t);
if (change) {
t.ctrl.start(change.payload);
}
});
return () => {
each(usedTransitions.current, t => {
if (t.expired) {
clearTimeout(t.expirationId);
}
detachRefs(t.ctrl, ref);
t.ctrl.stop(true);
});
};
});
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
const expired = reset && usedTransitions.current || [];
@ -20674,63 +20686,63 @@ const BLOCK_PREFIX = 'wp-block';
*
* Ideally, this hook should be removed in the future and styles should be added
* explicitly as editor styles.
*
* @param {Document} doc The document to append cloned stylesheets to.
*/
function styleSheetsCompat(doc) {
// Search the document for stylesheets targetting the editor canvas.
Array.from(document.styleSheets).forEach(styleSheet => {
try {
// May fail for external styles.
// eslint-disable-next-line no-unused-expressions
styleSheet.cssRules;
} catch (e) {
return;
}
const {
ownerNode,
cssRules
} = styleSheet;
if (!cssRules) {
return;
} // Generally, ignore inline styles. We add inline styles belonging to a
// stylesheet later, which may or may not match the selectors.
if (ownerNode.tagName !== 'LINK') {
return;
} // Don't try to add the reset styles, which were removed as a dependency
// from `edit-blocks` for the iframe since we don't need to reset admin
// styles.
if (ownerNode.id === 'wp-reset-editor-styles-css') {
return;
}
const isMatch = Array.from(cssRules).find(_ref => {
let {
selectorText
} = _ref;
return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
});
if (isMatch && !doc.getElementById(ownerNode.id)) {
// Display warning once we have a way to add style dependencies to the editor.
// See: https://github.com/WordPress/gutenberg/pull/37466.
doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
const inlineCssElement = document.getElementById(inlineCssId);
if (inlineCssElement) {
doc.head.appendChild(inlineCssElement.cloneNode(true));
function useStylesCompatibility() {
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
// Search the document for stylesheets targetting the editor canvas.
Array.from(document.styleSheets).forEach(styleSheet => {
try {
// May fail for external styles.
// eslint-disable-next-line no-unused-expressions
styleSheet.cssRules;
} catch (e) {
return;
}
}
});
const {
ownerNode,
cssRules
} = styleSheet;
if (!cssRules) {
return;
} // Generally, ignore inline styles. We add inline styles belonging to a
// stylesheet later, which may or may not match the selectors.
if (ownerNode.tagName !== 'LINK') {
return;
} // Don't try to add the reset styles, which were removed as a dependency
// from `edit-blocks` for the iframe since we don't need to reset admin
// styles.
if (ownerNode.id === 'wp-reset-editor-styles-css') {
return;
}
const isMatch = Array.from(cssRules).find(_ref => {
let {
selectorText
} = _ref;
return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
});
if (isMatch && !node.ownerDocument.getElementById(ownerNode.id)) {
// Display warning once we have a way to add style dependencies to the editor.
// See: https://github.com/WordPress/gutenberg/pull/37466.
node.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
const inlineCssElement = document.getElementById(inlineCssId);
if (inlineCssElement) {
node.appendChild(inlineCssElement.cloneNode(true));
}
}
});
}, []);
}
/**
* Bubbles some event types (keydown, keypress, and dragover) to parent document
@ -20870,11 +20882,7 @@ function Iframe(_ref3, ref) {
});
}, []);
const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRef, clearerRef, writingFlowRef]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (iframeDocument) {
styleSheetsCompat(iframeDocument);
}
}, [iframeDocument]);
const styleCompatibilityRef = useStylesCompatibility();
head = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("style", null, 'body{margin:0}'), styles.map(_ref4 => {
let {
tagName,
@ -20912,7 +20920,12 @@ function Iframe(_ref3, ref) {
}, head), (0,external_wp_element_namespaceObject.createElement)("body", {
ref: bodyRef,
className: classnames_default()(BODY_CLASS_NAME, ...bodyClasses)
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
}, (0,external_wp_element_namespaceObject.createElement)("div", {
style: {
display: 'none'
},
ref: styleCompatibilityRef
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
document: iframeDocument
}, children))), iframeDocument.documentElement)), tabIndex >= 0 && after);
}

File diff suppressed because one or more lines are too long

View File

@ -9522,8 +9522,6 @@ function comments_title_edit_Edit(_ref) {
let {
attributes: {
textAlign,
singleCommentLabel,
multipleCommentsLabel,
showPostTitle,
showCommentsCount,
level
@ -9536,7 +9534,6 @@ function comments_title_edit_Edit(_ref) {
} = _ref;
const TagName = 'h' + level;
const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)();
const [editingMode, setEditingMode] = (0,external_wp_element_namespaceObject.useState)('plural');
const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
const isSiteEditor = typeof postId === 'undefined';
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
@ -9582,17 +9579,7 @@ function comments_title_edit_Edit(_ref) {
}));
const inspectorControls = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Settings')
}, isSiteEditor && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Editing mode'),
onChange: setEditingMode,
value: editingMode
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
label: (0,external_wp_i18n_namespaceObject.__)('Singular'),
value: "singular"
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
label: (0,external_wp_i18n_namespaceObject.__)('Plural'),
value: "plural"
})), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Show post title'),
checked: showPostTitle,
onChange: value => setAttributes({
@ -9606,31 +9593,145 @@ function comments_title_edit_Edit(_ref) {
})
})));
const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('"Post Title"') : `"${rawTitle}"`;
const singlePlaceholder = showPostTitle ? (0,external_wp_i18n_namespaceObject.__)('One response to ') : (0,external_wp_i18n_namespaceObject.__)('One response');
const singlePlaceholderNoCount = showPostTitle ? (0,external_wp_i18n_namespaceObject.__)('Response to ') : (0,external_wp_i18n_namespaceObject.__)('Response');
const multiplePlaceholder = showPostTitle ? (0,external_wp_i18n_namespaceObject.__)('responses to ') : (0,external_wp_i18n_namespaceObject.__)('responses');
const multiplePlaceholderNoCount = showPostTitle ? (0,external_wp_i18n_namespaceObject.__)('Responses to ') : (0,external_wp_i18n_namespaceObject.__)('Responses');
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, editingMode === 'singular' || commentsCount === 1 ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": showCommentsCount ? singlePlaceholder : singlePlaceholderNoCount,
placeholder: showCommentsCount ? singlePlaceholder : singlePlaceholderNoCount,
value: singleCommentLabel,
onChange: newLabel => setAttributes({
singleCommentLabel: newLabel
})
}), showPostTitle ? postTitle : null) : (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, showCommentsCount ? commentsCount : null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
"aria-label": showCommentsCount ? ` ${multiplePlaceholder}` : multiplePlaceholderNoCount,
placeholder: showCommentsCount ? ` ${multiplePlaceholder}` : multiplePlaceholderNoCount,
value: multipleCommentsLabel,
onChange: newLabel => setAttributes({
multipleCommentsLabel: newLabel
})
}), showPostTitle ? postTitle : null)));
let placeholder;
if (showCommentsCount && commentsCount !== undefined) {
if (showPostTitle) {
if (commentsCount === 1) {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle);
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: 1: Number of comments, 2: Post title. */
(0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)('One response');
} else {
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Number of comments. */
(0,external_wp_i18n_namespaceObject._n)('%s responses', '%s responses', commentsCount), commentsCount);
}
} else if (showPostTitle) {
if (commentsCount === 1) {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle);
} else {
/* translators: %s: Post title. */
placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle);
}
} else if (commentsCount === 1) {
placeholder = (0,external_wp_i18n_namespaceObject.__)('Response');
} else {
placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses');
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, placeholder));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js
/**
* Internal dependencies
*/
const deprecated_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/comments-title",
title: "Comments Title",
category: "theme",
ancestor: ["core/comments-query-loop"],
description: "Displays a title with the number of comments",
textdomain: "default",
usesContext: ["postId", "postType"],
attributes: {
textAlign: {
type: "string"
},
showPostTitle: {
type: "boolean",
"default": true
},
showCommentsCount: {
type: "boolean",
"default": true
},
level: {
type: "number",
"default": 2
}
},
supports: {
anchor: false,
align: true,
html: false,
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true,
__experimentalFontFamily: true,
__experimentalTextTransform: true,
__experimentalDefaultControls: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true
}
}
}
};
const {
attributes,
supports
} = deprecated_metadata;
/* harmony default export */ var comments_title_deprecated = ([{
attributes: { ...attributes,
singleCommentLabel: {
type: 'string'
},
multipleCommentsLabel: {
type: 'string'
}
},
supports,
migrate: oldAttributes => {
/* eslint-disable no-unused-vars */
const {
singleCommentLabel,
multipleCommentsLabel,
...newAttributes
} = oldAttributes;
/* eslint-enable no-unused-vars */
return newAttributes;
},
isEligible: _ref => {
let {
multipleCommentsLabel,
singleCommentLabel
} = _ref;
return multipleCommentsLabel || singleCommentLabel;
},
save: () => null
}]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js
/**
* WordPress dependencies
@ -9654,12 +9755,6 @@ const comments_title_metadata = {
textAlign: {
type: "string"
},
singleCommentLabel: {
type: "string"
},
multipleCommentsLabel: {
type: "string"
},
showPostTitle: {
type: "boolean",
"default": true
@ -9711,13 +9806,15 @@ const comments_title_metadata = {
}
};
const {
name: comments_title_name
} = comments_title_metadata;
const comments_title_settings = {
icon: comment_title,
edit: comments_title_edit_Edit
edit: comments_title_edit_Edit,
deprecated: comments_title_deprecated
};
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/cover.js
@ -11220,8 +11317,11 @@ function CoverEdit(_ref5) {
const toggleUseFeaturedImage = () => {
setAttributes({
id: undefined,
url: undefined,
useFeaturedImage: !useFeaturedImage,
dimRatio: dimRatio === 100 ? 50 : dimRatio
dimRatio: dimRatio === 100 ? 50 : dimRatio,
backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
});
};
@ -13252,7 +13352,7 @@ variations_variations.forEach(variation => {
* Internal dependencies
*/
const deprecated_metadata = {
const embed_deprecated_metadata = {
$schema: "https://schemas.wp.org/trunk/block.json",
apiVersion: 2,
name: "core/embed",
@ -13301,7 +13401,7 @@ const deprecated_metadata = {
const {
attributes: embed_deprecated_blockAttributes
} = deprecated_metadata;
} = embed_deprecated_metadata;
const embed_deprecated_deprecated = [{
attributes: embed_deprecated_blockAttributes,
@ -21495,10 +21595,10 @@ const latest_posts_deprecated_metadata = {
style: "wp-block-latest-posts"
};
const {
attributes
attributes: deprecated_attributes
} = latest_posts_deprecated_metadata;
/* harmony default export */ var latest_posts_deprecated = ([{
attributes: { ...attributes,
attributes: { ...deprecated_attributes,
categories: {
type: 'string'
}
@ -29997,7 +30097,7 @@ const paragraph = (0,external_wp_element_namespaceObject.createElement)(external
const supports = {
const deprecated_supports = {
className: false
};
const paragraph_deprecated_blockAttributes = {
@ -30066,7 +30166,7 @@ const migrateCustomColorsAndFontSizes = attributes => {
};
const paragraph_deprecated_deprecated = [{
supports,
supports: deprecated_supports,
attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
@ -30123,7 +30223,7 @@ const paragraph_deprecated_deprecated = [{
}
}, {
supports,
supports: deprecated_supports,
attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
@ -30180,7 +30280,7 @@ const paragraph_deprecated_deprecated = [{
}
}, {
supports,
supports: deprecated_supports,
attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
@ -30239,7 +30339,7 @@ const paragraph_deprecated_deprecated = [{
}
}, {
supports,
supports: deprecated_supports,
attributes: (0,external_lodash_namespaceObject.omit)({ ...paragraph_deprecated_blockAttributes,
fontSize: {
type: 'number'
@ -30285,7 +30385,7 @@ const paragraph_deprecated_deprecated = [{
}
}, {
supports,
supports: deprecated_supports,
attributes: { ...paragraph_deprecated_blockAttributes,
content: {
type: 'string',
@ -31107,6 +31207,7 @@ const post_author_biography_settings = {
function PostCommentsEdit(_ref) {
let {
attributes: {
@ -31172,7 +31273,9 @@ function PostCommentsEdit(_ref) {
})), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, warning), showPlacholder && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-post-comments__placeholder",
ref: disabledRef
}, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('One response to'), " \u201C", postTitle, "\u201D"), (0,external_wp_element_namespaceObject.createElement)("div", {
}, (0,external_wp_element_namespaceObject.createElement)("h3", null,
/* translators: %s: Post title. */
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle)), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "navigation"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "alignleft"
@ -31199,34 +31302,50 @@ function PostCommentsEdit(_ref) {
height: "32",
width: "32",
loading: "lazy"
}), (0,external_wp_element_namespaceObject.createElement)("b", {
className: "fn"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top",
className: "url"
}, (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
className: "says"
}, (0,external_wp_i18n_namespaceObject.__)('says'), ":")), (0,external_wp_element_namespaceObject.createElement)("div", {
}), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Comment author link. */
(0,external_wp_i18n_namespaceObject.__)('%s <span>says:</span>'), (0,external_wp_i18n_namespaceObject.sprintf)('<cite><a>%s</a></cite>', (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))), {
span: (0,external_wp_element_namespaceObject.createElement)("span", {
className: "says"
}),
a:
/* eslint-disable jsx-a11y/anchor-has-content */
(0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top",
className: "url"
})
/* eslint-enable jsx-a11y/anchor-has-content */
,
cite: (0,external_wp_element_namespaceObject.createElement)("cite", {
className: "fn"
})
})), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-metadata"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#top"
}, (0,external_wp_element_namespaceObject.createElement)("time", {
dateTime: "2000-01-01T00:00:00+00:00"
}, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
dateTime: "2000-01-01T12:00:00+00:00"
}, (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 12:00 am'))), ' ', (0,external_wp_element_namespaceObject.createElement)("span", {
className: "edit-link"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
className: "comment-edit-link",
href: "#top"
}, (0,external_wp_i18n_namespaceObject.__)('Edit'))))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "comment-content"
}, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from'), ' ', (0,external_wp_element_namespaceObject.createElement)("a", {
href: "https://gravatar.com/"
}, "Gravatar"), ".")), (0,external_wp_element_namespaceObject.createElement)("div", {
}, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0,external_wp_element_namespaceObject.createElement)("br", null), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>'), {
a:
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
(0,external_wp_element_namespaceObject.createElement)("a", {
href: "https://gravatar.com/"
})
}))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "reply"
}, (0,external_wp_element_namespaceObject.createElement)("a", {
className: "comment-reply-link",
href: "#top",
"aria-label": "Reply to A WordPress Commenter"
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: Comment reply button text. %s: Comment author name. */
(0,external_wp_i18n_namespaceObject.__)('Reply to %s'), (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter'))
}, (0,external_wp_i18n_namespaceObject.__)('Reply')))))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "navigation"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
@ -42419,7 +42538,7 @@ const blockTable = (0,external_wp_element_namespaceObject.createElement)(externa
*/
const deprecated_supports = {
const table_deprecated_supports = {
align: true
}; // As the previous arbitrary colors won't match theme color palettes, the hex
// value will be mapped to the style.color.background attribute as if it was
@ -42753,7 +42872,7 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}
}
},
supports: deprecated_supports,
supports: table_deprecated_supports,
save(_ref5) {
let {

File diff suppressed because one or more lines are too long

View File

@ -746,9 +746,9 @@ function toggleFeature(scope, featureName) {
let {
registry
} = _ref5;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).toggleFeature`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).toggle`
alternative: `dispatch( 'core/preferences' ).toggle`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
};
@ -769,9 +769,9 @@ function setFeatureValue(scope, featureName, value) {
let {
registry
} = _ref6;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureValue`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).set`
alternative: `dispatch( 'core/preferences' ).set`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
};
@ -790,9 +790,9 @@ function setFeatureDefaults(scope, defaults) {
let {
registry
} = _ref7;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureDefaults`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).setDefaults`
alternative: `dispatch( 'core/preferences' ).setDefaults`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
};
@ -845,9 +845,9 @@ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)
*/
const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
external_wp_deprecated_default()(`wp.select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
since: '6.0',
alternative: `!! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName )`
alternative: `select( 'core/preferences' ).get( scope, featureName )`
});
return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
});

File diff suppressed because one or more lines are too long

View File

@ -909,9 +909,9 @@ function toggleFeature(scope, featureName) {
let {
registry
} = _ref5;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).toggleFeature`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).toggle`
alternative: `dispatch( 'core/preferences' ).toggle`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
};
@ -932,9 +932,9 @@ function setFeatureValue(scope, featureName, value) {
let {
registry
} = _ref6;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureValue`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).set`
alternative: `dispatch( 'core/preferences' ).set`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
};
@ -953,9 +953,9 @@ function setFeatureDefaults(scope, defaults) {
let {
registry
} = _ref7;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureDefaults`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).setDefaults`
alternative: `dispatch( 'core/preferences' ).setDefaults`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
};
@ -1008,9 +1008,9 @@ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)
*/
const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
external_wp_deprecated_default()(`wp.select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
since: '6.0',
alternative: `!! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName )`
alternative: `select( 'core/preferences' ).get( scope, featureName )`
});
return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
});
@ -2959,9 +2959,9 @@ function convertPanelsToOldFormat(inactivePanels, openPanels) {
const getPreferences = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
external_wp_deprecated_default()(`wp.data.select( 'core/edit-post' ).getPreferences`, {
external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreferences`, {
since: '6.0',
alternative: `wp.data.select( 'core/preferences' ).get`
alternative: `select( 'core/preferences' ).get`
}); // These preferences now exist in the preferences store.
// Fetch them so that they can be merged into the post
// editor preferences.
@ -2993,9 +2993,9 @@ const getPreferences = (0,external_wp_data_namespaceObject.createRegistrySelecto
*/
function getPreference(state, preferenceKey, defaultValue) {
external_wp_deprecated_default()(`wp.data.select( 'core/edit-post' ).getPreference`, {
external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreference`, {
since: '6.0',
alternative: `wp.data.select( 'core/preferences' ).get`
alternative: `select( 'core/preferences' ).get`
}); // Avoid using the `getPreferences` registry selector where possible.
const preferences = getPreferences(state);
@ -5885,9 +5885,9 @@ function EditTemplateTitle() {
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store);
const {
updateEditorSettings
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); // Only user-created and non-default templates can change the name.
if (template.has_theme_file) {
if (!template.is_custom || template.has_theme_file) {
return null;
}

File diff suppressed because one or more lines are too long

View File

@ -1604,9 +1604,9 @@ function toggleFeature(scope, featureName) {
let {
registry
} = _ref5;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).toggleFeature`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).toggle`
alternative: `dispatch( 'core/preferences' ).toggle`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
};
@ -1627,9 +1627,9 @@ function setFeatureValue(scope, featureName, value) {
let {
registry
} = _ref6;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureValue`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).set`
alternative: `dispatch( 'core/preferences' ).set`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
};
@ -1648,9 +1648,9 @@ function setFeatureDefaults(scope, defaults) {
let {
registry
} = _ref7;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureDefaults`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).setDefaults`
alternative: `dispatch( 'core/preferences' ).setDefaults`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
};
@ -1703,9 +1703,9 @@ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)
*/
const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
external_wp_deprecated_default()(`wp.select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
since: '6.0',
alternative: `!! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName )`
alternative: `select( 'core/preferences' ).get( scope, featureName )`
});
return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
});
@ -5965,7 +5965,9 @@ function TemplateDetails(_ref) {
// TODO: We should update this to filter by template part's areas as well.
postType: template.type,
postId: undefined
});
}); // Only user-created and non-default templates can change the name.
const canEditTitle = template.is_custom && !template.has_theme_file;
if (!template) {
return null;
@ -5980,7 +5982,7 @@ function TemplateDetails(_ref) {
className: "edit-site-template-details"
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-template-details__group"
}, template.is_custom ? (0,external_wp_element_namespaceObject.createElement)(EditTemplateTitle, {
}, canEditTitle ? (0,external_wp_element_namespaceObject.createElement)(EditTemplateTitle, {
template: template
}) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
level: 4,
@ -6574,8 +6576,8 @@ const GlobalStylesContext = (0,external_wp_element_namespaceObject.createContext
const EMPTY_CONFIG = {
isGlobalStylesUserThemeJSON: true,
version: 1
settings: {},
styles: {}
};
const useGlobalStylesReset = () => {
const {
@ -9437,12 +9439,10 @@ function GlobalStylesSidebar() {
}, (0,external_wp_i18n_namespaceObject.__)('Beta'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
icon: more_vertical,
label: (0,external_wp_i18n_namespaceObject.__)('More Global Styles Actions'),
toggleProps: {
disabled: !canReset
},
controls: [{
title: (0,external_wp_i18n_namespaceObject.__)('Reset to defaults'),
onClick: onReset
onClick: onReset,
isDisabled: !canReset
}, {
title: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide'),
onClick: () => toggle('core/edit-site', 'welcomeGuideStyles')
@ -12521,6 +12521,7 @@ const media = (0,external_wp_element_namespaceObject.createElement)(external_wp_
*/
const DEFAULT_TEMPLATE_SLUGS = ['front-page', 'single-post', 'page', 'index', 'archive', 'author', 'category', 'date', 'tag', 'taxonomy', 'search', '404'];
const TEMPLATE_ICONS = {
'front-page': library_home,
@ -12557,6 +12558,9 @@ function NewTemplate(_ref) {
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const {
setTemplate
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
async function createTemplate(_ref2) {
let {
@ -12578,7 +12582,9 @@ function NewTemplate(_ref) {
title
}, {
throwOnError: true
}); // Navigate to the created template editor.
}); // Set template before navigating away to avoid initial stale value.
setTemplate(template.id, template.slug); // Navigate to the created template editor.
history.push({
postId: template.id,

File diff suppressed because one or more lines are too long

View File

@ -534,9 +534,9 @@ function toggleFeature(scope, featureName) {
let {
registry
} = _ref5;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).toggleFeature`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).toggle`
alternative: `dispatch( 'core/preferences' ).toggle`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName);
};
@ -557,9 +557,9 @@ function setFeatureValue(scope, featureName, value) {
let {
registry
} = _ref6;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureValue`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).set`
alternative: `dispatch( 'core/preferences' ).set`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value);
};
@ -578,9 +578,9 @@ function setFeatureDefaults(scope, defaults) {
let {
registry
} = _ref7;
external_wp_deprecated_default()(`wp.dispatch( 'core/interface' ).setFeatureDefaults`, {
external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, {
since: '6.0',
alternative: `wp.dispatch( 'core/preferences' ).setDefaults`
alternative: `dispatch( 'core/preferences' ).setDefaults`
});
registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults);
};
@ -633,9 +633,9 @@ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)
*/
const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => {
external_wp_deprecated_default()(`wp.select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, {
since: '6.0',
alternative: `!! wp.select( 'core/preferences' ).isFeatureActive( scope, featureName )`
alternative: `select( 'core/preferences' ).get( scope, featureName )`
});
return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName);
});

File diff suppressed because one or more lines are too long

View File

@ -10639,6 +10639,7 @@ function PostTextEditor() {
const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(postContent);
const [isDirty, setIsDirty] = (0,external_wp_element_namespaceObject.useState)(false);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostTextEditor);
const valueRef = (0,external_wp_element_namespaceObject.useRef)();
if (!isDirty && value !== postContent) {
setValue(postContent);
@ -10679,6 +10680,16 @@ function PostTextEditor() {
}
};
(0,external_wp_element_namespaceObject.useEffect)(() => {
valueRef.current = value;
}, [value]); // Ensure changes aren't lost when component unmounts.
(0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
const blocks = (0,external_wp_blocks_namespaceObject.parse)(valueRef.current);
resetEditorBlocks(blocks);
};
}, []);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
as: "label",
htmlFor: `post-content-${instanceId}`

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53376';
$wp_version = '6.1-alpha-53377';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.