Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Image block: Set image display to grid when no alignment sent to properly align caption on resize - Update and align template descriptions - Site Editor - prevent loading state from showing the admin menu. - Add client side routing for Site Editor - Navigation: Add clearance for appender in submenus. - Fix CSS Custom Properties for presets in the site editor - Add/navigation blocks post processing after migration from menu items - Allow selector ordering to ensure theme.json root selector margin takes precedence - Do not remove theme presets if defaults are hidden - Format library: fix unsetting highlight color - FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity - ColorPalette: Improving accessibility and visibility - Update: Make the color popover on the gradient picker appear as expected - Site Editor: Display a notice if export fails - Fix docs and function naming for gallery block registration in PHP - Switch to addEventListener for load event in the navigation block view script - Fix mistake in _remove_theme_attribute_in_block_template_content - Better synchronisation between Gutenberg and Core code - Move the block page templates hook into compat/5.9 folder - Moves to the template loader hooks and functions into lib/compat folder - Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme - Site Editor: Update support doc URL in Welcome Guide - Global Styles: Add Welcome Guide toggle - Hide remove control point when removing would break gradient control - Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin - Image: Fix resizer controls being hidden in Safari when switching between alignments - Remove Navigation Menus from WP Admin sidebar - Site Editor: Hide the block appender in the Template Part editor - Site Editor: Use server definition for the Template Areas - Synchronize wp_is_block_theme and block-templates block support with Core - E2E: Retry login again after a bad nonce request to prevent intermittent test failures - Fix theme requirement validation with WP 5.8 - Fix WP 5.9 check for conditionally running code - Fix post comment form input width - Border Style Control: Update styling for consistency with border width control - Fix form-submit styles by adding button classes to the submit-button in post-comments block - Site Editor: Fix edit template part link in header dropdown - Move duotone palette to the bottom of global styles gradients - Fix how appearanceTools works - Move WP 5.9 wp-admin menus compatibility code to lib/compat folder - Revert "Site Editor: Set the <title> on the list page to be same as the CPT name" - Site Editor: Document Actions: add SR text to heading 1 - Do not register global styles CPT in WordPress 5.9 - Global Styles: Move the 'Edit colors' button to a standard menu item - Fix styles for previews and patterns - Site Editor: Fix failing E2E test - Templates: Search for old template names in the parent theme too - Remove 4 instances of 'gutenberg' text domain from WordPress core - Fix content loss when ungrouping template parts or reusable blocks - Simplify the RESET_BLOCK action to fix template part focus mode content loss - [Global Styles]: Make Blocks section more distinguishable - Only use block markup for comment form button when using a block theme - Navigation: Fix vertical alignment of page list in modal. - Fix: ToggleGroupControl active state - Remove gutenberg_ prefix from @wordpress/block-library Props ocean90, oandregal, hellofromtonya, youknowriad. See #54487. Built from https://develop.svn.wordpress.org/trunk@52364 git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
120b1ab117
commit
935058d178
|
@ -23,6 +23,8 @@ if ( ! wp_is_block_theme() ) {
|
|||
wp_die( __( 'The theme you are currently using is not compatible with Full Site Editing.' ) );
|
||||
}
|
||||
|
||||
// Used in the HTML title tag.
|
||||
$title = __( 'Editor (beta)' );
|
||||
$parent_file = 'themes.php';
|
||||
|
||||
// Flag that we're loading the block editor.
|
||||
|
@ -56,59 +58,32 @@ $custom_settings = array(
|
|||
$editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context );
|
||||
|
||||
if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) {
|
||||
|
||||
$post_type = get_post_type_object( $_GET['postType'] );
|
||||
|
||||
if ( ! $post_type ) {
|
||||
wp_die( __( 'Invalid post type.' ) );
|
||||
}
|
||||
|
||||
// Used in the HTML title tag.
|
||||
$title = $post_type->labels->name;
|
||||
|
||||
$preload_paths = array(
|
||||
'/',
|
||||
'/wp/v2/types/' . $post_type->name . '?context=edit',
|
||||
'/wp/v2/types?context=edit',
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( $post_type->name ) ),
|
||||
);
|
||||
|
||||
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
|
||||
|
||||
wp_add_inline_script(
|
||||
'wp-edit-site',
|
||||
sprintf(
|
||||
'wp.domReady( function() {
|
||||
wp.editSite.initializeList( "site-editor", "%s", %s );
|
||||
} );',
|
||||
$post_type->name,
|
||||
wp_json_encode( $editor_settings )
|
||||
)
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
// Used in the HTML title tag.
|
||||
$title = __( 'Editor (beta)' );
|
||||
}
|
||||
|
||||
$active_global_styles_id = WP_Theme_JSON_Resolver::get_user_custom_post_type_id();
|
||||
$active_theme = wp_get_theme()->get_stylesheet();
|
||||
$preload_paths = array(
|
||||
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ),
|
||||
array( '/wp/v2/media', 'OPTIONS' ),
|
||||
'/',
|
||||
'/wp/v2/types?context=edit',
|
||||
'/wp/v2/types/wp_template?context=edit',
|
||||
'/wp/v2/types/wp_template-part?context=edit',
|
||||
'/wp/v2/taxonomies?context=edit',
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( 'page' ) ),
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( 'post' ) ),
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_taxonomy_items( 'category' ) ),
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_taxonomy_items( 'post_tag' ) ),
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( 'wp_template' ) ),
|
||||
add_query_arg( 'context', 'edit', rest_get_route_for_post_type_items( 'wp_template_part' ) ),
|
||||
'/wp/v2/pages?context=edit',
|
||||
'/wp/v2/categories?context=edit',
|
||||
'/wp/v2/posts?context=edit',
|
||||
'/wp/v2/tags?context=edit',
|
||||
'/wp/v2/templates?context=edit&per_page=-1',
|
||||
'/wp/v2/template-parts?context=edit&per_page=-1',
|
||||
'/wp/v2/settings',
|
||||
'/wp/v2/themes?context=edit&status=active',
|
||||
'/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit',
|
||||
'/wp/v2/global-styles/' . $active_global_styles_id,
|
||||
'/wp/v2/themes/' . $active_theme . '/global-styles',
|
||||
'/wp/v2/global-styles/themes/' . $active_theme,
|
||||
);
|
||||
|
||||
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
|
||||
|
@ -123,8 +98,6 @@ if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) {
|
|||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// Preload server-registered block schemas.
|
||||
wp_add_inline_script(
|
||||
'wp-blocks',
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -311,7 +311,6 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
|
|||
array(
|
||||
'css' => 'variables',
|
||||
'__unstableType' => 'presets',
|
||||
'__experimentalNoWrapper' => true,
|
||||
),
|
||||
array(
|
||||
'css' => 'presets',
|
||||
|
|
|
@ -41,7 +41,7 @@ function get_block_theme_folders( $theme_stylesheet = null ) {
|
|||
$root_dir = get_theme_root( $theme_name );
|
||||
$theme_dir = "$root_dir/$theme_name";
|
||||
|
||||
if ( is_readable( $theme_dir . '/block-templates/index.html' ) ) {
|
||||
if ( file_exists( $theme_dir . '/block-templates' ) || file_exists( $theme_dir . '/block-template-parts' ) ) {
|
||||
return array(
|
||||
'wp_template' => 'block-templates',
|
||||
'wp_template_part' => 'block-template-parts',
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/gallery` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles backwards compatibility for Gallery Blocks,
|
||||
* whose images feature a `data-id` attribute.
|
||||
*
|
||||
* Now that the Gallery Block contains inner Image Blocks,
|
||||
* we add a custom `data-id` attribute before rendering the gallery
|
||||
* so that the Image Block can pick it up in its render_callback.
|
||||
*
|
||||
* @param array $parsed_block The block being rendered.
|
||||
* @return array The migrated block object.
|
||||
*/
|
||||
function block_core_gallery_data_id_backcompatibility( $parsed_block ) {
|
||||
if ( 'core/gallery' === $parsed_block['blockName'] ) {
|
||||
foreach ( $parsed_block['innerBlocks'] as $key => $inner_block ) {
|
||||
if ( 'core/image' === $inner_block['blockName'] ) {
|
||||
if ( ! isset( $parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] ) && isset( $inner_block['attrs']['id'] ) ) {
|
||||
$parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] = esc_attr( $inner_block['attrs']['id'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $parsed_block;
|
||||
}
|
||||
|
||||
add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' );
|
||||
|
||||
/**
|
||||
* Registers the `core/gallery` block on server.
|
||||
* This render callback needs to be here
|
||||
* so that the gallery styles are loaded in block-based themes.
|
||||
*/
|
||||
function register_block_core_gallery() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/gallery',
|
||||
array(
|
||||
'render_callback' => function ( $attributes, $content ) {
|
||||
return $content;
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'init', 'register_block_core_gallery', 20 );
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Server-side rendering of the `core/image` block.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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 array $content The block content.
|
||||
* @return string Returns the block content with the data-id attribute added.
|
||||
*/
|
||||
function render_block_core_image( $attributes, $content ) {
|
||||
if ( isset( $attributes['data-id'] ) ) {
|
||||
// Add the data-id="$id" attribute to the img element
|
||||
// to provide backwards compatibility for the Gallery Block,
|
||||
// which now wraps Image Blocks within innerBlocks.
|
||||
// The data-id attribute is added in a core/gallery `render_block_data` hook.
|
||||
$data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"';
|
||||
if ( ! strpos( $content, $data_id_attribute ) ) {
|
||||
$content = str_replace( '<img', '<img ' . $data_id_attribute . ' ', $content );
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers the `core/image` block on server.
|
||||
*/
|
||||
function register_block_core_image() {
|
||||
register_block_type_from_metadata(
|
||||
__DIR__ . '/image',
|
||||
array(
|
||||
'render_callback' => 'render_block_core_image',
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_image' );
|
|
@ -137,6 +137,22 @@ figure.wp-block-image:not(.wp-block) {
|
|||
caption-side: bottom;
|
||||
}
|
||||
|
||||
*:not([data-align]) > .wp-block-image {
|
||||
display: grid;
|
||||
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image .components-placeholder {
|
||||
grid-column: placeholder;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
||||
grid-column: image;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > figcaption {
|
||||
grid-column: image;
|
||||
display: table-caption;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
.wp-block[data-align=left] > .wp-block-image {
|
||||
margin-left: 1em;
|
||||
margin-right: 0;
|
||||
|
|
|
@ -1 +1 @@
|
|||
figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;right:50%;margin-top:-9px;margin-right:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;right:0;left:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=right]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=center]>.wp-block-image{margin-right:auto;margin-left:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-right:0;padding-left:0}
|
||||
figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;right:50%;margin-top:-9px;margin-right:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;right:0;left:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}:not([data-align])>.wp-block-image{display:grid;grid-template-columns:[image] minmax(0,max-content) [placeholder] auto}:not([data-align])>.wp-block-image .components-placeholder{grid-column:placeholder}:not([data-align])>.wp-block-image>div:not(.components-placeholder){grid-column:image}:not([data-align])>.wp-block-image>figcaption{grid-column:image;display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=right]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=center]>.wp-block-image{margin-right:auto;margin-left:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-right:0;padding-left:0}
|
|
@ -137,6 +137,22 @@ figure.wp-block-image:not(.wp-block) {
|
|||
caption-side: bottom;
|
||||
}
|
||||
|
||||
*:not([data-align]) > .wp-block-image {
|
||||
display: grid;
|
||||
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image .components-placeholder {
|
||||
grid-column: placeholder;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
||||
grid-column: image;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > figcaption {
|
||||
grid-column: image;
|
||||
display: table-caption;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
.wp-block[data-align=left] > .wp-block-image {
|
||||
margin-right: 1em;
|
||||
margin-left: 0;
|
||||
|
|
|
@ -1 +1 @@
|
|||
figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;left:50%;margin-top:-9px;margin-left:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;left:0;right:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=right]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=center]>.wp-block-image{margin-left:auto;margin-right:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-left:0;padding-right:0}
|
||||
figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;left:50%;margin-top:-9px;margin-left:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;left:0;right:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}:not([data-align])>.wp-block-image{display:grid;grid-template-columns:[image] minmax(0,max-content) [placeholder] auto}:not([data-align])>.wp-block-image .components-placeholder{grid-column:placeholder}:not([data-align])>.wp-block-image>div:not(.components-placeholder){grid-column:image}:not([data-align])>.wp-block-image>figcaption{grid-column:image;display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=right]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=center]>.wp-block-image{margin-left:auto;margin-right:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-left:0;padding-right:0}
|
|
@ -11,6 +11,8 @@ require ABSPATH . WPINC . '/blocks/block.php';
|
|||
require ABSPATH . WPINC . '/blocks/calendar.php';
|
||||
require ABSPATH . WPINC . '/blocks/categories.php';
|
||||
require ABSPATH . WPINC . '/blocks/file.php';
|
||||
require ABSPATH . WPINC . '/blocks/gallery.php';
|
||||
require ABSPATH . WPINC . '/blocks/image.php';
|
||||
require ABSPATH . WPINC . '/blocks/latest-comments.php';
|
||||
require ABSPATH . WPINC . '/blocks/latest-posts.php';
|
||||
require ABSPATH . WPINC . '/blocks/legacy-widget.php';
|
||||
|
@ -64,11 +66,9 @@ function register_core_block_types_from_metadata() {
|
|||
'cover',
|
||||
'embed',
|
||||
'freeform',
|
||||
'gallery',
|
||||
'group',
|
||||
'heading',
|
||||
'html',
|
||||
'image',
|
||||
'list',
|
||||
'media-text',
|
||||
'missing',
|
||||
|
|
|
@ -188,6 +188,12 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|||
);
|
||||
}
|
||||
|
||||
$aria_label = sprintf(
|
||||
/* translators: Accessibility text. %s: Parent page title. */
|
||||
__( '%s submenu' ),
|
||||
$label
|
||||
);
|
||||
|
||||
$html = '<li ' . $wrapper_attributes . '>';
|
||||
|
||||
// If Submenus open on hover, we render an anchor tag with attributes.
|
||||
|
@ -226,11 +232,11 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|||
if ( $show_submenu_indicators ) {
|
||||
// The submenu icon is rendered in a button here
|
||||
// so that there's a clickable elment to open the submenu.
|
||||
$html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
|
||||
$html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
|
||||
}
|
||||
} else {
|
||||
// If menus open on click, we render the parent as a button.
|
||||
$html .= '<button aria-label="' . $label . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
||||
$html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
||||
|
||||
// Wrap title with span to isolate it from submenu icon.
|
||||
$html .= '<span class="wp-block-navigation-item__label">';
|
||||
|
|
|
@ -137,6 +137,15 @@
|
|||
visibility: visible;
|
||||
}
|
||||
|
||||
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
||||
display: block;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.wp-block-navigation__submenu-container .block-list-appender {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Colors Selector component
|
||||
*/
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -137,6 +137,15 @@
|
|||
visibility: visible;
|
||||
}
|
||||
|
||||
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
||||
display: block;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.wp-block-navigation__submenu-container .block-list-appender {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Colors Selector component
|
||||
*/
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -359,6 +359,7 @@ button.wp-block-navigation-item__content {
|
|||
padding: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -359,6 +359,7 @@ button.wp-block-navigation-item__content {
|
|||
padding: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => '37dc06be3966f1583d5594ebf12956ed');
|
||||
<?php return array('dependencies' => array(), 'version' => '9d620afb4e0a01af65cf6ea7a2578d8f');
|
|
@ -145,7 +145,7 @@ function toggleSubmenuOnClick(event) {
|
|||
// scripts could be loaded before the body.
|
||||
|
||||
|
||||
window.onload = () => {
|
||||
window.addEventListener('load', () => {
|
||||
micromodal_es.init({
|
||||
onShow: navigationToggleModal,
|
||||
onClose: navigationToggleModal,
|
||||
|
@ -173,7 +173,7 @@ window.onload = () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => 'f3cbbfbf9b9c434c39d6f77037d5267c');
|
||||
<?php return array('dependencies' => array(), 'version' => 'd5ab04a497b4f1465f1f0060b6b71ae3');
|
File diff suppressed because one or more lines are too long
|
@ -174,11 +174,16 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
|||
}
|
||||
|
||||
$title = wp_kses( $page['title'], wp_kses_allowed_html( 'post' ) );
|
||||
$aria_label = sprintf(
|
||||
/* translators: Accessibility text. %s: Parent page title. */
|
||||
__( '%s submenu' ),
|
||||
$title
|
||||
);
|
||||
|
||||
$markup .= '<li class="wp-block-pages-list__item' . $css_class . '"' . $style_attribute . '>';
|
||||
|
||||
if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) {
|
||||
$markup .= '<button aria-label="' . $title . ' ' . __( 'submenu', 'gutenberg' ) . '" class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . $title . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
|
||||
$markup .= '<button aria-label="' . $aria_label . '" class="' . $navigation_child_content_class . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . $title . '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>' .
|
||||
'</button>';
|
||||
} else {
|
||||
$markup .= '<a class="wp-block-pages-list__item__link' . $navigation_child_content_class . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>';
|
||||
|
@ -186,7 +191,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
|||
|
||||
if ( isset( $page['children'] ) ) {
|
||||
if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) {
|
||||
$markup .= '<button aria-label="' . $title . ' ' . __( 'submenu', 'gutenberg' ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
||||
$markup .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">';
|
||||
$markup .= '<span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
|
||||
$markup .= '</button>';
|
||||
}
|
||||
|
|
|
@ -66,3 +66,20 @@ function register_block_core_post_comments() {
|
|||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_comments' );
|
||||
|
||||
/**
|
||||
* 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_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_block_form_defaults' );
|
||||
|
|
|
@ -30,5 +30,9 @@
|
|||
"link": true
|
||||
}
|
||||
},
|
||||
"style": "wp-block-post-comments"
|
||||
"style": [
|
||||
"wp-block-post-comments",
|
||||
"wp-block-buttons",
|
||||
"wp-block-button"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -125,7 +125,9 @@
|
|||
display: block;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
.wp-block-post-comments .comment-form-comment textarea {
|
||||
.wp-block-post-comments .comment-form textarea,
|
||||
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -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:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5;margin-right:-3.25em}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{line-height:1.5;margin-right:-3.25em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.75em}.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-comment textarea{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:.75em;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>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:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5;margin-right:-3.25em}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{line-height:1.5;margin-right:-3.25em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.75em}.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:.75em;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}
|
|
@ -125,7 +125,9 @@
|
|||
display: block;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
.wp-block-post-comments .comment-form-comment textarea {
|
||||
.wp-block-post-comments .comment-form textarea,
|
||||
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -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:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5;margin-left:-3.25em}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{line-height:1.5;margin-left:-3.25em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.75em}.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-comment textarea{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:.75em;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>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:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5;margin-left:-3.25em}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{line-height:1.5;margin-left:-3.25em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.75em}.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:.75em;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}
|
|
@ -64,8 +64,11 @@ function render_block_core_template_part( $attributes ) {
|
|||
} else {
|
||||
// Else, if the template part was provided by the active theme,
|
||||
// render the corresponding file content.
|
||||
$theme_folders = get_block_theme_folders();
|
||||
$template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
||||
$parent_theme_folders = get_block_theme_folders( get_template() );
|
||||
$child_theme_folders = get_block_theme_folders( get_stylesheet() );
|
||||
$child_theme_part_file_path = get_theme_file_path( '/' . $child_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
||||
$parent_theme_part_file_path = get_theme_file_path( '/' . $parent_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
||||
$template_part_file_path = 0 === validate_file( $attributes['slug'] ) && file_exists( $child_theme_part_file_path ) ? $child_theme_part_file_path : $parent_theme_part_file_path;
|
||||
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
|
||||
$content = file_get_contents( $template_part_file_path );
|
||||
$content = is_string( $content ) && '' !== $content
|
||||
|
|
|
@ -107,7 +107,7 @@ class WP_Theme_JSON {
|
|||
const PRESETS_METADATA = array(
|
||||
array(
|
||||
'path' => array( 'color', 'palette' ),
|
||||
'override' => false,
|
||||
'override' => array( 'color', 'defaultPalette' ),
|
||||
'value_key' => 'color',
|
||||
'css_vars' => '--wp--preset--color--$slug',
|
||||
'classes' => array(
|
||||
|
@ -119,7 +119,7 @@ class WP_Theme_JSON {
|
|||
),
|
||||
array(
|
||||
'path' => array( 'color', 'gradients' ),
|
||||
'override' => false,
|
||||
'override' => array( 'color', 'defaultGradients' ),
|
||||
'value_key' => 'gradient',
|
||||
'css_vars' => '--wp--preset--gradient--$slug',
|
||||
'classes' => array( '.has-$slug-gradient-background' => 'background' ),
|
||||
|
@ -397,13 +397,16 @@ class WP_Theme_JSON {
|
|||
private static function maybe_opt_in_into_settings( $theme_json ) {
|
||||
$new_theme_json = $theme_json;
|
||||
|
||||
if ( isset( $new_theme_json['settings']['appearanceTools'] ) ) {
|
||||
if (
|
||||
isset( $new_theme_json['settings']['appearanceTools'] ) &&
|
||||
true === $new_theme_json['settings']['appearanceTools']
|
||||
) {
|
||||
self::do_opt_in_into_settings( $new_theme_json['settings'] );
|
||||
}
|
||||
|
||||
if ( isset( $new_theme_json['settings']['blocks'] ) && is_array( $new_theme_json['settings']['blocks'] ) ) {
|
||||
foreach ( $new_theme_json['settings']['blocks'] as &$block ) {
|
||||
if ( isset( $block['appearanceTools'] ) ) {
|
||||
if ( isset( $block['appearanceTools'] ) && ( true === $block['appearanceTools'] ) ) {
|
||||
self::do_opt_in_into_settings( $block );
|
||||
}
|
||||
}
|
||||
|
@ -433,7 +436,9 @@ class WP_Theme_JSON {
|
|||
);
|
||||
|
||||
foreach ( $to_opt_in as $path ) {
|
||||
if ( null === _wp_array_get( $context, $path, null ) ) {
|
||||
// Use "unset prop" as a marker instead of "null" because
|
||||
// "null" can be a valid value for some props (e.g. blockGap).
|
||||
if ( 'unset prop' === _wp_array_get( $context, $path, 'unset prop' ) ) {
|
||||
_wp_array_set( $context, $path, true );
|
||||
}
|
||||
}
|
||||
|
@ -1502,9 +1507,9 @@ class WP_Theme_JSON {
|
|||
* we remove it from the theme presets.
|
||||
*/
|
||||
$nodes = self::get_setting_nodes( $incoming_data );
|
||||
$slugs_global = self::get_slugs_not_to_override( $this->theme_json );
|
||||
$slugs_global = self::get_default_slugs( $this->theme_json, array( 'settings' ) );
|
||||
foreach ( $nodes as $node ) {
|
||||
$slugs_node = self::get_slugs_not_to_override( $this->theme_json, $node['path'] );
|
||||
$slugs_node = self::get_default_slugs( $this->theme_json, $node['path'] );
|
||||
$slugs = array_merge_recursive( $slugs_global, $slugs_node );
|
||||
|
||||
// Replace the spacing.units.
|
||||
|
@ -1516,6 +1521,8 @@ class WP_Theme_JSON {
|
|||
|
||||
// Replace the presets.
|
||||
foreach ( self::PRESETS_METADATA as $preset ) {
|
||||
$override_preset = self::should_override_preset( $this->theme_json, $node['path'], $preset['override'] );
|
||||
|
||||
foreach ( self::VALID_ORIGINS as $origin ) {
|
||||
$path = array_merge( $node['path'], $preset['path'], array( $origin ) );
|
||||
$content = _wp_array_get( $incoming_data, $path, null );
|
||||
|
@ -1525,13 +1532,12 @@ class WP_Theme_JSON {
|
|||
|
||||
if (
|
||||
( 'theme' !== $origin ) ||
|
||||
( 'theme' === $origin && $preset['override'] )
|
||||
( 'theme' === $origin && $override_preset )
|
||||
) {
|
||||
_wp_array_set( $this->theme_json, $path, $content );
|
||||
}
|
||||
|
||||
if ( 'theme' === $origin && ! $preset['override'] ) {
|
||||
$content = self::filter_slugs( $content, $preset['path'], $slugs );
|
||||
} else {
|
||||
$slugs_for_preset = _wp_array_get( $slugs, $preset['path'], array() );
|
||||
$content = self::filter_slugs( $content, $slugs_for_preset );
|
||||
_wp_array_set( $this->theme_json, $path, $content );
|
||||
}
|
||||
}
|
||||
|
@ -1540,8 +1546,50 @@ class WP_Theme_JSON {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the slugs for all the presets that cannot be overriden
|
||||
* in the given path. It returns an associative array
|
||||
* Returns whether a presets should be overriden or not.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @param array $theme_json The theme.json like structure to inspect.
|
||||
* @param array $path Path to inspect.
|
||||
* @param bool|array $override Data to compute whether to override the preset.
|
||||
* @return boolean
|
||||
*/
|
||||
private static function should_override_preset( $theme_json, $path, $override ) {
|
||||
if ( is_bool( $override ) ) {
|
||||
return $override;
|
||||
}
|
||||
|
||||
/*
|
||||
* The relationship between whether to override the defaults
|
||||
* and whether the defaults are enabled is inverse:
|
||||
*
|
||||
* - If defaults are enabled => theme presets should not be overriden
|
||||
* - If defaults are disabled => theme presets should be overriden
|
||||
*
|
||||
* For example, a theme sets defaultPalette to false,
|
||||
* making the default palette hidden from the user.
|
||||
* In that case, we want all the theme presets to be present,
|
||||
* so they should override the defaults.
|
||||
*/
|
||||
if ( is_array( $override ) ) {
|
||||
$value = _wp_array_get( $theme_json, array_merge( $path, $override ) );
|
||||
if ( isset( $value ) ) {
|
||||
return ! $value;
|
||||
}
|
||||
|
||||
// Search the top-level key if none was found for this node.
|
||||
$value = _wp_array_get( $theme_json, array_merge( array( 'settings' ), $override ) );
|
||||
if ( isset( $value ) ) {
|
||||
return ! $value;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default slugs for all the presets in an associative array
|
||||
* whose keys are the preset paths and the leafs is the list of slugs.
|
||||
*
|
||||
* For example:
|
||||
|
@ -1555,26 +1603,23 @@ class WP_Theme_JSON {
|
|||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @param array $data A theme.json like structure to inspect.
|
||||
* @param array $node_path The path to inspect. Default `array( 'settings' )`.
|
||||
* @return array An associative array containing the slugs for the given path.
|
||||
* @param array $data A theme.json like structure.
|
||||
* @param array $node_path The path to inspect. It's 'settings' by default.
|
||||
* @return array
|
||||
*/
|
||||
private static function get_slugs_not_to_override( $data, $node_path = array( 'settings' ) ) {
|
||||
private static function get_default_slugs( $data, $node_path ) {
|
||||
$slugs = array();
|
||||
foreach ( self::PRESETS_METADATA as $metadata ) {
|
||||
if ( $metadata['override'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$slugs_for_preset = array();
|
||||
foreach ( self::PRESETS_METADATA as $metadata ) {
|
||||
$path = array_merge( $node_path, $metadata['path'], array( 'default' ) );
|
||||
$preset = _wp_array_get( $data, $path, null );
|
||||
if ( ! isset( $preset ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$slugs_for_preset = array();
|
||||
$slugs_for_preset = array_map(
|
||||
function( $value ) {
|
||||
static function( $value ) {
|
||||
return isset( $value['slug'] ) ? $value['slug'] : null;
|
||||
},
|
||||
$preset
|
||||
|
@ -1591,19 +1636,17 @@ class WP_Theme_JSON {
|
|||
* @since 5.9.0
|
||||
*
|
||||
* @param array $node The node with the presets to validate.
|
||||
* @param array $path The path to the preset type to inspect.
|
||||
* @param array $slugs The slugs that should not be overriden.
|
||||
* @return array The new node.
|
||||
*/
|
||||
private static function filter_slugs( $node, $path, $slugs ) {
|
||||
$slugs_for_preset = _wp_array_get( $slugs, $path, array() );
|
||||
if ( empty( $slugs_for_preset ) ) {
|
||||
private static function filter_slugs( $node, $slugs ) {
|
||||
if ( empty( $slugs ) ) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
$new_node = array();
|
||||
foreach ( $node as $value ) {
|
||||
if ( isset( $value['slug'] ) && ! in_array( $value['slug'], $slugs_for_preset, true ) ) {
|
||||
if ( isset( $value['slug'] ) && ! in_array( $value['slug'], $slugs, true ) ) {
|
||||
$new_node[] = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1698,8 +1698,9 @@
|
|||
}
|
||||
|
||||
.components-border-style-control legend {
|
||||
line-height: 1.2;
|
||||
padding-bottom: 4px;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
.components-border-style-control .components-border-style-control__buttons {
|
||||
display: inline-flex;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1698,8 +1698,9 @@
|
|||
}
|
||||
|
||||
.components-border-style-control legend {
|
||||
line-height: 1.2;
|
||||
padding-bottom: 4px;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 8px;
|
||||
padding: 0;
|
||||
}
|
||||
.components-border-style-control .components-border-style-control__buttons {
|
||||
display: inline-flex;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1005,6 +1005,22 @@ figure.wp-block-image:not(.wp-block) {
|
|||
caption-side: bottom;
|
||||
}
|
||||
|
||||
*:not([data-align]) > .wp-block-image {
|
||||
display: grid;
|
||||
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image .components-placeholder {
|
||||
grid-column: placeholder;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
||||
grid-column: image;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > figcaption {
|
||||
grid-column: image;
|
||||
display: table-caption;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
.wp-block[data-align=left] > .wp-block-image {
|
||||
margin-left: 1em;
|
||||
margin-right: 0;
|
||||
|
@ -1219,6 +1235,15 @@ figure.wp-block-image:not(.wp-block) {
|
|||
visibility: visible;
|
||||
}
|
||||
|
||||
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
||||
display: block;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.wp-block-navigation__submenu-container .block-list-appender {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Colors Selector component
|
||||
*/
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1010,6 +1010,22 @@ figure.wp-block-image:not(.wp-block) {
|
|||
caption-side: bottom;
|
||||
}
|
||||
|
||||
*:not([data-align]) > .wp-block-image {
|
||||
display: grid;
|
||||
grid-template-columns: [image] minmax(0, max-content) [placeholder] auto;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image .components-placeholder {
|
||||
grid-column: placeholder;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > div:not(.components-placeholder) {
|
||||
grid-column: image;
|
||||
}
|
||||
*:not([data-align]) > .wp-block-image > figcaption {
|
||||
grid-column: image;
|
||||
display: table-caption;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
.wp-block[data-align=left] > .wp-block-image {
|
||||
margin-right: 1em;
|
||||
margin-left: 0;
|
||||
|
@ -1224,6 +1240,15 @@ figure.wp-block-image:not(.wp-block) {
|
|||
visibility: visible;
|
||||
}
|
||||
|
||||
.is-editing > .wp-block-navigation__submenu-container > .block-list-appender {
|
||||
display: block;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.wp-block-navigation__submenu-container .block-list-appender {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Colors Selector component
|
||||
*/
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1771,6 +1771,7 @@ button.wp-block-navigation-item__content {
|
|||
padding: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
@ -2055,7 +2056,9 @@ p.has-background {
|
|||
display: block;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
.wp-block-post-comments .comment-form-comment textarea {
|
||||
.wp-block-post-comments .comment-form textarea,
|
||||
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -2120,12 +2123,12 @@ p.has-background {
|
|||
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
||||
padding: calc(0.667em + 2px);
|
||||
}
|
||||
.wp-block-post-comments-form .comment-form-comment textarea {
|
||||
.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-comment label,
|
||||
.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 {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1793,6 +1793,7 @@ button.wp-block-navigation-item__content {
|
|||
padding: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
@ -2077,7 +2078,9 @@ p.has-background {
|
|||
display: block;
|
||||
margin-bottom: 0.25em;
|
||||
}
|
||||
.wp-block-post-comments .comment-form-comment textarea {
|
||||
.wp-block-post-comments .comment-form textarea,
|
||||
.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]) {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -2142,12 +2145,12 @@ p.has-background {
|
|||
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) {
|
||||
padding: calc(0.667em + 2px);
|
||||
}
|
||||
.wp-block-post-comments-form .comment-form-comment textarea {
|
||||
.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-comment label,
|
||||
.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 {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -771,6 +771,10 @@ svg.components-checkbox-control__checked {
|
|||
padding: 8px;
|
||||
}
|
||||
|
||||
.components-dropdown-menu__menu .components-palette-edit__menu-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.component-color-indicator {
|
||||
width: 25px;
|
||||
height: 16px;
|
||||
|
@ -875,9 +879,9 @@ input.components-combobox-control__input[type=text]:focus {
|
|||
}
|
||||
|
||||
.components-color-palette__custom-color {
|
||||
position: relative;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: 0;
|
||||
display: block;
|
||||
border-radius: 2px;
|
||||
height: 48px;
|
||||
|
@ -889,6 +893,12 @@ input.components-combobox-control__input[type=text]:focus {
|
|||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
.components-color-palette__custom-color:focus {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
outline-width: 2px;
|
||||
}
|
||||
|
||||
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -771,6 +771,10 @@ svg.components-checkbox-control__checked {
|
|||
padding: 8px;
|
||||
}
|
||||
|
||||
.components-dropdown-menu__menu .components-palette-edit__menu-button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.component-color-indicator {
|
||||
width: 25px;
|
||||
height: 16px;
|
||||
|
@ -875,9 +879,9 @@ input.components-combobox-control__input[type=text]:focus {
|
|||
}
|
||||
|
||||
.components-color-palette__custom-color {
|
||||
position: relative;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: 0;
|
||||
display: block;
|
||||
border-radius: 2px;
|
||||
height: 48px;
|
||||
|
@ -889,6 +893,12 @@ input.components-combobox-control__input[type=text]:focus {
|
|||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
outline: 1px solid transparent;
|
||||
}
|
||||
.components-color-palette__custom-color:focus {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
outline-width: 2px;
|
||||
}
|
||||
|
||||
.components-dropdown__content.components-color-palette__custom-color-dropdown-content .components-popover__content {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1122,16 +1122,11 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|||
}
|
||||
.edit-site .edit-site-list .interface-interface-skeleton__content {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.edit-site-list-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.edit-site-list-main {
|
||||
.edit-site .edit-site-list .interface-interface-skeleton__content {
|
||||
padding: 72px;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1122,16 +1122,11 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|||
}
|
||||
.edit-site .edit-site-list .interface-interface-skeleton__content {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.edit-site-list-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
}
|
||||
@media (min-width: 782px) {
|
||||
.edit-site-list-main {
|
||||
.edit-site .edit-site-list .interface-interface-skeleton__content {
|
||||
padding: 72px;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -563,6 +563,7 @@ add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_
|
|||
add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' );
|
||||
add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
|
||||
add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' );
|
||||
add_action( 'enqueue_block_editor_assets', 'wp_enqueue_global_styles_css_custom_properties' );
|
||||
add_action( 'admin_print_scripts-index.php', 'wp_localize_community_events' );
|
||||
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
|
||||
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
|
||||
|
|
|
@ -17593,40 +17593,6 @@ function getFlattenedBlocksWithoutAttributes(blocks) {
|
|||
function getFlattenedBlockAttributes(blocks) {
|
||||
return flattenBlocks(blocks, block => block.attributes);
|
||||
}
|
||||
/**
|
||||
* Given a block order map object, returns *all* of the block client IDs that are
|
||||
* a descendant of the given root client ID.
|
||||
*
|
||||
* Calling this with `rootClientId` set to `''` results in a list of client IDs
|
||||
* that are in the post. That is, it excludes blocks like fetched reusable
|
||||
* blocks which are stored into state but not visible. It also excludes
|
||||
* InnerBlocks controllers, like template parts.
|
||||
*
|
||||
* It is important to exclude the full inner block controller and not just the
|
||||
* inner blocks because in many cases, we need to persist the previous value of
|
||||
* an inner block controller. To do so, it must be excluded from the list of
|
||||
* client IDs which are considered to be part of the top-level entity.
|
||||
*
|
||||
* @param {Object} blocksOrder Object that maps block client IDs to a list of
|
||||
* nested block client IDs.
|
||||
* @param {?string} rootClientId The root client ID to search. Defaults to ''.
|
||||
* @param {?Object} controlledInnerBlocks The InnerBlocks controller state.
|
||||
*
|
||||
* @return {Array} List of descendant client IDs.
|
||||
*/
|
||||
|
||||
|
||||
function getNestedBlockClientIds(blocksOrder) {
|
||||
let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||
let controlledInnerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
return Object(external_lodash_["reduce"])(blocksOrder[rootClientId], (result, clientId) => {
|
||||
if (!!controlledInnerBlocks[clientId]) {
|
||||
return result;
|
||||
}
|
||||
|
||||
return [...result, clientId, ...getNestedBlockClientIds(blocksOrder, clientId)];
|
||||
}, []);
|
||||
}
|
||||
/**
|
||||
* Returns an object against which it is safe to perform mutating operations,
|
||||
* given the original object and its current working copy.
|
||||
|
@ -17803,7 +17769,10 @@ const withBlockTree = reducer => function () {
|
|||
case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
|
||||
{
|
||||
const subTree = buildBlockTree(newState, action.blocks);
|
||||
newState.tree = updateParentInnerBlocksInTree(newState, { ...Object(external_lodash_["omit"])(newState.tree, action.replacedClientIds.concat(action.replacedClientIds.map(clientId => 'controlled||' + clientId))),
|
||||
newState.tree = updateParentInnerBlocksInTree(newState, { ...Object(external_lodash_["omit"])(newState.tree, action.replacedClientIds.concat( // Controlled inner blocks are only removed
|
||||
// if the block doesn't move to another position
|
||||
// otherwise their content will be lost.
|
||||
action.replacedClientIds.filter(clientId => !subTree[clientId]).map(clientId => 'controlled||' + clientId))),
|
||||
...subTree
|
||||
}, action.blocks.map(b => b.clientId), false); // If there are no replaced blocks, it means we're removing blocks so we need to update their parent.
|
||||
|
||||
|
@ -18017,56 +17986,15 @@ const withInnerBlocksRemoveCascade = reducer => (state, action) => {
|
|||
|
||||
const withBlockReset = reducer => (state, action) => {
|
||||
if (action.type === 'RESET_BLOCKS') {
|
||||
var _state$order, _state$controlledInne, _state$controlledInne2;
|
||||
|
||||
/**
|
||||
* A list of client IDs associated with the top level entity (like a
|
||||
* post or template). It excludes the client IDs of blocks associated
|
||||
* with other entities, like inner block controllers or reusable blocks.
|
||||
*/
|
||||
const visibleClientIds = getNestedBlockClientIds((_state$order = state === null || state === void 0 ? void 0 : state.order) !== null && _state$order !== void 0 ? _state$order : {}, '', (_state$controlledInne = state === null || state === void 0 ? void 0 : state.controlledInnerBlocks) !== null && _state$controlledInne !== void 0 ? _state$controlledInne : {}); // pickBy returns only the truthy values from controlledInnerBlocks
|
||||
|
||||
const controlledInnerBlocks = Object.keys(Object(external_lodash_["pickBy"])((_state$controlledInne2 = state === null || state === void 0 ? void 0 : state.controlledInnerBlocks) !== null && _state$controlledInne2 !== void 0 ? _state$controlledInne2 : {}));
|
||||
/**
|
||||
* Each update operation consists of a few parts:
|
||||
* 1. First, the client IDs associated with the top level entity are
|
||||
* removed from the existing state key, leaving in place controlled
|
||||
* blocks (like reusable blocks and inner block controllers).
|
||||
* 2. Second, the blocks from the reset action are used to calculate the
|
||||
* individual state keys. This will re-populate the clientIDs which
|
||||
* were removed in step 1.
|
||||
* 3. In some cases, we remove the recalculated inner block controllers,
|
||||
* letting their old values persist. We need to do this because the
|
||||
* reset block action from a top-level entity is not aware of any
|
||||
* inner blocks inside InnerBlock controllers. So if the new values
|
||||
* were used, it would not take into account the existing InnerBlocks
|
||||
* which already exist in the state for inner block controllers. For
|
||||
* example, `attributes` uses the newly computed value for controllers
|
||||
* since attributes are stored in the top-level entity. But `order`
|
||||
* uses the previous value for the controllers since the new value
|
||||
* does not include the order of controlled inner blocks. So if the
|
||||
* new value was used, template parts would disappear from the editor
|
||||
* whenever you try to undo a change in the top level entity.
|
||||
*/
|
||||
|
||||
const newState = { ...state,
|
||||
byClientId: { ...Object(external_lodash_["omit"])(state === null || state === void 0 ? void 0 : state.byClientId, visibleClientIds),
|
||||
...getFlattenedBlocksWithoutAttributes(action.blocks)
|
||||
},
|
||||
attributes: { ...Object(external_lodash_["omit"])(state === null || state === void 0 ? void 0 : state.attributes, visibleClientIds),
|
||||
...getFlattenedBlockAttributes(action.blocks)
|
||||
},
|
||||
order: { ...Object(external_lodash_["omit"])(state === null || state === void 0 ? void 0 : state.order, visibleClientIds),
|
||||
...Object(external_lodash_["omit"])(mapBlockOrder(action.blocks), controlledInnerBlocks)
|
||||
},
|
||||
parents: { ...Object(external_lodash_["omit"])(state === null || state === void 0 ? void 0 : state.parents, visibleClientIds),
|
||||
...mapBlockParents(action.blocks)
|
||||
},
|
||||
controlledInnerBlocks: (state === null || state === void 0 ? void 0 : state.controlledInnerBlocks) || {}
|
||||
byClientId: getFlattenedBlocksWithoutAttributes(action.blocks),
|
||||
attributes: getFlattenedBlockAttributes(action.blocks),
|
||||
order: mapBlockOrder(action.blocks),
|
||||
parents: mapBlockParents(action.blocks),
|
||||
controlledInnerBlocks: {}
|
||||
};
|
||||
const subTree = buildBlockTree(newState, action.blocks);
|
||||
newState.tree = { ...Object(external_lodash_["omit"])(state === null || state === void 0 ? void 0 : state.tree, visibleClientIds),
|
||||
...subTree,
|
||||
newState.tree = { ...subTree,
|
||||
// Root
|
||||
'': {
|
||||
innerBlocks: action.blocks.map(subBlock => subTree[subBlock.clientId])
|
||||
|
@ -32179,6 +32107,7 @@ function ColorGradientControlInner(_ref) {
|
|||
gradients,
|
||||
disableCustomGradients,
|
||||
__experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
|
||||
__experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
|
||||
clearable: clearable
|
||||
}))));
|
||||
}
|
||||
|
@ -47094,12 +47023,11 @@ const transformStyles = function (styles) {
|
|||
return Object(external_lodash_["map"])(styles, _ref => {
|
||||
let {
|
||||
css,
|
||||
baseURL,
|
||||
__experimentalNoWrapper = false
|
||||
baseURL
|
||||
} = _ref;
|
||||
const transforms = [];
|
||||
|
||||
if (wrapperClassName && !__experimentalNoWrapper) {
|
||||
if (wrapperClassName) {
|
||||
transforms.push(transforms_wrap(wrapperClassName));
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1844,6 +1844,7 @@ const WP_EMBED_TYPE = 'wp-embed';
|
|||
|
||||
// EXTERNAL MODULE: external "lodash"
|
||||
var external_lodash_ = __webpack_require__("YLtl");
|
||||
var external_lodash_default = /*#__PURE__*/__webpack_require__.n(external_lodash_);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
|
||||
var dedupe = __webpack_require__("A/WM");
|
||||
|
@ -16070,6 +16071,8 @@ function useClientWidth(ref, dependencies) {
|
|||
|
||||
|
||||
function Image(_ref) {
|
||||
var _imageRef$current3;
|
||||
|
||||
let {
|
||||
temporaryURL,
|
||||
attributes: {
|
||||
|
@ -16099,6 +16102,7 @@ function Image(_ref) {
|
|||
context,
|
||||
clientId
|
||||
} = _ref;
|
||||
const imageRef = Object(external_wp_element_["useRef"])();
|
||||
const captionRef = Object(external_wp_element_["useRef"])();
|
||||
const prevUrl = Object(external_wp_compose_["usePrevious"])(url);
|
||||
const {
|
||||
|
@ -16153,9 +16157,9 @@ function Image(_ref) {
|
|||
const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
|
||||
const isWideAligned = Object(external_lodash_["includes"])(['wide', 'full'], align);
|
||||
const [{
|
||||
naturalWidth,
|
||||
naturalHeight
|
||||
}, setNaturalSize] = Object(external_wp_element_["useState"])({});
|
||||
loadedNaturalWidth,
|
||||
loadedNaturalHeight
|
||||
}, setLoadedNaturalSize] = Object(external_wp_element_["useState"])({});
|
||||
const [isEditingImage, setIsEditingImage] = Object(external_wp_element_["useState"])(false);
|
||||
const [externalBlob, setExternalBlob] = Object(external_wp_element_["useState"])();
|
||||
const clientWidth = useClientWidth(containerRef, [align]);
|
||||
|
@ -16194,7 +16198,22 @@ function Image(_ref) {
|
|||
if (url && !prevUrl && isSelected) {
|
||||
captionRef.current.focus();
|
||||
}
|
||||
}, [url, prevUrl]);
|
||||
}, [url, prevUrl]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural
|
||||
// width and height. This resolves an issue in Safari where the loaded natural
|
||||
// witdth and height is otherwise lost when switching between alignments.
|
||||
// See: https://github.com/WordPress/gutenberg/pull/37210.
|
||||
|
||||
const {
|
||||
naturalWidth,
|
||||
naturalHeight
|
||||
} = Object(external_wp_element_["useMemo"])(() => {
|
||||
var _imageRef$current, _imageRef$current2;
|
||||
|
||||
return {
|
||||
naturalWidth: ((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth) || loadedNaturalWidth || undefined,
|
||||
naturalHeight: ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight) || loadedNaturalHeight || undefined
|
||||
};
|
||||
}, [loadedNaturalWidth, loadedNaturalHeight, (_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.complete]);
|
||||
|
||||
function onResizeStart() {
|
||||
toggleSelection(false);
|
||||
|
@ -16388,8 +16407,14 @@ function Image(_ref) {
|
|||
alt: defaultedAlt,
|
||||
onError: () => onImageError(),
|
||||
onLoad: event => {
|
||||
setNaturalSize(Object(external_lodash_["pick"])(event.target, ['naturalWidth', 'naturalHeight']));
|
||||
}
|
||||
var _event$target, _event$target2;
|
||||
|
||||
setLoadedNaturalSize({
|
||||
loadedNaturalWidth: (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.naturalWidth,
|
||||
loadedNaturalHeight: (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.naturalHeight
|
||||
});
|
||||
},
|
||||
ref: imageRef
|
||||
}), temporaryURL && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))
|
||||
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
|
||||
;
|
||||
|
@ -20873,6 +20898,7 @@ const PlaceholderPreview = _ref => {
|
|||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convert a flat menu item structure to a nested blocks structure.
|
||||
*
|
||||
|
@ -20887,7 +20913,8 @@ function menuItemsToBlocks(menuItems) {
|
|||
}
|
||||
|
||||
const menuTree = createDataTree(menuItems);
|
||||
return mapMenuItemsToBlocks(menuTree);
|
||||
const blocks = mapMenuItemsToBlocks(menuTree);
|
||||
return Object(external_wp_hooks_["applyFilters"])('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
|
||||
}
|
||||
/**
|
||||
* A recursive function that maps menu item nodes to blocks.
|
||||
|
@ -21590,6 +21617,7 @@ function NavigationInnerBlocks(_ref) {
|
|||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -21623,7 +21651,11 @@ function NavigationMenuSelector(_ref) {
|
|||
})
|
||||
})), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
onClick: onCreateNew
|
||||
}, Object(external_wp_i18n_["__"])('Create new menu'))));
|
||||
}, Object(external_wp_i18n_["__"])('Create new menu')), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
href: Object(external_wp_url_["addQueryArgs"])('edit.php', {
|
||||
post_type: 'wp_navigation'
|
||||
})
|
||||
}, Object(external_wp_i18n_["__"])('Manage menus'))));
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
|
||||
|
@ -21812,6 +21844,7 @@ function NavigationMenuDeleteControl(_ref) {
|
|||
* External dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
@ -21892,7 +21925,12 @@ function Navigation(_ref) {
|
|||
orientation = 'horizontal'
|
||||
} = {}
|
||||
} = attributes;
|
||||
const [areaMenu, setAreaMenu] = Object(external_wp_coreData_["useEntityProp"])('root', 'navigationArea', 'navigation', navigationArea);
|
||||
let areaMenu,
|
||||
setAreaMenu = external_lodash_default.a; // Navigation areas are deprecated and on their way out. Let's not perform
|
||||
// the request unless we're in an environment where the endpoint exists.
|
||||
|
||||
if (false) {}
|
||||
|
||||
const navigationAreaMenu = areaMenu === 0 ? undefined : areaMenu;
|
||||
const ref = navigationArea ? navigationAreaMenu : attributes.ref;
|
||||
const setRef = Object(external_wp_element_["useCallback"])(postId => {
|
||||
|
@ -24724,7 +24762,7 @@ function NavigationSubmenuEdit(_ref) {
|
|||
// see: https://github.com/WordPress/gutenberg/pull/34615.
|
||||
__experimentalCaptureToolbars: true,
|
||||
renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasDescendants || // Show the appender while dragging to allow inserting element between item and the appender.
|
||||
hasDescendants ? external_wp_blockEditor_["InnerBlocks"].DefaultAppender : false
|
||||
hasDescendants ? external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender : false
|
||||
});
|
||||
const ParentElement = openSubmenusOnClick ? 'button' : 'a';
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, !openSubmenusOnClick && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
|
||||
|
@ -26634,7 +26672,7 @@ const post_comments_metadata = {
|
|||
link: true
|
||||
}
|
||||
},
|
||||
style: "wp-block-post-comments"
|
||||
style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"]
|
||||
};
|
||||
|
||||
const {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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
|
@ -1564,7 +1564,7 @@ function parseCSS() {
|
|||
if (rule) {
|
||||
const [property, value] = rule.split(':');
|
||||
if (property === 'color') accumulator.color = value;
|
||||
if (property === 'background-color') accumulator.backgroundColor = value;
|
||||
if (property === 'background-color' && value !== transparentValue) accumulator.backgroundColor = value;
|
||||
}
|
||||
|
||||
return accumulator;
|
||||
|
@ -1575,10 +1575,9 @@ function parseClassName() {
|
|||
let className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||
let colorSettings = arguments.length > 1 ? arguments[1] : undefined;
|
||||
return className.split(' ').reduce((accumulator, name) => {
|
||||
const match = name.match(/^has-([^-]+)-color$/);
|
||||
|
||||
if (match) {
|
||||
const [, colorSlug] = name.match(/^has-([^-]+)-color$/);
|
||||
// `colorSlug` could contain dashes, so simply match the start and end.
|
||||
if (name.startsWith('has-') && name.endsWith('-color')) {
|
||||
const colorSlug = name.replace(/^has-/, '').replace(/-color$/, '');
|
||||
const colorObject = Object(external_wp_blockEditor_["getColorObjectByAttributeValues"])(colorSettings, colorSlug);
|
||||
accumulator.color = colorObject.color;
|
||||
}
|
||||
|
@ -1619,7 +1618,7 @@ function setColors(value, name, colorSettings, colors) {
|
|||
styles.push(['background-color', backgroundColor].join(':'));
|
||||
} else {
|
||||
// Override default browser color for mark element.
|
||||
styles.push(['background-color', 'rgba(0, 0, 0, 0)'].join(':'));
|
||||
styles.push(['background-color', transparentValue].join(':'));
|
||||
}
|
||||
|
||||
if (color) {
|
||||
|
@ -1727,6 +1726,7 @@ function InlineColorUI(_ref2) {
|
|||
*/
|
||||
|
||||
|
||||
const transparentValue = 'rgba(0, 0, 0, 0)';
|
||||
const text_color_name = 'core/text-color';
|
||||
|
||||
const text_color_title = Object(external_wp_i18n_["__"])('Highlight');
|
||||
|
@ -1743,7 +1743,7 @@ function getComputedStyleProperty(element, property) {
|
|||
const style = defaultView.getComputedStyle(element);
|
||||
const value = style.getPropertyValue(property);
|
||||
|
||||
if (property === 'background-color' && value === 'rgba(0, 0, 0, 0)' && element.parentElement) {
|
||||
if (property === 'background-color' && value === transparentValue && element.parentElement) {
|
||||
return getComputedStyleProperty(element.parentElement, property);
|
||||
}
|
||||
|
||||
|
@ -1762,7 +1762,7 @@ function fillComputedColors(element, _ref) {
|
|||
|
||||
return {
|
||||
color: color || getComputedStyleProperty(element, 'color'),
|
||||
backgroundColor: backgroundColor === 'rgba(0, 0, 0, 0)' ? getComputedStyleProperty(element, 'background-color') : backgroundColor
|
||||
backgroundColor: backgroundColor === transparentValue ? getComputedStyleProperty(element, 'background-color') : backgroundColor
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1830,7 +1830,7 @@ const text_color_textColor = {
|
|||
if (key !== 'style') return value; // We should not add a background-color if it's already set
|
||||
|
||||
if (value && value.includes('background-color')) return value;
|
||||
const addedCSS = ['background-color', 'rgba(0, 0, 0, 0)'].join(':'); // Prepend `addedCSS` to avoid a double `;;` as any the existing CSS
|
||||
const addedCSS = ['background-color', transparentValue].join(':'); // Prepend `addedCSS` to avoid a double `;;` as any the existing CSS
|
||||
// rules will already include a `;`.
|
||||
|
||||
return value ? [addedCSS, value].join(';') : addedCSS;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -504,7 +504,7 @@ function create_initial_post_types() {
|
|||
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
|
||||
'has_archive' => false,
|
||||
'show_ui' => wp_is_block_theme(),
|
||||
'show_in_menu' => 'themes.php',
|
||||
'show_in_menu' => false,
|
||||
'show_in_admin_bar' => false,
|
||||
'show_in_rest' => true,
|
||||
'rewrite' => false,
|
||||
|
|
|
@ -2863,3 +2863,14 @@ function wp_add_iframed_editor_assets_html() {
|
|||
|
||||
echo "<script>window.__editorAssets = $editor_assets</script>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that enqueues the CSS Custom Properties coming from theme.json.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*/
|
||||
function wp_enqueue_global_styles_css_custom_properties() {
|
||||
wp_register_style( 'global-styles-css-custom-properties', false, array(), true, true );
|
||||
wp_add_inline_style( 'global-styles-css-custom-properties', wp_get_global_stylesheet( array( 'variables' ) ) );
|
||||
wp_enqueue_style( 'global-styles-css-custom-properties' );
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-beta2-52363';
|
||||
$wp_version = '5.9-beta2-52364';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue