Editor: Update WordPress packages for 6.0 Beta 3

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

Props zieladam, ndiego.
See #55567.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2022-04-26 13:42:07 +00:00
parent cc6dcc2623
commit b9f396743c
55 changed files with 2056 additions and 496 deletions

File diff suppressed because one or more lines are too long

View File

@ -29,10 +29,7 @@ function render_block_core_comment_edit_link( $attributes, $content, $block ) {
$classes = '';
if ( isset( $attributes['textAlign'] ) ) {
$classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] );
}
if ( isset( $attributes['fontSize'] ) ) {
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
$classes .= 'has-text-align-' . $attributes['textAlign'];
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );

View File

@ -53,10 +53,7 @@ function render_block_core_comment_reply_link( $attributes, $content, $block ) {
$classes = '';
if ( isset( $attributes['textAlign'] ) ) {
$classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] );
}
if ( isset( $attributes['fontSize'] ) ) {
$classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
$classes .= 'has-text-align-' . $attributes['textAlign'];
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );

View File

@ -8,6 +8,8 @@
/**
* Function that recursively renders a list of nested comments.
*
* @global int $comment_depth
*
* @param WP_Comment[] $comments The array of comments.
* @param WP_Block $block Block instance.
* @return string
@ -31,6 +33,17 @@ function block_core_comment_template_render_comments( $comments, $block ) {
$children = $comment->get_children();
/*
* We need to create the CSS classes BEFORE recursing into the children.
* This is because comment_class() uses globals like `$comment_alt`
* and `$comment_thread_alt` which are order-sensitive.
*
* The `false` parameter at the end means that we do NOT want the function
* to `echo` the output but to return a string.
* See https://developer.wordpress.org/reference/functions/comment_class/#parameters.
*/
$comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false );
// If the comment has children, recurse to create the HTML for the nested
// comments.
if ( ! empty( $children ) ) {
@ -43,10 +56,6 @@ function block_core_comment_template_render_comments( $comments, $block ) {
$comment_depth -= 1;
}
// The `false` parameter at the end means that we do NOT want the function to `echo` the output but to return a string.
// See https://developer.wordpress.org/reference/functions/comment_class/#parameters.
$comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false );
$content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content );
}

View File

@ -0,0 +1,68 @@
<?php
/**
* Server-side rendering of the `core/comments-title` block.
*
* @package WordPress
*/
/**
* Renders the `core/comments-title` block on the server.
*
* @param array $attributes Block attributes.
*
* @return string Return the post comments title.
*/
function render_block_core_comments_title( $attributes ) {
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
$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() );
$tag_name = 'h2';
if ( isset( $attributes['level'] ) ) {
$tag_name = 'h' . $attributes['level'];
}
if ( '0' === $comments_count ) {
return;
}
$single_default_comment_label = $show_post_title ? __( 'One response to' ) : __( 'One response' );
$single_comment_label = ! empty( $attributes['singleCommentLabel'] ) ? $attributes['singleCommentLabel'] : $single_default_comment_label;
$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>',
$tag_name,
$wrapper_attributes,
$comments_title
);
}
/**
* Registers the `core/comments-title` block on the server.
*/
function register_block_core_comments_title() {
register_block_type_from_metadata(
__DIR__ . '/comments-title',
array(
'render_callback' => 'render_block_core_comments_title',
)
);
}
add_action( 'init', 'register_block_core_comments_title' );

View File

@ -0,0 +1,70 @@
{
"$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"
},
"singleCommentLabel": {
"type": "string"
},
"multipleCommentsLabel": {
"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
}
}
}
}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-comments-title.has-background {
padding: inherit;
}

View File

@ -0,0 +1 @@
.wp-block-comments-title.has-background{padding:inherit}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-comments-title.has-background {
padding: inherit;
}

View File

@ -0,0 +1 @@
.wp-block-comments-title.has-background{padding:inherit}

View File

@ -21,6 +21,7 @@ require ABSPATH . WPINC . '/blocks/comments-pagination-next.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-previous.php';
require ABSPATH . WPINC . '/blocks/comments-pagination.php';
require ABSPATH . WPINC . '/blocks/comments-title.php';
require ABSPATH . WPINC . '/blocks/cover.php';
require ABSPATH . WPINC . '/blocks/file.php';
require ABSPATH . WPINC . '/blocks/gallery.php';
@ -38,6 +39,7 @@ require ABSPATH . WPINC . '/blocks/pattern.php';
require ABSPATH . WPINC . '/blocks/post-author-biography.php';
require ABSPATH . WPINC . '/blocks/post-author.php';
require ABSPATH . WPINC . '/blocks/post-comments.php';
require ABSPATH . WPINC . '/blocks/post-comments-form.php';
require ABSPATH . WPINC . '/blocks/post-content.php';
require ABSPATH . WPINC . '/blocks/post-date.php';
require ABSPATH . WPINC . '/blocks/post-excerpt.php';

View File

