Update npm packages to latest versions for 6.4 beta 3.

The npm packages needed a further update for beta 3 in preparation for 6.4.

Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb.

See #59411.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2023-10-09 17:24:24 +00:00
parent d783a65dd9
commit d605f96c0f
45 changed files with 850 additions and 261 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,10 +9,11 @@
* Renders the `core/image` block on the server,
* adding a data-id attribute to the element if core/gallery has added on pre-render.
*
* @param array $attributes The block attributes.
* @param string $content The block content.
* @param WP_Block $block The block object.
* @return string Returns the block content with the data-id attribute added.
* @param array $attributes The block attributes.
* @param string $content The block content.
* @param WP_Block $block The block object.
*
* @return string The block content with the data-id attribute added.
*/
function render_block_core_image( $attributes, $content, $block ) {
@ -76,12 +77,13 @@ function render_block_core_image( $attributes, $content, $block ) {
}
/**
* Add the lightboxEnabled flag to the block data.
* Adds the lightboxEnabled flag to the block data.
*
* This is used to determine whether the lightbox should be rendered or not.
*
* @param array $block Block data.
* @return array Filtered block data.
* @param array $block Block data.
*
* @return array Filtered block data.
*/
function block_core_image_get_lightbox_settings( $block ) {
// Get the lightbox setting from the block attributes.
@ -113,43 +115,44 @@ function block_core_image_get_lightbox_settings( $block ) {
}
/**
* Add the directives and layout needed for the lightbox behavior.
* Adds the directives and layout needed for the lightbox behavior.
*
* @param string $block_content Rendered block content.
* @param array $block Block object.
* @return string Filtered block content.
* @param string $block_content Rendered block content.
* @param array $block Block object.
*
* @return string Filtered block content.
*/
function block_core_image_render_lightbox( $block_content, $block ) {
$processor = new WP_HTML_Tag_Processor( $block_content );
$aria_label = __( 'Enlarge image' );
$processor->next_tag( 'img' );
$alt_attribute = $processor->get_attribute( 'alt' );
if ( null !== $alt_attribute ) {
// An empty alt attribute `alt=""` is valid for decorative images.
if ( is_string( $alt_attribute ) ) {
$alt_attribute = trim( $alt_attribute );
}
// It only makes sense to append the alt text to the button aria-label when the alt text is non-empty.
if ( $alt_attribute ) {
/* translators: %s: Image alt text. */
$aria_label = sprintf( __( 'Enlarge image: %s' ), $alt_attribute );
}
$content = $processor->get_updated_html();
// Currently, we are only enabling the zoom animation.
$lightbox_animation = 'zoom';
// We want to store the src in the context so we can set it dynamically when the lightbox is opened.
$z = new WP_HTML_Tag_Processor( $content );
$z->next_tag( 'img' );
// Note: We want to store the `src` in the context so we
// can set it dynamically when the lightbox is opened.
if ( isset( $block['attrs']['id'] ) ) {
$img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
$img_metadata = wp_get_attachment_metadata( $block['attrs']['id'] );
$img_width = $img_metadata['width'];
$img_height = $img_metadata['height'];
} else {
$img_uploaded_src = $z->get_attribute( 'src' );
$img_uploaded_src = $processor->get_attribute( 'src' );
$img_width = 'none';
$img_height = 'none';
}
@ -160,7 +163,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
$scale_attr = false;
}
$w = new WP_HTML_Tag_Processor( $content );
$w = new WP_HTML_Tag_Processor( $block_content );
$w->next_tag( 'figure' );
$w->add_class( 'wp-lightbox-container' );
$w->set_attribute( 'data-wp-interactive', true );
@ -180,7 +183,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
"imageCurrentSrc": "",
"targetWidth": "%s",
"targetHeight": "%s",
"scaleAttr": "%s"
"scaleAttr": "%s",
"dialogLabel": "%s"
}
}
}',
@ -188,7 +192,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
$img_uploaded_src,
$img_width,
$img_height,
$scale_attr
$scale_attr,
__( 'Enlarged image' )
)
);
$w->next_tag( 'img' );
@ -200,19 +205,20 @@ function block_core_image_render_lightbox( $block_content, $block ) {
// Wrap the image in the body content with a button.
$img = null;
preg_match( '/<img[^>]+>/', $body_content, $img );
$button =
'<button
type="button"
aria-haspopup="dialog"
aria-label="' . esc_attr( $aria_label ) . '"
data-wp-on--click="actions.core.image.showLightbox"
data-wp-style--width="context.core.image.imageButtonWidth"
data-wp-style--height="context.core.image.imageButtonHeight"
data-wp-style--left="context.core.image.imageButtonLeft"
data-wp-style--top="context.core.image.imageButtonTop"
>
</button>'
. $img[0];
$button =
$img[0]
. '<button
type="button"
aria-haspopup="dialog"
aria-label="' . esc_attr( $aria_label ) . '"
data-wp-on--click="actions.core.image.showLightbox"
data-wp-style--width="context.core.image.imageButtonWidth"
data-wp-style--height="context.core.image.imageButtonHeight"
data-wp-style--left="context.core.image.imageButtonLeft"
data-wp-style--top="context.core.image.imageButtonTop"
></button>';
$body_content = preg_replace( '/<img[^>]+>/', $button, $body_content );
// We need both a responsive image and an enlarged image to animate
@ -220,7 +226,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
// image is a copy of the one in the body, which animates immediately
// as the lightbox is opened, while the enlarged one is a full-sized
// version that will likely still be loading as the animation begins.
$m = new WP_HTML_Tag_Processor( $content );
$m = new WP_HTML_Tag_Processor( $block_content );
$m->next_tag( 'figure' );
$m->add_class( 'responsive-image' );
$m->next_tag( 'img' );
@ -236,7 +242,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
$m->set_attribute( 'data-wp-style--object-fit', 'selectors.core.image.lightboxObjectFit' );
$initial_image_content = $m->get_updated_html();
$q = new WP_HTML_Tag_Processor( $content );
$q = new WP_HTML_Tag_Processor( $block_content );
$q->next_tag( 'figure' );
$q->add_class( 'enlarged-image' );
$q->next_tag( 'img' );
@ -252,24 +258,32 @@ function block_core_image_render_lightbox( $block_content, $block ) {
$q->set_attribute( 'data-wp-style--object-fit', 'selectors.core.image.lightboxObjectFit' );
$enlarged_image_content = $q->get_updated_html();
$background_color = esc_attr( wp_get_global_styles( array( 'color', 'background' ) ) );
// If the current theme does NOT have a `theme.json`, or the colors are not defined,
// we need to set the background color & close button color to some default values
// because we can't get them from the Global Styles.
$background_color = '#fff';
$close_button_color = '#000';
if ( wp_theme_has_theme_json() ) {
$global_styles_color = wp_get_global_styles( array( 'color' ) );
if ( ! empty( $global_styles_color['background'] ) ) {
$background_color = esc_attr( $global_styles_color['background'] );
}
if ( ! empty( $global_styles_color['text'] ) ) {
$close_button_color = esc_attr( $global_styles_color['text'] );
}
}
$close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15" height="15" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
$close_button_color = esc_attr( wp_get_global_styles( array( 'color', 'text' ) ) );
$dialog_label = $alt_attribute ? esc_attr( $alt_attribute ) : esc_attr__( 'Image' );
$close_button_label = esc_attr__( 'Close' );
$lightbox_html = <<<HTML
<div data-wp-body="" class="wp-lightbox-overlay $lightbox_animation"
data-wp-bind--role="selectors.core.image.roleAttribute"
aria-label="$dialog_label"
data-wp-bind--aria-label="selectors.core.image.dialogLabel"
data-wp-class--initialized="context.core.image.initialized"
data-wp-class--active="context.core.image.lightboxEnabled"
data-wp-class--hideAnimationEnabled="context.core.image.hideAnimationEnabled"
data-wp-bind--aria-hidden="!context.core.image.lightboxEnabled"
aria-hidden="true"
data-wp-bind--aria-modal="context.core.image.lightboxEnabled"
aria-modal="false"
data-wp-bind--aria-modal="selectors.core.image.ariaModal"
data-wp-effect="effects.core.image.initLightbox"
data-wp-on--keydown="actions.core.image.handleKeydown"
data-wp-on--touchstart="actions.core.image.handleTouchStart"
@ -282,7 +296,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
</button>
<div class="lightbox-image-container">$initial_image_content</div>
<div class="lightbox-image-container">$enlarged_image_content</div>
<div class="scrim" style="background-color: $background_color"></div>
<div class="scrim" style="background-color: $background_color" aria-hidden="true"></div>
</div>
HTML;
@ -290,11 +304,13 @@ HTML;
}
/**
* Ensure that the view script has the `wp-interactivity` dependency.
* Ensures that the view script has the `wp-interactivity` dependency.
*
* @since 6.4.0
*
* @global WP_Scripts $wp_scripts
*
* @return void
*/
function block_core_image_ensure_interactivity_dependency() {
global $wp_scripts;
@ -310,6 +326,8 @@ add_action( 'wp_print_scripts', 'block_core_image_ensure_interactivity_dependenc
/**
* Registers the `core/image` block on server.
*
* @return void
*/
function register_block_core_image() {
register_block_type_from_metadata(

View File

@ -93,6 +93,8 @@
}
.wp-lightbox-container{
display:flex;
flex-direction:column;
position:relative;
}
.wp-lightbox-container button{
@ -109,6 +111,10 @@
outline:5px auto -webkit-focus-ring-color;
outline-offset:5px;
}
.wp-lightbox-container button:focus,.wp-lightbox-container button:hover,.wp-lightbox-container button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay{
box-sizing:border-box;
@ -123,13 +129,22 @@
z-index:100000;
}
.wp-lightbox-overlay .close-button{
align-items:center;
cursor:pointer;
left:calc(env(safe-area-inset-left) + 20px);
display:flex;
justify-content:center;
left:calc(env(safe-area-inset-left) + 16px);
min-height:40px;
min-width:40px;
padding:0;
position:absolute;
top:calc(env(safe-area-inset-top) + 20px);
top:calc(env(safe-area-inset-top) + 16px);
z-index:5000000;
}
.wp-lightbox-overlay .close-button:focus,.wp-lightbox-overlay .close-button:hover,.wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay .lightbox-image-container{
height:var(--wp--lightbox-container-height);
overflow:hidden;

File diff suppressed because one or more lines are too long

View File

@ -93,6 +93,8 @@
}
.wp-lightbox-container{
display:flex;
flex-direction:column;
position:relative;
}
.wp-lightbox-container button{
@ -109,6 +111,10 @@
outline:5px auto -webkit-focus-ring-color;
outline-offset:5px;
}
.wp-lightbox-container button:focus,.wp-lightbox-container button:hover,.wp-lightbox-container button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay{
box-sizing:border-box;
@ -123,13 +129,22 @@
z-index:100000;
}
.wp-lightbox-overlay .close-button{
align-items:center;
cursor:pointer;
display:flex;
justify-content:center;
min-height:40px;
min-width:40px;
padding:0;
position:absolute;
right:calc(env(safe-area-inset-right) + 20px);
top:calc(env(safe-area-inset-top) + 20px);
right:calc(env(safe-area-inset-right) + 16px);
top:calc(env(safe-area-inset-top) + 16px);
z-index:5000000;
}
.wp-lightbox-overlay .close-button:focus,.wp-lightbox-overlay .close-button:hover,.wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay .lightbox-image-container{
height:var(--wp--lightbox-container-height);
left:50%;

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '8d947c6c7d5f7f3771d1');
<?php return array('dependencies' => array(), 'version' => '3417a4e11cf880e590b5');

View File

@ -206,7 +206,17 @@ function handleScroll(context) {
roleAttribute: ({
context
}) => {
return context.core.image.lightboxEnabled ? 'dialog' : '';
return context.core.image.lightboxEnabled ? 'dialog' : null;
},
ariaModal: ({
context
}) => {
return context.core.image.lightboxEnabled ? 'true' : null;
},
dialogLabel: ({
context
}) => {
return context.core.image.lightboxEnabled ? context.core.image.dialogLabel : null;
},
lightboxObjectFit: ({
context
@ -218,7 +228,7 @@ function handleScroll(context) {
enlargedImgSrc: ({
context
}) => {
return context.core.image.initialized ? context.core.image.imageUploadedSrc : '';
return context.core.image.initialized ? context.core.image.imageUploadedSrc : 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
}
}
}
@ -329,11 +339,11 @@ function setStyles(context, event) {
naturalHeight,
offsetWidth: originalWidth,
offsetHeight: originalHeight
} = event.target.nextElementSibling;
} = event.target.previousElementSibling;
let {
x: screenPosX,
y: screenPosY
} = event.target.nextElementSibling.getBoundingClientRect();
} = event.target.previousElementSibling.getBoundingClientRect();
// Natural ratio of the image clicked to open the lightbox.
const naturalRatio = naturalWidth / naturalHeight;

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'd147cc02d5d2c29b2a8e');
<?php return array('dependencies' => array(), 'version' => '6e38467974481d14d2da');

File diff suppressed because one or more lines are too long

View File

@ -48,14 +48,6 @@ function render_block_core_latest_posts( $attributes ) {
$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
$filter_latest_posts_excerpt_more = static function ( $more ) use ( $attributes ) {
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
};
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
if ( ! empty( $attributes['categories'] ) ) {
$args['category__in'] = array_column( $attributes['categories'], 'id' );
}
@ -151,6 +143,24 @@ function render_block_core_latest_posts( $attributes ) {
$trimmed_excerpt = get_the_excerpt( $post );
/*
* Adds a "Read more" link with screen reader text.
* [&hellip;] is the default excerpt ending from wp_trim_excerpt() in Core.
*/
if ( str_ends_with( $trimmed_excerpt, ' [&hellip;]' ) ) {
$excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) {
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
$trimmed_excerpt .= sprintf(
/* translators: 1: A URL to a post, 2: The static string "Read more", 3: The post title only visible to screen readers. */
__( '… <a href="%1$s" rel="noopener noreferrer">%2$s<span class="screen-reader-text">: %3$s</span></a>' ),
esc_url( $post_link ),
__( 'Read more' ),
esc_html( $title )
);
}
}
if ( post_password_required( $post ) ) {
$trimmed_excerpt = __( 'This content is password protected.' );
}

View File

@ -60,4 +60,7 @@
}
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{
opacity:1;
}
.wp-block-post-featured-image:where(.alignleft,.alignright){
width:100%;
}

View File

@ -1 +1 @@
.wp-block-post-featured-image{margin-left:0;margin-right:0}.wp-block-post-featured-image a{display:block;height:100%}.wp-block-post-featured-image img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;width:100%}.wp-block-post-featured-image.alignfull img,.wp-block-post-featured-image.alignwide img{width:100%}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim{background-color:#000;inset:0;position:absolute}.wp-block-post-featured-image{position:relative}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-gradient{background-color:transparent}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-0{opacity:0}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10{opacity:.1}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20{opacity:.2}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30{opacity:.3}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40{opacity:.4}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50{opacity:.5}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60{opacity:.6}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70{opacity:.7}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80{opacity:.8}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90{opacity:.9}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{opacity:1}
.wp-block-post-featured-image{margin-left:0;margin-right:0}.wp-block-post-featured-image a{display:block;height:100%}.wp-block-post-featured-image img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;width:100%}.wp-block-post-featured-image.alignfull img,.wp-block-post-featured-image.alignwide img{width:100%}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim{background-color:#000;inset:0;position:absolute}.wp-block-post-featured-image{position:relative}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-gradient{background-color:transparent}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-0{opacity:0}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10{opacity:.1}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20{opacity:.2}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30{opacity:.3}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40{opacity:.4}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50{opacity:.5}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60{opacity:.6}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70{opacity:.7}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80{opacity:.8}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90{opacity:.9}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{opacity:1}.wp-block-post-featured-image:where(.alignleft,.alignright){width:100%}

View File

@ -60,4 +60,7 @@
}
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{
opacity:1;
}
.wp-block-post-featured-image:where(.alignleft,.alignright){
width:100%;
}

View File

@ -1 +1 @@
.wp-block-post-featured-image{margin-left:0;margin-right:0}.wp-block-post-featured-image a{display:block;height:100%}.wp-block-post-featured-image img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;width:100%}.wp-block-post-featured-image.alignfull img,.wp-block-post-featured-image.alignwide img{width:100%}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim{background-color:#000;inset:0;position:absolute}.wp-block-post-featured-image{position:relative}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-gradient{background-color:transparent}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-0{opacity:0}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10{opacity:.1}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20{opacity:.2}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30{opacity:.3}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40{opacity:.4}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50{opacity:.5}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60{opacity:.6}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70{opacity:.7}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80{opacity:.8}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90{opacity:.9}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{opacity:1}
.wp-block-post-featured-image{margin-left:0;margin-right:0}.wp-block-post-featured-image a{display:block;height:100%}.wp-block-post-featured-image img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;width:100%}.wp-block-post-featured-image.alignfull img,.wp-block-post-featured-image.alignwide img{width:100%}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim{background-color:#000;inset:0;position:absolute}.wp-block-post-featured-image{position:relative}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-gradient{background-color:transparent}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-0{opacity:0}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10{opacity:.1}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20{opacity:.2}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30{opacity:.3}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40{opacity:.4}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50{opacity:.5}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60{opacity:.6}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70{opacity:.7}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80{opacity:.8}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90{opacity:.9}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{opacity:1}.wp-block-post-featured-image:where(.alignleft,.alignright){width:100%}

View File

@ -40,4 +40,26 @@
.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{
grid-template-columns:1fr;
}
}
.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{
-webkit-margin-start:2em;
-webkit-margin-end:0;
float:left;
margin-inline-end:0;
margin-inline-start:2em;
}
.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{
-webkit-margin-start:0;
-webkit-margin-end:2em;
float:right;
margin-inline-end:2em;
margin-inline-start:0;
}
.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{
-webkit-margin-start:auto;
-webkit-margin-end:auto;
margin-inline-end:auto;
margin-inline-start:auto;
}

View File

@ -1 +1 @@
.wp-block-post-template{list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}.wp-block-post-template.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container>li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}@media (max-width:600px){.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{grid-template-columns:1fr}}
.wp-block-post-template{list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}.wp-block-post-template.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container>li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}@media (max-width:600px){.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{grid-template-columns:1fr}}.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{-webkit-margin-start:2em;-webkit-margin-end:0;float:left;margin-inline-end:0;margin-inline-start:2em}.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{-webkit-margin-start:0;-webkit-margin-end:2em;float:right;margin-inline-end:2em;margin-inline-start:0}.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{-webkit-margin-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-inline-start:auto}

