mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Site Logo: Add option to set site icon from Site Logo block - Navigation: Enable even more compact setup state. - Remove template parts from post content inserter an __unstable filter - Template Editor Mode: Hide editor mode switcher - Avoid using CSS variables for block gap styles - Try to fix auto resizing in template part focus mode - Lower the specificity of font size CSS Custom Properties in the editor - Site icon: Fix site icon styling to display non-square site icons within a square button - [Site Editor]: Register block editor shortcuts - Update regex to handle 404 template slug - Site Editor: Remove dead code - [Block Editor]: Restrict delete multi selected blocks shortcut - Fix: Gradients are not being applied by class - Update: Make the global styles subtitles font smaller - Post Content/Title: Reflect changes when previewing post - ServerSideRender: Fix loading state - [Block Library]: Fix editable post blocks in Query Loop with zero queryId - Post Excerpt: Fix previews - WP59: Contextualize "Export" string to differentiate it from other occurrences in WP Core - Tools Panel: Fix race conditions caused by conditionally displayed ToolsPanelItems - ToolsPanel: Allow items to register when panelId is null - Font Size Picker: Allow non-integers as simple CSS values and in hints - [Components - FontSizePicker]: Use incremental sequence of numbers as labels for the available font-sizes at the segmented control (conditionally) See #54487. Built from https://develop.svn.wordpress.org/trunk@52434 git-svn-id: http://core.svn.wordpress.org/trunk@52026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
15b614acc3
commit
28a12c8bce
File diff suppressed because one or more lines are too long
@ -39,9 +39,10 @@ function wp_register_layout_support( $block_type ) {
|
||||
* @param array $layout Layout object. The one that is passed has already checked
|
||||
* the existence of default block layout.
|
||||
* @param bool $has_block_gap_support Whether the theme has support for the block gap.
|
||||
* @param string $gap_value The block gap value to apply.
|
||||
* @return string CSS style.
|
||||
*/
|
||||
function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false ) {
|
||||
function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false, $gap_value = null ) {
|
||||
$layout_type = isset( $layout['type'] ) ? $layout['type'] : 'default';
|
||||
|
||||
$style = '';
|
||||
@ -72,8 +73,9 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
|
||||
$style .= "$selector .alignleft { float: left; margin-right: 2em; }";
|
||||
$style .= "$selector .alignright { float: right; margin-left: 2em; }";
|
||||
if ( $has_block_gap_support ) {
|
||||
$style .= "$selector > * { margin-top: 0; margin-bottom: 0; }";
|
||||
$style .= "$selector > * + * { margin-top: var( --wp--style--block-gap ); margin-bottom: 0; }";
|
||||
$gap_style = $gap_value ? $gap_value : 'var( --wp--style--block-gap )';
|
||||
$style .= "$selector > * { margin-top: 0; margin-bottom: 0; }";
|
||||
$style .= "$selector > * + * { margin-top: $gap_style; margin-bottom: 0; }";
|
||||
}
|
||||
} elseif ( 'flex' === $layout_type ) {
|
||||
$layout_orientation = isset( $layout['orientation'] ) ? $layout['orientation'] : 'horizontal';
|
||||
@ -96,7 +98,8 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
|
||||
$style = "$selector {";
|
||||
$style .= 'display: flex;';
|
||||
if ( $has_block_gap_support ) {
|
||||
$style .= 'gap: var( --wp--style--block-gap, 0.5em );';
|
||||
$gap_style = $gap_value ? $gap_value : 'var( --wp--style--block-gap, 0.5em )';
|
||||
$style .= "gap: $gap_style;";
|
||||
} else {
|
||||
$style .= 'gap: 0.5em;';
|
||||
}
|
||||
@ -156,8 +159,13 @@ function wp_render_layout_support_flag( $block_content, $block ) {
|
||||
$used_layout = $default_layout;
|
||||
}
|
||||
|
||||
$id = uniqid();
|
||||
$style = wp_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support );
|
||||
$id = uniqid();
|
||||
$gap_value = _wp_array_get( $block, array( 'attrs', 'style', 'spacing', 'blockGap' ) );
|
||||
// Skip if gap value contains unsupported characters.
|
||||
// Regex for CSS value borrowed from `safecss_filter_attr`, and used here
|
||||
// because we only want to match against the value, not the CSS attribute.
|
||||
$gap_value = preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value;
|
||||
$style = wp_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support, $gap_value );
|
||||
// This assumes the hook only applies to blocks with a single wrapper.
|
||||
// I think this is a reasonable limitation for that particular hook.
|
||||
$content = preg_replace(
|
||||
|
@ -95,59 +95,6 @@ function wp_skip_spacing_serialization( $block_type ) {
|
||||
$spacing_support['__experimentalSkipSerialization'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the spacing gap support to the block wrapper, to ensure
|
||||
* that the CSS variable is rendered in all environments.
|
||||
*
|
||||
* @since 5.9.0
|
||||
* @access private
|
||||
*
|
||||
* @param string $block_content Rendered block content.
|
||||
* @param array $block Block object.
|
||||
* @return string Filtered block content.
|
||||
*/
|
||||
function wp_render_spacing_gap_support( $block_content, $block ) {
|
||||
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
|
||||
$has_gap_support = block_has_support( $block_type, array( 'spacing', 'blockGap' ), false );
|
||||
if ( ! $has_gap_support || ! isset( $block['attrs']['style']['spacing']['blockGap'] ) ) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
$gap_value = $block['attrs']['style']['spacing']['blockGap'];
|
||||
|
||||
// Skip if gap value contains unsupported characters.
|
||||
// Regex for CSS value borrowed from `safecss_filter_attr`, and used here
|
||||
// because we only want to match against the value, not the CSS attribute.
|
||||
if ( preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
$style = sprintf(
|
||||
'--wp--style--block-gap: %s',
|
||||
esc_attr( $gap_value )
|
||||
);
|
||||
|
||||
// Attempt to update an existing style attribute on the wrapper element.
|
||||
$injected_style = preg_replace(
|
||||
'/^([^>.]+?)(' . preg_quote( 'style="', '/' ) . ')(?=.+?>)/',
|
||||
'$1$2' . $style . '; ',
|
||||
$block_content,
|
||||
1
|
||||
);
|
||||
|
||||
// If there is no existing style attribute, add one to the wrapper element.
|
||||
if ( $injected_style === $block_content ) {
|
||||
$injected_style = preg_replace(
|
||||
'/<([a-zA-Z0-9]+)([ >])/',
|
||||
'<$1 style="' . $style . '"$2',
|
||||
$block_content,
|
||||
1
|
||||
);
|
||||
};
|
||||
|
||||
return $injected_style;
|
||||
}
|
||||
|
||||
// Register the block support.
|
||||
WP_Block_Supports::get_instance()->register(
|
||||
'spacing',
|
||||
@ -156,5 +103,3 @@ WP_Block_Supports::get_instance()->register(
|
||||
'apply' => 'wp_apply_spacing_support',
|
||||
)
|
||||
);
|
||||
|
||||
add_filter( 'render_block', 'wp_render_spacing_gap_support', 10, 2 );
|
||||
|
@ -23,11 +23,10 @@
|
||||
"link": true
|
||||
},
|
||||
"spacing": {
|
||||
"blockGap": true,
|
||||
"margin": [ "top", "bottom" ],
|
||||
"padding": true,
|
||||
"__experimentalDefaultControls": {
|
||||
"blockGap": true
|
||||
"padding": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -98,17 +98,7 @@
|
||||
}
|
||||
},
|
||||
"spacing": {
|
||||
"blockGap": true,
|
||||
"units": [
|
||||
"px",
|
||||
"em",
|
||||
"rem",
|
||||
"vh",
|
||||
"vw"
|
||||
],
|
||||
"__experimentalDefaultControls": {
|
||||
"blockGap": true
|
||||
}
|
||||
"units": [ "px", "em", "rem", "vh", "vw" ]
|
||||
},
|
||||
"__experimentalLayout": {
|
||||
"allowSwitching": false,
|
||||
|
@ -293,7 +293,6 @@
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__controls {
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
@ -302,19 +301,23 @@
|
||||
display: none;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 4px 8px;
|
||||
float: right;
|
||||
width: 100%;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(3),
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(2) {
|
||||
display: none;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
@ -334,6 +337,10 @@
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
|
File diff suppressed because one or more lines are too long
@ -293,7 +293,6 @@
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__controls {
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
@ -302,19 +301,23 @@
|
||||
display: none;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 4px 8px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(3),
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(2) {
|
||||
display: none;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
@ -334,6 +337,10 @@
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
|
2
wp-includes/blocks/navigation/editor.min.css
vendored
2
wp-includes/blocks/navigation/editor.min.css
vendored
File diff suppressed because one or more lines are too long
@ -36,11 +36,16 @@ function render_block_core_post_content( $attributes, $content, $block ) {
|
||||
|
||||
$seen_ids[ $post_id ] = true;
|
||||
|
||||
// Check is needed for backward compatibility with third-party plugins
|
||||
// that might rely on the `in_the_loop` check; calling `the_post` sets it to true.
|
||||
if ( ! in_the_loop() && have_posts() ) {
|
||||
the_post();
|
||||
}
|
||||
|
||||
$content = get_the_content( null, false, $post_id );
|
||||
// When inside the main loop, we want to use queried object
|
||||
// so that `the_preview` for the current post can apply.
|
||||
// We force this behavior by omitting the third argument (post ID) from the `get_the_content`.
|
||||
$content = get_the_content( null, false );
|
||||
/** This filter is documented in wp-includes/post-template.php */
|
||||
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
|
||||
unset( $seen_ids[ $post_id ] );
|
||||
|
@ -18,7 +18,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$excerpt = get_the_excerpt( $block->context['postId'] );
|
||||
$excerpt = get_the_excerpt();
|
||||
|
||||
if ( empty( $excerpt ) ) {
|
||||
return '';
|
||||
|
@ -20,7 +20,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
$post_ID = $block->context['postId'];
|
||||
$title = get_the_title( $post_ID );
|
||||
$title = get_the_title();
|
||||
|
||||
if ( ! $title ) {
|
||||
return '';
|
||||
|
@ -76,6 +76,23 @@ function register_block_core_site_logo_setting() {
|
||||
|
||||
add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 );
|
||||
|
||||
/**
|
||||
* Register a core site setting for a site icon
|
||||
*/
|
||||
function register_block_core_site_icon_setting() {
|
||||
register_setting(
|
||||
'general',
|
||||
'site_icon',
|
||||
array(
|
||||
'show_in_rest' => true,
|
||||
'type' => 'integer',
|
||||
'description' => __( 'Site icon.' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 );
|
||||
|
||||
/**
|
||||
* Registers the `core/site-logo` block on the server.
|
||||
*/
|
||||
|
@ -16,12 +16,16 @@
|
||||
"linkTarget": {
|
||||
"type": "string",
|
||||
"default": "_self"
|
||||
},
|
||||
"shouldSyncIcon": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"example": {
|
||||
"viewportWidth": 500,
|
||||
"attributes": {
|
||||
"width": 350
|
||||
"width": 350,
|
||||
"className": "block-editor-block-types-list__site-logo-example"
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
|
@ -317,7 +317,7 @@ class WP_Theme_JSON {
|
||||
'spacing' => array(
|
||||
'margin' => null,
|
||||
'padding' => null,
|
||||
'blockGap' => null,
|
||||
'blockGap' => 'top',
|
||||
),
|
||||
'typography' => array(
|
||||
'fontFamily' => null,
|
||||
@ -472,17 +472,28 @@ class WP_Theme_JSON {
|
||||
|
||||
$output = array_intersect_key( $input, array_flip( self::VALID_TOP_LEVEL_KEYS ) );
|
||||
|
||||
// Some styles are only meant to be available at the top-level (e.g.: blockGap),
|
||||
// hence, the schema for blocks & elements should not have them.
|
||||
$styles_non_top_level = self::VALID_STYLES;
|
||||
foreach ( array_keys( $styles_non_top_level ) as $section ) {
|
||||
foreach ( array_keys( $styles_non_top_level[ $section ] ) as $prop ) {
|
||||
if ( 'top' === $styles_non_top_level[ $section ][ $prop ] ) {
|
||||
unset( $styles_non_top_level[ $section ][ $prop ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build the schema based on valid block & element names.
|
||||
$schema = array();
|
||||
$schema_styles_elements = array();
|
||||
foreach ( $valid_element_names as $element ) {
|
||||
$schema_styles_elements[ $element ] = self::VALID_STYLES;
|
||||
$schema_styles_elements[ $element ] = $styles_non_top_level;
|
||||
}
|
||||
$schema_styles_blocks = array();
|
||||
$schema_settings_blocks = array();
|
||||
foreach ( $valid_block_names as $block ) {
|
||||
$schema_settings_blocks[ $block ] = self::VALID_SETTINGS;
|
||||
$schema_styles_blocks[ $block ] = self::VALID_STYLES;
|
||||
$schema_styles_blocks[ $block ] = $styles_non_top_level;
|
||||
$schema_styles_blocks[ $block ]['elements'] = $schema_styles_elements;
|
||||
}
|
||||
$schema['styles'] = self::VALID_STYLES;
|
||||
|
@ -1391,7 +1391,6 @@ figure.wp-block-image:not(.wp-block) {
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__controls {
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
@ -1400,19 +1399,23 @@ figure.wp-block-image:not(.wp-block) {
|
||||
display: none;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 4px 8px;
|
||||
float: right;
|
||||
width: 100%;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(3),
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(2) {
|
||||
display: none;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
@ -1432,6 +1435,10 @@ figure.wp-block-image:not(.wp-block) {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
@ -2602,8 +2609,6 @@ div[data-type="core/post-featured-image"] img {
|
||||
*/
|
||||
/* stylelint-disable function-comma-space-after */
|
||||
/* stylelint-enable function-comma-space-after */
|
||||
--wp--preset--font-size--normal: 16px;
|
||||
--wp--preset--font-size--huge: 42px;
|
||||
}
|
||||
:root .editor-styles-wrapper .has-very-light-gray-background-color {
|
||||
background-color: #eee;
|
||||
@ -2639,6 +2644,11 @@ div[data-type="core/post-featured-image"] img {
|
||||
background: linear-gradient(-135deg, #020381 0%, #2874fc 100%);
|
||||
}
|
||||
|
||||
.editor-styles-wrapper {
|
||||
--wp--preset--font-size--normal: 16px;
|
||||
--wp--preset--font-size--huge: 42px;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .has-regular-font-size {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
26
wp-includes/css/dist/block-library/editor.css
vendored
26
wp-includes/css/dist/block-library/editor.css
vendored
@ -1396,7 +1396,6 @@ figure.wp-block-image:not(.wp-block) {
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__controls {
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
box-shadow: inset 0 0 0 1px #1e1e1e;
|
||||
@ -1405,19 +1404,23 @@ figure.wp-block-image:not(.wp-block) {
|
||||
display: none;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 4px 8px;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
.is-large .wp-block-navigation-placeholder__controls {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls {
|
||||
display: flex;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr,
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(3),
|
||||
.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions > :nth-last-child(2) {
|
||||
display: none;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon {
|
||||
@ -1437,6 +1440,10 @@ figure.wp-block-image:not(.wp-block) {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
|
||||
flex-direction: row !important;
|
||||
}
|
||||
|
||||
.wp-block-navigation-placeholder__actions {
|
||||
display: flex;
|
||||
font-size: 13px;
|
||||
@ -2610,8 +2617,6 @@ div[data-type="core/post-featured-image"] img {
|
||||
*/
|
||||
/* stylelint-disable function-comma-space-after */
|
||||
/* stylelint-enable function-comma-space-after */
|
||||
--wp--preset--font-size--normal: 16px;
|
||||
--wp--preset--font-size--huge: 42px;
|
||||
}
|
||||
:root .editor-styles-wrapper .has-very-light-gray-background-color {
|
||||
background-color: #eee;
|
||||
@ -2647,6 +2652,11 @@ div[data-type="core/post-featured-image"] img {
|
||||
background: linear-gradient(135deg, #020381 0%, #2874fc 100%);
|
||||
}
|
||||
|
||||
.editor-styles-wrapper {
|
||||
--wp--preset--font-size--normal: 16px;
|
||||
--wp--preset--font-size--huge: 42px;
|
||||
}
|
||||
|
||||
.editor-styles-wrapper .has-regular-font-size {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
7
wp-includes/css/dist/edit-post/style-rtl.css
vendored
7
wp-includes/css/dist/edit-post/style-rtl.css
vendored
@ -732,10 +732,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-post-fullscreen-mode-close_site-icon {
|
||||
.edit-post-fullscreen-mode-close.has-icon .edit-post-fullscreen-mode-close_site-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 2px;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.edit-post-header-toolbar {
|
||||
|
File diff suppressed because one or more lines are too long
7
wp-includes/css/dist/edit-post/style.css
vendored
7
wp-includes/css/dist/edit-post/style.css
vendored
@ -732,10 +732,13 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-post-fullscreen-mode-close_site-icon {
|
||||
.edit-post-fullscreen-mode-close.has-icon .edit-post-fullscreen-mode-close_site-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 2px;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.edit-post-header-toolbar {
|
||||
|
2
wp-includes/css/dist/edit-post/style.min.css
vendored
2
wp-includes/css/dist/edit-post/style.min.css
vendored
File diff suppressed because one or more lines are too long
10
wp-includes/css/dist/edit-site/style-rtl.css
vendored
10
wp-includes/css/dist/edit-site/style-rtl.css
vendored
@ -580,7 +580,8 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
||||
.edit-site-global-styles-subtitle {
|
||||
margin-bottom: 0 !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
font-weight: 500 !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
|
||||
@ -914,10 +915,13 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
||||
.edit-site-navigation-toggle__button.has-icon:focus::before {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
}
|
||||
|
||||
.edit-site-navigation-toggle__site-icon {
|
||||
.edit-site-navigation-toggle__button .edit-site-navigation-toggle__site-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 2px;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.edit-site-navigation-panel {
|
||||
|
File diff suppressed because one or more lines are too long
10
wp-includes/css/dist/edit-site/style.css
vendored
10
wp-includes/css/dist/edit-site/style.css
vendored
@ -580,7 +580,8 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
||||
.edit-site-global-styles-subtitle {
|
||||
margin-bottom: 0 !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: 500;
|
||||
font-weight: 500 !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
|
||||
@ -914,10 +915,13 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
||||
.edit-site-navigation-toggle__button.has-icon:focus::before {
|
||||
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
||||
}
|
||||
|
||||
.edit-site-navigation-toggle__site-icon {
|
||||
.edit-site-navigation-toggle__button .edit-site-navigation-toggle__site-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 2px;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.edit-site-navigation-panel {
|
||||
|
2
wp-includes/css/dist/edit-site/style.min.css
vendored
2
wp-includes/css/dist/edit-site/style.min.css
vendored
File diff suppressed because one or more lines are too long
359
wp-includes/js/dist/block-editor.js
vendored
359
wp-includes/js/dist/block-editor.js
vendored
@ -12733,6 +12733,15 @@ function BlockTools(_ref) {
|
||||
insertBeforeBlock(Object(external_lodash_["first"])(clientIds));
|
||||
}
|
||||
} else if (isMatch('core/block-editor/delete-multi-selection', event)) {
|
||||
/**
|
||||
* Check if the target element is a text area, input or
|
||||
* event.defaultPrevented and return early. In all these
|
||||
* cases backspace could be handled elsewhere.
|
||||
*/
|
||||
if (['INPUT', 'TEXTAREA'].includes(event.target.nodeName) || event.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
const clientIds = getSelectedBlockClientIds();
|
||||
|
||||
if (clientIds.length > 1) {
|
||||
@ -19177,6 +19186,9 @@ var rememo = __webpack_require__("pPDe");
|
||||
// EXTERNAL MODULE: external ["wp","element"]
|
||||
var external_wp_element_ = __webpack_require__("GRId");
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","hooks"]
|
||||
var external_wp_hooks_ = __webpack_require__("g56x");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
|
||||
var symbol = __webpack_require__("+WrK");
|
||||
|
||||
@ -19193,6 +19205,7 @@ var symbol = __webpack_require__("+WrK");
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A block selection object.
|
||||
*
|
||||
@ -20378,16 +20391,32 @@ const canInsertBlockTypeUnmemoized = function (state, blockName) {
|
||||
const blockAllowedParentBlocks = blockType.parent;
|
||||
const parentName = getBlockName(state, rootClientId);
|
||||
const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
|
||||
const canInsert = hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true;
|
||||
|
||||
if (hasParentAllowedBlock !== null && hasBlockAllowedParent !== null) {
|
||||
return hasParentAllowedBlock || hasBlockAllowedParent;
|
||||
} else if (hasParentAllowedBlock !== null) {
|
||||
return hasParentAllowedBlock;
|
||||
} else if (hasBlockAllowedParent !== null) {
|
||||
return hasBlockAllowedParent;
|
||||
if (!canInsert) {
|
||||
return canInsert;
|
||||
}
|
||||
/**
|
||||
* This filter is an ad-hoc solution to prevent adding template parts inside post content.
|
||||
* Conceptually, having a filter inside a selector is bad pattern so this code will be
|
||||
* replaced by a declarative API that doesn't the following drawbacks:
|
||||
*
|
||||
* Filters are not reactive: Upon switching between "template mode" and non "template mode",
|
||||
* the filter and selector won't necessarily be executed again. For now, it doesn't matter much
|
||||
* because you can't switch between the two modes while the inserter stays open.
|
||||
*
|
||||
* Filters are global: Once they're defined, they will affect all editor instances and all registries.
|
||||
* An ideal API would only affect specific editor instances.
|
||||
*/
|
||||
|
||||
return true;
|
||||
|
||||
return Object(external_wp_hooks_["applyFilters"])('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, {
|
||||
// Pass bound selectors of the current registry. If we're in a nested
|
||||
// context, the data will differ from the one selected from the root
|
||||
// registry.
|
||||
getBlock: getBlock.bind(null, state),
|
||||
getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state)
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Determines if the given block type is allowed to be inserted into the block list.
|
||||
@ -23172,7 +23201,6 @@ function getGradientSlugByValue(gradients, value) {
|
||||
|
||||
return gradient && gradient.slug;
|
||||
}
|
||||
const EMPTY_OBJECT = {};
|
||||
function __experimentalUseGradient() {
|
||||
let {
|
||||
gradientAttribute = 'gradient',
|
||||
@ -23181,8 +23209,10 @@ function __experimentalUseGradient() {
|
||||
const {
|
||||
clientId
|
||||
} = Object(_block_edit__WEBPACK_IMPORTED_MODULE_3__[/* useBlockEditContext */ "c"])();
|
||||
const gradientsPerOrigin = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients') || EMPTY_OBJECT;
|
||||
const allGradients = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => [...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.custom) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.theme) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.default) || [])], [gradientsPerOrigin]);
|
||||
const userGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.custom');
|
||||
const themeGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.theme');
|
||||
const defaultGradientPalette = Object(_use_setting__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])('color.gradients.default');
|
||||
const allGradients = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]);
|
||||
const {
|
||||
gradient,
|
||||
customGradient
|
||||
@ -26090,15 +26120,19 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
||||
}));
|
||||
},
|
||||
save: function FlexLayoutStyle(_ref3) {
|
||||
var _style$spacing$blockG, _style$spacing;
|
||||
|
||||
let {
|
||||
selector,
|
||||
layout
|
||||
layout,
|
||||
style
|
||||
} = _ref3;
|
||||
const {
|
||||
orientation = 'horizontal'
|
||||
} = layout;
|
||||
const blockGapSupport = Object(use_setting["a" /* default */])('spacing.blockGap');
|
||||
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
||||
const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap, 0.5em )';
|
||||
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
||||
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
||||
const rowOrientation = `
|
||||
@ -26114,7 +26148,7 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
||||
return Object(external_wp_element_["createElement"])("style", null, `
|
||||
${appendSelectors(selector)} {
|
||||
display: flex;
|
||||
gap: ${hasBlockGapStylesSupport ? 'var( --wp--style--block-gap, 0.5em )' : '0.5em'};
|
||||
gap: ${hasBlockGapStylesSupport ? blockGapValue : '0.5em'};
|
||||
flex-wrap: ${flexWrap};
|
||||
${orientation === 'horizontal' ? rowOrientation : columnOrientation}
|
||||
}
|
||||
@ -26351,9 +26385,12 @@ var stretch_wide = __webpack_require__("beZb");
|
||||
return null;
|
||||
},
|
||||
save: function DefaultLayoutStyle(_ref2) {
|
||||
var _style$spacing$blockG, _style$spacing;
|
||||
|
||||
let {
|
||||
selector,
|
||||
layout = {}
|
||||
layout = {},
|
||||
style
|
||||
} = _ref2;
|
||||
const {
|
||||
contentSize,
|
||||
@ -26361,7 +26398,8 @@ var stretch_wide = __webpack_require__("beZb");
|
||||
} = layout;
|
||||
const blockGapSupport = Object(use_setting["a" /* default */])('spacing.blockGap');
|
||||
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
||||
let style = !!contentSize || !!wideSize ? `
|
||||
const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap )';
|
||||
let output = !!contentSize || !!wideSize ? `
|
||||
${appendSelectors(selector, '> *')} {
|
||||
max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
|
||||
margin-left: auto !important;
|
||||
@ -26376,7 +26414,7 @@ var stretch_wide = __webpack_require__("beZb");
|
||||
max-width: none;
|
||||
}
|
||||
` : '';
|
||||
style += `
|
||||
output += `
|
||||
${appendSelectors(selector, '> [data-align="left"]')} {
|
||||
float: left;
|
||||
margin-right: 2em;
|
||||
@ -26390,18 +26428,18 @@ var stretch_wide = __webpack_require__("beZb");
|
||||
`;
|
||||
|
||||
if (hasBlockGapStylesSupport) {
|
||||
style += `
|
||||
output += `
|
||||
${appendSelectors(selector, '> *')} {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
${appendSelectors(selector, '> * + *')} {
|
||||
margin-top: var( --wp--style--block-gap );
|
||||
margin-top: ${blockGapValue};
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
return Object(external_wp_element_["createElement"])("style", null, style);
|
||||
return Object(external_wp_element_["createElement"])("style", null, output);
|
||||
},
|
||||
|
||||
getOrientation() {
|
||||
@ -34360,6 +34398,7 @@ const justifyLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["crea
|
||||
/* unused harmony export Trail */
|
||||
/* unused harmony export Transition */
|
||||
/* unused harmony export config */
|
||||
/* unused harmony export easings */
|
||||
/* unused harmony export inferTo */
|
||||
/* unused harmony export interpolate */
|
||||
/* unused harmony export to */
|
||||
@ -34546,8 +34585,8 @@ function useChain(refs, timeSteps, timeFrame = 1000) {
|
||||
|
||||
props.delay = key => delay + callProp(memoizedDelayProp || 0, key);
|
||||
});
|
||||
ctrl.start();
|
||||
});
|
||||
ref.start();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -34597,13 +34636,65 @@ const config = {
|
||||
friction: 120
|
||||
}
|
||||
};
|
||||
const c1 = 1.70158;
|
||||
const c2 = c1 * 1.525;
|
||||
const c3 = c1 + 1;
|
||||
const c4 = 2 * Math.PI / 3;
|
||||
const c5 = 2 * Math.PI / 4.5;
|
||||
|
||||
const linear = t => t;
|
||||
const bounceOut = x => {
|
||||
const n1 = 7.5625;
|
||||
const d1 = 2.75;
|
||||
|
||||
if (x < 1 / d1) {
|
||||
return n1 * x * x;
|
||||
} else if (x < 2 / d1) {
|
||||
return n1 * (x -= 1.5 / d1) * x + 0.75;
|
||||
} else if (x < 2.5 / d1) {
|
||||
return n1 * (x -= 2.25 / d1) * x + 0.9375;
|
||||
} else {
|
||||
return n1 * (x -= 2.625 / d1) * x + 0.984375;
|
||||
}
|
||||
};
|
||||
|
||||
const easings = {
|
||||
linear: x => x,
|
||||
easeInQuad: x => x * x,
|
||||
easeOutQuad: x => 1 - (1 - x) * (1 - x),
|
||||
easeInOutQuad: x => x < 0.5 ? 2 * x * x : 1 - Math.pow(-2 * x + 2, 2) / 2,
|
||||
easeInCubic: x => x * x * x,
|
||||
easeOutCubic: x => 1 - Math.pow(1 - x, 3),
|
||||
easeInOutCubic: x => x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2,
|
||||
easeInQuart: x => x * x * x * x,
|
||||
easeOutQuart: x => 1 - Math.pow(1 - x, 4),
|
||||
easeInOutQuart: x => x < 0.5 ? 8 * x * x * x * x : 1 - Math.pow(-2 * x + 2, 4) / 2,
|
||||
easeInQuint: x => x * x * x * x * x,
|
||||
easeOutQuint: x => 1 - Math.pow(1 - x, 5),
|
||||
easeInOutQuint: x => x < 0.5 ? 16 * x * x * x * x * x : 1 - Math.pow(-2 * x + 2, 5) / 2,
|
||||
easeInSine: x => 1 - Math.cos(x * Math.PI / 2),
|
||||
easeOutSine: x => Math.sin(x * Math.PI / 2),
|
||||
easeInOutSine: x => -(Math.cos(Math.PI * x) - 1) / 2,
|
||||
easeInExpo: x => x === 0 ? 0 : Math.pow(2, 10 * x - 10),
|
||||
easeOutExpo: x => x === 1 ? 1 : 1 - Math.pow(2, -10 * x),
|
||||
easeInOutExpo: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow(2, 20 * x - 10) / 2 : (2 - Math.pow(2, -20 * x + 10)) / 2,
|
||||
easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)),
|
||||
easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)),
|
||||
easeInOutCirc: x => x < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2,
|
||||
easeInBack: x => c3 * x * x * x - c1 * x * x,
|
||||
easeOutBack: x => 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2),
|
||||
easeInOutBack: x => x < 0.5 ? Math.pow(2 * x, 2) * ((c2 + 1) * 2 * x - c2) / 2 : (Math.pow(2 * x - 2, 2) * ((c2 + 1) * (x * 2 - 2) + c2) + 2) / 2,
|
||||
easeInElastic: x => x === 0 ? 0 : x === 1 ? 1 : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4),
|
||||
easeOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1,
|
||||
easeInOutElastic: x => x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 : Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5) / 2 + 1,
|
||||
easeInBounce: x => 1 - bounceOut(1 - x),
|
||||
easeOutBounce: bounceOut,
|
||||
easeInOutBounce: x => x < 0.5 ? (1 - bounceOut(1 - 2 * x)) / 2 : (1 + bounceOut(2 * x - 1)) / 2
|
||||
};
|
||||
|
||||
const defaults = _extends({}, config.default, {
|
||||
mass: 1,
|
||||
damping: 1,
|
||||
easing: linear,
|
||||
easing: easings.linear,
|
||||
clamp: false
|
||||
});
|
||||
|
||||
@ -34738,7 +34829,8 @@ function scheduleProps(callId, {
|
||||
}
|
||||
|
||||
function onResume() {
|
||||
if (delay > 0) {
|
||||
if (delay > 0 && !_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) {
|
||||
state.delayed = true;
|
||||
timeout = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].setTimeout(onStart, delay);
|
||||
state.pauseQueue.add(onPause);
|
||||
state.timeouts.add(timeout);
|
||||
@ -34748,6 +34840,10 @@ function scheduleProps(callId, {
|
||||
}
|
||||
|
||||
function onStart() {
|
||||
if (state.delayed) {
|
||||
state.delayed = false;
|
||||
}
|
||||
|
||||
state.pauseQueue.delete(onPause);
|
||||
state.timeouts.delete(timeout);
|
||||
|
||||
@ -35015,6 +35111,7 @@ class SpringValue extends FrameValue {
|
||||
this.defaultProps = {};
|
||||
this._state = {
|
||||
paused: false,
|
||||
delayed: false,
|
||||
pauseQueue: new Set(),
|
||||
resumeQueue: new Set(),
|
||||
timeouts: new Set()
|
||||
@ -35062,6 +35159,10 @@ class SpringValue extends FrameValue {
|
||||
return isPaused(this);
|
||||
}
|
||||
|
||||
get isDelayed() {
|
||||
return this._state.delayed;
|
||||
}
|
||||
|
||||
advance(dt) {
|
||||
let idle = true;
|
||||
let changed = false;
|
||||
@ -35265,7 +35366,11 @@ class SpringValue extends FrameValue {
|
||||
this.queue = [];
|
||||
}
|
||||
|
||||
return Promise.all(queue.map(props => this._update(props))).then(results => getCombinedResult(this, results));
|
||||
return Promise.all(queue.map(props => {
|
||||
const up = this._update(props);
|
||||
|
||||
return up;
|
||||
})).then(results => getCombinedResult(this, results));
|
||||
}
|
||||
|
||||
stop(cancel) {
|
||||
@ -35798,7 +35903,9 @@ class Controller {
|
||||
}
|
||||
|
||||
get idle() {
|
||||
return !this._state.asyncTo && Object.values(this.springs).every(spring => spring.idle);
|
||||
return !this._state.asyncTo && Object.values(this.springs).every(spring => {
|
||||
return spring.idle && !spring.isDelayed && !spring.isPaused;
|
||||
});
|
||||
}
|
||||
|
||||
get item() {
|
||||
@ -36361,24 +36468,50 @@ const initSpringRef = () => SpringRef();
|
||||
const useSpringRef = () => Object(react__WEBPACK_IMPORTED_MODULE_1__["useState"])(initSpringRef)[0];
|
||||
|
||||
function useTrail(length, propsArg, deps) {
|
||||
var _passedRef;
|
||||
|
||||
const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) && propsArg;
|
||||
if (propsFn && !deps) deps = [];
|
||||
let reverse = true;
|
||||
let passedRef = undefined;
|
||||
const result = useSprings(length, (i, ctrl) => {
|
||||
const props = propsFn ? propsFn(i, ctrl) : propsArg;
|
||||
passedRef = props.ref;
|
||||
reverse = reverse && props.reverse;
|
||||
return props;
|
||||
}, deps || [{}]);
|
||||
const ref = result[1];
|
||||
const ref = (_passedRef = passedRef) != null ? _passedRef : result[1];
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => {
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ref.current, (ctrl, i) => {
|
||||
const parent = ref.current[i + (reverse ? 1 : -1)];
|
||||
if (parent) ctrl.start({
|
||||
to: parent.springs
|
||||
});
|
||||
|
||||
if (parent) {
|
||||
ctrl.start({
|
||||
to: parent.springs
|
||||
});
|
||||
} else {
|
||||
ctrl.start();
|
||||
}
|
||||
});
|
||||
}, deps);
|
||||
|
||||
ref['start'] = propsArg => {
|
||||
const results = [];
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ref.current, (ctrl, i) => {
|
||||
const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) ? propsArg(i, ctrl) : propsArg;
|
||||
const parent = ref.current[i + (reverse ? 1 : -1)];
|
||||
|
||||
if (parent) {
|
||||
results.push(ctrl.start(_extends({}, props, {
|
||||
to: parent.springs
|
||||
})));
|
||||
} else {
|
||||
results.push(ctrl.start(_extends({}, props)));
|
||||
}
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
if (propsFn || arguments.length == 3) {
|
||||
ref['_getProps'] = (propsArg, ctrl, i) => {
|
||||
const props = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(propsArg) ? propsArg(i, ctrl) : propsArg;
|
||||
@ -36412,6 +36545,7 @@ function useTransition(data, props, deps) {
|
||||
sort,
|
||||
trail = 0,
|
||||
expires = true,
|
||||
exitBeforeEnter = false,
|
||||
onDestroyed,
|
||||
ref: propsRef,
|
||||
config: propsConfig
|
||||
@ -36424,14 +36558,16 @@ function useTransition(data, props, deps) {
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => {
|
||||
usedTransitions.current = transitions;
|
||||
});
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useOnce */ "C"])(() => () => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(usedTransitions.current, t => {
|
||||
if (t.expired) {
|
||||
clearTimeout(t.expirationId);
|
||||
}
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useOnce */ "C"])(() => () => {
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(usedTransitions.current, t => {
|
||||
if (t.expired) {
|
||||
clearTimeout(t.expirationId);
|
||||
}
|
||||
|
||||
detachRefs(t.ctrl, ref);
|
||||
t.ctrl.stop(true);
|
||||
}));
|
||||
detachRefs(t.ctrl, ref);
|
||||
t.ctrl.stop(true);
|
||||
});
|
||||
});
|
||||
const keys = getKeys(items, propsFn ? propsFn() : props, prevTransitions);
|
||||
const expired = reset && usedTransitions.current || [];
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(expired, ({
|
||||
@ -36491,6 +36627,8 @@ function useTransition(data, props, deps) {
|
||||
const forceUpdate = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useForceUpdate */ "z"])();
|
||||
const defaultProps = getDefaultProps(props);
|
||||
const changes = new Map();
|
||||
const exitingTransitions = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(new Map());
|
||||
const forceChange = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false);
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(transitions, (t, i) => {
|
||||
const key = t.key;
|
||||
const prevPhase = t.phase;
|
||||
@ -36576,30 +36714,53 @@ function useTransition(data, props, deps) {
|
||||
}
|
||||
|
||||
if (idle && transitions.some(t => t.expired)) {
|
||||
exitingTransitions.current.delete(t);
|
||||
|
||||
if (exitBeforeEnter) {
|
||||
forceChange.current = true;
|
||||
}
|
||||
|
||||
forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const springs = getSprings(t.ctrl, payload);
|
||||
changes.set(t, {
|
||||
phase,
|
||||
springs,
|
||||
payload
|
||||
});
|
||||
|
||||
if (phase === TransitionPhase.LEAVE && exitBeforeEnter) {
|
||||
exitingTransitions.current.set(t, {
|
||||
phase,
|
||||
springs,
|
||||
payload
|
||||
});
|
||||
} else {
|
||||
changes.set(t, {
|
||||
phase,
|
||||
springs,
|
||||
payload
|
||||
});
|
||||
}
|
||||
});
|
||||
const context = Object(react__WEBPACK_IMPORTED_MODULE_1__["useContext"])(SpringContext);
|
||||
const prevContext = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* usePrev */ "D"])(context);
|
||||
const hasContext = context !== prevContext && hasProps(context);
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => {
|
||||
if (hasContext) Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(transitions, t => {
|
||||
t.ctrl.start({
|
||||
default: context
|
||||
if (hasContext) {
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(transitions, t => {
|
||||
t.ctrl.start({
|
||||
default: context
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}, [context]);
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(changes, (_, t) => {
|
||||
if (exitingTransitions.current.size) {
|
||||
const ind = transitions.findIndex(state => state.key === t.key);
|
||||
transitions.splice(ind, 1);
|
||||
}
|
||||
});
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* useLayoutEffect */ "A"])(() => {
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(changes, ({
|
||||
Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(exitingTransitions.current.size ? exitingTransitions.current : changes, ({
|
||||
phase,
|
||||
payload
|
||||
}, t) => {
|
||||
@ -36618,10 +36779,14 @@ function useTransition(data, props, deps) {
|
||||
if (payload) {
|
||||
replaceRef(ctrl, payload.ref);
|
||||
|
||||
if (ctrl.ref) {
|
||||
if (ctrl.ref && !forceChange.current) {
|
||||
ctrl.update(payload);
|
||||
} else {
|
||||
ctrl.start(payload);
|
||||
|
||||
if (forceChange.current) {
|
||||
forceChange.current = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -37172,7 +37337,7 @@ raf.setTimeout = (handler, ms) => {
|
||||
let cancel = () => {
|
||||
let i = timeouts.findIndex(t => t.cancel == cancel);
|
||||
if (~i) timeouts.splice(i, 1);
|
||||
__raf.count -= ~i ? 1 : 0;
|
||||
pendingCount -= ~i ? 1 : 0;
|
||||
};
|
||||
|
||||
let timeout = {
|
||||
@ -37181,7 +37346,7 @@ raf.setTimeout = (handler, ms) => {
|
||||
cancel
|
||||
};
|
||||
timeouts.splice(findTimeout(time), 0, timeout);
|
||||
__raf.count += 1;
|
||||
pendingCount += 1;
|
||||
start();
|
||||
return timeout;
|
||||
};
|
||||
@ -37189,8 +37354,11 @@ raf.setTimeout = (handler, ms) => {
|
||||
let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
|
||||
|
||||
raf.cancel = fn => {
|
||||
onStartQueue.delete(fn);
|
||||
onFrameQueue.delete(fn);
|
||||
updateQueue.delete(fn);
|
||||
writeQueue.delete(fn);
|
||||
onFinishQueue.delete(fn);
|
||||
};
|
||||
|
||||
raf.sync = fn => {
|
||||
@ -37245,6 +37413,7 @@ raf.advance = () => {
|
||||
};
|
||||
|
||||
let ts = -1;
|
||||
let pendingCount = 0;
|
||||
let sync = false;
|
||||
|
||||
function schedule(fn, queue) {
|
||||
@ -37267,6 +37436,10 @@ function start() {
|
||||
}
|
||||
}
|
||||
|
||||
function stop() {
|
||||
ts = -1;
|
||||
}
|
||||
|
||||
function loop() {
|
||||
if (~ts) {
|
||||
nativeRaf(loop);
|
||||
@ -37281,7 +37454,7 @@ function react_spring_rafz_esm_update() {
|
||||
|
||||
if (count) {
|
||||
eachSafely(timeouts.splice(0, count), t => t.handler());
|
||||
__raf.count -= count;
|
||||
pendingCount -= count;
|
||||
}
|
||||
|
||||
onStartQueue.flush();
|
||||
@ -37289,6 +37462,10 @@ function react_spring_rafz_esm_update() {
|
||||
onFrameQueue.flush();
|
||||
writeQueue.flush();
|
||||
onFinishQueue.flush();
|
||||
|
||||
if (!pendingCount) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
function makeQueue() {
|
||||
@ -37296,21 +37473,21 @@ function makeQueue() {
|
||||
let current = next;
|
||||
return {
|
||||
add(fn) {
|
||||
__raf.count += current == next && !next.has(fn) ? 1 : 0;
|
||||
pendingCount += current == next && !next.has(fn) ? 1 : 0;
|
||||
next.add(fn);
|
||||
},
|
||||
|
||||
delete(fn) {
|
||||
__raf.count -= current == next && next.has(fn) ? 1 : 0;
|
||||
pendingCount -= current == next && next.has(fn) ? 1 : 0;
|
||||
return next.delete(fn);
|
||||
},
|
||||
|
||||
flush(arg) {
|
||||
if (current.size) {
|
||||
next = new Set();
|
||||
__raf.count -= current.size;
|
||||
pendingCount -= current.size;
|
||||
eachSafely(current, fn => fn(arg) && next.add(fn));
|
||||
__raf.count += next.size;
|
||||
pendingCount += next.size;
|
||||
current = next;
|
||||
}
|
||||
}
|
||||
@ -37329,7 +37506,13 @@ function eachSafely(values, each) {
|
||||
}
|
||||
|
||||
const __raf = {
|
||||
count: 0,
|
||||
count() {
|
||||
return pendingCount;
|
||||
},
|
||||
|
||||
isRunning() {
|
||||
return ts >= 0;
|
||||
},
|
||||
|
||||
clear() {
|
||||
ts = -1;
|
||||
@ -37339,7 +37522,7 @@ const __raf = {
|
||||
onFrameQueue = makeQueue();
|
||||
writeQueue = makeQueue();
|
||||
onFinishQueue = makeQueue();
|
||||
__raf.count = 0;
|
||||
pendingCount = 0;
|
||||
}
|
||||
|
||||
};
|
||||
@ -37949,14 +38132,53 @@ const setHidden = (target, key, value) => Object.defineProperty(target, key, {
|
||||
const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
|
||||
const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
|
||||
const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i');
|
||||
let namedColorRegex;
|
||||
const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
|
||||
const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
|
||||
|
||||
const variableToRgba = input => {
|
||||
const [token, fallback] = parseCSSVariable(input);
|
||||
|
||||
if (!token) {
|
||||
return input;
|
||||
}
|
||||
|
||||
const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
|
||||
|
||||
if (value) {
|
||||
return value.trim();
|
||||
} else if (fallback && fallback.startsWith('--')) {
|
||||
const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
|
||||
|
||||
if (_value) {
|
||||
return _value;
|
||||
} else {
|
||||
return input;
|
||||
}
|
||||
} else if (fallback && cssVariableRegex.test(fallback)) {
|
||||
return variableToRgba(fallback);
|
||||
} else if (fallback) {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return input;
|
||||
};
|
||||
|
||||
const parseCSSVariable = current => {
|
||||
const match = cssVariableRegex.exec(current);
|
||||
if (!match) return [,];
|
||||
const [, token, fallback] = match;
|
||||
return [token, fallback];
|
||||
};
|
||||
|
||||
let namedColorRegex;
|
||||
|
||||
const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
|
||||
|
||||
const createStringInterpolator = config => {
|
||||
if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
|
||||
const output = config.output.map(value => getFluidValue(value).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba));
|
||||
const output = config.output.map(value => {
|
||||
return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
|
||||
});
|
||||
const keyframes = output.map(value => value.match(numberRegex).map(Number));
|
||||
const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
|
||||
if (!(i in values)) {
|
||||
@ -38005,7 +38227,7 @@ function deprecateDirectCall() {
|
||||
}
|
||||
|
||||
function isAnimatedString(value) {
|
||||
return is.str(value) && (value[0] == '#' || /\d/.test(value) || value in (colors$1 || {}));
|
||||
return is.str(value) && (value[0] == '#' || /\d/.test(value) || cssVariableRegex.test(value) || value in (colors$1 || {}));
|
||||
}
|
||||
|
||||
const useOnce = effect => Object(external_React_["useEffect"])(effect, emptyDeps);
|
||||
@ -42194,7 +42416,6 @@ function ColorPanel(_ref) {
|
||||
|
||||
|
||||
const COLOR_SUPPORT_KEY = 'color';
|
||||
const EMPTY_OBJECT = {};
|
||||
|
||||
const hasColorSupport = blockType => {
|
||||
const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY);
|
||||
@ -42364,7 +42585,7 @@ function immutableSet(object, path, value) {
|
||||
|
||||
|
||||
function ColorEdit(props) {
|
||||
var _gradientsPerOrigin$t, _style$color6, _style$color7, _style$color8, _style$elements2, _style$elements2$link, _style$elements2$link2, _style$elements3, _style$elements3$link, _style$elements3$link2;
|
||||
var _style$color6, _style$color7, _style$color8, _style$elements2, _style$elements2$link, _style$elements2$link2, _style$elements3, _style$elements3$link, _style$elements3$link2;
|
||||
|
||||
const {
|
||||
name: blockName,
|
||||
@ -42377,15 +42598,17 @@ function ColorEdit(props) {
|
||||
const themePalette = Object(use_setting["a" /* default */])('color.palette.theme');
|
||||
const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default');
|
||||
const allSolids = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]);
|
||||
const gradientsPerOrigin = Object(use_setting["a" /* default */])('color.gradients') || EMPTY_OBJECT;
|
||||
const userGradientPalette = Object(use_setting["a" /* default */])('color.gradients.custom');
|
||||
const themeGradientPalette = Object(use_setting["a" /* default */])('color.gradients.theme');
|
||||
const defaultGradientPalette = Object(use_setting["a" /* default */])('color.gradients.default');
|
||||
const allGradients = Object(external_wp_element_["useMemo"])(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]);
|
||||
const areCustomSolidsEnabled = Object(use_setting["a" /* default */])('color.custom');
|
||||
const areCustomGradientsEnabled = Object(use_setting["a" /* default */])('color.customGradient');
|
||||
const isBackgroundEnabled = Object(use_setting["a" /* default */])('color.background');
|
||||
const isLinkEnabled = Object(use_setting["a" /* default */])('color.link');
|
||||
const isTextEnabled = Object(use_setting["a" /* default */])('color.text');
|
||||
const solidsEnabled = areCustomSolidsEnabled || !themePalette || (themePalette === null || themePalette === void 0 ? void 0 : themePalette.length) > 0;
|
||||
const gradientsEnabled = areCustomGradientsEnabled || !(gradientsPerOrigin !== null && gradientsPerOrigin !== void 0 && gradientsPerOrigin.theme) || (gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : (_gradientsPerOrigin$t = gradientsPerOrigin.theme) === null || _gradientsPerOrigin$t === void 0 ? void 0 : _gradientsPerOrigin$t.length) > 0;
|
||||
const allGradients = Object(external_wp_element_["useMemo"])(() => [...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.custom) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.theme) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.default) || [])], [gradientsPerOrigin]); // Shouldn't be needed but right now the ColorGradientsPanel
|
||||
const gradientsEnabled = areCustomGradientsEnabled || !themeGradientPalette || (themeGradientPalette === null || themeGradientPalette === void 0 ? void 0 : themeGradientPalette.length) > 0; // Shouldn't be needed but right now the ColorGradientsPanel
|
||||
// can trigger both onChangeColor and onChangeBackground
|
||||
// synchronously causing our two callbacks to override changes
|
||||
// from each other.
|
||||
@ -44409,6 +44632,7 @@ function compileStyleValue(uncompiledValue) {
|
||||
|
||||
function getInlineStyles() {
|
||||
let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
const ignoredStyles = ['spacing.blockGap'];
|
||||
const output = {};
|
||||
Object.keys(external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"]).forEach(propKey => {
|
||||
const path = external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"][propKey].value;
|
||||
@ -44428,7 +44652,7 @@ function getInlineStyles() {
|
||||
output[name] = compileStyleValue(value);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
} else if (!ignoredStyles.includes(path.join('.'))) {
|
||||
output[propKey] = compileStyleValue(Object(external_lodash_["get"])(styles, path));
|
||||
}
|
||||
}
|
||||
@ -45103,7 +45327,8 @@ const withLayoutStyles = Object(external_wp_compose_["createHigherOrderComponent
|
||||
});
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, shouldRenderLayoutStyles && element && Object(external_wp_element_["createPortal"])(Object(external_wp_element_["createElement"])(block_list_layout["b" /* LayoutStyle */], {
|
||||
selector: `.wp-container-${id}`,
|
||||
layout: usedLayout
|
||||
layout: usedLayout,
|
||||
style: attributes === null || attributes === void 0 ? void 0 : attributes.style
|
||||
}), element), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
|
||||
className: className
|
||||
})));
|
||||
@ -45251,7 +45476,7 @@ function getColorClassesAndStyles(attributes) {
|
||||
style: styleProp
|
||||
};
|
||||
}
|
||||
const use_color_props_EMPTY_OBJECT = {};
|
||||
const EMPTY_OBJECT = {};
|
||||
/**
|
||||
* Determines the color related props for a block derived from its color block
|
||||
* support attributes.
|
||||
@ -45276,7 +45501,7 @@ function useColorProps(attributes) {
|
||||
const userPalette = Object(use_setting["a" /* default */])('color.palette.custom') || [];
|
||||
const themePalette = Object(use_setting["a" /* default */])('color.palette.theme') || [];
|
||||
const defaultPalette = Object(use_setting["a" /* default */])('color.palette.default') || [];
|
||||
const gradientsPerOrigin = Object(use_setting["a" /* default */])('color.gradients') || use_color_props_EMPTY_OBJECT;
|
||||
const gradientsPerOrigin = Object(use_setting["a" /* default */])('color.gradients') || EMPTY_OBJECT;
|
||||
const colors = Object(external_wp_element_["useMemo"])(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]);
|
||||
const gradients = Object(external_wp_element_["useMemo"])(() => [...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.custom) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.theme) || []), ...((gradientsPerOrigin === null || gradientsPerOrigin === void 0 ? void 0 : gradientsPerOrigin.default) || [])], [gradientsPerOrigin]);
|
||||
const colorProps = getColorClassesAndStyles(attributes); // Force inline styles to apply colors when themes do not load their color
|
||||
|
8
wp-includes/js/dist/block-editor.min.js
vendored
8
wp-includes/js/dist/block-editor.min.js
vendored
File diff suppressed because one or more lines are too long
171
wp-includes/js/dist/block-library.js
vendored
171
wp-includes/js/dist/block-library.js
vendored
@ -6554,11 +6554,10 @@ const columns_metadata = {
|
||||
link: true
|
||||
},
|
||||
spacing: {
|
||||
blockGap: true,
|
||||
margin: ["top", "bottom"],
|
||||
padding: true,
|
||||
__experimentalDefaultControls: {
|
||||
blockGap: true
|
||||
padding: true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -23054,11 +23053,7 @@ const navigation_metadata = {
|
||||
}
|
||||
},
|
||||
spacing: {
|
||||
blockGap: true,
|
||||
units: ["px", "em", "rem", "vh", "vw"],
|
||||
__experimentalDefaultControls: {
|
||||
blockGap: true
|
||||
}
|
||||
units: ["px", "em", "rem", "vh", "vw"]
|
||||
},
|
||||
__experimentalLayout: {
|
||||
allowSwitching: false,
|
||||
@ -26438,7 +26433,7 @@ function PostAuthorEdit(_ref) {
|
||||
attributes,
|
||||
setAttributes
|
||||
} = _ref;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const {
|
||||
authorId,
|
||||
authorDetails,
|
||||
@ -26897,7 +26892,7 @@ function Content(props) {
|
||||
postId
|
||||
} = {}
|
||||
} = props;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const userCanEdit = useCanEditEntity('postType', postType, postId);
|
||||
const isEditable = userCanEdit && !isDescendentOfQueryLoop;
|
||||
return isEditable ? Object(external_wp_element_["createElement"])(EditableContent, props) : Object(external_wp_element_["createElement"])(ReadOnlyContent, {
|
||||
@ -27025,7 +27020,7 @@ function PostDateEdit(_ref) {
|
||||
},
|
||||
setAttributes
|
||||
} = _ref;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const [siteFormat] = Object(external_wp_coreData_["useEntityProp"])('root', 'site', 'date_format');
|
||||
const [date, setDate] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'date', postId);
|
||||
|
||||
@ -27300,7 +27295,7 @@ function PostExcerptEditor(_ref) {
|
||||
queryId
|
||||
}
|
||||
} = _ref;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const userCanEdit = useCanEditEntity('postType', postType, postId);
|
||||
const isEditable = userCanEdit && !isDescendentOfQueryLoop;
|
||||
const [rawExcerpt, setExcerpt, {
|
||||
@ -27590,7 +27585,7 @@ function PostFeaturedImageDisplay(_ref) {
|
||||
queryId
|
||||
}
|
||||
} = _ref;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const {
|
||||
isLink,
|
||||
height,
|
||||
@ -28510,7 +28505,7 @@ function PostTitleEdit(_ref) {
|
||||
}
|
||||
} = _ref;
|
||||
const TagName = 0 === level ? 'p' : 'h' + level;
|
||||
const isDescendentOfQueryLoop = !!queryId;
|
||||
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
||||
const userCanEdit = useCanEditEntity('postType', postType, postId);
|
||||
const [rawTitle = '', setTitle, fullTitle] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'title', postId);
|
||||
const [link] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'link', postId);
|
||||
@ -33641,7 +33636,8 @@ const SiteLogo = _ref => {
|
||||
width,
|
||||
height,
|
||||
isLink,
|
||||
linkTarget
|
||||
linkTarget,
|
||||
shouldSyncIcon
|
||||
},
|
||||
containerRef,
|
||||
isSelected,
|
||||
@ -33649,7 +33645,10 @@ const SiteLogo = _ref => {
|
||||
setLogo,
|
||||
logoUrl,
|
||||
siteUrl,
|
||||
logoId
|
||||
logoId,
|
||||
iconId,
|
||||
setIcon,
|
||||
canUserEdit
|
||||
} = _ref;
|
||||
const clientWidth = useClientWidth(containerRef, [align]);
|
||||
const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
|
||||
@ -33680,6 +33679,16 @@ const SiteLogo = _ref => {
|
||||
...Object(external_lodash_["pick"])(getSettings(), ['imageEditing', 'maxWidth'])
|
||||
};
|
||||
}, []);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
// Turn the `Use as site icon` toggle off if it is on but the logo and icon have
|
||||
// fallen out of sync. This can happen if the toggle is saved in the `on` position,
|
||||
// but changes are later made to the site icon in the Customizer.
|
||||
if (shouldSyncIcon && logoId !== iconId) {
|
||||
setAttributes({
|
||||
shouldSyncIcon: false
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
if (!isSelected) {
|
||||
setIsEditingImage(false);
|
||||
@ -33828,6 +33837,14 @@ const SiteLogo = _ref => {
|
||||
});
|
||||
}
|
||||
}, imgWrapper);
|
||||
const syncSiteIconHelpText = Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
|
||||
a: // eslint-disable-next-line jsx-a11y/anchor-has-content
|
||||
Object(external_wp_element_["createElement"])("a", {
|
||||
href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
|
||||
target: "_blank",
|
||||
rel: "noopener noreferrer"
|
||||
})
|
||||
});
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
|
||||
title: Object(external_wp_i18n_["__"])('Settings')
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
|
||||
@ -33852,6 +33869,16 @@ const SiteLogo = _ref => {
|
||||
linkTarget: value ? '_blank' : '_self'
|
||||
}),
|
||||
checked: linkTarget === '_blank'
|
||||
})), canUserEdit && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
|
||||
label: Object(external_wp_i18n_["__"])('Use as site icon'),
|
||||
onChange: value => {
|
||||
setAttributes({
|
||||
shouldSyncIcon: value
|
||||
});
|
||||
setIcon(value ? logoId : undefined);
|
||||
},
|
||||
checked: !!shouldSyncIcon,
|
||||
help: syncSiteIconHelpText
|
||||
})))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
|
||||
group: "block"
|
||||
}, canEditImage && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
|
||||
@ -33869,7 +33896,9 @@ function LogoEdit(_ref2) {
|
||||
isSelected
|
||||
} = _ref2;
|
||||
const {
|
||||
width
|
||||
className: styleClass,
|
||||
width,
|
||||
shouldSyncIcon
|
||||
} = attributes;
|
||||
const [logoUrl, setLogoUrl] = Object(external_wp_element_["useState"])();
|
||||
const ref = Object(external_wp_element_["useRef"])();
|
||||
@ -33877,6 +33906,7 @@ function LogoEdit(_ref2) {
|
||||
siteLogoId,
|
||||
canUserEdit,
|
||||
url,
|
||||
siteIconId,
|
||||
mediaItemData,
|
||||
isRequestingMediaItem
|
||||
} = Object(external_wp_data_["useSelect"])(select => {
|
||||
@ -33896,6 +33926,8 @@ function LogoEdit(_ref2) {
|
||||
|
||||
const _siteLogoId = _canUserEdit ? _siteLogo : _readOnlyLogo;
|
||||
|
||||
const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
|
||||
|
||||
const mediaItem = _siteLogoId && select(external_wp_coreData_["store"]).getMedia(_siteLogoId, {
|
||||
context: 'view'
|
||||
});
|
||||
@ -33913,15 +33945,54 @@ function LogoEdit(_ref2) {
|
||||
url: mediaItem.source_url,
|
||||
alt: mediaItem.alt_text
|
||||
},
|
||||
isRequestingMediaItem: _isRequestingMediaItem
|
||||
isRequestingMediaItem: _isRequestingMediaItem,
|
||||
siteIconId: _siteIconId
|
||||
};
|
||||
}, []);
|
||||
const {
|
||||
getGlobalBlockCount
|
||||
} = Object(external_wp_data_["useSelect"])(external_wp_blockEditor_["store"]);
|
||||
const {
|
||||
editEntityRecord
|
||||
} = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
// Cleanup function to discard unsaved changes to the icon and logo when
|
||||
// the block is removed.
|
||||
return () => {
|
||||
// Do nothing if the block is being rendered in the styles preview or the
|
||||
// block inserter.
|
||||
if (styleClass !== null && styleClass !== void 0 && styleClass.includes('block-editor-block-types-list__site-logo-example') || styleClass !== null && styleClass !== void 0 && styleClass.includes('block-editor-block-styles__block-preview-container')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const setLogo = newValue => editEntityRecord('root', 'site', undefined, {
|
||||
site_logo: newValue
|
||||
const logoBlockCount = getGlobalBlockCount('core/site-logo'); // Only discard unsaved changes if we are removing the last Site Logo block
|
||||
// on the page.
|
||||
|
||||
if (logoBlockCount === 0) {
|
||||
editEntityRecord('root', 'site', undefined, {
|
||||
site_logo: undefined,
|
||||
site_icon: undefined
|
||||
});
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const setLogo = function (newValue) {
|
||||
let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
|
||||
// `shouldForceSync` is used to force syncing when the attribute
|
||||
// may not have updated yet.
|
||||
if (shouldSyncIcon || shouldForceSync) {
|
||||
setIcon(newValue);
|
||||
}
|
||||
|
||||
editEntityRecord('root', 'site', undefined, {
|
||||
site_logo: newValue
|
||||
});
|
||||
};
|
||||
|
||||
const setIcon = newValue => editEntityRecord('root', 'site', undefined, {
|
||||
site_icon: newValue
|
||||
});
|
||||
|
||||
let alt = null;
|
||||
@ -33934,7 +34005,26 @@ function LogoEdit(_ref2) {
|
||||
}
|
||||
}
|
||||
|
||||
const onSelectLogo = media => {
|
||||
const onInitialSelectLogo = media => {
|
||||
// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no
|
||||
// site icon, automatically sync the logo to the icon.
|
||||
if (shouldSyncIcon === undefined) {
|
||||
const shouldForceSync = !siteIconId;
|
||||
setAttributes({
|
||||
shouldSyncIcon: shouldForceSync
|
||||
}); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by
|
||||
// the time `setLogo` is called, pass an argument to force the syncing.
|
||||
|
||||
onSelectLogo(media, shouldForceSync);
|
||||
return;
|
||||
}
|
||||
|
||||
onSelectLogo(media);
|
||||
};
|
||||
|
||||
const onSelectLogo = function (media) {
|
||||
let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
|
||||
if (!media) {
|
||||
return;
|
||||
}
|
||||
@ -33946,7 +34036,7 @@ function LogoEdit(_ref2) {
|
||||
return;
|
||||
}
|
||||
|
||||
setLogo(media.id);
|
||||
setLogo(media.id, shouldForceSync);
|
||||
};
|
||||
|
||||
const onRemoveLogo = () => {
|
||||
@ -33996,7 +34086,10 @@ function LogoEdit(_ref2) {
|
||||
logoUrl: logoUrl,
|
||||
setLogo: setLogo,
|
||||
logoId: (mediaItemData === null || mediaItemData === void 0 ? void 0 : mediaItemData.id) || siteLogoId,
|
||||
siteUrl: url
|
||||
siteUrl: url,
|
||||
setIcon: setIcon,
|
||||
iconId: siteIconId,
|
||||
canUserEdit: canUserEdit
|
||||
});
|
||||
}
|
||||
|
||||
@ -34031,7 +34124,7 @@ function LogoEdit(_ref2) {
|
||||
}, isLoading && Object(external_wp_element_["createElement"])("span", {
|
||||
className: "components-placeholder__preview"
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))), !logoUrl && canUserEdit && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], {
|
||||
onSelect: onSelectLogo,
|
||||
onSelect: onInitialSelectLogo,
|
||||
accept: ACCEPT_MEDIA_STRING,
|
||||
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
|
||||
onError: onUploadError,
|
||||
@ -34081,12 +34174,16 @@ const site_logo_metadata = {
|
||||
linkTarget: {
|
||||
type: "string",
|
||||
"default": "_self"
|
||||
},
|
||||
shouldSyncIcon: {
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
example: {
|
||||
viewportWidth: 500,
|
||||
attributes: {
|
||||
width: 350
|
||||
width: 350,
|
||||
className: "block-editor-block-types-list__site-logo-example"
|
||||
}
|
||||
},
|
||||
supports: {
|
||||
@ -39554,7 +39651,31 @@ const template_part_settings = {
|
||||
edit: TemplatePartEdit
|
||||
}; // Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
|
||||
|
||||
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations);
|
||||
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
|
||||
|
||||
const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
|
||||
Object(external_wp_hooks_["addFilter"])('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
|
||||
let {
|
||||
getBlock,
|
||||
getBlockParentsByBlockName
|
||||
} = _ref2;
|
||||
|
||||
if (blockType.name !== 'core/template-part') {
|
||||
return can;
|
||||
}
|
||||
|
||||
for (const disallowedParentType of DISALLOWED_PARENTS) {
|
||||
var _getBlock;
|
||||
|
||||
const hasDisallowedParent = ((_getBlock = getBlock(rootClientId)) === null || _getBlock === void 0 ? void 0 : _getBlock.name) === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length;
|
||||
|
||||
if (hasDisallowedParent) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
|
||||
|
||||
|
2
wp-includes/js/dist/block-library.min.js
vendored
2
wp-includes/js/dist/block-library.min.js
vendored
File diff suppressed because one or more lines are too long
84
wp-includes/js/dist/components.js
vendored
84
wp-includes/js/dist/components.js
vendored
@ -41251,7 +41251,7 @@ const NameContainer = Object(emotion_styled_base_browser_esm["a" /* default */])
|
||||
} : undefined)("line-height:", space(8), ";margin-left:", space(2), ";margin-right:", space(2), ";white-space:nowrap;overflow:hidden;" + ( true ? "" : undefined));
|
||||
const PaletteHeading = /*#__PURE__*/Object(emotion_styled_base_browser_esm["a" /* default */])(heading_component, true ? {
|
||||
target: "e5bw3225"
|
||||
} : undefined)("text-transform:uppercase;line-height:", space(6), ";&&&{margin-bottom:0;}" + ( true ? "" : undefined));
|
||||
} : undefined)("text-transform:uppercase;line-height:", space(6), ";font-weight:500;&&&{font-size:11px;margin-bottom:0;}" + ( true ? "" : undefined));
|
||||
const PaletteActionsContainer = /*#__PURE__*/Object(emotion_styled_base_browser_esm["a" /* default */])(view_component["a" /* default */], true ? {
|
||||
target: "e5bw3224"
|
||||
} : undefined)("height:", space(6), ";display:flex;" + ( true ? "" : undefined));
|
||||
@ -51484,12 +51484,13 @@ const FONT_SIZES_ALIASES = ['1', '2', '3', '4', '5'];
|
||||
*/
|
||||
|
||||
function splitValueAndUnitFromSize(size) {
|
||||
/**
|
||||
* The first matched result is ignored as it's the left
|
||||
* hand side of the capturing group in the regex.
|
||||
*/
|
||||
const [, numericValue, unit] = size.split(/(\d+)/);
|
||||
return [numericValue, unit];
|
||||
const [numericValue, unit] = `${size}`.match(/[\d\.]+|\D+/g);
|
||||
|
||||
if (!isNaN(parseFloat(numericValue)) && isFinite(numericValue)) {
|
||||
return [numericValue, unit];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
/**
|
||||
* Some themes use css vars for their font sizes, so until we
|
||||
@ -51500,7 +51501,7 @@ function splitValueAndUnitFromSize(size) {
|
||||
*/
|
||||
|
||||
function isSimpleCssValue(value) {
|
||||
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;
|
||||
const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%)?$/i;
|
||||
return sizeRegex.test(value);
|
||||
}
|
||||
/**
|
||||
@ -51534,7 +51535,7 @@ function getSelectOptions(optionsArray, disableCustomFontSizes) {
|
||||
key: slug,
|
||||
name,
|
||||
size,
|
||||
__experimentalHint: size && isSimpleCssValue(size) && parseInt(size)
|
||||
__experimentalHint: size && isSimpleCssValue(size) && parseFloat(size)
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -58858,20 +58859,28 @@ const DEFAULT_COLUMNS = 2;
|
||||
const generateMenuItems = _ref => {
|
||||
let {
|
||||
panelItems,
|
||||
shouldReset
|
||||
shouldReset,
|
||||
currentMenuItems
|
||||
} = _ref;
|
||||
const menuItems = {
|
||||
default: {},
|
||||
optional: {}
|
||||
};
|
||||
panelItems.forEach(_ref2 => {
|
||||
var _currentMenuItems$gro;
|
||||
|
||||
let {
|
||||
hasValue,
|
||||
isShownByDefault,
|
||||
label
|
||||
} = _ref2;
|
||||
const group = isShownByDefault ? 'default' : 'optional';
|
||||
menuItems[group][label] = shouldReset ? false : hasValue();
|
||||
const group = isShownByDefault ? 'default' : 'optional'; // If a menu item for this label already exists, do not overwrite its value.
|
||||
// This can cause default controls that have been flagged as customized to
|
||||
// lose their value.
|
||||
|
||||
const existingItemValue = currentMenuItems === null || currentMenuItems === void 0 ? void 0 : (_currentMenuItems$gro = currentMenuItems[group]) === null || _currentMenuItems$gro === void 0 ? void 0 : _currentMenuItems$gro[label];
|
||||
const value = existingItemValue !== undefined ? existingItemValue : hasValue();
|
||||
menuItems[group][label] = shouldReset ? false : value;
|
||||
});
|
||||
return menuItems;
|
||||
};
|
||||
@ -58900,7 +58909,19 @@ function useToolsPanel(props) {
|
||||
const [panelItems, setPanelItems] = Object(external_wp_element_["useState"])([]);
|
||||
|
||||
const registerPanelItem = item => {
|
||||
setPanelItems(items => [...items, item]);
|
||||
setPanelItems(items => {
|
||||
const newItems = [...items]; // If an item with this label is already registered, remove it first.
|
||||
// This can happen when an item is moved between the default and optional
|
||||
// groups.
|
||||
|
||||
const existingIndex = newItems.findIndex(oldItem => oldItem.label === item.label);
|
||||
|
||||
if (existingIndex !== -1) {
|
||||
newItems.splice(existingIndex, 1);
|
||||
}
|
||||
|
||||
return [...newItems, item];
|
||||
});
|
||||
}; // Panels need to deregister on unmount to avoid orphans in menu state.
|
||||
// This is an issue when panel items are being injected via SlotFills.
|
||||
|
||||
@ -58910,11 +58931,16 @@ function useToolsPanel(props) {
|
||||
// controls, e.g. both panels have a "padding" control, the
|
||||
// deregistration of the first panel doesn't occur until after the
|
||||
// registration of the next.
|
||||
const index = panelItems.findIndex(item => item.label === label);
|
||||
setPanelItems(items => {
|
||||
const newItems = [...items];
|
||||
const index = newItems.findIndex(item => item.label === label);
|
||||
|
||||
if (index !== -1) {
|
||||
setPanelItems(items => items.splice(index, 1));
|
||||
}
|
||||
if (index !== -1) {
|
||||
newItems.splice(index, 1);
|
||||
}
|
||||
|
||||
return newItems;
|
||||
});
|
||||
}; // Manage and share display state of menu items representing child controls.
|
||||
|
||||
|
||||
@ -58924,22 +58950,28 @@ function useToolsPanel(props) {
|
||||
}); // Setup menuItems state as panel items register themselves.
|
||||
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
const items = generateMenuItems({
|
||||
panelItems,
|
||||
shouldReset: false
|
||||
setMenuItems(prevState => {
|
||||
const items = generateMenuItems({
|
||||
panelItems,
|
||||
shouldReset: false,
|
||||
currentMenuItems: prevState
|
||||
});
|
||||
return items;
|
||||
});
|
||||
setMenuItems(items);
|
||||
}, [panelItems]); // Force a menu item to be checked.
|
||||
// This is intended for use with default panel items. They are displayed
|
||||
// separately to optional items and have different display states,
|
||||
//.we need to update that when their value is customized.
|
||||
// we need to update that when their value is customized.
|
||||
|
||||
const flagItemCustomization = function (label) {
|
||||
let group = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
||||
setMenuItems({ ...menuItems,
|
||||
[group]: { ...menuItems[group],
|
||||
[label]: true
|
||||
}
|
||||
setMenuItems(items => {
|
||||
const newState = { ...items,
|
||||
[group]: { ...items[group],
|
||||
[label]: true
|
||||
}
|
||||
};
|
||||
return newState;
|
||||
});
|
||||
}; // Whether all optional menu items are hidden or not must be tracked
|
||||
// in order to later determine if the panel display is empty and handle
|
||||
|
4
wp-includes/js/dist/components.min.js
vendored
4
wp-includes/js/dist/components.min.js
vendored
File diff suppressed because one or more lines are too long
23
wp-includes/js/dist/edit-post.js
vendored
23
wp-includes/js/dist/edit-post.js
vendored
@ -3746,12 +3746,12 @@ var external_wp_blockLibrary_ = __webpack_require__("QyPg");
|
||||
// EXTERNAL MODULE: external ["wp","data"]
|
||||
var external_wp_data_ = __webpack_require__("1ZqX");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 17 modules
|
||||
var build_module = __webpack_require__("U60i");
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","hooks"]
|
||||
var external_wp_hooks_ = __webpack_require__("g56x");
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@wordpress/interface/build-module/index.js + 17 modules
|
||||
var build_module = __webpack_require__("U60i");
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","mediaUtils"]
|
||||
var external_wp_mediaUtils_ = __webpack_require__("6aBm");
|
||||
|
||||
@ -5918,17 +5918,23 @@ function ModeSwitcher() {
|
||||
shortcut,
|
||||
isRichEditingEnabled,
|
||||
isCodeEditingEnabled,
|
||||
isEditingTemplate,
|
||||
mode
|
||||
} = Object(external_wp_data_["useSelect"])(select => ({
|
||||
shortcut: select(external_wp_keyboardShortcuts_["store"]).getShortcutRepresentation('core/edit-post/toggle-mode'),
|
||||
isRichEditingEnabled: select(external_wp_editor_["store"]).getEditorSettings().richEditingEnabled,
|
||||
isCodeEditingEnabled: select(external_wp_editor_["store"]).getEditorSettings().codeEditingEnabled,
|
||||
isEditingTemplate: select(store["a" /* store */]).isEditingTemplate(),
|
||||
mode: select(store["a" /* store */]).getEditorMode()
|
||||
}), []);
|
||||
const {
|
||||
switchEditorMode
|
||||
} = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
|
||||
|
||||
if (isEditingTemplate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isRichEditingEnabled || !isCodeEditingEnabled) {
|
||||
return null;
|
||||
}
|
||||
@ -9571,6 +9577,7 @@ function PluginSidebarMoreMenuItem(props) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
@ -9578,6 +9585,7 @@ function PluginSidebarMoreMenuItem(props) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Reinitializes the editor after the user chooses to reboot the editor after
|
||||
* an unhandled error occurs, replacing previously mounted editor element using
|
||||
@ -9617,6 +9625,15 @@ function reinitializeEditor(postType, postId, target, settings, initialEdits) {
|
||||
*/
|
||||
|
||||
function initializeEditor(id, postType, postId, settings, initialEdits) {
|
||||
// Prevent adding template part in the post editor.
|
||||
// Only add the filter when the post editor is initialized, not imported.
|
||||
Object(external_wp_hooks_["addFilter"])('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (can, blockType) => {
|
||||
if (!Object(external_wp_data_["select"])(store["a" /* store */]).isEditingTemplate() && blockType.name === 'core/template-part') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return can;
|
||||
});
|
||||
const target = document.getElementById(id);
|
||||
const reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
|
||||
Object(external_wp_data_["dispatch"])(build_module["i" /* store */]).setFeatureDefaults('core/edit-post', {
|
||||
|
2
wp-includes/js/dist/edit-post.min.js
vendored
2
wp-includes/js/dist/edit-post.min.js
vendored
File diff suppressed because one or more lines are too long
53
wp-includes/js/dist/edit-site.js
vendored
53
wp-includes/js/dist/edit-site.js
vendored
@ -488,7 +488,7 @@ function SiteExport() {
|
||||
icon: library_download,
|
||||
onClick: handleExport,
|
||||
info: Object(external_wp_i18n_["__"])('Download your templates and template parts.')
|
||||
}, Object(external_wp_i18n_["__"])('Export'));
|
||||
}, Object(external_wp_i18n_["_x"])('Export', 'site exporter menu item'));
|
||||
}
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","dataControls"]
|
||||
@ -530,23 +530,18 @@ const TEMPLATES_TOP_LEVEL = [...TEMPLATES_PRIMARY, ...TEMPLATES_SECONDARY];
|
||||
const TEMPLATES_GENERAL = ['page-home'];
|
||||
const TEMPLATES_POSTS_PREFIXES = ['post-', 'author-', 'single-post-', 'tag-'];
|
||||
const TEMPLATES_PAGES_PREFIXES = ['page-'];
|
||||
const TEMPLATES_NEW_OPTIONS = ['front-page', 'single-post', 'page', 'archive', 'search', '404', 'index'];
|
||||
const TEMPLATE_OVERRIDES = {
|
||||
singular: ['single', 'page'],
|
||||
index: ['archive', '404', 'search', 'singular', 'home'],
|
||||
home: ['front-page']
|
||||
};
|
||||
const MENU_ROOT = 'root';
|
||||
const MENU_CONTENT_CATEGORIES = 'content-categories';
|
||||
const MENU_CONTENT_PAGES = 'content-pages';
|
||||
const MENU_CONTENT_POSTS = 'content-posts';
|
||||
const MENU_TEMPLATE_PARTS = 'template-parts';
|
||||
const MENU_TEMPLATES = 'templates';
|
||||
const MENU_TEMPLATES_GENERAL = 'templates-general';
|
||||
const MENU_TEMPLATES_PAGES = 'templates-pages';
|
||||
const MENU_TEMPLATES_POSTS = 'templates-posts';
|
||||
const MENU_TEMPLATES_UNUSED = 'templates-unused';
|
||||
const SEARCH_DEBOUNCE_IN_MS = 75;
|
||||
const MENU_TEMPLATE_PARTS_HEADERS = 'template-parts-headers';
|
||||
const MENU_TEMPLATE_PARTS_FOOTERS = 'template-parts-footers';
|
||||
const MENU_TEMPLATE_PARTS_SIDEBARS = 'template-parts-sidebars';
|
||||
@ -6264,14 +6259,41 @@ function ResizableEditor(_ref) {
|
||||
return;
|
||||
}
|
||||
|
||||
const resizeObserver = new iframe.contentWindow.ResizeObserver(() => {
|
||||
setHeight(iframe.contentDocument.querySelector(`.edit-site-block-editor__block-list`).offsetHeight);
|
||||
}); // Observing the <html> rather than the <body> because the latter
|
||||
// gets destroyed and remounted after initialization in <Iframe>.
|
||||
let animationFrame = null;
|
||||
|
||||
resizeObserver.observe(iframe.contentDocument.documentElement);
|
||||
function resizeHeight() {
|
||||
if (!animationFrame) {
|
||||
// Throttle the updates on animation frame.
|
||||
animationFrame = iframe.contentWindow.requestAnimationFrame(() => {
|
||||
setHeight(iframe.contentDocument.documentElement.scrollHeight);
|
||||
animationFrame = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let resizeObserver;
|
||||
|
||||
function registerObserver() {
|
||||
var _resizeObserver;
|
||||
|
||||
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect();
|
||||
resizeObserver = new iframe.contentWindow.ResizeObserver(resizeHeight); // Observing the <html> rather than the <body> because the latter
|
||||
// gets destroyed and remounted after initialization in <Iframe>.
|
||||
|
||||
resizeObserver.observe(iframe.contentDocument.documentElement);
|
||||
resizeHeight();
|
||||
} // This is only required in Firefox for some unknown reasons.
|
||||
|
||||
|
||||
iframe.addEventListener('load', registerObserver); // This is required in Chrome and Safari.
|
||||
|
||||
registerObserver();
|
||||
return () => {
|
||||
resizeObserver.disconnect();
|
||||
var _iframe$contentWindow, _resizeObserver2;
|
||||
|
||||
(_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.cancelAnimationFrame(animationFrame);
|
||||
(_resizeObserver2 = resizeObserver) === null || _resizeObserver2 === void 0 ? void 0 : _resizeObserver2.disconnect();
|
||||
iframe.removeEventListener('load', registerObserver);
|
||||
};
|
||||
}, [enableResizing]);
|
||||
const resizeWidthBy = Object(external_wp_element_["useCallback"])(deltaPixels => {
|
||||
@ -6320,7 +6342,10 @@ function ResizableEditor(_ref) {
|
||||
styles: settings.styles
|
||||
}), Object(external_wp_element_["createElement"])("style", null, // Forming a "block formatting context" to prevent margin collapsing.
|
||||
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
||||
`.edit-site-block-editor__block-list { display: flow-root; }`)),
|
||||
`.is-root-container { display: flow-root; }`), enableResizing && Object(external_wp_element_["createElement"])("style", null, // Force the <html> and <body>'s heights to fit the content.
|
||||
`html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }`, // Some themes will have `min-height: 100vh` for the root container,
|
||||
// which isn't a requirement in auto resize mode.
|
||||
`.is-root-container { min-height: 0 !important; }`)),
|
||||
ref: ref,
|
||||
name: "editor-canvas",
|
||||
className: "edit-site-visual-editor__editor-canvas"
|
||||
@ -6418,7 +6443,7 @@ function BlockEditor(_ref) {
|
||||
clearSelectedBlock();
|
||||
}
|
||||
}
|
||||
}, Object(external_wp_element_["createElement"])(back_button, null), Object(external_wp_element_["createElement"])(resizable_editor // Reinitialize the editor and reset the states when the template changes.
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockEditorKeyboardShortcuts"].Register, null), Object(external_wp_element_["createElement"])(back_button, null), Object(external_wp_element_["createElement"])(resizable_editor // Reinitialize the editor and reset the states when the template changes.
|
||||
, {
|
||||
key: templateId,
|
||||
enableResizing: isTemplatePart && // Disable resizing in mobile viewport.
|
||||
|
4
wp-includes/js/dist/edit-site.min.js
vendored
4
wp-includes/js/dist/edit-site.min.js
vendored
File diff suppressed because one or more lines are too long
1
wp-includes/js/dist/editor.js
vendored
1
wp-includes/js/dist/editor.js
vendored
@ -5267,6 +5267,7 @@ const TRANSLATED_SITE_PROPERTIES = {
|
||||
title: Object(external_wp_i18n_["__"])('Title'),
|
||||
description: Object(external_wp_i18n_["__"])('Tagline'),
|
||||
site_logo: Object(external_wp_i18n_["__"])('Logo'),
|
||||
site_icon: Object(external_wp_i18n_["__"])('Icon'),
|
||||
show_on_front: Object(external_wp_i18n_["__"])('Show on front'),
|
||||
page_on_front: Object(external_wp_i18n_["__"])('Page on front')
|
||||
};
|
||||
|
2
wp-includes/js/dist/editor.min.js
vendored
2
wp-includes/js/dist/editor.min.js
vendored
File diff suppressed because one or more lines are too long
16
wp-includes/js/dist/server-side-render.js
vendored
16
wp-includes/js/dist/server-side-render.js
vendored
@ -307,6 +307,14 @@ function ServerSideRender(props) {
|
||||
const hasEmptyResponse = response === '';
|
||||
const hasError = response === null || response === void 0 ? void 0 : response.error;
|
||||
|
||||
if (isLoading) {
|
||||
return Object(external_wp_element_["createElement"])(LoadingResponsePlaceholder, Object(esm_extends["a" /* default */])({}, props, {
|
||||
showLoader: showLoader
|
||||
}), hasResponse && Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
|
||||
className: className
|
||||
}, response));
|
||||
}
|
||||
|
||||
if (hasEmptyResponse || !hasResponse) {
|
||||
return Object(external_wp_element_["createElement"])(EmptyResponsePlaceholder, props);
|
||||
}
|
||||
@ -317,14 +325,6 @@ function ServerSideRender(props) {
|
||||
}, props));
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return Object(external_wp_element_["createElement"])(LoadingResponsePlaceholder, Object(esm_extends["a" /* default */])({}, props, {
|
||||
showLoader: showLoader
|
||||
}), hasResponse && Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
|
||||
className: className
|
||||
}, response));
|
||||
}
|
||||
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
|
||||
className: className
|
||||
}, response);
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! This file is auto-generated */
|
||||
this.wp=this.wp||{},this.wp.serverSideRender=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="4dqW")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4dqW":function(e,t,r){"use strict";r.r(t);var n=r("wx14"),o=r("GRId"),c=r("1ZqX"),u=r("NMb1"),l=r.n(u),s=r("YLtl"),i=r("K9lf"),a=r("l3Sj"),d=r("ywyh"),p=r.n(d),f=r("Mmq9"),b=r("tI+e"),w=r("HSyU");function O(e){let{className:t}=e;return Object(o.createElement)(b.Placeholder,{className:t},Object(a.__)("Block rendered as empty."))}function j(e){let{response:t,className:r}=e;const n=Object(a.sprintf)(Object(a.__)("Error loading block: %s"),t.errorMsg);return Object(o.createElement)(b.Placeholder,{className:r},n)}function m(e){let{children:t,showLoader:r}=e;return Object(o.createElement)("div",{style:{position:"relative"}},r&&Object(o.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},Object(o.createElement)(b.Spinner,null)),Object(o.createElement)("div",{style:{opacity:r?"0.3":1}},t))}function y(e){const{attributes:t,block:r,className:c,httpMethod:u="GET",urlQueryArgs:l,EmptyResponsePlaceholder:a=O,ErrorResponsePlaceholder:d=j,LoadingResponsePlaceholder:b=m}=e,y=Object(o.useRef)(!0),[h,v]=Object(o.useState)(!1),S=Object(o.useRef)(),[g,E]=Object(o.useState)(null),x=Object(i.usePrevious)(e),[P,M]=Object(o.useState)(!1);function R(){if(!y.current)return;M(!0);const e=t&&Object(w.__experimentalSanitizeBlockAttributes)(r,t),n="POST"===u,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(f.addQueryArgs)("/wp/v2/block-renderer/"+e,{context:"edit",...null!==t?{attributes:t}:{},...r})}(r,n?null:null!=e?e:null,l),c=n?{attributes:null!=e?e:null}:null,s=S.current=p()({path:o,data:c,method:n?"POST":"GET"}).then(e=>{y.current&&s===S.current&&e&&E(e.rendered)}).catch(e=>{y.current&&s===S.current&&E({error:!0,errorMsg:e.message})}).finally(()=>{y.current&&s===S.current&&M(!1)});return s}const _=Object(i.useDebounce)(R,500);Object(o.useEffect)(()=>()=>{y.current=!1},[]),Object(o.useEffect)(()=>{void 0===x?R():Object(s.isEqual)(x,e)||_()}),Object(o.useEffect)(()=>{if(!P)return;const e=setTimeout(()=>{v(!0)},1e3);return()=>clearTimeout(e)},[P]);const T=!!g,N=""===g,L=null==g?void 0:g.error;return N||!T?Object(o.createElement)(a,e):L?Object(o.createElement)(d,Object(n.a)({response:g},e)):P?Object(o.createElement)(b,Object(n.a)({},e,{showLoader:h}),T&&Object(o.createElement)(o.RawHTML,{className:c},g)):Object(o.createElement)(o.RawHTML,{className:c},g)}const h={},v=Object(c.withSelect)(e=>{const t=e("core/editor");if(t){const e=t.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return h})(e=>{let{urlQueryArgs:t=h,currentPostId:r,...c}=e;const u=Object(o.useMemo)(()=>r?{post_id:r,...t}:t,[r,t]);return Object(o.createElement)(y,Object(n.a)({urlQueryArgs:u},c))});window&&window.wp&&window.wp.components&&(window.wp.components.ServerSideRender=Object(o.forwardRef)((e,t)=>(l()("wp.components.ServerSideRender",{since:"5.3",alternative:"wp.serverSideRender"}),Object(o.createElement)(v,Object(n.a)({},e,{ref:t})))));t.default=v},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},K9lf:function(e,t){e.exports=window.wp.compose},Mmq9:function(e,t){e.exports=window.wp.url},NMb1:function(e,t){e.exports=window.wp.deprecated},YLtl:function(e,t){e.exports=window.lodash},l3Sj:function(e,t){e.exports=window.wp.i18n},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}}).default;
|
||||
this.wp=this.wp||{},this.wp.serverSideRender=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="4dqW")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4dqW":function(e,t,r){"use strict";r.r(t);var n=r("wx14"),o=r("GRId"),c=r("1ZqX"),u=r("NMb1"),l=r.n(u),s=r("YLtl"),i=r("K9lf"),a=r("l3Sj"),d=r("ywyh"),p=r.n(d),f=r("Mmq9"),b=r("tI+e"),w=r("HSyU");function O(e){let{className:t}=e;return Object(o.createElement)(b.Placeholder,{className:t},Object(a.__)("Block rendered as empty."))}function j(e){let{response:t,className:r}=e;const n=Object(a.sprintf)(Object(a.__)("Error loading block: %s"),t.errorMsg);return Object(o.createElement)(b.Placeholder,{className:r},n)}function m(e){let{children:t,showLoader:r}=e;return Object(o.createElement)("div",{style:{position:"relative"}},r&&Object(o.createElement)("div",{style:{position:"absolute",top:"50%",left:"50%",marginTop:"-9px",marginLeft:"-9px"}},Object(o.createElement)(b.Spinner,null)),Object(o.createElement)("div",{style:{opacity:r?"0.3":1}},t))}function y(e){const{attributes:t,block:r,className:c,httpMethod:u="GET",urlQueryArgs:l,EmptyResponsePlaceholder:a=O,ErrorResponsePlaceholder:d=j,LoadingResponsePlaceholder:b=m}=e,y=Object(o.useRef)(!0),[h,v]=Object(o.useState)(!1),S=Object(o.useRef)(),[g,E]=Object(o.useState)(null),x=Object(i.usePrevious)(e),[P,M]=Object(o.useState)(!1);function R(){if(!y.current)return;M(!0);const e=t&&Object(w.__experimentalSanitizeBlockAttributes)(r,t),n="POST"===u,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(f.addQueryArgs)("/wp/v2/block-renderer/"+e,{context:"edit",...null!==t?{attributes:t}:{},...r})}(r,n?null:null!=e?e:null,l),c=n?{attributes:null!=e?e:null}:null,s=S.current=p()({path:o,data:c,method:n?"POST":"GET"}).then(e=>{y.current&&s===S.current&&e&&E(e.rendered)}).catch(e=>{y.current&&s===S.current&&E({error:!0,errorMsg:e.message})}).finally(()=>{y.current&&s===S.current&&M(!1)});return s}const _=Object(i.useDebounce)(R,500);Object(o.useEffect)(()=>()=>{y.current=!1},[]),Object(o.useEffect)(()=>{void 0===x?R():Object(s.isEqual)(x,e)||_()}),Object(o.useEffect)(()=>{if(!P)return;const e=setTimeout(()=>{v(!0)},1e3);return()=>clearTimeout(e)},[P]);const T=!!g,N=""===g,L=null==g?void 0:g.error;return P?Object(o.createElement)(b,Object(n.a)({},e,{showLoader:h}),T&&Object(o.createElement)(o.RawHTML,{className:c},g)):N||!T?Object(o.createElement)(a,e):L?Object(o.createElement)(d,Object(n.a)({response:g},e)):Object(o.createElement)(o.RawHTML,{className:c},g)}const h={},v=Object(c.withSelect)(e=>{const t=e("core/editor");if(t){const e=t.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return h})(e=>{let{urlQueryArgs:t=h,currentPostId:r,...c}=e;const u=Object(o.useMemo)(()=>r?{post_id:r,...t}:t,[r,t]);return Object(o.createElement)(y,Object(n.a)({urlQueryArgs:u},c))});window&&window.wp&&window.wp.components&&(window.wp.components.ServerSideRender=Object(o.forwardRef)((e,t)=>(l()("wp.components.ServerSideRender",{since:"5.3",alternative:"wp.serverSideRender"}),Object(o.createElement)(v,Object(n.a)({},e,{ref:t})))));t.default=v},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},K9lf:function(e,t){e.exports=window.wp.compose},Mmq9:function(e,t){e.exports=window.wp.url},NMb1:function(e,t){e.exports=window.wp.deprecated},YLtl:function(e,t){e.exports=window.lodash},l3Sj:function(e,t){e.exports=window.wp.i18n},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}}).default;
|
@ -781,7 +781,7 @@ class WP_REST_Templates_Controller extends WP_REST_Controller {
|
||||
'context' => array( 'embed', 'view', 'edit' ),
|
||||
'required' => true,
|
||||
'minLength' => 1,
|
||||
'pattern' => '[a-zA-Z_\-]+',
|
||||
'pattern' => '[a-zA-Z0-9_\-]+',
|
||||
),
|
||||
'theme' => array(
|
||||
'description' => __( 'Theme identifier for the template.' ),
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-beta4-52433';
|
||||
$wp_version = '5.9-beta4-52434';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user