@ -0,0 +1,73 @@
<?php
/**
* Server-side rendering of the `core/post-comments-form` block.
*
* @package WordPress
*/
/**
* Renders the `core/post-comments-form` block on the server.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
* @return string Returns the filtered post comments form for the current post.
*/
function render_block_core_post_comments_form( $attributes, $content, $block ) {
if ( ! isset( $block->context['postId'] ) ) {
return '';
}
$classes = 'comment-respond'; // See comment further below.
if ( isset( $attributes['textAlign'] ) ) {
$classes .= 'has-text-align-' . $attributes['textAlign'];
}
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
ob_start();
comment_form( array(), $block->context['postId'] );
$form = ob_get_clean();
// We use the outermost wrapping `<div />` returned by `comment_form()`
// which is identified by its default classname `comment-respond` to inject
// our wrapper attributes. This way, it is guaranteed that all styling applied
// to the block is carried along when the comment form is moved to the location
// of the 'Reply' link that the user clicked by Core's `comment-reply.js` script.
$form = str_replace( 'class="comment-respond"', $wrapper_attributes, $form );
// Enqueue the comment-reply script.
wp_enqueue_script( 'comment-reply' );
return $form;
}
/**
* Registers the `core/post-comments-form` block on the server.
*/
function register_block_core_post_comments_form() {
register_block_type_from_metadata(
__DIR__ . '/post-comments-form',
array(
'render_callback' => 'render_block_core_post_comments_form',
)
);
}
add_action( 'init', 'register_block_core_post_comments_form' );
/**
* Use the button block classes for the form-submit button.
*
* @param array $fields The default comment form arguments.
*
* @return array Returns the modified fields.
*/
function post_comments_form_block_form_defaults( $fields ) {
if ( wp_is_block_theme() ) {
$fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link" value="%4$s" />';
$fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
}
return $fields;
}
add_filter( 'comment_form_defaults', 'post_comments_form_block_form_defaults' );

View File

@ -0,0 +1,43 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "core/post-comments-form",
"title": "Post Comments Form",
"category": "theme",
"description": "Display a post's comments form.",
"textdomain": "default",
"attributes": {
"textAlign": {
"type": "string"
}
},
"usesContext": [ "postId", "postType" ],
"supports": {
"html": false,
"color": {
"gradients": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
"text": true
}
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"editorStyle": "wp-block-post-comments-form-editor",
"style": [
"wp-block-post-comments-form",
"wp-block-buttons",
"wp-block-button"
]
}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments-form * {
pointer-events: none;
}

View File

@ -0,0 +1 @@
.wp-block-post-comments-form *{pointer-events:none}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments-form * {
pointer-events: none;
}

View File

@ -0,0 +1 @@
.wp-block-post-comments-form *{pointer-events:none}

View File

@ -0,0 +1,140 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.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 textarea,
.wp-block-post-comments-form input:not([type=submit]) {
border: 1px solid #949494;
font-size: 1em;
font-family: inherit;
}
.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
padding: calc(0.667em + 2px);
}
.wp-block-post-comments-form .comment-form textarea,
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
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: 0.25em;
}
.wp-block-post-comments-form .comment-form-cookies-consent {
display: flex;
gap: 0.25em;
}
.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent {
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);
}

View File

@ -0,0 +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)}

View File

@ -0,0 +1,140 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.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 textarea,
.wp-block-post-comments-form input:not([type=submit]) {
border: 1px solid #949494;
font-size: 1em;
font-family: inherit;
}
.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
padding: calc(0.667em + 2px);
}
.wp-block-post-comments-form .comment-form textarea,
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) {
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: 0.25em;
}
.wp-block-post-comments-form .comment-form-cookies-consent {
display: flex;
gap: 0.25em;
}
.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent {
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);
}

View File

@ -0,0 +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)}

View File

@ -40,5 +40,6 @@
"wp-block-post-comments",
"wp-block-buttons",
"wp-block-button"
]
],
"editorStyle": "wp-block-post-comments-editor"
}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments__placeholder * {
pointer-events: none;
}

View File

@ -0,0 +1 @@
.wp-block-post-comments__placeholder *{pointer-events:none}

View File

@ -0,0 +1,79 @@
/**
* Colors
*/
/**
* Breakpoints & Media Queries
*/
/**
* SCSS Variables.
*
* Please use variables from this sheet to ensure consistency across the UI.
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
*/
/**
* Colors
*/
/**
* Fonts & basic variables.
*/
/**
* Grid System.
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
*/
/**
* Dimensions.
*/
/**
* Shadows.
*/
/**
* Editor widths.
*/
/**
* Block & Editor UI.
*/
/**
* Block paddings.
*/
/**
* React Native specific.
* These variables do not appear to be used anywhere else.
*/
/**
* Converts a hex value into the rgb equivalent.
*
* @param {string} hex - the hexadecimal value to convert
* @return {string} comma separated rgb values
*/
/**
* Breakpoint mixins
*/
/**
* Long content fade mixin
*
* Creates a fading overlay to signify that the content is longer
* than the space allows.
*/
/**
* Focus styles.
*/
/**
* Applies editor left position to the selector passed as argument
*/
/**
* Styles that are reused verbatim in a few places
*/
/**
* Allows users to opt-out of animations via OS-level preferences.
*/
/**
* Reset default styles for JavaScript UI based pages.
* This is a WP-admin agnostic reset
*/
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments__placeholder * {
pointer-events: none;
}

View File

@ -0,0 +1 @@
.wp-block-post-comments__placeholder *{pointer-events:none}

View File

@ -74,10 +74,8 @@
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments > h3:first-of-type {
margin-top: 0;
}
.wp-block-post-comments .commentlist {
clear: both;
list-style: none;
margin: 0;
padding: 0;

View File

@ -1 +1 @@
.wp-block-post-comments>h3:first-of-type{margin-top:0}.wp-block-post-comments .commentlist{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;margin-right:-3.25em}.wp-block-post-comments .comment-meta b{font-weight:400}.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;margin-right:-3.25em}.wp-block-post-comments .comment-meta b{font-weight:400}.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}

View File