View File

@ -40,4 +40,26 @@
.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{
grid-template-columns:1fr;
}
}
.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{
-webkit-margin-start:2em;
-webkit-margin-end:0;
float:right;
margin-inline-end:0;
margin-inline-start:2em;
}
.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{
-webkit-margin-start:0;
-webkit-margin-end:2em;
float:left;
margin-inline-end:2em;
margin-inline-start:0;
}
.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{
-webkit-margin-start:auto;
-webkit-margin-end:auto;
margin-inline-end:auto;
margin-inline-start:auto;
}

View File

@ -1 +1 @@
.wp-block-post-template{list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}.wp-block-post-template.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container>li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}@media (max-width:600px){.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{grid-template-columns:1fr}}
.wp-block-post-template{list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}.wp-block-post-template.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container>li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}@media (max-width:600px){.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid{grid-template-columns:1fr}}.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{-webkit-margin-start:2em;-webkit-margin-end:0;float:right;margin-inline-end:0;margin-inline-start:2em}.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{-webkit-margin-start:0;-webkit-margin-end:2em;float:left;margin-inline-end:2em;margin-inline-start:0}.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{-webkit-margin-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-inline-start:auto}

View File

@ -3568,7 +3568,7 @@
flex-grow:1;
height:100%;
overflow-y:auto;
padding:32px 24px;
padding:16px 24px;
}
.block-editor-block-patterns-list__list-item .block-editor-block-preview__container{

File diff suppressed because one or more lines are too long

View File

@ -3568,7 +3568,7 @@
flex-grow:1;
height:100%;
overflow-y:auto;
padding:32px 24px;
padding:16px 24px;
}
.block-editor-block-patterns-list__list-item .block-editor-block-preview__container{

File diff suppressed because one or more lines are too long

View File

@ -1170,6 +1170,8 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
}
.wp-lightbox-container{
display:flex;
flex-direction:column;
position:relative;
}
.wp-lightbox-container button{
@ -1186,6 +1188,10 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
outline:5px auto -webkit-focus-ring-color;
outline-offset:5px;
}
.wp-lightbox-container button:focus,.wp-lightbox-container button:hover,.wp-lightbox-container button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay{
box-sizing:border-box;
@ -1200,13 +1206,22 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
z-index:100000;
}
.wp-lightbox-overlay .close-button{
align-items:center;
cursor:pointer;
left:calc(env(safe-area-inset-left) + 20px);
display:flex;
justify-content:center;
left:calc(env(safe-area-inset-left) + 16px);
min-height:40px;
min-width:40px;
padding:0;
position:absolute;
top:calc(env(safe-area-inset-top) + 20px);
top:calc(env(safe-area-inset-top) + 16px);
z-index:5000000;
}
.wp-lightbox-overlay .close-button:focus,.wp-lightbox-overlay .close-button:hover,.wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay .lightbox-image-container{
height:var(--wp--lightbox-container-height);
overflow:hidden;
@ -2278,6 +2293,9 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{
opacity:1;
}
.wp-block-post-featured-image:where(.alignleft,.alignright){
width:100%;
}
.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous{
display:inline-block;
@ -2420,6 +2438,29 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
grid-template-columns:1fr;
}
}
.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{
-webkit-margin-start:2em;
-webkit-margin-end:0;
float:left;
margin-inline-end:0;
margin-inline-start:2em;
}
.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{
-webkit-margin-start:0;
-webkit-margin-end:2em;
float:right;
margin-inline-end:2em;
margin-inline-start:0;
}
.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{
-webkit-margin-start:auto;
-webkit-margin-end:auto;
margin-inline-end:auto;
margin-inline-start:auto;
}
.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{
margin-bottom:.5em;
margin-right:.5em;

File diff suppressed because one or more lines are too long

View File

@ -1170,6 +1170,8 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
}
.wp-lightbox-container{
display:flex;
flex-direction:column;
position:relative;
}
.wp-lightbox-container button{
@ -1186,6 +1188,10 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
outline:5px auto -webkit-focus-ring-color;
outline-offset:5px;
}
.wp-lightbox-container button:focus,.wp-lightbox-container button:hover,.wp-lightbox-container button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay{
box-sizing:border-box;
@ -1200,13 +1206,22 @@ h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-t
z-index:100000;
}
.wp-lightbox-overlay .close-button{
align-items:center;
cursor:pointer;
display:flex;
justify-content:center;
min-height:40px;
min-width:40px;
padding:0;
position:absolute;
right:calc(env(safe-area-inset-right) + 20px);
top:calc(env(safe-area-inset-top) + 20px);
right:calc(env(safe-area-inset-right) + 16px);
top:calc(env(safe-area-inset-top) + 16px);
z-index:5000000;
}
.wp-lightbox-overlay .close-button:focus,.wp-lightbox-overlay .close-button:hover,.wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background){
background:none;
border:none;
}
.wp-lightbox-overlay .lightbox-image-container{
height:var(--wp--lightbox-container-height);
left:50%;
@ -2278,6 +2293,9 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{
opacity:1;
}
.wp-block-post-featured-image:where(.alignleft,.alignright){
width:100%;
}
.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous{
display:inline-block;
@ -2420,6 +2438,29 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
grid-template-columns:1fr;
}
}
.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{
-webkit-margin-start:2em;
-webkit-margin-end:0;
float:right;
margin-inline-end:0;
margin-inline-start:2em;
}
.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{
-webkit-margin-start:0;
-webkit-margin-end:2em;
float:left;
margin-inline-end:2em;
margin-inline-start:0;
}
.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{
-webkit-margin-start:auto;
-webkit-margin-end:auto;
margin-inline-end:auto;
margin-inline-start:auto;
}
.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{
margin-bottom:.5em;
margin-right:.5em;

File diff suppressed because one or more lines are too long

View File

@ -2285,6 +2285,25 @@ h3.edit-site-template-card__template-areas-title{
margin:0 0 8px;
}
.edit-site-template-panel__replace-template-modal{
z-index:1000001;
}
.edit-site-template-panel__replace-template-modal__content{
column-count:2;
column-gap:24px;
}
@media (min-width:782px){
.edit-site-template-panel__replace-template-modal__content{
column-count:3;
}
}
@media (min-width:1280px){
.edit-site-template-panel__replace-template-modal__content{
column-count:4;
}
}
.edit-site-editor__interface-skeleton{
opacity:1;
transition:opacity .1s ease-out;

File diff suppressed because one or more lines are too long

View File

@ -2285,6 +2285,25 @@ h3.edit-site-template-card__template-areas-title{
margin:0 0 8px;
}
.edit-site-template-panel__replace-template-modal{
z-index:1000001;
}
.edit-site-template-panel__replace-template-modal__content{
column-count:2;
column-gap:24px;
}
@media (min-width:782px){
.edit-site-template-panel__replace-template-modal__content{
column-count:3;
}
}
@media (min-width:1280px){
.edit-site-template-panel__replace-template-modal__content{
column-count:4;
}
}
.edit-site-editor__interface-skeleton{
opacity:1;
transition:opacity .1s ease-out;

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,30 @@
.patterns-menu-items__convert-modal{
z-index:1000001;
}
.patterns-menu-items__convert-modal [role=dialog]>[role=document]{
width:350px;
}
.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{
max-width:300px;
min-height:40px;
position:relative;
width:100%;
}
.patterns-menu-items__convert-modal .components-form-token-field__suggestions-list{
background-color:#fff;
border:1px solid var(--wp-admin-theme-color);
border-bottom-left-radius:2px;
border-bottom-right-radius:2px;
border-top:none;
box-shadow:0 0 0 .5px var(--wp-admin-theme-color);
box-sizing:border-box;
min-width:auto;
position:absolute;
right:-1px;
width:calc(100% + 2px);
z-index:1;
}
.patterns-create-modal__name-input input[type=text]{
min-height:34px;
margin:0;
min-height:40px;
}

View File

@ -1 +1 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.patterns-menu-items__convert-modal{z-index:1000001}.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{max-width:300px}.patterns-create-modal__name-input input[type=text]{min-height:34px}
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.patterns-menu-items__convert-modal{z-index:1000001}.patterns-menu-items__convert-modal [role=dialog]>[role=document]{width:350px}.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{min-height:40px;position:relative;width:100%}.patterns-menu-items__convert-modal .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid var(--wp-admin-theme-color);border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top:none;box-shadow:0 0 0 .5px var(--wp-admin-theme-color);box-sizing:border-box;min-width:auto;position:absolute;right:-1px;width:calc(100% + 2px);z-index:1}.patterns-create-modal__name-input input[type=text]{margin:0;min-height:40px}

View File

@ -18,10 +18,30 @@
.patterns-menu-items__convert-modal{
z-index:1000001;
}
.patterns-menu-items__convert-modal [role=dialog]>[role=document]{
width:350px;
}
.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{
max-width:300px;
min-height:40px;
position:relative;
width:100%;
}
.patterns-menu-items__convert-modal .components-form-token-field__suggestions-list{
background-color:#fff;
border:1px solid var(--wp-admin-theme-color);
border-bottom-left-radius:2px;
border-bottom-right-radius:2px;
border-top:none;
box-shadow:0 0 0 .5px var(--wp-admin-theme-color);
box-sizing:border-box;
left:-1px;
min-width:auto;
position:absolute;
width:calc(100% + 2px);
z-index:1;
}
.patterns-create-modal__name-input input[type=text]{
min-height:34px;
margin:0;
min-height:40px;
}

View File

@ -1 +1 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.patterns-menu-items__convert-modal{z-index:1000001}.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{max-width:300px}.patterns-create-modal__name-input input[type=text]{min-height:34px}
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.patterns-menu-items__convert-modal{z-index:1000001}.patterns-menu-items__convert-modal [role=dialog]>[role=document]{width:350px}.patterns-menu-items__convert-modal .patterns-menu-items__convert-modal-categories{min-height:40px;position:relative;width:100%}.patterns-menu-items__convert-modal .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid var(--wp-admin-theme-color);border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top:none;box-shadow:0 0 0 .5px var(--wp-admin-theme-color);box-sizing:border-box;left:-1px;min-width:auto;position:absolute;width:calc(100% + 2px);z-index:1}.patterns-create-modal__name-input input[type=text]{margin:0;min-height:40px}

View File

@ -3620,8 +3620,10 @@ __webpack_require__.d(private_selectors_namespaceObject, {
getBlockRemovalRules: function() { return getBlockRemovalRules; },
getEnabledBlockParents: function() { return getEnabledBlockParents; },
getEnabledClientIdsTree: function() { return getEnabledClientIdsTree; },
getInserterMediaCategories: function() { return getInserterMediaCategories; },
getLastInsertedBlocksClientIds: function() { return getLastInsertedBlocksClientIds; },
getOpenedBlockSettingsMenu: function() { return getOpenedBlockSettingsMenu; },
getRegisteredInserterMediaCategories: function() { return getRegisteredInserterMediaCategories; },
getRemovalPromptData: function() { return getRemovalPromptData; },
getStyleOverrides: function() { return getStyleOverrides; },
isBlockInterfaceHidden: function() { return private_selectors_isBlockInterfaceHidden; },
@ -5785,6 +5787,22 @@ function styleOverrides(state = new Map(), action) {
}
return state;
}
/**
* Reducer returning a map of the registered inserter media categories.
*
* @param {Array} state Current state.
* @param {Object} action Dispatched action.
*
* @return {Array} Updated state.
*/
function registeredInserterMediaCategories(state = [], action) {
switch (action.type) {
case 'REGISTER_INSERTER_MEDIA_CATEGORY':
return [...state, action.category];
}
return state;
}
const combinedReducers = (0,external_wp_data_namespaceObject.combineReducers)({
blocks,
isTyping,
@ -5811,7 +5829,8 @@ const combinedReducers = (0,external_wp_data_namespaceObject.combineReducers)({
styleOverrides,
removalPromptData,
blockRemovalRules,
openedBlockSettingsMenu
openedBlockSettingsMenu,
registeredInserterMediaCategories
});
function withAutomaticChangeReset(reducer) {
return (state, action) => {
@ -9130,6 +9149,58 @@ function getStyleOverrides(state) {
return state.styleOverrides;
}
/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */
/**
* Returns the registered inserter media categories through the public API.
*
* @param {Object} state Editor state.
*
* @return {InserterMediaCategory[]} Inserter media categories.
*/
function getRegisteredInserterMediaCategories(state) {
return state.registeredInserterMediaCategories;
}
/**
* Returns an array containing the allowed inserter media categories.
* It merges the registered media categories from extenders with the
* core ones. It also takes into account the allowed `mime_types`, which
* can be altered by `upload_mimes` filter and restrict some of them.
*
* @param {Object} state Global application state.
*
* @return {InserterMediaCategory[]} Client IDs of descendants.
*/
const getInserterMediaCategories = rememo(state => {
const {
settings: {
inserterMediaCategories,
allowedMimeTypes,
enableOpenverseMediaCategory
},
registeredInserterMediaCategories
} = state;
// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict
// some of them. In this case we shouldn't add the category to the available media
// categories list in the inserter.
if (!inserterMediaCategories && !registeredInserterMediaCategories.length || !allowedMimeTypes) {
return;
}
const coreInserterMediaCategoriesNames = inserterMediaCategories?.map(({
name
}) => name) || [];
const mergedCategories = [...(inserterMediaCategories || []), ...(registeredInserterMediaCategories || []).filter(({
name
}) => !coreInserterMediaCategoriesNames.includes(name))];
return mergedCategories.filter(category => {
// Check if Openverse category is enabled.
if (!enableOpenverseMediaCategory && category.name === 'openverse') {
return false;
}
return Object.values(allowedMimeTypes).some(mimeType => mimeType.startsWith(`${category.mediaType}/`));
});
}, state => [state.settings.inserterMediaCategories, state.settings.allowedMimeTypes, state.settings.enableOpenverseMediaCategory, state.registeredInserterMediaCategories]);
;// CONCATENATED MODULE: external ["wp","a11y"]
var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/selection.js
@ -10759,19 +10830,17 @@ const registerInserterMediaCategory = category => ({
console.error('Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.');
return;
}
const {
inserterMediaCategories = []
} = select.getSettings();
if (inserterMediaCategories.some(({
const registeredInserterMediaCategories = select.getRegisteredInserterMediaCategories();
if (registeredInserterMediaCategories.some(({
name
}) => name === category.name)) {
console.error(`A category is already registered with the same name: "${category.name}".`);
return;
}
if (inserterMediaCategories.some(({
if (registeredInserterMediaCategories.some(({
labels: {
name
}
} = {}
}) => name === category.labels?.name)) {
console.error(`A category is already registered with the same labels.name: "${category.labels.name}".`);
return;
@ -10781,12 +10850,10 @@ const registerInserterMediaCategory = category => ({
// private, so extenders can only add new inserter media categories and don't have any
// control over the core media categories.
dispatch({
type: 'UPDATE_SETTINGS',
settings: {
inserterMediaCategories: [...inserterMediaCategories, {
...category,
isExternalResource: true
}]
type: 'REGISTER_INSERTER_MEDIA_CATEGORY',
category: {
...category,
isExternalResource: true
}
});
};
@ -24785,7 +24852,15 @@ function bubbleEvent(event, Constructor, frame) {
for (const key in event) {
init[key] = event[key];
}
if (event instanceof frame.ownerDocument.defaultView.MouseEvent) {
// Check if the event is a MouseEvent generated within the iframe.
// If so, adjust the coordinates to be relative to the position of
// the iframe. This ensures that components such as Draggable
// receive coordinates relative to the window, instead of relative
// to the iframe. Without this, the Draggable event handler would
// result in components "jumping" position as soon as the user
// drags over the iframe.
if (event instanceof frame.contentDocument.defaultView.MouseEvent) {
const rect = frame.getBoundingClientRect();
init.clientX += rect.left;
init.clientY += rect.top;
@ -26326,6 +26401,11 @@ const wrap = (namespace, ignore = []) => node => {
return selector;
}
// Skip the update when a selector already has a namespace + space (" ").
if (selector.trim().startsWith(`${namespace} `)) {
return selector;
}
// Anything other than a root tag is always prefixed.
{
if (!selector.match(IS_ROOT_TAG)) {
@ -28356,12 +28436,10 @@ function BlockPatternsSyncFilter({
}, {
value: SYNC_TYPES.full,
label: (0,external_wp_i18n_namespaceObject.__)('Synced'),
info: (0,external_wp_i18n_namespaceObject.__)('Updated everywhere'),
disabled: shouldDisableSyncFilter
}, {
value: SYNC_TYPES.unsynced,
label: (0,external_wp_i18n_namespaceObject.__)('Standard'),
info: (0,external_wp_i18n_namespaceObject.__)('Edit freely'),
label: (0,external_wp_i18n_namespaceObject.__)('Not synced'),
disabled: shouldDisableSyncFilter
}], [shouldDisableSyncFilter]);
const patternSourceMenuOptions = (0,external_wp_element_namespaceObject.useMemo)(() => [{
@ -28370,18 +28448,15 @@ function BlockPatternsSyncFilter({
disabled: shouldDisableNonUserSources
}, {
value: PATTERN_TYPES.directory,
label: (0,external_wp_i18n_namespaceObject.__)('Directory'),
info: (0,external_wp_i18n_namespaceObject.__)('Pattern directory & core'),
label: (0,external_wp_i18n_namespaceObject.__)('Pattern Directory'),
disabled: shouldDisableNonUserSources
}, {
value: PATTERN_TYPES.theme,
label: (0,external_wp_i18n_namespaceObject.__)('Theme'),
info: (0,external_wp_i18n_namespaceObject.__)('Bundled with the theme'),
label: (0,external_wp_i18n_namespaceObject.__)('Theme & Plugins'),
disabled: shouldDisableNonUserSources
}, {
value: PATTERN_TYPES.user,
label: (0,external_wp_i18n_namespaceObject.__)('User'),
info: (0,external_wp_i18n_namespaceObject.__)('Custom created')
label: (0,external_wp_i18n_namespaceObject.__)('User')
}], [shouldDisableNonUserSources]);
function handleSetSourceFilterChange(newSourceFilter) {
setPatternSourceFilter(newSourceFilter);
@ -28407,7 +28482,7 @@ function BlockPatternsSyncFilter({
}))
})
}, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
label: (0,external_wp_i18n_namespaceObject.__)('Author')
label: (0,external_wp_i18n_namespaceObject.__)('Source')
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
choices: patternSourceMenuOptions,
onSelect: value => {
@ -28424,6 +28499,12 @@ function BlockPatternsSyncFilter({
scrollContainerRef.current?.scrollTo(0, 0);
},
value: patternSyncFilter
})), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-tool-selector__help"
}, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced.'), {
Link: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/patterns/')
})
})))));
}
@ -28615,7 +28696,7 @@ function BlockPatternsCategoryPanel({
setPatternSourceFilter: onSetPatternSourceFilter,
scrollContainerRef: scrollContainerRef,
category: category
})), category.description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, null, category.description), !currentCategoryPatterns.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
})), !currentCategoryPatterns.length && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
className: "block-editor-inserter__patterns-category-no-results"
}, (0,external_wp_i18n_namespaceObject.__)('No results found'))), currentCategoryPatterns.length > 0 && (0,external_wp_element_namespaceObject.createElement)(block_patterns_list, {
@ -28694,8 +28775,9 @@ function BlockPatternsTabs({
*/
/** @typedef {import('./api').InserterMediaRequest} InserterMediaRequest */
/** @typedef {import('./api').InserterMediaItem} InserterMediaItem */
/** @typedef {import('../../../store/actions').InserterMediaRequest} InserterMediaRequest */
/** @typedef {import('../../../store/actions').InserterMediaItem} InserterMediaItem */
/**
* Fetches media items based on the provided category.
@ -28737,38 +28819,9 @@ function useMediaResults(category, query = {}) {
isLoading
};
}
function useInserterMediaCategories() {
const {
inserterMediaCategories,
allowedMimeTypes,
enableOpenverseMediaCategory
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const settings = select(store).getSettings();
return {
inserterMediaCategories: settings.inserterMediaCategories,
allowedMimeTypes: settings.allowedMimeTypes,
enableOpenverseMediaCategory: settings.enableOpenverseMediaCategory
};
}, []);
// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict
// some of them. In this case we shouldn't add the category to the available media
// categories list in the inserter.
const allowedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!inserterMediaCategories || !allowedMimeTypes) {
return;
}
return inserterMediaCategories.filter(category => {
// Check if Openverse category is enabled.
if (!enableOpenverseMediaCategory && category.name === 'openverse') {
return false;
}
return Object.values(allowedMimeTypes).some(mimeType => mimeType.startsWith(`${category.mediaType}/`));
});
}, [inserterMediaCategories, allowedMimeTypes, enableOpenverseMediaCategory]);
return allowedCategories;
}
function useMediaCategories(rootClientId) {
const [categories, setCategories] = (0,external_wp_element_namespaceObject.useState)([]);
const inserterMediaCategories = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getInserterMediaCategories(), []);
const {
canInsertImage,
canInsertVideo,
@ -28783,7 +28836,6 @@ function useMediaCategories(rootClientId) {
canInsertAudio: canInsertBlockType('core/audio', rootClientId)
};
}, [rootClientId]);
const inserterMediaCategories = useInserterMediaCategories();
(0,external_wp_element_namespaceObject.useEffect)(() => {
(async () => {
const _categories = [];
@ -47405,6 +47457,7 @@ const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)
* WordPress dependencies
*/
const getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
(0,external_wp_i18n_namespaceObject.__)('Block %1$d of %2$d, Level %3$d'), position, siblingCount, level);
@ -47444,6 +47497,39 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
};
}
/**
* Shift focus to the list view item associated with a particular clientId.
*
* @typedef {import('@wordpress/element').RefObject} RefObject
*
* @param {string} focusClientId The client ID of the block to focus.
* @param {RefObject<HTMLElement>} treeGridElementRef The container element to search within.
*/
function focusListItem(focusClientId, treeGridElementRef) {
const getFocusElement = () => {
const row = treeGridElementRef.current?.querySelector(`[role=row][data-block="${focusClientId}"]`);
if (!row) return null;
// Focus the first focusable in the row, which is the ListViewBlockSelectButton.
return external_wp_dom_namespaceObject.focus.focusable.find(row)[0];
};
let focusElement = getFocusElement();
if (focusElement) {
focusElement.focus();
} else {
// The element hasn't been painted yet. Defer focusing on the next frame.
// This could happen when all blocks have been deleted and the default block
// hasn't been added to the editor yet.
window.requestAnimationFrame(() => {
focusElement = getFocusElement();
// Ignore if the element still doesn't exist.
if (focusElement) {
focusElement.focus();
}
});
}
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js
/**
@ -47463,7 +47549,6 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
/**
* Internal dependencies
*/
@ -47529,7 +47614,6 @@ function ListViewBlock({
// translators: %s: The title of the block.
(0,external_wp_i18n_namespaceObject.__)('Options for %s'), blockTitle);
const {
isTreeGridMounted,
expand,
collapse,
BlockSettingsMenu,
@ -47547,15 +47631,6 @@ function ListViewBlock({
'is-visible': isHovered || isFirstSelectedBlock
});
// If ListView has experimental features related to the Persistent List View,
// only focus the selected list item on mount; otherwise the list would always
// try to steal the focus from the editor canvas.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isTreeGridMounted && isSelected) {
cellRef.current.focus();
}
}, []);
// If multiple blocks are selected, deselect all blocks when the user
// presses the escape key.
const onKeyDown = event => {
@ -47581,27 +47656,7 @@ function ListViewBlock({
if (shouldSelectBlock) {
selectBlock(undefined, focusClientId, null, null);
}
const getFocusElement = () => {
const row = treeGridElementRef.current?.querySelector(`[role=row][data-block="${focusClientId}"]`);
if (!row) return null;
// Focus the first focusable in the row, which is the ListViewBlockSelectButton.
return external_wp_dom_namespaceObject.focus.focusable.find(row)[0];
};
let focusElement = getFocusElement();
if (focusElement) {
focusElement.focus();
} else {
// The element hasn't been painted yet. Defer focusing on the next frame.
// This could happen when all blocks have been deleted and the default block
// hasn't been added to the editor yet.
window.requestAnimationFrame(() => {
focusElement = getFocusElement();
// Ignore if the element still doesn't exist.
if (focusElement) {
focusElement.focus();
}
});
}
focusListItem(focusClientId, treeGridElementRef);
}, [selectBlock, treeGridElementRef]);
const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => {
// Prevent shift+click from opening link in a new window when toggling.
@ -47862,7 +47917,14 @@ function ListViewBranch(props) {
// but asynchronous for any other block.
const isSelected = isClientIdSelected(clientId, selectedClientIds);
const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
const showBlock = isDragged || blockInView || isSelected || isBranchDragged;
// To avoid performance issues, we only render blocks that are in view,
// or blocks that are selected or dragged. If a block is selected,
// it is only counted if it is the first of the block selection.
// This prevents the entire tree from being rendered when a branch is
// selected, or a user selects all blocks, while still enabling scroll
// into view behavior when selecting a block or opening the list view.
const showBlock = isDragged || blockInView || isBranchDragged || isSelected && clientId === selectedClientIds[0];
return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
key: clientId,
value: !isSelected
@ -49720,6 +49782,7 @@ function BlockSettingsDropdown({
const expanded = (state, action) => {
if (Array.isArray(action.clientIds)) {
return {
@ -49813,7 +49876,6 @@ function ListViewComponent({
});
const elementRef = (0,external_wp_element_namespaceObject.useRef)();
const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([elementRef, dropZoneRef, ref]);
const isMounted = (0,external_wp_element_namespaceObject.useRef)(false);
const [insertedBlock, setInsertedBlock] = (0,external_wp_element_namespaceObject.useState)(null);
const {
setSelectedTreeId
@ -49835,7 +49897,13 @@ function ListViewComponent({
}
}, [setSelectedTreeId, updateBlockSelection, onSelect, getBlock]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
isMounted.current = true;
// If a blocks are already selected when the list view is initially
// mounted, shift focus to the first selected block.
if (selectedClientIds?.length) {
focusListItem(selectedClientIds[0], elementRef);
}
// Disable reason: Only focus on the selected item when the list view is mounted.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
if (!clientId) {
@ -49867,7 +49935,6 @@ function ListViewComponent({
}
}, [updateBlockSelection]);
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
isTreeGridMounted: isMounted.current,
draggedClientIds,
expandedState,
expand,
@ -50255,7 +50322,6 @@ function useStylesForBlocks({
/**
* Internal dependencies
*/
@ -50305,7 +50371,7 @@ function BlockStyles({
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-block-styles__variants"
}, stylesToRender.map(style => {
const buttonText = style.isDefault ? (0,external_wp_i18n_namespaceObject.__)('Default') : style.label || style.name;
const buttonText = style.label || style.name;
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
className: classnames_default()('block-editor-block-styles__item', {

File diff suppressed because one or more lines are too long

View File

@ -13098,7 +13098,7 @@ function CoverInspectorControls({
const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
const htmlElementMessages = {
header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'),
section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
@ -15146,6 +15146,7 @@ class EmbedPreview extends external_wp_element_namespaceObject.Component {
const EmbedEdit = props => {
const {
attributes: {
@ -15244,6 +15245,22 @@ const EmbedEdit = props => {
});
}, [preview?.html, attributesUrl, cannotEmbed, fetching]);
// Try a different provider in case the embed url is not supported.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!cannotEmbed || fetching || !url) {
return;
}
// Until X provider is supported in WordPress, as a workaround we use Twitter provider.
if ((0,external_wp_url_namespaceObject.getAuthority)(url) === 'x.com') {
const newURL = new URL(url);
newURL.host = 'twitter.com';
setAttributes({
url: newURL.toString()
});
}
}, [url, cannotEmbed, fetching, setAttributes]);
// Handle incoming preview.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (preview && !isEditingURL) {
@ -24104,7 +24121,7 @@ function image_Image({
});
const lightboxSetting = (0,external_wp_blockEditor_namespaceObject.useSetting)('lightbox');
const showLightboxToggle = !!lightbox || lightboxSetting?.allowEditing === true;
const lightboxChecked = lightbox?.enabled || !lightbox && lightboxSetting?.enabled;
const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled;
const dimensionsControl = (0,external_wp_element_namespaceObject.createElement)(DimensionsTool, {
value: {
width,
@ -25942,14 +25959,18 @@ function LatestPostsEdit({
}
});
const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_element_namespaceObject.createInterpolateElement)( /* translators: excerpt truncation character, default … */
(0,external_wp_i18n_namespaceObject.__)(' … <a>Read more</a>'), {
const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: The static string "Read more", 2: The post title only visible to screen readers. */
(0,external_wp_i18n_namespaceObject.__)('… <a>%1$s<span>: %2$s</span></a>'), (0,external_wp_i18n_namespaceObject.__)('Read more'), titleTrimmed || (0,external_wp_i18n_namespaceObject.__)('(no title)')), {
a:
// eslint-disable-next-line jsx-a11y/anchor-has-content
(0,external_wp_element_namespaceObject.createElement)("a", {
className: "wp-block-latest-posts__read-more",
href: post.link,
rel: "noopener noreferrer",
onClick: showRedirectionPreventedNotice
}),
span: (0,external_wp_element_namespaceObject.createElement)("span", {
className: "screen-reader-text"
})
})) : excerpt;
return (0,external_wp_element_namespaceObject.createElement)("li", {
@ -29175,7 +29196,7 @@ function MediaTextEdit({
}), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
checked: imageFill,
checked: !!imageFill,
onChange: () => setAttributes({
imageFill: !imageFill
})
@ -30791,7 +30812,8 @@ function NavigationInnerBlocks({
// Show the appender while dragging to allow inserting element between item and the appender.
parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
placeholder: showPlaceholder ? placeholder : undefined,
__experimentalCaptureToolbars: true
__experimentalCaptureToolbars: true,
__unstableDisableLayoutClassNames: true
});
return (0,external_wp_element_namespaceObject.createElement)("div", {
...innerBlocksProps
@ -31786,13 +31808,16 @@ const ManageMenusButton = ({
function DeletedNavigationWarning({
onCreateNew
}) {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
onClick: onCreateNew,
variant: "link"
}, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?')));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. <button>Create a new menu?</button>'), {
button: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
onClick: onCreateNew,
variant: "link"
})
}));
}
/* harmony default export */ var deleted_navigation_warning = (DeletedNavigationWarning);
@ -32492,7 +32517,8 @@ function Navigation({
// These props are used by the navigation editor to override specific
// navigation block settings.
hasSubmenuIndicatorSetting = true,
customPlaceholder: CustomPlaceholder = null
customPlaceholder: CustomPlaceholder = null,
__unstableLayoutClassNames: layoutClassNames
}) {
const {
openSubmenusOnClick,
@ -32656,7 +32682,7 @@ function Navigation({
[(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor?.slug)]: !!backgroundColor?.slug,
[`has-text-decoration-${textDecoration}`]: textDecoration,
'block-editor-block-content-overlay': hasBlockOverlay
}),
}, layoutClassNames),
style: {
color: !textColor?.slug && textColor?.color,
backgroundColor: !backgroundColor?.slug && backgroundColor?.color

File diff suppressed because one or more lines are too long

View File

@ -10432,7 +10432,7 @@ const PAGE_CONTENT_BLOCK_TYPES = {
};
const POST_TYPE_LABELS = {
[TEMPLATE_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Template'),
[TEMPLATE_PART_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Template Part'),
[TEMPLATE_PART_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Template part'),
[PATTERN_TYPES.user]: (0,external_wp_i18n_namespaceObject.__)('Pattern'),
[NAVIGATION_POST_TYPE]: (0,external_wp_i18n_namespaceObject.__)('Navigation')
};
@ -12254,14 +12254,13 @@ function isSaveViewOpened(state) {
* @param {Object} state Global application state.
* @return {Array} Template parts and their blocks in an array.
*/
const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const templateType = getEditedPostType(state);
const templateId = getEditedPostId(state);
const template = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', templateType, templateId);
const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
per_page: -1
});
return memoizedGetFilteredTemplatePartBlocks(template.blocks, templateParts);
const clientIds = select(external_wp_blockEditor_namespaceObject.store).__experimentalGetGlobalBlocksByName('core/template-part');
const blocks = select(external_wp_blockEditor_namespaceObject.store).getBlocksByClientId(clientIds);
return memoizedGetFilteredTemplatePartBlocks(blocks, templateParts);
});
/**
@ -16998,6 +16997,20 @@ const symbolFilled = (0,external_wp_element_namespaceObject.createElement)(exter
}));
/* harmony default export */ var symbol_filled = (symbolFilled);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
/**
* WordPress dependencies
*/
const upload = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
}));
/* harmony default export */ var library_upload = (upload);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/utils/template-part-create.js
/**
* External dependencies
@ -17789,7 +17802,7 @@ function AddNewPattern() {
});
}
controls.push({
icon: library_symbol,
icon: library_upload,
onClick: () => {
patternUploadInputRef.current.click();
},
@ -18561,6 +18574,29 @@ function NavigationMenuEditor({
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function useNavigationMenuTitle(id) {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
if (!id) {
return undefined;
}
const editedRecord = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, id);
// Do not display a 'trashed' navigation menu.
return editedRecord.status === 'trash' ? undefined : editedRecord.title;
}, [id]);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js
/**
@ -18569,7 +18605,6 @@ function NavigationMenuEditor({
/**
* Internal dependencies
*/
@ -18578,8 +18613,10 @@ function NavigationMenuEditor({
function TemplatePartNavigationMenu({
id
}) {
const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', NAVIGATION_POST_TYPE, 'title', id);
if (!id) return null;
const title = useNavigationMenuTitle(id);
if (!id || title === undefined) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
size: "11",
@ -18597,22 +18634,24 @@ function TemplatePartNavigationMenu({
*/
/**
* Internal dependencies
*/
function TemplatePartNavigationMenuListItem({
id
}) {
const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', NAVIGATION_POST_TYPE, 'title', id);
const title = useNavigationMenuTitle(id);
const linkInfo = useLink({
postId: id,
postType: NAVIGATION_POST_TYPE
});
if (!id) return null;
if (!id || title === undefined) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, {
withChevron: true,
...linkInfo
@ -18688,6 +18727,12 @@ function TemplatePartNavigationMenus({
function getBlocksFromRecord(record) {
if (record?.blocks) {
return record?.blocks;
}
return record?.content && typeof record.content !== 'function' ? (0,external_wp_blocks_namespaceObject.parse)(record.content) : [];
}
/**
* Retrieves a list of specific blocks from a given tree of blocks.
@ -18732,7 +18777,7 @@ function useNavigationMenuContent(postType, postId) {
if (postType !== TEMPLATE_PART_POST_TYPE) {
return;
}
const blocks = record?.content && typeof record.content !== 'function' ? (0,external_wp_blocks_namespaceObject.parse)(record.content) : [];
const blocks = getBlocksFromRecord(record);
const navigationBlocks = getBlocksOfTypeFromBlocks('core/navigation', blocks);
if (!navigationBlocks.length) {
return;
@ -21490,7 +21535,7 @@ async function resolvers_fetchInstallFonts(data) {
}
async function resolvers_fetchUninstallFonts(fonts) {
const data = {
fontFamilies: fonts
font_families: fonts
};
const config = {
path: '/wp/v2/fonts',
@ -21677,7 +21722,7 @@ function utils_makeFormDataFromFontFamilies(fontFamilies) {
}
return family;
});
formData.append('fontFamilies', JSON.stringify(newFontFamilies));
formData.append('font_families', JSON.stringify(newFontFamilies));
return formData;
}
@ -29324,6 +29369,148 @@ function PagePanels() {
}, (0,external_wp_element_namespaceObject.createElement)(PageContent, null)));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ReplaceTemplateButton({
onClick,
availableTemplates
}) {
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const [showModal, setShowModal] = (0,external_wp_element_namespaceObject.useState)(false);
const onClose = () => {
setShowModal(false);
};
const {
postId,
postType
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
return {
postId: select(store_store).getEditedPostId(),
postType: select(store_store).getEditedPostType()
};
}, []);
const onTemplateSelect = async selectedTemplate => {
onClose(); // Close the template suggestions modal first.
onClick();
await editEntityRecord('postType', postType, postId, {
blocks: selectedTemplate.blocks,
content: (0,external_wp_blocks_namespaceObject.serialize)(selectedTemplate.blocks)
});
};
if (!availableTemplates.length || availableTemplates.length < 1) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
info: (0,external_wp_i18n_namespaceObject.__)('Replace the contents of this template with another.'),
onClick: () => setShowModal(true)
}, (0,external_wp_i18n_namespaceObject.__)('Replace template')), showModal && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Choose a template'),
onRequestClose: onClose,
overlayClassName: "edit-site-template-panel__replace-template-modal",
isFullScreen: true
}, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-template-panel__replace-template-modal__content"
}, (0,external_wp_element_namespaceObject.createElement)(replace_template_button_TemplatesList, {
availableTemplates: availableTemplates,
onSelect: onTemplateSelect
}))));
}
function replace_template_button_TemplatesList({
availableTemplates,
onSelect
}) {
const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(availableTemplates);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
blockPatterns: availableTemplates,
shownPatterns: shownTemplates,
onClickPattern: onSelect
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-edit-mode/template-panel/hooks.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
block.innerBlocks = block.innerBlocks.map(innerBlock => {
return injectThemeAttributeInBlockTemplateContent(innerBlock, currentThemeStylesheet);
});
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
block.attributes.theme = currentThemeStylesheet;
}
return block;
}
function preparePatterns(patterns, template, currentThemeStylesheet) {
// Filter out duplicates.
const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name);
// Filter out core patterns.
const filterOutCorePatterns = pattern => !PATTERN_CORE_SOURCES.includes(pattern.source);
// Filter only the patterns that are compatible with the current template.
const filterCompatiblePatterns = pattern => pattern.templateTypes?.includes(template.slug);
return patterns.filter(filterOutCorePatterns && filterOutDuplicatesByName && filterCompatiblePatterns).map(pattern => ({
...pattern,
keywords: pattern.keywords || [],
type: PATTERN_TYPES.theme,
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
}).map(block => injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet))
}));
}
function useAvailablePatterns(template) {
const {
blockPatterns,
restBlockPatterns,
currentThemeStylesheet
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _settings$__experimen;
const {
getSettings
} = unlock(select(store_store));
const settings = getSettings();
return {
blockPatterns: (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns,
restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
currentThemeStylesheet: select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet
};
}, []);
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const mergedPatterns = [...(blockPatterns || []), ...(restBlockPatterns || [])];
return preparePatterns(mergedPatterns, template, currentThemeStylesheet);
}, [blockPatterns, restBlockPatterns, template, currentThemeStylesheet]);
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-edit-mode/template-panel/template-actions.js
/**
@ -29339,14 +29526,17 @@ function PagePanels() {
*/
function Actions({
template
}) {
const availablePatterns = useAvailablePatterns(template);
const {
revertTemplate
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const isRevertable = isTemplateRevertable(template);
if (!isRevertable) {
if (!isRevertable && (!availablePatterns.length || availablePatterns.length < 1)) {
return null;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
@ -29358,13 +29548,17 @@ function Actions({
}
}, ({
onClose
}) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
}) => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, isRevertable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
info: (0,external_wp_i18n_namespaceObject.__)('Use the template as supplied by the theme.'),
onClick: () => {
revertTemplate(template);
onClose();
}
}, (0,external_wp_i18n_namespaceObject.__)('Clear customizations'))));
}, (0,external_wp_i18n_namespaceObject.__)('Clear customizations')), (0,external_wp_element_namespaceObject.createElement)(ReplaceTemplateButton, {
availableTemplates: availablePatterns,
template: template,
onClick: onClose
})));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-edit-mode/template-panel/template-areas.js

File diff suppressed because one or more lines are too long

View File

@ -282,41 +282,25 @@ var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
const unescapeString = arg => {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(arg);
};
const EMPTY_ARRAY = [];
const MAX_TERMS_SUGGESTIONS = 20;
const DEFAULT_QUERY = {
per_page: MAX_TERMS_SUGGESTIONS,
_fields: 'id,name',
context: 'view'
};
const CATEGORY_SLUG = 'wp_pattern_category';
function CategorySelector({
values,
onChange
categoryTerms,
onChange,
categoryMap
}) {
const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)('');
const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 500);
const {
searchResults
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords
} = select(external_wp_coreData_namespaceObject.store);
return {
searchResults: !!search ? getEntityRecords('taxonomy', CATEGORY_SLUG, {
...DEFAULT_QUERY,
search
}) : EMPTY_ARRAY
};
}, [search]);
const suggestions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return (searchResults !== null && searchResults !== void 0 ? searchResults : []).map(term => unescapeString(term.name));
}, [searchResults]);
return Array.from(categoryMap.values()).map(category => unescapeString(category.label)).filter(category => {
if (search !== '') {
return category.toLowerCase().includes(search.toLowerCase());
}
return true;
}).sort((a, b) => a.localeCompare(b));
}, [search, categoryMap]);
function handleChange(termNames) {
const uniqueTerms = termNames.reduce((terms, newTerm) => {
if (!terms.some(term => term.toLowerCase() === newTerm.toLowerCase())) {
@ -326,16 +310,17 @@ function CategorySelector({
}, []);
onChange(uniqueTerms);
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
className: "patterns-menu-items__convert-modal-categories",
value: values,
value: categoryTerms,
suggestions: suggestions,
onChange: handleChange,
onInputChange: debouncedSearch,
maxSuggestions: MAX_TERMS_SUGGESTIONS,
label: (0,external_wp_i18n_namespaceObject.__)('Categories'),
tokenizeOnBlur: true
}));
tokenizeOnBlur: true,
__experimentalExpandOnFocus: true,
__next40pxDefaultSize: true
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/create-pattern-modal.js
@ -382,6 +367,38 @@ function CreatePatternModal({
const {
createErrorNotice
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const {
corePatternCategories,
userPatternCategories
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getUserPatternCategories,
getBlockPatternCategories
} = select(external_wp_coreData_namespaceObject.store);
return {
corePatternCategories: getBlockPatternCategories(),
userPatternCategories: getUserPatternCategories()
};
});
const categoryMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Merge the user and core pattern categories and remove any duplicates.
const uniqueCategories = new Map();
[...userPatternCategories, ...corePatternCategories].forEach(category => {
if (!uniqueCategories.has(category.label) &&
// There are two core categories with `Post` label so explicitly remove the one with
// the `query` slug to avoid any confusion.
category.name !== 'query') {
// We need to store the name separately as this is used as the slug in the
// taxonomy and may vary from the label.
uniqueCategories.set(category.label, {
label: category.label,
value: category.label,
name: category.name
});
}
});
return uniqueCategories;
}, [userPatternCategories, corePatternCategories]);
async function onCreate(patternTitle, sync) {
if (!title || isSaving) {
return;
@ -413,9 +430,16 @@ function CreatePatternModal({
*/
async function findOrCreateTerm(term) {
try {
const newTerm = await saveEntityRecord('taxonomy', CATEGORY_SLUG, {
// We need to match any existing term to the correct slug to prevent duplicates, eg.
// the core `Headers` category uses the singular `header` as the slug.
const existingTerm = categoryMap.get(term);
const termData = existingTerm ? {
name: existingTerm.label,
slug: existingTerm.name
} : {
name: term
}, {
};
const newTerm = await saveEntityRecord('taxonomy', CATEGORY_SLUG, termData, {
throwOnError: true
});
invalidateResolution('getUserPatternCategories');
@ -449,8 +473,9 @@ function CreatePatternModal({
placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'),
className: "patterns-create-modal__name-input"
}), (0,external_wp_element_namespaceObject.createElement)(CategorySelector, {
values: categoryTerms,
onChange: setCategoryTerms
categoryTerms: categoryTerms,
onChange: setCategoryTerms,
categoryMap: categoryMap
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Synced'),
help: (0,external_wp_i18n_namespaceObject.__)('Editing the pattern will update it anywhere it is used.'),

File diff suppressed because one or more lines are too long

View File

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