Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536
 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896
 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589
 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581
 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

 - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569
 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534
 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573
 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585
 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572
 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501
 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625
 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622
 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2021-06-15 08:52:30 +00:00
parent f0ac297720
commit c114304471
63 changed files with 2138 additions and 1957 deletions

View File

@ -24,7 +24,10 @@ $preload_paths = array(
);
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
$editor_settings = get_block_editor_settings( array(), $block_editor_context );
$editor_settings = get_block_editor_settings(
get_legacy_widget_block_editor_settings(),
$block_editor_context
);
wp_add_inline_script(
'wp-edit-widgets',

File diff suppressed because one or more lines are too long

View File

@ -225,6 +225,20 @@ function get_default_block_editor_settings() {
$editor_settings['gradients'] = $gradient_presets;
}
return $editor_settings;
}
/**
* Returns the block editor settings needed to use the Legacy Widget block which
* is not registered by default.
*
* @since 5.8.0
*
* @return array Settings to be used with get_block_editor_settings().
*/
function get_legacy_widget_block_editor_settings() {
$editor_settings = array();
/**
* Filters the list of widget-type IDs that should **not** be offered by the
* Legacy Widget block.
@ -296,13 +310,32 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
$editor_settings['__experimentalFeatures'] = $theme_json->get_settings();
// These settings may need to be updated based on data coming from theme.json sources.
if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) {
$editor_settings['colors'] = $editor_settings['__experimentalFeatures']['color']['palette'];
unset( $editor_settings['__experimentalFeatures']['color']['palette'] );
if ( isset( $settings['__experimentalFeatures']['color']['palette'] ) ) {
$colors_by_origin = $settings['__experimentalFeatures']['color']['palette'];
$settings['colors'] = isset( $colors_by_origin['user'] ) ?
$colors_by_origin['user'] : (
isset( $colors_by_origin['theme'] ) ?
$colors_by_origin['theme'] :
$colors_by_origin['core']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) {
$editor_settings['gradients'] = $editor_settings['__experimentalFeatures']['color']['gradients'];
unset( $editor_settings['__experimentalFeatures']['color']['gradients'] );
if ( isset( $settings['__experimentalFeatures']['color']['gradients'] ) ) {
$gradients_by_origin = $settings['__experimentalFeatures']['color']['gradients'];
$settings['gradients'] = isset( $gradients_by_origin['user'] ) ?
$gradients_by_origin['user'] : (
isset( $gradients_by_origin['theme'] ) ?
$gradients_by_origin['theme'] :
$gradients_by_origin['core']
);
}
if ( isset( $settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
$font_sizes_by_origin = $settings['__experimentalFeatures']['typography']['fontSizes'];
$settings['fontSizes'] = isset( $font_sizes_by_origin['user'] ) ?
$font_sizes_by_origin['user'] : (
isset( $font_sizes_by_origin['theme'] ) ?
$font_sizes_by_origin['theme'] :
$font_sizes_by_origin['core']
);
}
if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) {
$editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom'];
@ -312,10 +345,6 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex
$editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient'];
unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) {
$editor_settings['fontSizes'] = $editor_settings['__experimentalFeatures']['typography']['fontSizes'];
unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] );
}
if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
$editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );

View File

@ -1 +0,0 @@
.wp-block-legacy-widget__edit-form{background:#fff;border-radius:2px;border:1px solid #1e1e1e;padding:11px}.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title{color:#000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;font-weight:600;margin:0 0 12px}.wp-block-legacy-widget__edit-form .widget-inside{border:none;box-shadow:none;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.wp-block-legacy-widget__edit-form .widget-inside label{font-size:13px}.wp-block-legacy-widget__edit-form .widget-inside label+.widefat{margin-top:12px}.wp-block-legacy-widget__edit-form .widget.open{z-index:0}.wp-block-legacy-widget__edit-no-preview,.wp-block-legacy-widget__edit-preview{cursor:pointer}.wp-block-legacy-widget__edit-no-preview:hover:after,.wp-block-legacy-widget__edit-preview:hover:after{border-radius:2px;border:1px solid #949494;bottom:0;content:"";right:0;position:absolute;left:0;top:0}.wp-block-legacy-widget__edit-preview.is-offscreen{right:-9999px;position:absolute;top:0;width:100%}.wp-block-legacy-widget__edit-preview-iframe{overflow:hidden;width:100%}.wp-block-legacy-widget__edit-no-preview{background:#f0f0f0;padding:8px 12px;font-size:13px}.wp-block-legacy-widget__edit-no-preview h3{font-size:14px;font-weight:600;margin:4px 0}.wp-block-legacy-widget__edit-no-preview p{margin:4px 0}.wp-block-legacy-widget-inspector-card{padding:0 52px 16px 16px}.interface-complementary-area .wp-block-legacy-widget-inspector-card__name{margin:0 0 5px;font-weight:500}.is-selected .wp-block-legacy-widget__container{padding:8px 12px;min-height:50px}

View File

@ -1 +0,0 @@
.wp-block-legacy-widget__edit-form{background:#fff;border-radius:2px;border:1px solid #1e1e1e;padding:11px}.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title{color:#000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;font-weight:600;margin:0 0 12px}.wp-block-legacy-widget__edit-form .widget-inside{border:none;box-shadow:none;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.wp-block-legacy-widget__edit-form .widget-inside label{font-size:13px}.wp-block-legacy-widget__edit-form .widget-inside label+.widefat{margin-top:12px}.wp-block-legacy-widget__edit-form .widget.open{z-index:0}.wp-block-legacy-widget__edit-no-preview,.wp-block-legacy-widget__edit-preview{cursor:pointer}.wp-block-legacy-widget__edit-no-preview:hover:after,.wp-block-legacy-widget__edit-preview:hover:after{border-radius:2px;border:1px solid #949494;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.wp-block-legacy-widget__edit-preview.is-offscreen{left:-9999px;position:absolute;top:0;width:100%}.wp-block-legacy-widget__edit-preview-iframe{overflow:hidden;width:100%}.wp-block-legacy-widget__edit-no-preview{background:#f0f0f0;padding:8px 12px;font-size:13px}.wp-block-legacy-widget__edit-no-preview h3{font-size:14px;font-weight:600;margin:4px 0}.wp-block-legacy-widget__edit-no-preview p{margin:4px 0}.wp-block-legacy-widget-inspector-card{padding:0 16px 16px 52px}.interface-complementary-area .wp-block-legacy-widget-inspector-card__name{margin:0 0 5px;font-weight:500}.is-selected .wp-block-legacy-widget__container{padding:8px 12px;min-height:50px}

View File

@ -5,7 +5,7 @@
"category": "design",
"description": "Displays the contents of a post or page.",
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"align": [ "wide", "full" ],
"html": false,

View File

@ -17,7 +17,7 @@
"default": false
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"html": false,
"color": {

View File

@ -21,7 +21,7 @@
"default": true
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"html": false,
"color": {

View File

@ -11,7 +11,7 @@
"default": false
}
},
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"supports": {
"align": [ "left", "right", "center", "wide", "full" ],
"html": false

View File

@ -5,7 +5,7 @@
"category": "design",
"description": "Displays the title of a post, page, or any other content-type.",
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"usesContext": [ "postId", "postType", "queryId" ],
"attributes": {
"textAlign": {
"type": "string"

View File

@ -112,34 +112,32 @@
justify-content: flex-end;
}
.wp-social-link {
.wp-block-social-link {
display: block;
border-radius: 9999px;
transition: transform 0.1s ease;
height: auto;
}
@media (prefers-reduced-motion: reduce) {
.wp-social-link {
.wp-block-social-link {
transition-duration: 0s;
transition-delay: 0s;
}
}
.wp-social-link a {
.wp-block-social-link a {
display: block;
line-height: 0;
transition: transform 0.1s ease;
}
.wp-social-link a,
.wp-social-link a:hover,
.wp-social-link a:active,
.wp-social-link a:visited,
.wp-social-link svg {
.wp-block-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg {
color: currentColor;
fill: currentColor;
}
.wp-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links:not(.is-style-logos-only) .wp-social-link {
background-color: #f0f0f0;

File diff suppressed because one or more lines are too long

View File

@ -112,34 +112,32 @@
justify-content: flex-end;
}
.wp-social-link {
.wp-block-social-link {
display: block;
border-radius: 9999px;
transition: transform 0.1s ease;
height: auto;
}
@media (prefers-reduced-motion: reduce) {
.wp-social-link {
.wp-block-social-link {
transition-duration: 0s;
transition-delay: 0s;
}
}
.wp-social-link a {
.wp-block-social-link a {
display: block;
line-height: 0;
transition: transform 0.1s ease;
}
.wp-social-link a,
.wp-social-link a:hover,
.wp-social-link a:active,
.wp-social-link a:visited,
.wp-social-link svg {
.wp-block-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg {
color: currentColor;
fill: currentColor;
}
.wp-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links:not(.is-style-logos-only) .wp-social-link {
background-color: #f0f0f0;

File diff suppressed because one or more lines are too long

View File

@ -837,7 +837,10 @@ final class WP_Customize_Widgets {
if ( wp_use_widgets_block_editor() ) {
$block_editor_context = new WP_Block_Editor_Context();
$editor_settings = get_block_editor_settings( array(), $block_editor_context );
$editor_settings = get_block_editor_settings(
get_legacy_widget_block_editor_settings(),
$block_editor_context
);
wp_add_inline_script(
'wp-customize-widgets',

View File

@ -248,7 +248,7 @@ class WP_Theme_JSON_Resolver {
$config = self::read_json_file( __DIR__ . '/theme.json' );
$config = self::translate( $config );
self::$core = new WP_Theme_JSON( $config );
self::$core = new WP_Theme_JSON( $config, 'core' );
return self::$core;
}

View File

@ -40,6 +40,12 @@ class WP_Theme_JSON {
*/
const ROOT_BLOCK_SELECTOR = 'body';
const VALID_ORIGINS = array(
'core',
'theme',
'user',
);
/**
* Presets are a set of values that serve
* to bootstrap some styles: colors, font sizes, etc.
@ -246,14 +252,31 @@ class WP_Theme_JSON {
* @since 5.8.0
*
* @param array $theme_json A structure that follows the theme.json schema.
* @param string $origin What source of data this object represents. One of core, theme, or user. Default: theme.
*/
public function __construct( $theme_json = array() ) {
public function __construct( $theme_json = array(), $origin = 'theme' ) {
if ( ! in_array( $origin, self::VALID_ORIGINS, true ) ) {
$origin = 'theme';
}
if ( ! isset( $theme_json['version'] ) || self::LATEST_SCHEMA !== $theme_json['version'] ) {
$this->theme_json = array();
return;
}
$this->theme_json = self::sanitize( $theme_json );
// Internally, presets are keyed by origin.
$nodes = self::get_setting_nodes( $this->theme_json );
foreach ( $nodes as $node ) {
foreach ( self::PRESETS_METADATA as $preset ) {
$path = array_merge( $node['path'], $preset['path'] );
$preset = _wp_array_get( $this->theme_json, $path, null );
if ( null !== $preset ) {
_wp_array_set( $this->theme_json, $path, array( $origin => $preset ) );
}
}
}
}
/**
@ -631,6 +654,32 @@ class WP_Theme_JSON {
return implode( ',', $new_selectors );
}
/**
* Given an array of presets keyed by origin and the value key of the preset,
* it returns an array where each key is the preset slug and each value the preset value.
*
* @param array $preset_per_origin Array of presets keyed by origin.
* @param string $value_key The property of the preset that contains its value.
*
* @return array Array of presets where each key is a slug and each value is the preset value.
*/
private static function get_merged_preset_by_slug( $preset_per_origin, $value_key ) {
$result = array();
foreach ( self::VALID_ORIGINS as $origin ) {
if ( ! isset( $preset_per_origin[ $origin ] ) ) {
continue;
}
foreach ( $preset_per_origin[ $origin ] as $preset ) {
// We don't want to use kebabCase here,
// see https://github.com/WordPress/gutenberg/issues/32347
// However, we need to make sure the generated class or css variable
// doesn't contain spaces.
$result[ preg_replace( '/\s+/', '-', $preset['slug'] ) ] = $preset[ $value_key ];
}
}
return $result;
}
/**
* Given a settings array, it returns the generated rulesets
* for the preset classes.
@ -651,19 +700,16 @@ class WP_Theme_JSON {
$stylesheet = '';
foreach ( self::PRESETS_METADATA as $preset ) {
$values = _wp_array_get( $settings, $preset['path'], array() );
foreach ( $values as $value ) {
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'] );
foreach ( $preset['classes'] as $class ) {
foreach ( $preset_by_slug as $slug => $value ) {
$stylesheet .= self::to_ruleset(
// We don't want to use kebabCase here,
// see https://github.com/WordPress/gutenberg/issues/32347
// However, we need to make sure the generated class
// doesn't contain spaces.
self::append_to_selector( $selector, '.has-' . preg_replace( '/\s+/', '-', $value['slug'] ) . '-' . $class['class_suffix'] ),
self::append_to_selector( $selector, '.has-' . $slug . '-' . $class['class_suffix'] ),
array(
array(
'name' => $class['property_name'],
'value' => $value[ $preset['value_key'] ] . ' !important',
'value' => $value . ' !important',
),
)
);
@ -695,11 +741,12 @@ class WP_Theme_JSON {
private static function compute_preset_vars( $settings ) {
$declarations = array();
foreach ( self::PRESETS_METADATA as $preset ) {
$values = _wp_array_get( $settings, $preset['path'], array() );
foreach ( $values as $value ) {
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'] );
foreach ( $preset_by_slug as $slug => $value ) {
$declarations[] = array(
'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . $value['slug'],
'value' => $value[ $preset['value_key'] ],
'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . $slug,
'value' => $value,
);
}
}
@ -1039,88 +1086,36 @@ class WP_Theme_JSON {
/**
* Merge new incoming data.
*
* @since 5.8.0
*
* @param WP_Theme_JSON $incoming Data to merge.
*/
public function merge( $incoming, $update_or_remove = 'remove' ) {
public function merge( $incoming ) {
$incoming_data = $incoming->get_raw_data();
$existing_data = $this->theme_json;
$this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data );
// The array_replace_recursive algorithm merges at the leaf level.
// For leaf values that are arrays it will use the numeric indexes for replacement.
$this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data );
// There are a few cases in which we want to merge things differently
// from what array_replace_recursive does.
// Some incoming properties should replace the existing.
// In those cases, we want to replace the existing with the incoming value, if it exists.
$to_replace = array();
$to_replace[] = array( 'custom' );
$to_replace[] = array( 'spacing', 'units' );
$to_replace[] = array( 'typography', 'fontSizes' );
$to_replace[] = array( 'typography', 'fontFamilies' );
// Some others should be appended to the existing.
// If the slug is the same than an existing element,
// the $update_or_remove param is used to decide
// what to do with the existing element:
// either remove it and append the incoming,
// or update it with the incoming.
$to_append = array();
$to_append[] = array( 'color', 'duotone' );
$to_append[] = array( 'color', 'gradients' );
$to_append[] = array( 'color', 'palette' );
$to_replace[] = array( 'color', 'duotone' );
foreach ( self::VALID_ORIGINS as $origin ) {
$to_replace[] = array( 'color', 'palette', $origin );
$to_replace[] = array( 'color', 'gradients', $origin );
$to_replace[] = array( 'typography', 'fontSizes', $origin );
$to_replace[] = array( 'typography', 'fontFamilies', $origin );
}
$nodes = self::get_setting_nodes( $this->theme_json );
foreach ( $nodes as $metadata ) {
foreach ( $to_replace as $path_to_replace ) {
$path = array_merge( $metadata['path'], $path_to_replace );
foreach ( $to_replace as $property_path ) {
$path = array_merge( $metadata['path'], $property_path );
$node = _wp_array_get( $incoming_data, $path, array() );
if ( ! empty( $node ) ) {
_wp_array_set( $this->theme_json, $path, $node );
}
}
foreach ( $to_append as $path_to_append ) {
$path = array_merge( $metadata['path'], $path_to_append );
$incoming_node = _wp_array_get( $incoming_data, $path, array() );
$existing_node = _wp_array_get( $existing_data, $path, array() );
if ( empty( $incoming_node ) && empty( $existing_node ) ) {
continue;
}
$index_table = array();
$existing_slugs = array();
$merged = array();
foreach ( $existing_node as $key => $value ) {
$index_table[ $value['slug'] ] = $key;
$existing_slugs[] = $value['slug'];
$merged[ $key ] = $value;
}
$to_remove = array();
foreach ( $incoming_node as $value ) {
if ( ! in_array( $value['slug'], $existing_slugs, true ) ) {
$merged[] = $value;
} elseif ( 'update' === $update_or_remove ) {
$merged[ $index_table[ $value['slug'] ] ] = $value;
} else {
$merged[] = $value;
$to_remove[] = $index_table[ $value['slug'] ];
}
}
// Remove the duplicated values and pack the sparsed array.
foreach ( $to_remove as $index ) {
unset( $merged[ $index ] );
}
$merged = array_values( $merged );
_wp_array_set( $this->theme_json, $path, $merged );
}
}
}
/**

View File

@ -323,10 +323,10 @@
left: 8px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-hovered {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
cursor: default;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-hovered::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered::after {
top: 1px;
right: 1px;
left: 1px;
@ -334,10 +334,10 @@
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
border-radius: 1px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
cursor: unset;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
top: 1px;
right: 1px;
@ -345,7 +345,7 @@
bottom: 1px;
border-radius: 1px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected:focus::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
@ -721,6 +721,9 @@
margin-top: 12px;
margin-bottom: 12px;
}
.components-popover.block-editor-block-list__block-popover.is-insertion-point-visible {
visibility: hidden;
}
.is-dragging-components-draggable .components-popover.block-editor-block-list__block-popover {
opacity: 0;
animation: hide-during-dragging 1ms linear forwards;

File diff suppressed because one or more lines are too long

View File

@ -323,10 +323,10 @@
right: 8px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-hovered {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
cursor: default;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-hovered::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered::after {
top: 1px;
left: 1px;
right: 1px;
@ -334,10 +334,10 @@
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
border-radius: 1px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
cursor: unset;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after {
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
top: 1px;
left: 1px;
@ -345,7 +345,7 @@
bottom: 1px;
border-radius: 1px;
}
.is-outline-mode:not(.is-typing) .block-editor-block-list__block.is-selected:focus::after {
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
@ -721,6 +721,9 @@
margin-top: 12px;
margin-bottom: 12px;
}
.components-popover.block-editor-block-list__block-popover.is-insertion-point-visible {
visibility: hidden;
}
.is-dragging-components-draggable .components-popover.block-editor-block-list__block-popover {
opacity: 0;
animation: hide-during-dragging 1ms linear forwards;

File diff suppressed because one or more lines are too long

View File

@ -1038,91 +1038,6 @@ figure.wp-block-image:not(.wp-block) {
margin-bottom: 20px;
}
.wp-block-legacy-widget__edit-form {
background: #fff;
border-radius: 2px;
border: 1px solid #1e1e1e;
padding: 11px;
}
.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title {
color: #000;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 600;
margin: 0 0 12px 0;
}
.wp-block-legacy-widget__edit-form .widget-inside {
border: none;
box-shadow: none;
display: block;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.wp-block-legacy-widget__edit-form .widget-inside label {
font-size: 13px;
}
.wp-block-legacy-widget__edit-form .widget-inside label + .widefat {
margin-top: 12px;
}
.wp-block-legacy-widget__edit-form .widget.open {
z-index: 0;
}
.wp-block-legacy-widget__edit-preview,
.wp-block-legacy-widget__edit-no-preview {
cursor: pointer;
}
.wp-block-legacy-widget__edit-preview:hover::after,
.wp-block-legacy-widget__edit-no-preview:hover::after {
border-radius: 2px;
border: 1px solid #949494;
bottom: 0;
content: "";
right: 0;
position: absolute;
left: 0;
top: 0;
}
.wp-block-legacy-widget__edit-preview.is-offscreen {
right: -9999px;
position: absolute;
top: 0;
width: 100%;
}
.wp-block-legacy-widget__edit-preview-iframe {
overflow: hidden;
width: 100%;
}
.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
padding: 8px 12px;
font-size: 13px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;
font-weight: 600;
margin: 4px 0;
}
.wp-block-legacy-widget__edit-no-preview p {
margin: 4px 0;
}
.wp-block-legacy-widget-inspector-card {
padding: 0 52px 16px 16px;
}
.interface-complementary-area .wp-block-legacy-widget-inspector-card__name {
margin: 0 0 5px;
font-weight: 500;
}
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}
.wp-block-media-text .__resizable_base__ {
grid-column: 1/span 2;
grid-row: 2;

File diff suppressed because one or more lines are too long

View File

@ -1043,91 +1043,6 @@ figure.wp-block-image:not(.wp-block) {
margin-bottom: 20px;
}
.wp-block-legacy-widget__edit-form {
background: #fff;
border-radius: 2px;
border: 1px solid #1e1e1e;
padding: 11px;
}
.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title {
color: #000;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 14px;
font-weight: 600;
margin: 0 0 12px 0;
}
.wp-block-legacy-widget__edit-form .widget-inside {
border: none;
box-shadow: none;
display: block;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
.wp-block-legacy-widget__edit-form .widget-inside label {
font-size: 13px;
}
.wp-block-legacy-widget__edit-form .widget-inside label + .widefat {
margin-top: 12px;
}
.wp-block-legacy-widget__edit-form .widget.open {
z-index: 0;
}
.wp-block-legacy-widget__edit-preview,
.wp-block-legacy-widget__edit-no-preview {
cursor: pointer;
}
.wp-block-legacy-widget__edit-preview:hover::after,
.wp-block-legacy-widget__edit-no-preview:hover::after {
border-radius: 2px;
border: 1px solid #949494;
bottom: 0;
content: "";
left: 0;
position: absolute;
right: 0;
top: 0;
}
.wp-block-legacy-widget__edit-preview.is-offscreen {
left: -9999px;
position: absolute;
top: 0;
width: 100%;
}
.wp-block-legacy-widget__edit-preview-iframe {
overflow: hidden;
width: 100%;
}
.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
padding: 8px 12px;
font-size: 13px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;
font-weight: 600;
margin: 4px 0;
}
.wp-block-legacy-widget__edit-no-preview p {
margin: 4px 0;
}
.wp-block-legacy-widget-inspector-card {
padding: 0 16px 16px 52px;
}
.interface-complementary-area .wp-block-legacy-widget-inspector-card__name {
margin: 0 0 5px;
font-weight: 500;
}
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}
.wp-block-media-text .__resizable_base__ {
grid-column: 1/span 2;
grid-row: 2;

File diff suppressed because one or more lines are too long

View File

@ -2310,34 +2310,32 @@ p.has-text-color a {
justify-content: flex-end;
}
.wp-social-link {
.wp-block-social-link {
display: block;
border-radius: 9999px;
transition: transform 0.1s ease;
height: auto;
}
@media (prefers-reduced-motion: reduce) {
.wp-social-link {
.wp-block-social-link {
transition-duration: 0s;
transition-delay: 0s;
}
}
.wp-social-link a {
.wp-block-social-link a {
display: block;
line-height: 0;
transition: transform 0.1s ease;
}
.wp-social-link a,
.wp-social-link a:hover,
.wp-social-link a:active,
.wp-social-link a:visited,
.wp-social-link svg {
.wp-block-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg {
color: currentColor;
fill: currentColor;
}
.wp-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links:not(.is-style-logos-only) .wp-social-link {
background-color: #f0f0f0;

File diff suppressed because one or more lines are too long

View File

@ -2350,34 +2350,32 @@ p.has-text-color a {
justify-content: flex-end;
}
.wp-social-link {
.wp-block-social-link {
display: block;
border-radius: 9999px;
transition: transform 0.1s ease;
height: auto;
}
@media (prefers-reduced-motion: reduce) {
.wp-social-link {
.wp-block-social-link {
transition-duration: 0s;
transition-delay: 0s;
}
}
.wp-social-link a {
.wp-block-social-link a {
display: block;
line-height: 0;
transition: transform 0.1s ease;
}
.wp-social-link a,
.wp-social-link a:hover,
.wp-social-link a:active,
.wp-social-link a:visited,
.wp-social-link svg {
.wp-block-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,
.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg {
color: currentColor;
fill: currentColor;
}
.wp-social-link:hover {
transform: scale(1.1);
}
.wp-block-social-links:not(.is-style-logos-only) .wp-social-link {
background-color: #f0f0f0;

File diff suppressed because one or more lines are too long

View File

@ -1629,8 +1629,31 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
}
@media (min-width: 782px) {
.edit-post-template__modal .components-base-control {
width: 320px;
}
}
.edit-post-template__modal .components-modal__header {
border-bottom: none;
}
.edit-post-template__modal .components-modal__content::before {
margin-bottom: 4px;
}
.edit-post-template__modal-actions {
padding-top: 12px;
margin-top: 12px;
}
.edit-post-template-modal__tip {
padding: 16px 24px;
background: #f0f0f0;
border-radius: 2px;
}
@media (min-width: 782px) {
.edit-post-template-modal__tip {
width: 240px;
}
}
.edit-post-template__actions button:not(:last-child) {
@ -1760,8 +1783,9 @@ h2.edit-post-template-summary__title {
.edit-post-visual-editor__content-area {
width: 100%;
height: 100%;
min-height: 100%;
position: relative;
display: flex;
}
.edit-post-welcome-guide {

File diff suppressed because one or more lines are too long

View File

@ -1633,8 +1633,31 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
}
@media (min-width: 782px) {
.edit-post-template__modal .components-base-control {
width: 320px;
}
}
.edit-post-template__modal .components-modal__header {
border-bottom: none;
}
.edit-post-template__modal .components-modal__content::before {
margin-bottom: 4px;
}
.edit-post-template__modal-actions {
padding-top: 12px;
margin-top: 12px;
}
.edit-post-template-modal__tip {
padding: 16px 24px;
background: #f0f0f0;
border-radius: 2px;
}
@media (min-width: 782px) {
.edit-post-template-modal__tip {
width: 240px;
}
}
.edit-post-template__actions button:not(:last-child) {
@ -1764,8 +1787,9 @@ h2.edit-post-template-summary__title {
.edit-post-visual-editor__content-area {
width: 100%;
height: 100%;
min-height: 100%;
position: relative;
display: flex;
}
.edit-post-welcome-guide {

File diff suppressed because one or more lines are too long

View File

@ -440,6 +440,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
.edit-widgets-header__actions {
display: flex;
}
.edit-widgets-header__actions .components-button {
margin-left: 4px;
}
@media (min-width: 600px) {
.edit-widgets-header__actions .components-button {
margin-left: 12px;
}
}
.edit-widgets-header__actions .edit-widgets-more-menu .components-button,
.edit-widgets-header__actions .interface-pinned-items .components-button {
margin-left: 0;
}
.edit-widgets-header-toolbar {
border: none;

File diff suppressed because one or more lines are too long

View File

@ -440,6 +440,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
.edit-widgets-header__actions {
display: flex;
}
.edit-widgets-header__actions .components-button {
margin-right: 4px;
}
@media (min-width: 600px) {
.edit-widgets-header__actions .components-button {
margin-right: 12px;
}
}
.edit-widgets-header__actions .edit-widgets-more-menu .components-button,
.edit-widgets-header__actions .interface-pinned-items .components-button {
margin-right: 0;
}
.edit-widgets-header-toolbar {
border: none;

File diff suppressed because one or more lines are too long

View File

@ -68,6 +68,18 @@
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
:root {
--wp-admin-theme-color: #007cba;
--wp-admin-theme-color-darker-10: #006ba1;
--wp-admin-theme-color-darker-20: #005a87;
--wp-admin-border-width-focus: 2px;
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
:root {
--wp-admin-border-width-focus: 1.5px;
}
}
.wp-block-legacy-widget__edit-form {
background: #fff;
border-radius: 2px;
@ -127,8 +139,9 @@
.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
padding: 8px 12px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
padding: 8px 12px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;

View File

@ -0,0 +1 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.wp-block-legacy-widget__edit-form{background:#fff;border-radius:2px;border:1px solid #1e1e1e;padding:11px}.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title{color:#000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;font-weight:600;margin:0 0 12px}.wp-block-legacy-widget__edit-form .widget-inside{border:none;box-shadow:none;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.wp-block-legacy-widget__edit-form .widget-inside label{font-size:13px}.wp-block-legacy-widget__edit-form .widget-inside label+.widefat{margin-top:12px}.wp-block-legacy-widget__edit-form .widget.open{z-index:0}.wp-block-legacy-widget__edit-no-preview,.wp-block-legacy-widget__edit-preview{cursor:pointer}.wp-block-legacy-widget__edit-no-preview:hover:after,.wp-block-legacy-widget__edit-preview:hover:after{border-radius:2px;border:1px solid #949494;bottom:0;content:"";right:0;position:absolute;left:0;top:0}.wp-block-legacy-widget__edit-preview.is-offscreen{right:-9999px;position:absolute;top:0;width:100%}.wp-block-legacy-widget__edit-preview-iframe{overflow:hidden;width:100%}.wp-block-legacy-widget__edit-no-preview{background:#f0f0f0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;padding:8px 12px}.wp-block-legacy-widget__edit-no-preview h3{font-size:14px;font-weight:600;margin:4px 0}.wp-block-legacy-widget__edit-no-preview p{margin:4px 0}.wp-block-legacy-widget-inspector-card{padding:0 52px 16px 16px}.interface-complementary-area .wp-block-legacy-widget-inspector-card__name{margin:0 0 5px;font-weight:500}.is-selected .wp-block-legacy-widget__container{padding:8px 12px;min-height:50px}

View File

@ -68,6 +68,18 @@
/**
* Reset the WP Admin page styles for Gutenberg-like pages.
*/
:root {
--wp-admin-theme-color: #007cba;
--wp-admin-theme-color-darker-10: #006ba1;
--wp-admin-theme-color-darker-20: #005a87;
--wp-admin-border-width-focus: 2px;
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
:root {
--wp-admin-border-width-focus: 1.5px;
}
}
.wp-block-legacy-widget__edit-form {
background: #fff;
border-radius: 2px;
@ -127,8 +139,9 @@
.wp-block-legacy-widget__edit-no-preview {
background: #f0f0f0;
padding: 8px 12px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
padding: 8px 12px;
}
.wp-block-legacy-widget__edit-no-preview h3 {
font-size: 14px;

View File

@ -0,0 +1 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.wp-block-legacy-widget__edit-form{background:#fff;border-radius:2px;border:1px solid #1e1e1e;padding:11px}.wp-block-legacy-widget__edit-form .wp-block-legacy-widget__edit-form-title{color:#000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;font-weight:600;margin:0 0 12px}.wp-block-legacy-widget__edit-form .widget-inside{border:none;box-shadow:none;display:block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}.wp-block-legacy-widget__edit-form .widget-inside label{font-size:13px}.wp-block-legacy-widget__edit-form .widget-inside label+.widefat{margin-top:12px}.wp-block-legacy-widget__edit-form .widget.open{z-index:0}.wp-block-legacy-widget__edit-no-preview,.wp-block-legacy-widget__edit-preview{cursor:pointer}.wp-block-legacy-widget__edit-no-preview:hover:after,.wp-block-legacy-widget__edit-preview:hover:after{border-radius:2px;border:1px solid #949494;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.wp-block-legacy-widget__edit-preview.is-offscreen{left:-9999px;position:absolute;top:0;width:100%}.wp-block-legacy-widget__edit-preview-iframe{overflow:hidden;width:100%}.wp-block-legacy-widget__edit-no-preview{background:#f0f0f0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;padding:8px 12px}.wp-block-legacy-widget__edit-no-preview h3{font-size:14px;font-weight:600;margin:4px 0}.wp-block-legacy-widget__edit-no-preview p{margin:4px 0}.wp-block-legacy-widget-inspector-card{padding:0 16px 16px 52px}.interface-complementary-area .wp-block-legacy-widget-inspector-card__name{margin:0 0 5px;font-weight:500}.is-selected .wp-block-legacy-widget__container{padding:8px 12px;min-height:50px}

View File

@ -7065,7 +7065,8 @@ __webpack_require__.d(__webpack_exports__, "__experimentalBlockVariationTransfor
__webpack_require__.d(__webpack_exports__, "BlockVerticalAlignmentToolbar", function() { return /* reexport */ BlockVerticalAlignmentToolbar; });
__webpack_require__.d(__webpack_exports__, "BlockVerticalAlignmentControl", function() { return /* reexport */ BlockVerticalAlignmentControl; });
__webpack_require__.d(__webpack_exports__, "__experimentalBorderStyleControl", function() { return /* reexport */ BorderStyleControl; });
__webpack_require__.d(__webpack_exports__, "ButtonBlockerAppender", function() { return /* reexport */ button_block_appender; });
__webpack_require__.d(__webpack_exports__, "ButtonBlockerAppender", function() { return /* reexport */ ButtonBlockerAppender; });
__webpack_require__.d(__webpack_exports__, "ButtonBlockAppender", function() { return /* reexport */ button_block_appender; });
__webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ color_palette; });
__webpack_require__.d(__webpack_exports__, "ColorPaletteControl", function() { return /* reexport */ ColorPaletteControl; });
__webpack_require__.d(__webpack_exports__, "ContrastChecker", function() { return /* reexport */ contrast_checker; });
@ -11493,6 +11494,13 @@ function actions_stopMultiSelect() {
*/
function* actions_multiSelect(start, end) {
const startBlockRootClientId = yield external_wp_data_["controls"].select(STORE_NAME, 'getBlockRootClientId', start);
const endBlockRootClientId = yield external_wp_data_["controls"].select(STORE_NAME, 'getBlockRootClientId', end); // Only allow block multi-selections at the same level.
if (startBlockRootClientId !== endBlockRootClientId) {
return;
}
yield {
type: 'MULTI_SELECT',
start,
@ -13515,18 +13523,11 @@ const deprecatedFlags = {
},
'spacing.customPadding': settings => settings.enableCustomSpacing
};
const filterColorsFromCoreOrigin = (path, setting) => {
if (path !== 'color.palette' && path !== 'color.gradients') {
return setting;
}
if (!Array.isArray(setting)) {
return setting;
}
const colors = setting.filter(color => (color === null || color === void 0 ? void 0 : color.origin) !== 'core');
return colors.length > 0 ? colors : setting;
const PATHS_WITH_MERGE = {
'color.gradients': true,
'color.palette': true,
'typography.fontFamilies': true,
'typography.fontSizes': true
};
/**
* Hook that retrieves the editor setting.
@ -13542,7 +13543,6 @@ const filterColorsFromCoreOrigin = (path, setting) => {
* ```
*/
function useSetting(path) {
const {
name: blockName
@ -13558,14 +13558,20 @@ function useSetting(path) {
const experimentalFeaturesResult = (_get = Object(external_lodash_["get"])(settings, blockPath)) !== null && _get !== void 0 ? _get : Object(external_lodash_["get"])(settings, defaultsPath);
if (experimentalFeaturesResult !== undefined) {
return filterColorsFromCoreOrigin(path, experimentalFeaturesResult);
if (PATHS_WITH_MERGE[path]) {
var _ref, _experimentalFeatures;
return (_ref = (_experimentalFeatures = experimentalFeaturesResult.user) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.core;
}
return experimentalFeaturesResult;
} // 2 - Use deprecated settings, otherwise.
const deprecatedSettingsValue = deprecatedFlags[path] ? deprecatedFlags[path](settings) : undefined;
if (deprecatedSettingsValue !== undefined) {
return filterColorsFromCoreOrigin(path, deprecatedSettingsValue);
return deprecatedSettingsValue;
} // 3 - Fall back for typography.dropCap:
// This is only necessary to support typography.dropCap.
// when __experimentalFeatures are not present (core without plugin).
@ -19203,10 +19209,14 @@ function BlockTitle({
/**
* Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.
*
* @param {Object} props Component props.
* @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail.
* @return {WPElement} Block Breadcrumb.
*/
function BlockBreadcrumb() {
function BlockBreadcrumb({
rootLabelText
}) {
const {
selectBlock,
clearSelectedBlock
@ -19228,6 +19238,8 @@ function BlockBreadcrumb() {
hasSelection: !!getSelectionStart().clientId
};
}, []);
const rootLabel = rootLabelText || Object(external_wp_i18n_["__"])('Document');
/*
* Disable reason: The `list` ARIA role is redundant but
* Safari+VoiceOver won't announce the list otherwise.
@ -19235,6 +19247,7 @@ function BlockBreadcrumb() {
/* eslint-disable jsx-a11y/no-redundant-roles */
return Object(external_wp_element_["createElement"])("ul", {
className: "block-editor-block-breadcrumb",
role: "list",
@ -19246,7 +19259,7 @@ function BlockBreadcrumb() {
className: "block-editor-block-breadcrumb__button",
isTertiary: true,
onClick: clearSelectedBlock
}, Object(external_wp_i18n_["__"])('Document')), !hasSelection && Object(external_wp_i18n_["__"])('Document')), parents.map(parentClientId => Object(external_wp_element_["createElement"])("li", {
}, rootLabel), !hasSelection && rootLabel), parents.map(parentClientId => Object(external_wp_element_["createElement"])("li", {
key: parentClientId
}, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
className: "block-editor-block-breadcrumb__button",
@ -20719,10 +20732,12 @@ function useBlockClassNames(clientId) {
getBlockName,
getSettings,
hasSelectedInnerBlock,
isTyping,
__experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames
} = select(store);
const {
__experimentalSpotlightEntityBlocks: spotlightEntityBlocks
__experimentalSpotlightEntityBlocks: spotlightEntityBlocks,
outlineMode
} = getSettings();
const isDragging = isBlockBeingDragged(clientId);
const isSelected = isBlockSelected(clientId);
@ -20740,7 +20755,8 @@ function useBlockClassNames(clientId) {
'has-child-selected': isAncestorOfSelectedBlock,
'has-active-entity': activeEntityBlockId,
// Determine if there is an active entity area to spotlight.
'is-active-entity': activeEntityBlockId === clientId
'is-active-entity': activeEntityBlockId === clientId,
'remove-outline': isSelected && outlineMode && isTyping()
});
}, [clientId]);
}
@ -23910,6 +23926,7 @@ function DefaultBlockAppender({
/**
* Internal dependencies
*/
@ -23971,10 +23988,22 @@ function ButtonBlockAppender({
});
}
/**
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md
* Use `ButtonBlockAppender` instead.
*
* @deprecated
*/
const ButtonBlockerAppender = Object(external_wp_element_["forwardRef"])((props, ref) => {
external_wp_deprecated_default()(`wp.blockEditor.ButtonBlockerAppender`, {
alternative: 'wp.blockEditor.ButtonBlockAppender'
});
return ButtonBlockAppender(props, ref);
});
/**
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md
*/
/* harmony default export */ var button_block_appender = (Object(external_wp_element_["forwardRef"])(ButtonBlockAppender));
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js
@ -24406,12 +24435,7 @@ function getNearestBlockIndex(elements, position, orientation) {
// If the user is dropping to the trailing edge of the block
// add 1 to the index to represent dragging after.
const isTrailingEdge = edge === 'bottom' || edge === 'right';
let offset = isTrailingEdge ? 1 : 0; // If the target is the dragged block itself and another 1 to
// index as the dragged block is set to `display: none` and
// should be skipped in the calculation.
const isTargetDraggedBlock = isTrailingEdge && elements[index + 1] && elements[index + 1].classList.contains('is-dragging');
offset += isTargetDraggedBlock ? 1 : 0; // Update the currently known best candidate.
const offset = isTrailingEdge ? 1 : 0; // Update the currently known best candidate.
candidateDistance = distance;
candidateIndex = index + offset;
@ -24438,32 +24462,28 @@ function useBlockDropZone({
rootClientId: targetRootClientId = ''
} = {}) {
const [targetBlockIndex, setTargetBlockIndex] = Object(external_wp_element_["useState"])(null);
const isLockedAll = Object(external_wp_data_["useSelect"])(select => {
const {
isLockedAll,
orientation
} = Object(external_wp_data_["useSelect"])(select => {
var _getBlockListSettings;
const {
getBlockListSettings,
getTemplateLock
} = select(store);
return {
isLockedAll: getTemplateLock(targetRootClientId) === 'all',
orientation: (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation
};
return getTemplateLock(targetRootClientId) === 'all';
}, [targetRootClientId]);
const {
getBlockListSettings
} = Object(external_wp_data_["useSelect"])(store);
const {
showInsertionPoint,
hideInsertionPoint
} = Object(external_wp_data_["useDispatch"])(store);
const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex);
const throttled = Object(external_wp_compose_["useThrottle"])(Object(external_wp_element_["useCallback"])((event, currentTarget) => {
var _getBlockListSettings;
const blockElements = Array.from(currentTarget.children);
const targetIndex = getNearestBlockIndex(blockElements, {
x: event.clientX,
y: event.clientY
}, orientation);
}, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation);
setTargetBlockIndex(targetIndex === undefined ? 0 : targetIndex);
if (targetIndex !== null) {
@ -24481,6 +24501,12 @@ function useBlockDropZone({
throttled(event, event.currentTarget);
},
onDragLeave() {
throttled.cancel();
hideInsertionPoint();
setTargetBlockIndex(null);
},
onDragEnd() {
throttled.cancel();
hideInsertionPoint();
@ -24560,7 +24586,6 @@ function InsertionPointPopover({
const ref = Object(external_wp_element_["useRef"])();
const {
orientation,
isHidden,
previousClientId,
nextClientId,
rootClientId,
@ -24571,38 +24596,34 @@ function InsertionPointPopover({
const {
getBlockOrder,
getBlockListSettings,
getMultiSelectedBlockClientIds,
getSelectedBlockClientId,
hasMultiSelection,
getSettings,
getBlockInsertionPoint
getBlockInsertionPoint,
isBlockBeingDragged,
getPreviousBlockClientId,
getNextBlockClientId
} = select(store);
const insertionPoint = getBlockInsertionPoint();
const order = getBlockOrder(insertionPoint.rootClientId);
const targetClientId = order[insertionPoint.index - 1];
const targetRootClientId = insertionPoint.rootClientId;
const blockOrder = getBlockOrder(targetRootClientId);
if (!blockOrder.length) {
if (!order.length) {
return {};
}
const previous = targetClientId ? targetClientId : blockOrder[blockOrder.length - 1];
const isLast = previous === blockOrder[blockOrder.length - 1];
const next = isLast ? null : blockOrder[blockOrder.indexOf(previous) + 1];
const {
hasReducedUI
} = getSettings();
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds();
const selectedBlockClientId = getSelectedBlockClientId();
const blockOrientation = ((_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical';
let _previousClientId = order[insertionPoint.index - 1];
let _nextClientId = order[insertionPoint.index];
while (isBlockBeingDragged(_previousClientId)) {
_previousClientId = getPreviousBlockClientId(_previousClientId);
}
while (isBlockBeingDragged(_nextClientId)) {
_nextClientId = getNextBlockClientId(_nextClientId);
}
return {
previousClientId: previous,
nextClientId: next,
isHidden: hasReducedUI || (hasMultiSelection() ? next && multiSelectedBlockClientIds.includes(next) : next && blockOrientation === 'vertical' && next === selectedBlockClientId),
orientation: blockOrientation,
clientId: targetClientId,
rootClientId: targetRootClientId,
previousClientId: _previousClientId,
nextClientId: _nextClientId,
orientation: ((_getBlockListSettings = getBlockListSettings(insertionPoint.rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation) || 'vertical',
rootClientId: insertionPoint.rootClientId,
isInserterShown: insertionPoint === null || insertionPoint === void 0 ? void 0 : insertionPoint.__unstableWithInserter
};
}, []);
@ -24704,11 +24725,7 @@ function InsertionPointPopover({
// should serve the purpose of inserting blocks.
const showInsertionPointInserter = !isHidden && nextElement && isInserterShown; // Show the indicator if the insertion point inserter is visible, or if
// the `showInsertionPoint` state is `true`. The latter is generally true
// when hovering blocks for insertion in the block library.
const showInsertionPointIndicator = showInsertionPointInserter || !isHidden;
const showInsertionPointInserter = nextElement && isInserterShown;
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
// While ideally it would be enough to capture the
// bubbling focus event from the Inserter, due to the
@ -24736,7 +24753,7 @@ function InsertionPointPopover({
'is-with-inserter': showInsertionPointInserter
}),
style: style
}, showInsertionPointIndicator && Object(external_wp_element_["createElement"])("div", {
}, Object(external_wp_element_["createElement"])("div", {
className: "block-editor-block-list__insertion-point-indicator"
}), showInsertionPointInserter && Object(external_wp_element_["createElement"])("div", {
className: classnames_default()('block-editor-block-list__insertion-point-inserter')
@ -24761,11 +24778,7 @@ function InsertionPoint({
__unstableContentRef
}) {
const isVisible = Object(external_wp_data_["useSelect"])(select => {
const {
isMultiSelecting,
isBlockInsertionPointVisible
} = select(store);
return isBlockInsertionPointVisible() && !isMultiSelecting();
return select(store).isBlockInsertionPointVisible();
}, []);
return Object(external_wp_element_["createElement"])(InsertionPointOpenRef.Provider, {
value: Object(external_wp_element_["useRef"])(false)
@ -24790,18 +24803,24 @@ function InsertionPoint({
function useInBetweenInserter() {
const openRef = Object(external_wp_element_["useContext"])(InsertionPointOpenRef);
const hasReducedUI = Object(external_wp_data_["useSelect"])(select => select(store).getSettings().hasReducedUI, []);
const {
getBlockListSettings,
getBlockRootClientId,
getBlockIndex,
isBlockInsertionPointVisible,
isMultiSelecting
isMultiSelecting,
getSelectedBlockClientIds
} = Object(external_wp_data_["useSelect"])(store);
const {
showInsertionPoint,
hideInsertionPoint
} = Object(external_wp_data_["useDispatch"])(store);
return Object(external_wp_compose_["useRefEffect"])(node => {
if (hasReducedUI) {
return;
}
function onMouseMove(event) {
var _getBlockListSettings;
@ -24855,6 +24874,12 @@ function useInBetweenInserter() {
if (!clientId) {
return;
} // Don't show the inserter when hovering above (conflicts with
// block toolbar) or inside selected block(s).
if (getSelectedBlockClientIds().includes(clientId)) {
return;
}
const elementRect = element.getBoundingClientRect();
@ -24887,7 +24912,7 @@ function useInBetweenInserter() {
return () => {
node.removeEventListener('mousemove', onMouseMove);
};
}, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint]);
}, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds]);
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/pre-parse-patterns.js
@ -27872,6 +27897,21 @@ function BlockPopover({
hasFixedToolbar,
lastClientId
} = Object(external_wp_data_["useSelect"])(block_popover_selector, []);
const isInsertionPointVisible = Object(external_wp_data_["useSelect"])(select => {
const {
isBlockInsertionPointVisible,
getBlockInsertionPoint,
getBlockOrder
} = select(store);
if (!isBlockInsertionPointVisible()) {
return false;
}
const insertionPoint = getBlockInsertionPoint();
const order = getBlockOrder(insertionPoint.rootClientId);
return order[insertionPoint.index] === clientId;
}, [clientId]);
const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
const [isToolbarForced, setIsToolbarForced] = Object(external_wp_element_["useState"])(false);
const [isInserterShown, setIsInserterShown] = Object(external_wp_element_["useState"])(false);
@ -27962,7 +28002,9 @@ function BlockPopover({
position: popoverPosition,
focusOnMount: false,
anchorRef: anchorRef,
className: "block-editor-block-list__block-popover",
className: classnames_default()('block-editor-block-list__block-popover', {
'is-insertion-point-visible': isInsertionPointVisible
}),
__unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
// otherwise render in place (not in the the default popover slot).
,
@ -28216,13 +28258,11 @@ function Root({
}) {
const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
const {
isTyping,
isOutlineMode,
isFocusMode,
isNavigationMode
} = Object(external_wp_data_["useSelect"])(select => {
const {
isTyping: _isTyping,
getSettings,
isNavigationMode: _isNavigationMode
} = select(store);
@ -28231,7 +28271,6 @@ function Root({
focusMode
} = getSettings();
return {
isTyping: _isTyping(),
isOutlineMode: outlineMode,
isFocusMode: focusMode,
isNavigationMode: _isNavigationMode()
@ -28240,7 +28279,6 @@ function Root({
return Object(external_wp_element_["createElement"])("div", {
ref: Object(external_wp_compose_["useMergeRefs"])([useBlockSelectionClearer(), useBlockDropZone(), useInBetweenInserter()]),
className: classnames_default()('block-editor-block-list__layout is-root-container', className, {
'is-typing': isTyping,
'is-outline-mode': isOutlineMode,
'is-focus-mode': isFocusMode && isLargeViewport,
'is-navigate-mode': isNavigationMode
@ -28250,14 +28288,12 @@ function Root({
function BlockList({
className,
__experimentalLayout
...props
}) {
usePreParsePatterns();
return Object(external_wp_element_["createElement"])(BlockToolsBackCompat, null, Object(external_wp_element_["createElement"])(Root, {
className: className
}, Object(external_wp_element_["createElement"])(BlockListItems, {
__experimentalLayout: __experimentalLayout
})));
}, Object(external_wp_element_["createElement"])(BlockListItems, props)));
}
function Items({

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1930,14 +1930,43 @@ function useDropZone({
const {
ownerDocument
} = element;
/**
* Checks if an element is in the drop zone.
*
* @param {HTMLElement|null} elementToCheck
*
* @return {boolean} True if in drop zone, false if not.
*/
function maybeDragStart(event) {
function isElementInZone(elementToCheck) {
if (!elementToCheck || !element.contains(elementToCheck)) {
return false;
}
do {
if (elementToCheck.dataset.isDropZone) {
return elementToCheck === element;
}
} while (elementToCheck = elementToCheck.parentElement);
return false;
}
function maybeDragStart(
/** @type {DragEvent} */
event) {
if (isDragging) {
return;
}
isDragging = true;
ownerDocument.removeEventListener('dragenter', maybeDragStart);
ownerDocument.removeEventListener('dragenter', maybeDragStart); // Note that `dragend` doesn't fire consistently for file and
// HTML drag events where the drag origin is outside the browser
// window. In Firefox it may also not fire if the originating
// node is removed.
ownerDocument.addEventListener('dragend', maybeDragEnd);
ownerDocument.addEventListener('mousemove', maybeDragEnd);
if (onDragStartRef.current) {
onDragStartRef.current(event);
@ -1976,7 +2005,7 @@ function useDropZone({
// leaving the drop zone, which means the `relatedTarget`
// (element that has been entered) should be outside the drop
// zone.
if (element.contains(event.relatedTarget)) {
if (isElementInZone(event.relatedTarget)) {
return;
}
@ -2014,32 +2043,30 @@ function useDropZone({
isDragging = false;
ownerDocument.addEventListener('dragenter', maybeDragStart);
ownerDocument.removeEventListener('dragend', maybeDragEnd);
ownerDocument.removeEventListener('mousemove', maybeDragEnd);
if (onDragEndRef.current) {
onDragEndRef.current(event);
}
}
element.dataset.isDropZone = 'true';
element.addEventListener('drop', onDrop);
element.addEventListener('dragenter', onDragEnter);
element.addEventListener('dragover', onDragOver);
element.addEventListener('dragleave', onDragLeave); // Note that `dragend` doesn't fire consistently for file and HTML
// drag events where the drag origin is outside the browser window.
// In Firefox it may also not fire if the originating node is
// removed.
ownerDocument.addEventListener('dragend', maybeDragEnd);
ownerDocument.addEventListener('mouseup', maybeDragEnd); // The `dragstart` event doesn't fire if the drag started outside
element.addEventListener('dragleave', onDragLeave); // The `dragstart` event doesn't fire if the drag started outside
// the document.
ownerDocument.addEventListener('dragenter', maybeDragStart);
return () => {
delete element.dataset.isDropZone;
element.removeEventListener('drop', onDrop);
element.removeEventListener('dragenter', onDragEnter);
element.removeEventListener('dragover', onDragOver);
element.removeEventListener('dragleave', onDragLeave);
ownerDocument.removeEventListener('dragend', maybeDragEnd);
ownerDocument.removeEventListener('mouseup', maybeDragEnd);
ownerDocument.removeEventListener('mousemove', maybeDragEnd);
ownerDocument.addEventListener('dragenter', maybeDragStart);
};
}, [isDisabled]);

File diff suppressed because one or more lines are too long

View File

@ -619,6 +619,7 @@ __webpack_require__.d(build_module_selectors_namespaceObject, "getThemeSupports"
__webpack_require__.d(build_module_selectors_namespaceObject, "getEmbedPreview", function() { return getEmbedPreview; });
__webpack_require__.d(build_module_selectors_namespaceObject, "isPreviewEmbedFallback", function() { return isPreviewEmbedFallback; });
__webpack_require__.d(build_module_selectors_namespaceObject, "canUser", function() { return canUser; });
__webpack_require__.d(build_module_selectors_namespaceObject, "canUserEditEntityRecord", function() { return canUserEditEntityRecord; });
__webpack_require__.d(build_module_selectors_namespaceObject, "getAutosaves", function() { return getAutosaves; });
__webpack_require__.d(build_module_selectors_namespaceObject, "getAutosave", function() { return getAutosave; });
__webpack_require__.d(build_module_selectors_namespaceObject, "hasFetchedAutosaves", function() { return hasFetchedAutosaves; });
@ -639,6 +640,7 @@ __webpack_require__.d(resolvers_namespaceObject, "getCurrentTheme", function() {
__webpack_require__.d(resolvers_namespaceObject, "getThemeSupports", function() { return resolvers_getThemeSupports; });
__webpack_require__.d(resolvers_namespaceObject, "getEmbedPreview", function() { return resolvers_getEmbedPreview; });
__webpack_require__.d(resolvers_namespaceObject, "canUser", function() { return resolvers_canUser; });
__webpack_require__.d(resolvers_namespaceObject, "canUserEditEntityRecord", function() { return resolvers_canUserEditEntityRecord; });
__webpack_require__.d(resolvers_namespaceObject, "getAutosaves", function() { return resolvers_getAutosaves; });
__webpack_require__.d(resolvers_namespaceObject, "getAutosave", function() { return resolvers_getAutosave; });
__webpack_require__.d(resolvers_namespaceObject, "__experimentalGetTemplateForLink", function() { return resolvers_experimentalGetTemplateForLink; });
@ -3852,6 +3854,28 @@ function canUser(state, action, resource, id) {
const key = Object(external_lodash_["compact"])([action, resource, id]).join('/');
return Object(external_lodash_["get"])(state, ['userPermissions', key]);
}
/**
* Returns whether the current user can edit the given entity.
*
* Calling this may trigger an OPTIONS request to the REST API via the
* `canUser()` resolver.
*
* https://developer.wordpress.org/rest-api/reference/
*
* @param {Object} state Data state.
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {number} key Record's key.
* @param {string} recordId Record's id.
* @return {boolean|undefined} Whether or not the user can edit,
* or `undefined` if the OPTIONS request is still being made.
*/
function canUserEditEntityRecord(state, kind, name, key, recordId) {
const entity = getEntityRecord(state, kind, name, key);
const resource = (entity === null || entity === void 0 ? void 0 : entity.rest_base) || '';
return canUser(state, 'update', resource, recordId);
}
/**
* Returns the latest autosaves for the post.
*
@ -4297,6 +4321,21 @@ function* resolvers_canUser(action, resource, id) {
const isAllowed = Object(external_lodash_["includes"])(allowHeader, method);
yield receiveUserPermission(key, isAllowed);
}
/**
* Checks whether the current user can perform the given action on the given
* REST resource.
*
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {number} key Record's key.
* @param {string} recordId Record's id.
*/
function* resolvers_canUserEditEntityRecord(kind, name, key, recordId) {
const entity = yield external_wp_data_["controls"].select('core', 'getEntityRecord', kind, name, key);
const resource = (entity === null || entity === void 0 ? void 0 : entity.rest_base) || '';
yield resolvers_canUser('update', resource, recordId);
}
/**
* Request autosave data from the REST API.
*
@ -4505,9 +4544,12 @@ function useEntityId(kind, type) {
* @param {string} prop The property name.
* @param {string} [_id] An entity ID to use instead of the context-provided one.
*
* @return {[*, Function]} A tuple where the first item is the
* property value and the second is the
* setter.
* @return {[*, Function, *]} An array where the first item is the
* property value, the second is the
* setter and the third is the full value
* object from REST API containing more
* information like `raw`, `rendered` and
* `protected` props.
*/
function useEntityProp(kind, type, prop, _id) {

File diff suppressed because one or more lines are too long

View File

@ -1498,7 +1498,9 @@ function SidebarBlockEditor({
isInserterOpened: isInserterOpened,
setIsInserterOpened: setIsInserterOpened,
isFixedToolbarActive: isFixedToolbarActive
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSelectionClearer"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ObserveTyping"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], null))))), Object(external_wp_element_["createPortal"])( // This is a temporary hack to prevent button component inside <BlockInspector>
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockTools"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockSelectionClearer"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ObserveTyping"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], {
renderAppender: external_wp_blockEditor_["ButtonBlockAppender"]
}))))), Object(external_wp_element_["createPortal"])( // This is a temporary hack to prevent button component inside <BlockInspector>
// from submitting form when type="button" is not specified.
Object(external_wp_element_["createElement"])("form", {
onSubmit: event => event.preventDefault()
@ -2422,6 +2424,7 @@ function initialize(editorName, blockEditorSettings) {
const coreBlocks = Object(external_wp_blockLibrary_["__experimentalGetCoreBlocks"])().filter(block => !['core/more'].includes(block.name));
Object(external_wp_blockLibrary_["registerCoreBlocks"])(coreBlocks);
Object(external_wp_widgets_["registerLegacyWidgetBlock"])();
if (false) {}

File diff suppressed because one or more lines are too long

View File

@ -3345,11 +3345,11 @@ function useSelect(_mapSelect, deps) {
errorMessage += `\nThe error may be correlated with this previous error:\n`;
errorMessage += `${latestMapOutputError.current.stack}\n\n`;
errorMessage += 'Original stack trace:';
throw new Error(errorMessage);
} else {
// eslint-disable-next-line no-console
} // eslint-disable-next-line no-console
console.error(errorMessage);
}
mapOutput = latestMapOutput.current;
}
}

File diff suppressed because one or more lines are too long

View File

@ -3986,10 +3986,14 @@ function __spreadArrays() {
return r;
}
function __spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}
function __await(v) {
@ -5035,10 +5039,14 @@ function tslib_es6_spreadArrays() {
return r;
}
function tslib_es6_spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
function tslib_es6_spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}
function tslib_es6_await(v) {
@ -6579,10 +6587,14 @@ function tslib_tslib_es6_spreadArrays() {
return r;
}
function tslib_tslib_es6_spreadArray(to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
function tslib_tslib_es6_spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || from);
}
function tslib_tslib_es6_await(v) {
@ -13132,7 +13144,7 @@ function VisualEditor({
setIsEditingTemplate
} = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
const desktopCanvasStyles = {
height: '100%',
minHeight: '100%',
width: '100%',
margin: 0,
display: 'flex',
@ -16787,7 +16799,7 @@ function PostTemplateActions() {
isLink: true,
onClick: () => setIsModalOpen(true)
}, Object(external_wp_i18n_["__"])('New'))), isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
title: Object(external_wp_i18n_["__"])('Create a custom template'),
title: Object(external_wp_i18n_["__"])('Create custom template'),
closeLabel: Object(external_wp_i18n_["__"])('Close'),
onRequestClose: () => {
setIsModalOpen(false);
@ -16814,15 +16826,20 @@ function PostTemplateActions() {
setIsModalOpen(false);
}
}, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
}, Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
align: "flex-start",
gap: 8
}, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
label: Object(external_wp_i18n_["__"])('Name'),
value: title,
onChange: setTitle
}), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
className: "edit-post-post-template__modal-actions",
justify: "flex-end"
onChange: setTitle,
help: Object(external_wp_i18n_["__"])('Describe the purpose of the template, e.g. "Full Width". Custom templates can be applied to any post or page.')
}))), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
className: "edit-post-template__modal-actions",
justify: "flex-end",
expanded: false
}, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
isSecondary: true,
isTertiary: true,
onClick: () => {
setIsModalOpen(false);
setTitle('');

File diff suppressed because one or more lines are too long

View File

@ -235,7 +235,8 @@ var external_lodash_ = __webpack_require__("YLtl");
const PREFERENCES_DEFAULTS = {
features: {
fixedToolbar: false,
welcomeGuide: true
welcomeGuide: true,
showBlockBreadcrumbs: true
}
};
@ -777,11 +778,14 @@ function* saveWidgetArea(widgetAreaId) {
const widget = transformBlockToWidget(block, oldWidget); // We'll replace the null widgetId after save, but we track it here
// since order is important.
sidebarWidgetsIds.push(widgetId);
sidebarWidgetsIds.push(widgetId); // We need to check for the id in the widget object here, because a deleted
// and restored widget won't have this id.
if (widgetId) {
if (widget.id) {
yield dispatch('core', 'editEntityRecord', 'root', 'widget', widgetId, { ...widget,
sidebar: widgetAreaId
}, {
undoIgnore: true
});
const hasEdits = yield controls_select('core', 'hasEditsForEntityRecord', 'root', 'widget', widgetId);
@ -824,10 +828,10 @@ function* saveWidgetArea(widgetAreaId) {
const {
block,
position
} = batchMeta[i];
yield dispatch('core/block-editor', 'updateBlockAttributes', block.clientId, {
__internalWidgetId: widget.id
});
} = batchMeta[i]; // Set __internalWidgetId on the block. This will be persisted to the
// store when we dispatch receiveEntityRecords( post ) below.
post.blocks[position].attributes.__internalWidgetId = widget.id;
const error = yield controls_select('core', 'getLastEntitySaveError', 'root', 'widget', widget.id);
if (error) {
@ -849,6 +853,8 @@ function* saveWidgetArea(widgetAreaId) {
yield dispatch('core', 'editEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
widgets: sidebarWidgetsIds
}, {
undoIgnore: true
});
yield* trySaveWidgetArea(widgetAreaId);
yield dispatch('core', 'receiveEntityRecords', KIND, POST_TYPE, post, undefined);
@ -1400,7 +1406,7 @@ function WidgetAreaInnerBlocks() {
onInput: onInput,
onChange: onChange,
templateLock: false,
renderAppender: external_wp_blockEditor_["InnerBlocks"].DefaultBlockAppender
renderAppender: external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender
});
}
@ -2560,6 +2566,12 @@ function MoreMenu() {
info: Object(external_wp_i18n_["__"])('Aids screen readers by stopping text caret from leaving blocks.'),
messageActivated: Object(external_wp_i18n_["__"])('Contain text cursor inside block activated'),
messageDeactivated: Object(external_wp_i18n_["__"])('Contain text cursor inside block deactivated')
}), Object(external_wp_element_["createElement"])(FeatureToggle, {
feature: "showBlockBreadcrumbs",
label: Object(external_wp_i18n_["__"])('Display block breadcrumbs'),
info: Object(external_wp_i18n_["__"])('Shows block breadcrumbs at the bottom of the editor.'),
messageActivated: Object(external_wp_i18n_["__"])('Display block breadcrumbs activated'),
messageDeactivated: Object(external_wp_i18n_["__"])('Display block breadcrumbs deactivated')
})))), Object(external_wp_element_["createElement"])(KeyboardShortcutHelpModal, {
isModalActive: isKeyboardShortcutsModalActive,
toggleModal: toggleKeyboardShortcutsModal
@ -2826,7 +2838,10 @@ const interfaceLabels = {
body: Object(external_wp_i18n_["__"])('Widgets and blocks'),
/* translators: accessibility text for the widgets screen settings landmark region. */
sidebar: Object(external_wp_i18n_["__"])('Widgets settings')
sidebar: Object(external_wp_i18n_["__"])('Widgets settings'),
/* translators: accessibility text for the widgets screen footer landmark region. */
footer: Object(external_wp_i18n_["__"])('Widgets footer')
};
function Interface({
@ -2843,11 +2858,13 @@ function Interface({
insertionIndex
} = use_widget_library_insertion_point();
const {
hasBlockBreadCrumbsEnabled,
hasSidebarEnabled,
isInserterOpened
} = Object(external_wp_data_["useSelect"])(select => ({
hasSidebarEnabled: !!select(build_module["g" /* store */]).getActiveComplementaryArea(store.name),
isInserterOpened: !!select(store).isInserterOpened()
isInserterOpened: !!select(store).isInserterOpened(),
hasBlockBreadCrumbsEnabled: select(store).__unstableIsFeatureActive('showBlockBreadcrumbs')
}), []); // Inserter and Sidebars are mutually exclusive
Object(external_wp_element_["useEffect"])(() => {
@ -2888,7 +2905,12 @@ function Interface({
}),
content: Object(external_wp_element_["createElement"])(WidgetAreasBlockEditorContent, {
blockEditorSettings: blockEditorSettings
})
}),
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && Object(external_wp_element_["createElement"])("div", {
className: "edit-widgets-layout__footer"
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockBreadcrumb"], {
rootLabelText: Object(external_wp_i18n_["__"])('Widgets')
}))
});
}
@ -3119,6 +3141,7 @@ function initialize(id, settings) {
const coreBlocks = Object(external_wp_blockLibrary_["__experimentalGetCoreBlocks"])().filter(block => !['core/more'].includes(block.name));
Object(external_wp_blockLibrary_["registerCoreBlocks"])(coreBlocks);
Object(external_wp_widgets_["registerLegacyWidgetBlock"])();
if (false) {}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1553,15 +1553,18 @@ function wp_default_styles( $styles ) {
'list-reusable-blocks' => array( 'wp-components' ),
'reusable-blocks' => array( 'wp-components' ),
'nux' => array( 'wp-components' ),
'edit-widgets' => array(
'widgets' => array(
'wp-components',
),
'edit-widgets' => array(
'wp-widgets',
'wp-block-editor',
'wp-edit-blocks',
'wp-block-library',
'wp-reusable-blocks',
),
'customize-widgets' => array(
'wp-components',
'wp-widgets',
'wp-block-editor',
'wp-edit-blocks',
'wp-block-library',
@ -1622,12 +1625,15 @@ function wp_default_styles( $styles ) {
'wp-block-library',
'wp-block-directory',
'wp-components',
'wp-customize-widgets',
'wp-edit-post',
'wp-edit-widgets',
'wp-editor',
'wp-format-library',
'wp-list-reusable-blocks',
'wp-reusable-blocks',
'wp-nux',
'wp-widgets',
// Deprecated CSS.
'deprecated-media',
'farbtastic',

View File

@ -76,10 +76,16 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID
*/
function the_block_template_skip_link() {
// Early exit if not an FSE theme.
// Early exit if not a block theme.
if ( ! current_theme_supports( 'block-templates' ) ) {
return;
}
// Early exit if not a block template.
global $_wp_current_template_content;
if ( ! $_wp_current_template_content ) {
return;
}
?>
<?php
@ -137,7 +143,12 @@ function the_block_template_skip_link() {
// Get the site wrapper.
// The skip-link will be injected in the beginning of it.
parentEl = document.querySelector( '.wp-site-blocks' ) || document.body,
parentEl = document.querySelector( '.wp-site-blocks' );
// Early exit if the root element was not found.
if ( ! parentEl ) {
return;
}
// Get the skip-link target's ID, and generate one if it doesn't exist.
skipLinkTargetID = skipLinkTarget.id;

View File

@ -50,74 +50,62 @@
{
"name": "Vivid cyan blue to vivid purple",
"gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",
"slug": "vivid-cyan-blue-to-vivid-purple",
"origin": "core"
"slug": "vivid-cyan-blue-to-vivid-purple"
},
{
"name": "Light green cyan to vivid green cyan",
"gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",
"slug": "light-green-cyan-to-vivid-green-cyan",
"origin": "core"
"slug": "light-green-cyan-to-vivid-green-cyan"
},
{
"name": "Luminous vivid amber to luminous vivid orange",
"gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",
"slug": "luminous-vivid-amber-to-luminous-vivid-orange",
"origin": "core"
"slug": "luminous-vivid-amber-to-luminous-vivid-orange"
},
{
"name": "Luminous vivid orange to vivid red",
"gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",
"slug": "luminous-vivid-orange-to-vivid-red",
"origin": "core"
"slug": "luminous-vivid-orange-to-vivid-red"
},
{
"name": "Very light gray to cyan bluish gray",
"gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",
"slug": "very-light-gray-to-cyan-bluish-gray",
"origin": "core"
"slug": "very-light-gray-to-cyan-bluish-gray"
},
{
"name": "Cool to warm spectrum",
"gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",
"slug": "cool-to-warm-spectrum",
"origin": "core"
"slug": "cool-to-warm-spectrum"
},
{
"name": "Blush light purple",
"gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",
"slug": "blush-light-purple",
"origin": "core"
"slug": "blush-light-purple"
},
{
"name": "Blush bordeaux",
"gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",
"slug": "blush-bordeaux",
"origin": "core"
"slug": "blush-bordeaux"
},
{
"name": "Luminous dusk",
"gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",
"slug": "luminous-dusk",
"origin": "core"
"slug": "luminous-dusk"
},
{
"name": "Pale ocean",
"gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",
"slug": "pale-ocean",
"origin": "core"
"slug": "pale-ocean"
},
{
"name": "Electric grass",
"gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",
"slug": "electric-grass",
"origin": "core"
"slug": "electric-grass"
},
{
"name": "Midnight",
"gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",
"slug": "midnight",
"origin": "core"
"slug": "midnight"
}
],
"link": false,
@ -125,74 +113,62 @@
{
"name": "Black",
"slug": "black",
"color": "#000000",
"origin": "core"
"color": "#000000"
},
{
"name": "Cyan bluish gray",
"slug": "cyan-bluish-gray",
"color": "#abb8c3",
"origin": "core"
"color": "#abb8c3"
},
{
"name": "White",
"slug": "white",
"color": "#ffffff",
"origin": "core"
"color": "#ffffff"
},
{
"name": "Pale pink",
"slug": "pale-pink",
"color": "#f78da7",
"origin": "core"
"color": "#f78da7"
},
{
"name": "Vivid red",
"slug": "vivid-red",
"color": "#cf2e2e",
"origin": "core"
"color": "#cf2e2e"
},
{
"name": "Luminous vivid orange",
"slug": "luminous-vivid-orange",
"color": "#ff6900",
"origin": "core"
"color": "#ff6900"
},
{
"name": "Luminous vivid amber",
"slug": "luminous-vivid-amber",
"color": "#fcb900",
"origin": "core"
"color": "#fcb900"
},
{
"name": "Light green cyan",
"slug": "light-green-cyan",
"color": "#7bdcb5",
"origin": "core"
"color": "#7bdcb5"
},
{
"name": "Vivid green cyan",
"slug": "vivid-green-cyan",
"color": "#00d084",
"origin": "core"
"color": "#00d084"
},
{
"name": "Pale cyan blue",
"slug": "pale-cyan-blue",
"color": "#8ed1fc",
"origin": "core"
"color": "#8ed1fc"
},
{
"name": "Vivid cyan blue",
"slug": "vivid-cyan-blue",
"color": "#0693e3",
"origin": "core"
"color": "#0693e3"
},
{
"name": "Vivid purple",
"slug": "vivid-purple",
"color": "#9b51e0",
"origin": "core"
"color": "#9b51e0"
}
]
},

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-beta1-51148';
$wp_version = '5.8-beta1-51149';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.