@ -74,10 +74,8 @@
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
.wp-block-post-comments > h3:first-of-type {
margin-top: 0;
}
.wp-block-post-comments .commentlist {
clear: both;
list-style: none;
margin: 0;
padding: 0;

View File

@ -1 +1 @@
.wp-block-post-comments>h3:first-of-type{margin-top:0}.wp-block-post-comments .commentlist{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;margin-left:-3.25em}.wp-block-post-comments .comment-meta b{font-weight:400}.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;margin-left:-3.25em}.wp-block-post-comments .comment-meta b{font-weight:400}.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}

View File

@ -1018,7 +1018,6 @@
border: none;
border-radius: 2px;
z-index: 10;
pointer-events: none;
}
.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active::before, .block-editor-block-content-overlay.parent-highlighted.overlay-active::before {
background: rgba(var(--wp-admin-theme-color--rgb), 0.1);

File diff suppressed because one or more lines are too long

View File

@ -1018,7 +1018,6 @@
border: none;
border-radius: 2px;
z-index: 10;
pointer-events: none;
}
.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active::before, .block-editor-block-content-overlay.parent-highlighted.overlay-active::before {
background: rgba(var(--wp-admin-theme-color--rgb), 0.1);

File diff suppressed because one or more lines are too long

View File

@ -287,6 +287,10 @@ html :where(.wp-block-column) {
margin-right: 0;
}
.wp-block-comments-title.has-background {
padding: inherit;
}
.wp-block-cover {
/* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */
}
@ -2690,6 +2694,14 @@ div[data-type="core/post-featured-image"] img {
display: block;
}
.wp-block-post-comments__placeholder * {
pointer-events: none;
}
.wp-block-post-comments-form * {
pointer-events: none;
}
:root .editor-styles-wrapper {
/*
* Our classes uses the same values we set for gradient value attributes,

File diff suppressed because one or more lines are too long

View File

@ -291,6 +291,10 @@ html :where(.wp-block-column) {
margin-right: 0;
}
.wp-block-comments-title.has-background {
padding: inherit;
}
.wp-block-cover {
/* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */
}
@ -2701,6 +2705,14 @@ div[data-type="core/post-featured-image"] img {
display: block;
}
.wp-block-post-comments__placeholder * {
pointer-events: none;
}
.wp-block-post-comments-form * {
pointer-events: none;
}
:root .editor-styles-wrapper {
/*
* Our classes uses the same values we set for gradient value attributes,

File diff suppressed because one or more lines are too long

View File

@ -2099,10 +2099,8 @@ p.has-background {
margin: 0;
}
.wp-block-post-comments > h3:first-of-type {
margin-top: 0;
}
.wp-block-post-comments .commentlist {
clear: both;
list-style: none;
margin: 0;
padding: 0;
@ -2240,6 +2238,15 @@ p.has-background {
.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent {
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);
}
.wp-block-post-excerpt__more-link {
display: inline-block;

File diff suppressed because one or more lines are too long

View File

@ -2123,10 +2123,8 @@ p.has-background {
margin: 0;
}
.wp-block-post-comments > h3:first-of-type {
margin-top: 0;
}
.wp-block-post-comments .commentlist {
clear: both;
list-style: none;
margin: 0;
padding: 0;
@ -2264,6 +2262,15 @@ p.has-background {
.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent {
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);
}
.wp-block-post-excerpt__more-link {
display: inline-block;

File diff suppressed because one or more lines are too long

View File

@ -2864,6 +2864,7 @@ __webpack_require__.d(__webpack_exports__, {
"__unstableEditorStyles": function() { return /* reexport */ EditorStyles; },
"__unstableIframe": function() { return /* reexport */ iframe; },
"__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; },
"__unstablePresetDuotoneFilter": function() { return /* reexport */ PresetDuotoneFilter; },
"__unstableRichTextInputEvent": function() { return /* reexport */ __unstableRichTextInputEvent; },
"__unstableUseBlockSelectionClearer": function() { return /* reexport */ useBlockSelectionClearer; },
"__unstableUseClipboardHandler": function() { return /* reexport */ useClipboardHandler; },
@ -20354,7 +20355,13 @@ function useSelectionObserver() {
}
const clientId = getBlockClientId(extractSelectionStartNode(selection));
const endClientId = getBlockClientId(extractSelectionEndNode(selection));
const endClientId = getBlockClientId(extractSelectionEndNode(selection)); // If the selection did not involve a block, return early.
if (clientId === undefined && endClientId === undefined) {
use_selection_observer_setContentEditableWrapper(node, false);
return;
}
const isSingularSelection = clientId === endClientId;
if (isSingularSelection) {
@ -36477,28 +36484,44 @@ function getValuesFromColors() {
*/
/**
* SVG and stylesheet needed for rendering the duotone filter.
* Stylesheet for rendering the duotone filter.
*
* @param {Object} props Duotone props.
* @param {string} props.selector Selector to apply the filter to.
* @param {string} props.id Unique id for this duotone filter.
* @param {Values} props.values R, G, B, and A values to filter with.
*
* @return {WPElement} Duotone element.
*/
function DuotoneFilter(_ref) {
function DuotoneStylesheet(_ref) {
let {
selector,
id,
values
id
} = _ref;
const stylesheet = `
const css = `
${selector} {
filter: url( #${id} );
}
`;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
return (0,external_wp_element_namespaceObject.createElement)("style", null, css);
}
/**
* SVG for rendering the duotone filter.
*
* @param {Object} props Duotone props.
* @param {string} props.id Unique id for this duotone filter.
* @param {Values} props.values R, G, B, and A values to filter with.
*
* @return {WPElement} Duotone element.
*/
function DuotoneFilter(_ref2) {
let {
id,
values
} = _ref2;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlnsXlink: "http://www.w3.org/1999/xlink",
viewBox: "0 0 0 0",
width: "0",
@ -36538,18 +36561,40 @@ ${selector} {
// Re-mask the image with the original transparency since the feColorMatrix above loses that information.
in2: "SourceGraphic",
operator: "in"
})))), (0,external_wp_element_namespaceObject.createElement)("style", {
dangerouslySetInnerHTML: {
__html: stylesheet
}
}))));
}
/**
* SVG and stylesheet needed for rendering the duotone filter.
*
* @param {Object} props Duotone props.
* @param {string} props.selector Selector to apply the filter to.
* @param {string} props.id Unique id for this duotone filter.
* @param {Values} props.values R, G, B, and A values to filter with.
*
* @return {WPElement} Duotone element.
*/
function InlineDuotone(_ref3) {
let {
selector,
id,
values
} = _ref3;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, {
id: id,
values: values
}), (0,external_wp_element_namespaceObject.createElement)(DuotoneStylesheet, {
id: id,
selector: selector
}));
}
function useMultiOriginPresets(_ref2) {
function useMultiOriginPresets(_ref4) {
let {
presetSetting,
defaultSetting
} = _ref2;
} = _ref4;
const disableDefault = !useSetting(defaultSetting);
const userPresets = useSetting(`${presetSetting}.custom`) || duotone_EMPTY_ARRAY;
const themePresets = useSetting(`${presetSetting}.theme`) || duotone_EMPTY_ARRAY;
@ -36557,13 +36602,13 @@ function useMultiOriginPresets(_ref2) {
return (0,external_wp_element_namespaceObject.useMemo)(() => [...userPresets, ...themePresets, ...(disableDefault ? duotone_EMPTY_ARRAY : defaultPresets)], [disableDefault, userPresets, themePresets, defaultPresets]);
}
function DuotonePanel(_ref3) {
function DuotonePanel(_ref5) {
var _style$color;
let {
attributes,
setAttributes
} = _ref3;
} = _ref5;
const style = attributes === null || attributes === void 0 ? void 0 : attributes.style;
const duotone = style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.duotone;
const duotonePalette = useMultiOriginPresets({
@ -36698,7 +36743,7 @@ const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrd
const selectorsGroup = scopeSelector(`.editor-styles-wrapper .${id}`, duotoneSupport);
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id);
const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, element && (0,external_wp_element_namespaceObject.createPortal)((0,external_wp_element_namespaceObject.createElement)(InlineDuotone, {
selector: selectorsGroup,
id: id,
values: getValuesFromColors(values)
@ -36706,6 +36751,15 @@ const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrd
className: className
})));
}, 'withDuotoneStyles');
function PresetDuotoneFilter(_ref6) {
let {
preset
} = _ref6;
return (0,external_wp_element_namespaceObject.createElement)(DuotoneFilter, {
id: `wp-duotone-${preset.slug}`,
values: getValuesFromColors(preset.colors)
});
}
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes);
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/duotone/with-editor-controls', withDuotoneControls);
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/duotone/with-styles', withDuotoneStyles);
@ -37187,6 +37241,7 @@ function useCachedTruthy(value) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -6468,6 +6468,10 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
support: ['color', 'text'],
requiresOptOut: true
},
filter: {
value: ['filter', 'duotone'],
support: ['color', '__experimentalDuotone']
},
linkColor: {
value: ['elements', 'link', 'color', 'text'],
support: ['color', 'link']

File diff suppressed because one or more lines are too long

View File

@ -2600,157 +2600,6 @@ module.exports = function isPrimitive(value) {
};
/***/ }),
/***/ 2920:
/***/ (function(module) {
//
// Main
//
function memoize (fn, options) {
var cache = options && options.cache
? options.cache
: cacheDefault
var serializer = options && options.serializer
? options.serializer
: serializerDefault
var strategy = options && options.strategy
? options.strategy
: strategyDefault
return strategy(fn, {
cache: cache,
serializer: serializer
})
}
//
// Strategy
//
function isPrimitive (value) {
return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs
}
function monadic (fn, cache, serializer, arg) {
var cacheKey = isPrimitive(arg) ? arg : serializer(arg)
var computedValue = cache.get(cacheKey)
if (typeof computedValue === 'undefined') {
computedValue = fn.call(this, arg)
cache.set(cacheKey, computedValue)
}
return computedValue
}
function variadic (fn, cache, serializer) {
var args = Array.prototype.slice.call(arguments, 3)
var cacheKey = serializer(args)
var computedValue = cache.get(cacheKey)
if (typeof computedValue === 'undefined') {
computedValue = fn.apply(this, args)
cache.set(cacheKey, computedValue)
}
return computedValue
}
function assemble (fn, context, strategy, cache, serialize) {
return strategy.bind(
context,
fn,
cache,
serialize
)
}
function strategyDefault (fn, options) {
var strategy = fn.length === 1 ? monadic : variadic
return assemble(
fn,
this,
strategy,
options.cache.create(),
options.serializer
)
}
function strategyVariadic (fn, options) {
var strategy = variadic
return assemble(
fn,
this,
strategy,
options.cache.create(),
options.serializer
)
}
function strategyMonadic (fn, options) {
var strategy = monadic
return assemble(
fn,
this,
strategy,
options.cache.create(),
options.serializer
)
}
//
// Serializer
//
function serializerDefault () {
return JSON.stringify(arguments)
}
//
// Cache
//
function ObjectWithoutPrototypeCache () {
this.cache = Object.create(null)
}
ObjectWithoutPrototypeCache.prototype.has = function (key) {
return (key in this.cache)
}
ObjectWithoutPrototypeCache.prototype.get = function (key) {
return this.cache[key]
}
ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
this.cache[key] = value
}
var cacheDefault = {
create: function create () {
return new ObjectWithoutPrototypeCache()
}
}
//
// API
//
module.exports = memoize
module.exports.strategies = {
variadic: strategyVariadic,
monadic: strategyMonadic
}
/***/ }),
/***/ 9930:
@ -26789,7 +26638,7 @@ var PresenceContext_PresenceContext = (0,external_React_.createContext)(null);
;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.mjs
var is_browser_isBrowser = typeof window !== "undefined";
var is_browser_isBrowser = typeof document !== "undefined";
@ -26806,12 +26655,13 @@ var useIsomorphicLayoutEffect = is_browser_isBrowser ? external_React_.useLayout
// Does this device prefer reduced motion? Returns `null` server-side.
var prefersReducedMotion = { current: null };
var hasDetected = false;
function initPrefersReducedMotion() {
hasDetected = true;
if (typeof window === "undefined")
if (!is_browser_isBrowser)
return;
if (window.matchMedia) {
var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)");
@ -54775,6 +54625,7 @@ function PaletteEditListView(_ref4) {
}
};
}, []);
const debounceOnChange = (0,external_wp_compose_namespaceObject.useDebounce)(onChange, 100);
return (0,external_wp_element_namespaceObject.createElement)(v_stack_component, {
spacing: 3
}, (0,external_wp_element_namespaceObject.createElement)(item_group_component, {
@ -54790,7 +54641,7 @@ function PaletteEditListView(_ref4) {
}
},
onChange: newElement => {
onChange(elements.map((currentElement, currentIndex) => {
debounceOnChange(elements.map((currentElement, currentIndex) => {
if (currentIndex === index) {
return newElement;
}
@ -69493,67 +69344,34 @@ var resizer_assign = (undefined && undefined.__assign) || function () {
return resizer_assign.apply(this, arguments);
};
var rowSizeBase = {
width: '100%',
height: '10px',
top: '0px',
left: '0px',
cursor: 'row-resize',
};
var colSizeBase = {
width: '10px',
height: '100%',
top: '0px',
left: '0px',
cursor: 'col-resize',
};
var edgeBase = {
width: '20px',
height: '20px',
position: 'absolute',
};
var styles = {
top: {
width: '100%',
height: '10px',
top: '-5px',
left: '0px',
cursor: 'row-resize',
},
right: {
width: '10px',
height: '100%',
top: '0px',
right: '-5px',
cursor: 'col-resize',
},
bottom: {
width: '100%',
height: '10px',
bottom: '-5px',
left: '0px',
cursor: 'row-resize',
},
left: {
width: '10px',
height: '100%',
top: '0px',
left: '-5px',
cursor: 'col-resize',
},
topRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
top: '-10px',
cursor: 'ne-resize',
},
bottomRight: {
width: '20px',
height: '20px',
position: 'absolute',
right: '-10px',
bottom: '-10px',
cursor: 'se-resize',
},
bottomLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
bottom: '-10px',
cursor: 'sw-resize',
},
topLeft: {
width: '20px',
height: '20px',
position: 'absolute',
left: '-10px',
top: '-10px',
cursor: 'nw-resize',
},
top: resizer_assign(resizer_assign({}, rowSizeBase), { top: '-5px' }),
right: resizer_assign(resizer_assign({}, colSizeBase), { left: undefined, right: '-5px' }),
bottom: resizer_assign(resizer_assign({}, rowSizeBase), { top: undefined, bottom: '-5px' }),
left: resizer_assign(resizer_assign({}, colSizeBase), { left: '-5px' }),
topRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', top: '-10px', cursor: 'ne-resize' }),
bottomRight: resizer_assign(resizer_assign({}, edgeBase), { right: '-10px', bottom: '-10px', cursor: 'se-resize' }),
bottomLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', bottom: '-10px', cursor: 'sw-resize' }),
topLeft: resizer_assign(resizer_assign({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
};
var Resizer = /** @class */ (function (_super) {
resizer_extends(Resizer, _super);
@ -69574,9 +69392,6 @@ var Resizer = /** @class */ (function (_super) {
}(external_React_.PureComponent));
// EXTERNAL MODULE: ./node_modules/fast-memoize/src/index.js
var src = __webpack_require__(2920);
var src_default = /*#__PURE__*/__webpack_require__.n(src);
;// CONCATENATED MODULE: ./node_modules/re-resizable/lib/index.js
var lib_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
@ -69609,11 +69424,11 @@ var DEFAULT_SIZE = {
width: 'auto',
height: 'auto',
};
var lib_clamp = src_default()(function (n, min, max) { return Math.max(Math.min(n, max), min); });
var snap = src_default()(function (n, size) { return Math.round(n / size) * size; });
var hasDirection = src_default()(function (dir, target) {
var lib_clamp = function (n, min, max) { return Math.max(Math.min(n, max), min); };
var snap = function (n, size) { return Math.round(n / size) * size; };
var hasDirection = function (dir, target) {
return new RegExp(dir, 'i').test(target);
});
};
// INFO: In case of window is a Proxy and does not porxy Events correctly, use isTouchEvent & isMouseEvent to distinguish event type instead of `instanceof`.
var lib_isTouchEvent = function (event) {
return Boolean(event.touches && event.touches.length);
@ -69622,61 +69437,58 @@ var lib_isMouseEvent = function (event) {
return Boolean((event.clientX || event.clientX === 0) &&
(event.clientY || event.clientY === 0));
};
var findClosestSnap = src_default()(function (n, snapArray, snapGap) {
var findClosestSnap = function (n, snapArray, snapGap) {
if (snapGap === void 0) { snapGap = 0; }
var closestGapIndex = snapArray.reduce(function (prev, curr, index) { return (Math.abs(curr - n) < Math.abs(snapArray[prev] - n) ? index : prev); }, 0);
var gap = Math.abs(snapArray[closestGapIndex] - n);
return snapGap === 0 || gap < snapGap ? snapArray[closestGapIndex] : n;
});
var endsWith = src_default()(function (str, searchStr) {
return str.substr(str.length - searchStr.length, searchStr.length) === searchStr;
});
var getStringSize = src_default()(function (n) {
};
var getStringSize = function (n) {
n = n.toString();
if (n === 'auto') {
return n;
}
if (endsWith(n, 'px')) {
if (n.endsWith('px')) {
return n;
}
if (endsWith(n, '%')) {
if (n.endsWith('%')) {
return n;
}
if (endsWith(n, 'vh')) {
if (n.endsWith('vh')) {
return n;
}
if (endsWith(n, 'vw')) {
if (n.endsWith('vw')) {
return n;
}
if (endsWith(n, 'vmax')) {
if (n.endsWith('vmax')) {
return n;
}
if (endsWith(n, 'vmin')) {
if (n.endsWith('vmin')) {
return n;
}
return n + "px";
});
};
var getPixelSize = function (size, parentSize, innerWidth, innerHeight) {
if (size && typeof size === 'string') {
if (endsWith(size, 'px')) {
if (size.endsWith('px')) {
return Number(size.replace('px', ''));
}
if (endsWith(size, '%')) {
if (size.endsWith('%')) {
var ratio = Number(size.replace('%', '')) / 100;
return parentSize * ratio;
}
if (endsWith(size, 'vw')) {
if (size.endsWith('vw')) {
var ratio = Number(size.replace('vw', '')) / 100;
return innerWidth * ratio;
}
if (endsWith(size, 'vh')) {
if (size.endsWith('vh')) {
var ratio = Number(size.replace('vh', '')) / 100;
return innerHeight * ratio;
}
}
return size;
};
var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
var calculateNewMax = function (parentSize, innerWidth, innerHeight, maxWidth, maxHeight, minWidth, minHeight) {
maxWidth = getPixelSize(maxWidth, parentSize.width, innerWidth, innerHeight);
maxHeight = getPixelSize(maxHeight, parentSize.height, innerWidth, innerHeight);
minWidth = getPixelSize(minWidth, parentSize.width, innerWidth, innerHeight);
@ -69687,7 +69499,7 @@ var calculateNewMax = src_default()(function (parentSize, innerWidth, innerHeigh
minWidth: typeof minWidth === 'undefined' ? undefined : Number(minWidth),
minHeight: typeof minHeight === 'undefined' ? undefined : Number(minHeight),
};
});
};
var definedProps = [
'as',
'style',
@ -69871,8 +69683,8 @@ var Resizable = /** @class */ (function (_super) {
if (typeof _this.state[key] === 'undefined' || _this.state[key] === 'auto') {
return 'auto';
}
if (_this.propsSize && _this.propsSize[key] && endsWith(_this.propsSize[key].toString(), '%')) {
if (endsWith(_this.state[key].toString(), '%')) {
if (_this.propsSize && _this.propsSize[key] && _this.propsSize[key].toString().endsWith('%')) {
if (_this.state[key].toString().endsWith('%')) {
return _this.state[key].toString();
}
var parentSize = _this.getParentSize();
@ -70158,6 +69970,7 @@ var Resizable = /** @class */ (function (_super) {
this.setState(state);
};
Resizable.prototype.onMouseMove = function (event) {
var _this = this;
if (!this.state.isResizing || !this.resizable || !this.window) {
return;
}
@ -70206,29 +70019,29 @@ var Resizable = /** @class */ (function (_super) {
height: newHeight - original.height,
};
if (width && typeof width === 'string') {
if (endsWith(width, '%')) {
if (width.endsWith('%')) {
var percent = (newWidth / parentSize.width) * 100;
newWidth = percent + "%";
}
else if (endsWith(width, 'vw')) {
else if (width.endsWith('vw')) {
var vw = (newWidth / this.window.innerWidth) * 100;
newWidth = vw + "vw";
}
else if (endsWith(width, 'vh')) {
else if (width.endsWith('vh')) {
var vh = (newWidth / this.window.innerHeight) * 100;
newWidth = vh + "vh";
}
}
if (height && typeof height === 'string') {
if (endsWith(height, '%')) {
if (height.endsWith('%')) {
var percent = (newHeight / parentSize.height) * 100;
newHeight = percent + "%";
}
else if (endsWith(height, 'vw')) {
else if (height.endsWith('vw')) {
var vw = (newHeight / this.window.innerWidth) * 100;
newHeight = vw + "vw";
}
else if (endsWith(height, 'vh')) {
else if (height.endsWith('vh')) {
var vh = (newHeight / this.window.innerHeight) * 100;
newHeight = vh + "vh";
}
@ -70243,7 +70056,10 @@ var Resizable = /** @class */ (function (_super) {
else if (this.flexDir === 'column') {
newState.flexBasis = newState.height;
}
this.setState(newState);
// For v18, update state sync
(0,external_ReactDOM_namespaceObject.flushSync)(function () {
_this.setState(newState);
});
if (this.props.onResize) {
this.props.onResize(event, direction, this.resizable, delta);
}

File diff suppressed because one or more lines are too long

View File

@ -6376,6 +6376,16 @@ const PRESET_METADATA = [{
classSuffix: 'gradient-background',
propertyName: 'background'
}]
}, {
path: ['color', 'duotone'],
cssVarInfix: 'duotone',
valueFunc: _ref => {
let {
slug
} = _ref;
return `url( '#wp-duotone-${slug}' )`;
},
classes: []
}, {
path: ['typography', 'fontSizes'],
valueKey: 'size',
@ -6466,8 +6476,8 @@ function getPresetVariableFromValue(features, blockName, variableStylePath, pres
return `var:preset|${cssVarInfix}|${presetObject.slug}`;
}
function getValueFromPresetVariable(features, blockName, variable, _ref) {
let [presetType, slug] = _ref;
function getValueFromPresetVariable(features, blockName, variable, _ref2) {
let [presetType, slug] = _ref2;
const metadata = (0,external_lodash_namespaceObject.find)(PRESET_METADATA, ['cssVarInfix', presetType]);
if (!metadata) {
@ -7401,6 +7411,8 @@ function getCSSRules(style, options) {
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/use-global-styles-output.js
/**
* External dependencies
*/
@ -7412,6 +7424,7 @@ function getCSSRules(style, options) {
/**
* Internal dependencies
*/
@ -7450,13 +7463,18 @@ function getPresetsDeclarations() {
let {
path,
valueKey,
valueFunc,
cssVarInfix
} = _ref;
const presetByOrigin = (0,external_lodash_namespaceObject.get)(blockPresets, path, []);
['default', 'theme', 'custom'].forEach(origin => {
if (presetByOrigin[origin]) {
presetByOrigin[origin].forEach(value => {
declarations.push(`--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(value.slug)}: ${value[valueKey]}`);
if (valueKey) {
declarations.push(`--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(value.slug)}: ${value[valueKey]}`);
} else if (valueFunc && typeof valueFunc === 'function') {
declarations.push(`--wp--preset--${cssVarInfix}--${(0,external_lodash_namespaceObject.kebabCase)(value.slug)}: ${valueFunc(value)}`);
}
});
}
});
@ -7510,6 +7528,18 @@ function getPresetsClasses(blockSelector) {
}, '');
}
function getPresetsSvgFilters() {
let blockPresets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return PRESET_METADATA.filter( // Duotone are the only type of filters for now.
metadata => metadata.path.at(-1) === 'duotone').flatMap(metadata => {
const presetByOrigin = (0,external_lodash_namespaceObject.get)(blockPresets, metadata.path, {});
return ['default', 'theme'].filter(origin => presetByOrigin[origin]).flatMap(origin => presetByOrigin[origin].map(preset => (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__unstablePresetDuotoneFilter, {
preset: preset,
key: preset.slug
})));
});
}
function flattenTree() {
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let prefix = arguments.length > 1 ? arguments[1] : undefined;
@ -7598,7 +7628,7 @@ const getNodesWithStyles = (tree, blockSelectors) => {
return nodes;
}
const pickStyleKeys = treeToPickFrom => (0,external_lodash_namespaceObject.pickBy)(treeToPickFrom, (value, key) => ['border', 'color', 'spacing', 'typography'].includes(key)); // Top-level.
const pickStyleKeys = treeToPickFrom => (0,external_lodash_namespaceObject.pickBy)(treeToPickFrom, (value, key) => ['border', 'color', 'spacing', 'typography', 'filter'].includes(key)); // Top-level.
const styles = pickStyleKeys(tree.styles);
@ -7627,7 +7657,8 @@ const getNodesWithStyles = (tree, blockSelectors) => {
if (!!blockStyles && !!(blockSelectors !== null && blockSelectors !== void 0 && (_blockSelectors$block = blockSelectors[blockName]) !== null && _blockSelectors$block !== void 0 && _blockSelectors$block.selector)) {
nodes.push({
styles: blockStyles,
selector: blockSelectors[blockName].selector
selector: blockSelectors[blockName].selector,
duotoneSelector: blockSelectors[blockName].duotoneSelector
});
}
@ -7718,12 +7749,41 @@ const toCustomProperties = (tree, blockSelectors) => {
const toStyles = (tree, blockSelectors) => {
const nodesWithStyles = getNodesWithStyles(tree, blockSelectors);
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
let ruleset = '.wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }';
/*
* Reset default browser margin on the root body element.
* This is set on the root selector **before** generating the ruleset
* from the `theme.json`. This is to ensure that if the `theme.json` declares
* `margin` in its `spacing` declaration for the `body` element then these
* user-generated values take precedence in the CSS cascade.
* @link https://github.com/WordPress/gutenberg/issues/36147.
*/
let ruleset = 'body {margin: 0;}';
nodesWithStyles.forEach(_ref8 => {
let {
selector,
duotoneSelector,
styles
} = _ref8;
const duotoneStyles = {};
if (styles !== null && styles !== void 0 && styles.filter) {
duotoneStyles.filter = styles.filter;
delete styles.filter;
} // Process duotone styles (they use color.__experimentalDuotone selector).
if (duotoneSelector) {
const duotoneDeclarations = getStylesDeclarations(duotoneStyles);
if (duotoneDeclarations.length === 0) {
return;
}
ruleset = ruleset + `${duotoneSelector}{${duotoneDeclarations.join(';')};}`;
} // Process the remaning block styles (they use either normal block class or __experimentalSelector).
const declarations = getStylesDeclarations(styles);
if (declarations.length === 0) {
@ -7751,17 +7811,28 @@ const toStyles = (tree, blockSelectors) => {
});
return ruleset;
};
function toSvgFilters(tree, blockSelectors) {
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
return nodesWithSettings.flatMap(_ref10 => {
let {
presets
} = _ref10;
return getPresetsSvgFilters(presets);
});
}
const getBlockSelectors = blockTypes => {
const result = {};
blockTypes.forEach(blockType => {
var _blockType$supports$_, _blockType$supports;
var _blockType$supports$_, _blockType$supports, _blockType$supports$c, _blockType$supports2, _blockType$supports2$;
const name = blockType.name;
const selector = (_blockType$supports$_ = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports = blockType.supports) === null || _blockType$supports === void 0 ? void 0 : _blockType$supports.__experimentalSelector) !== null && _blockType$supports$_ !== void 0 ? _blockType$supports$_ : '.wp-block-' + name.replace('core/', '').replace('/', '-');
const duotoneSelector = (_blockType$supports$c = blockType === null || blockType === void 0 ? void 0 : (_blockType$supports2 = blockType.supports) === null || _blockType$supports2 === void 0 ? void 0 : (_blockType$supports2$ = _blockType$supports2.color) === null || _blockType$supports2$ === void 0 ? void 0 : _blockType$supports2$.__experimentalDuotone) !== null && _blockType$supports$c !== void 0 ? _blockType$supports$c : null;
result[name] = {
name,
selector
selector,
duotoneSelector
};
});
return result;
@ -7770,6 +7841,7 @@ const getBlockSelectors = blockTypes => {
function useGlobalStylesOutput() {
const [stylesheets, setStylesheets] = (0,external_wp_element_namespaceObject.useState)([]);
const [settings, setSettings] = (0,external_wp_element_namespaceObject.useState)({});
const [svgFilters, setSvgFilters] = (0,external_wp_element_namespaceObject.useState)({});
const {
merged: mergedConfig
} = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext);
@ -7781,6 +7853,7 @@ function useGlobalStylesOutput() {
const blockSelectors = getBlockSelectors((0,external_wp_blocks_namespaceObject.getBlockTypes)());
const customProperties = toCustomProperties(mergedConfig, blockSelectors);
const globalStyles = toStyles(mergedConfig, blockSelectors);
const filters = toSvgFilters(mergedConfig, blockSelectors);
setStylesheets([{
css: customProperties,
isGlobalStyles: true
@ -7789,8 +7862,9 @@ function useGlobalStylesOutput() {
isGlobalStyles: true
}]);
setSettings(mergedConfig.settings);
setSvgFilters(filters);
}, [mergedConfig]);
return [stylesheets, settings];
return [stylesheets, settings, svgFilters];
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/preview.js
@ -10838,6 +10912,7 @@ function ResizableEditor(_ref) {
let {
enableResizing,
settings,
children,
...props
} = _ref;
const deviceType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).__experimentalGetPreviewDeviceType(), []);
@ -10945,7 +11020,7 @@ function ResizableEditor(_ref) {
ref: ref,
name: "editor-canvas",
className: "edit-site-visual-editor__editor-canvas"
}, props)));
}, props), settings.svgFilters, children));
}
/* harmony default export */ var resizable_editor = (ResizableEditor);
@ -11914,7 +11989,7 @@ function WelcomeGuide() {
function useGlobalStylesRenderer() {
const [styles, settings] = useGlobalStylesOutput();
const [styles, settings, svgFilters] = useGlobalStylesOutput();
const {
getSettings
} = (0,external_wp_data_namespaceObject.useSelect)(store_store);
@ -11930,6 +12005,7 @@ function useGlobalStylesRenderer() {
const nonGlobalStyles = (0,external_lodash_namespaceObject.filter)(currentStoreSettings.styles, style => !style.isGlobalStyles);
updateSettings({ ...currentStoreSettings,
styles: [...nonGlobalStyles, ...styles],
svgFilters,
__experimentalFeatures: settings
});
}, [styles, settings]);

File diff suppressed because one or more lines are too long

View File

@ -10541,7 +10541,13 @@ function PostTaxonomies(_ref) {
taxonomyWrapper = external_lodash_namespaceObject.identity
} = _ref;
const availableTaxonomies = (0,external_lodash_namespaceObject.filter)(taxonomies, taxonomy => (0,external_lodash_namespaceObject.includes)(taxonomy.types, postType));
const visibleTaxonomies = (0,external_lodash_namespaceObject.filter)(availableTaxonomies, taxonomy => taxonomy.visibility.show_ui);
const visibleTaxonomies = (0,external_lodash_namespaceObject.filter)(availableTaxonomies, // In some circumstances .visibility can end up as undefined so optional chaining operator required.
// https://github.com/WordPress/gutenberg/issues/40326
taxonomy => {
var _taxonomy$visibility;
return (_taxonomy$visibility = taxonomy.visibility) === null || _taxonomy$visibility === void 0 ? void 0 : _taxonomy$visibility.show_ui;
});
return visibleTaxonomies.map(taxonomy => {
const TaxonomyComponent = taxonomy.hierarchical ? hierarchical_term_selector : flat_term_selector;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, {

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-beta2-53277';
$wp_version = '6.0-beta2-53278';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.