Editor: Update packages for 6.1 Release Candidate 1.

Package updates for bug and regression fixes:
@wordpress/block-directory: 3.15.6
@wordpress/block-editor: 10.0.6
@wordpress/block-library: 7.14.6
@wordpress/components: 21.0.5
@wordpress/customize-widgets: 3.14.6
@wordpress/edit-post: 6.14.6
@wordpress/edit-site: 4.14.8
@wordpress/edit-widgets: 4.14.6
@wordpress/editor: 12.16.6
@wordpress/format-library: 3.15.6
@wordpress/interface: 4.16.5
@wordpress/list-reusable-blocks: 3.15.5
@wordpress/nux: 5.15.5
@wordpress/preferences: 2.9.5
@wordpress/reusable-blocks: 3.15.6
@wordpress/server-side-render: 3.15.5
@wordpress/widgets: 2.15.6

References:
* [https://github.com/WordPress/gutenberg/pull/43181 Gutenberg PR 43181] - Merge inner blocks if wrappers are equal
* [https://github.com/WordPress/gutenberg/pull/44098 Gutenberg PR 44098] - Fix content blocks with nested blocks always appear as top level
* [https://github.com/WordPress/gutenberg/pull/44150 Gutenberg PR 44150] - Refresh selection styles
* [https://github.com/WordPress/gutenberg/pull/44415 Gutenberg PR 44415] - Removes `__unstableMaxPages` attribute from Page List and Nav blocks
* [https://github.com/WordPress/gutenberg/pull/44463 Gutenberg PR 44463] - Follow discussion settings in the comments block edit
* [https://github.com/WordPress/gutenberg/pull/44584 Gutenberg PR 44584] - Avoid querying block templates during installation
* [https://github.com/WordPress/gutenberg/pull/44637 Gutenberg PR 44637] - Resizable editor: Fix height setting bug
* [https://github.com/WordPress/gutenberg/pull/44640 Gutenberg PR 44640] - Only include theme.css if the theme declares support for wp-block-styles
* [https://github.com/WordPress/gutenberg/pull/44650 Gutenberg PR 44650] - Fix empty links being created for the author's name comment
* [https://github.com/WordPress/gutenberg/pull/44652 Gutenberg PR 44652] - Block Editor: Fix block search for non-Latin characters
* [https://github.com/WordPress/gutenberg/pull/44660 Gutenberg PR 44660] - Legacy Group inner block wrapper should work with constrained layout
* [https://github.com/WordPress/gutenberg/pull/44676 Gutenberg PR 44676] - Hide list items from content area of content locked blocks
* [https://github.com/WordPress/gutenberg/pull/44718 Gutenberg PR 44718] - Margin visualizer: Apply negative value to margins with `calc()`
* [https://github.com/WordPress/gutenberg/pull/44721 Gutenberg PR 44721] - Remove anchor support from the navigation block
* [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] - Buttons: Add specificity for the editor

Follow-up to [54257], [54335], and [54383].

Props bernhard-reiter, czapla, annezazu, cbravobernal, ndiego, bjorsch, nendeb55.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54483


git-svn-id: http://core.svn.wordpress.org/trunk@54042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2022-10-11 15:26:55 +00:00
parent ac36170175
commit 23d251e0ab
26 changed files with 761 additions and 710 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block )
$comment_author = get_comment_author( $comment ); $comment_author = get_comment_author( $comment );
$link = get_comment_author_url( $comment ); $link = get_comment_author_url( $comment );
if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) { if ( ! empty( $link ) && ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
$comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author ); $comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
} }
if ( '0' === $comment->comment_approved && ! $show_pending_links ) { if ( '0' === $comment->comment_approved && ! $show_pending_links ) {

View File

@ -98,7 +98,14 @@ function block_core_navigation_link_build_css_font_sizes( $context ) {
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
} elseif ( $has_custom_font_size ) { } elseif ( $has_custom_font_size ) {
// Add the custom font size inline style. // Add the custom font size inline style.
$font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); $font_sizes['inline_styles'] = sprintf(
'font-size: %s;',
gutenberg_get_typography_font_size_value(
array(
'size' => $context['style']['typography']['fontSize'],
)
)
);
} }
return $font_sizes; return $font_sizes;

View File

@ -98,7 +98,14 @@ function block_core_navigation_submenu_build_css_font_sizes( $context ) {
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
} elseif ( $has_custom_font_size ) { } elseif ( $has_custom_font_size ) {
// Add the custom font size inline style. // Add the custom font size inline style.
$font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); $font_sizes['inline_styles'] = sprintf(
'font-size: %s;',
gutenberg_get_typography_font_size_value(
array(
'size' => $context['style']['typography']['fontSize'],
)
)
);
} }
return $font_sizes; return $font_sizes;

View File

@ -307,9 +307,6 @@ function block_core_navigation_get_fallback_blocks() {
$page_list_fallback = array( $page_list_fallback = array(
array( array(
'blockName' => 'core/page-list', 'blockName' => 'core/page-list',
'attrs' => array(
'__unstableMaxPages' => 4,
),
), ),
); );

View File

@ -88,7 +88,6 @@
}, },
"supports": { "supports": {
"align": [ "wide", "full" ], "align": [ "wide", "full" ],
"anchor": true,
"html": false, "html": false,
"inserter": true, "inserter": true,
"typography": { "typography": {

View File

@ -119,7 +119,14 @@ function block_core_page_list_build_css_font_sizes( $context ) {
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
} elseif ( $has_custom_font_size ) { } elseif ( $has_custom_font_size ) {
// Add the custom font size inline style. // Add the custom font size inline style.
$font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); $font_sizes['inline_styles'] = sprintf(
'font-size: %s;',
gutenberg_get_typography_font_size_value(
array(
'size' => $context['style']['typography']['fontSize'],
)
)
);
} }
return $font_sizes; return $font_sizes;
@ -299,11 +306,6 @@ function render_block_core_page_list( $attributes, $content, $block ) {
$nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children ); $nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children );
// Limit the number of items to be visually displayed.
if ( ! empty( $attributes['__unstableMaxPages'] ) ) {
$nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] );
}
$is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context ); $is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context );
$open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false; $open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false;

View File

@ -7,11 +7,7 @@
"description": "Display a list of all pages.", "description": "Display a list of all pages.",
"keywords": [ "menu", "navigation" ], "keywords": [ "menu", "navigation" ],
"textdomain": "default", "textdomain": "default",
"attributes": { "attributes": {},
"__unstableMaxPages": {
"type": "number"
}
},
"usesContext": [ "usesContext": [
"textColor", "textColor",
"customTextColor", "customTextColor",

View File

@ -2,62 +2,62 @@
// This file was autogenerated by tools/release/sync-stable-blocks.js, do not change manually! // This file was autogenerated by tools/release/sync-stable-blocks.js, do not change manually!
// Requires files for dynamic blocks necessary for core blocks registration. // Requires files for dynamic blocks necessary for core blocks registration.
require ABSPATH . WPINC . '/blocks/archives.php'; require_once ABSPATH . WPINC . '/blocks/archives.php';
require ABSPATH . WPINC . '/blocks/avatar.php'; require_once ABSPATH . WPINC . '/blocks/avatar.php';
require ABSPATH . WPINC . '/blocks/block.php'; require_once ABSPATH . WPINC . '/blocks/block.php';
require ABSPATH . WPINC . '/blocks/calendar.php'; require_once ABSPATH . WPINC . '/blocks/calendar.php';
require ABSPATH . WPINC . '/blocks/categories.php'; require_once ABSPATH . WPINC . '/blocks/categories.php';
require ABSPATH . WPINC . '/blocks/comment-author-name.php'; require_once ABSPATH . WPINC . '/blocks/comment-author-name.php';
require ABSPATH . WPINC . '/blocks/comment-content.php'; require_once ABSPATH . WPINC . '/blocks/comment-content.php';
require ABSPATH . WPINC . '/blocks/comment-date.php'; require_once ABSPATH . WPINC . '/blocks/comment-date.php';
require ABSPATH . WPINC . '/blocks/comment-edit-link.php'; require_once ABSPATH . WPINC . '/blocks/comment-edit-link.php';
require ABSPATH . WPINC . '/blocks/comment-reply-link.php'; require_once ABSPATH . WPINC . '/blocks/comment-reply-link.php';
require ABSPATH . WPINC . '/blocks/comment-template.php'; require_once ABSPATH . WPINC . '/blocks/comment-template.php';
require ABSPATH . WPINC . '/blocks/comments.php'; require_once ABSPATH . WPINC . '/blocks/comments.php';
require ABSPATH . WPINC . '/blocks/comments-pagination.php'; require_once ABSPATH . WPINC . '/blocks/comments-pagination.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-next.php'; require_once ABSPATH . WPINC . '/blocks/comments-pagination-next.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php'; require_once ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php';
require ABSPATH . WPINC . '/blocks/comments-pagination-previous.php'; require_once ABSPATH . WPINC . '/blocks/comments-pagination-previous.php';
require ABSPATH . WPINC . '/blocks/comments-title.php'; require_once ABSPATH . WPINC . '/blocks/comments-title.php';
require ABSPATH . WPINC . '/blocks/cover.php'; require_once ABSPATH . WPINC . '/blocks/cover.php';
require ABSPATH . WPINC . '/blocks/file.php'; require_once ABSPATH . WPINC . '/blocks/file.php';
require ABSPATH . WPINC . '/blocks/gallery.php'; require_once ABSPATH . WPINC . '/blocks/gallery.php';
require ABSPATH . WPINC . '/blocks/home-link.php'; require_once ABSPATH . WPINC . '/blocks/home-link.php';
require ABSPATH . WPINC . '/blocks/image.php'; require_once ABSPATH . WPINC . '/blocks/image.php';
require ABSPATH . WPINC . '/blocks/latest-comments.php'; require_once ABSPATH . WPINC . '/blocks/latest-comments.php';
require ABSPATH . WPINC . '/blocks/latest-posts.php'; require_once ABSPATH . WPINC . '/blocks/latest-posts.php';
require ABSPATH . WPINC . '/blocks/loginout.php'; require_once ABSPATH . WPINC . '/blocks/loginout.php';
require ABSPATH . WPINC . '/blocks/navigation.php'; require_once ABSPATH . WPINC . '/blocks/navigation.php';
require ABSPATH . WPINC . '/blocks/navigation-link.php'; require_once ABSPATH . WPINC . '/blocks/navigation-link.php';
require ABSPATH . WPINC . '/blocks/navigation-submenu.php'; require_once ABSPATH . WPINC . '/blocks/navigation-submenu.php';
require ABSPATH . WPINC . '/blocks/page-list.php'; require_once ABSPATH . WPINC . '/blocks/page-list.php';
require ABSPATH . WPINC . '/blocks/pattern.php'; require_once ABSPATH . WPINC . '/blocks/pattern.php';
require ABSPATH . WPINC . '/blocks/post-author.php'; require_once ABSPATH . WPINC . '/blocks/post-author.php';
require ABSPATH . WPINC . '/blocks/post-author-biography.php'; require_once ABSPATH . WPINC . '/blocks/post-author-biography.php';
require ABSPATH . WPINC . '/blocks/post-comments-form.php'; require_once ABSPATH . WPINC . '/blocks/post-comments-form.php';
require ABSPATH . WPINC . '/blocks/post-content.php'; require_once ABSPATH . WPINC . '/blocks/post-content.php';
require ABSPATH . WPINC . '/blocks/post-date.php'; require_once ABSPATH . WPINC . '/blocks/post-date.php';
require ABSPATH . WPINC . '/blocks/post-excerpt.php'; require_once ABSPATH . WPINC . '/blocks/post-excerpt.php';
require ABSPATH . WPINC . '/blocks/post-featured-image.php'; require_once ABSPATH . WPINC . '/blocks/post-featured-image.php';
require ABSPATH . WPINC . '/blocks/post-navigation-link.php'; require_once ABSPATH . WPINC . '/blocks/post-navigation-link.php';
require ABSPATH . WPINC . '/blocks/post-template.php'; require_once ABSPATH . WPINC . '/blocks/post-template.php';
require ABSPATH . WPINC . '/blocks/post-terms.php'; require_once ABSPATH . WPINC . '/blocks/post-terms.php';
require ABSPATH . WPINC . '/blocks/post-title.php'; require_once ABSPATH . WPINC . '/blocks/post-title.php';
require ABSPATH . WPINC . '/blocks/query.php'; require_once ABSPATH . WPINC . '/blocks/query.php';
require ABSPATH . WPINC . '/blocks/query-no-results.php'; require_once ABSPATH . WPINC . '/blocks/query-no-results.php';
require ABSPATH . WPINC . '/blocks/query-pagination.php'; require_once ABSPATH . WPINC . '/blocks/query-pagination.php';
require ABSPATH . WPINC . '/blocks/query-pagination-next.php'; require_once ABSPATH . WPINC . '/blocks/query-pagination-next.php';
require ABSPATH . WPINC . '/blocks/query-pagination-numbers.php'; require_once ABSPATH . WPINC . '/blocks/query-pagination-numbers.php';
require ABSPATH . WPINC . '/blocks/query-pagination-previous.php'; require_once ABSPATH . WPINC . '/blocks/query-pagination-previous.php';
require ABSPATH . WPINC . '/blocks/query-title.php'; require_once ABSPATH . WPINC . '/blocks/query-title.php';
require ABSPATH . WPINC . '/blocks/read-more.php'; require_once ABSPATH . WPINC . '/blocks/read-more.php';
require ABSPATH . WPINC . '/blocks/rss.php'; require_once ABSPATH . WPINC . '/blocks/rss.php';
require ABSPATH . WPINC . '/blocks/search.php'; require_once ABSPATH . WPINC . '/blocks/search.php';
require ABSPATH . WPINC . '/blocks/shortcode.php'; require_once ABSPATH . WPINC . '/blocks/shortcode.php';
require ABSPATH . WPINC . '/blocks/site-logo.php'; require_once ABSPATH . WPINC . '/blocks/site-logo.php';
require ABSPATH . WPINC . '/blocks/site-tagline.php'; require_once ABSPATH . WPINC . '/blocks/site-tagline.php';
require ABSPATH . WPINC . '/blocks/site-title.php'; require_once ABSPATH . WPINC . '/blocks/site-title.php';
require ABSPATH . WPINC . '/blocks/social-link.php'; require_once ABSPATH . WPINC . '/blocks/social-link.php';
require ABSPATH . WPINC . '/blocks/tag-cloud.php'; require_once ABSPATH . WPINC . '/blocks/tag-cloud.php';
require ABSPATH . WPINC . '/blocks/template-part.php'; require_once ABSPATH . WPINC . '/blocks/template-part.php';
require ABSPATH . WPINC . '/blocks/term-description.php'; require_once ABSPATH . WPINC . '/blocks/term-description.php';

View File

@ -381,7 +381,7 @@ function styles_for_block_core_search( $attributes ) {
} }
// Get typography styles to be shared across inner elements. // Get typography styles to be shared across inner elements.
$typography_styles = get_typography_styles_for_block_core_search( $attributes ); $typography_styles = esc_attr( get_typography_styles_for_block_core_search( $attributes ) );
if ( ! empty( $typography_styles ) ) { if ( ! empty( $typography_styles ) ) {
$label_styles [] = $typography_styles; $label_styles [] = $typography_styles;
$button_styles[] = $typography_styles; $button_styles[] = $typography_styles;
@ -442,31 +442,39 @@ function get_typography_styles_for_block_core_search( $attributes ) {
// Add typography styles. // Add typography styles.
if ( ! empty( $attributes['style']['typography']['fontSize'] ) ) { if ( ! empty( $attributes['style']['typography']['fontSize'] ) ) {
$typography_styles[] = sprintf( 'font-size: %s;', esc_attr( $attributes['style']['typography']['fontSize'] ) ); $typography_styles[] = sprintf(
'font-size: %s;',
gutenberg_get_typography_font_size_value(
array(
'size' => $attributes['style']['typography']['fontSize'],
)
)
);
} }
if ( ! empty( $attributes['style']['typography']['fontFamily'] ) ) { if ( ! empty( $attributes['style']['typography']['fontFamily'] ) ) {
$typography_styles[] = sprintf( 'font-family: %s;', esc_attr( $attributes['style']['typography']['fontFamily'] ) ); $typography_styles[] = sprintf( 'font-family: %s;', $attributes['style']['typography']['fontFamily'] );
} }
if ( ! empty( $attributes['style']['typography']['letterSpacing'] ) ) { if ( ! empty( $attributes['style']['typography']['letterSpacing'] ) ) {
$typography_styles[] = sprintf( 'letter-spacing: %s;', esc_attr( $attributes['style']['typography']['letterSpacing'] ) ); $typography_styles[] = sprintf( 'letter-spacing: %s;', $attributes['style']['typography']['letterSpacing'] );
} }
if ( ! empty( $attributes['style']['typography']['fontWeight'] ) ) { if ( ! empty( $attributes['style']['typography']['fontWeight'] ) ) {
$typography_styles[] = sprintf( 'font-weight: %s;', esc_attr( $attributes['style']['typography']['fontWeight'] ) ); $typography_styles[] = sprintf( 'font-weight: %s;', $attributes['style']['typography']['fontWeight'] );
} }
if ( ! empty( $attributes['style']['typography']['fontStyle'] ) ) { if ( ! empty( $attributes['style']['typography']['fontStyle'] ) ) {
$typography_styles[] = sprintf( 'font-style: %s;', esc_attr( $attributes['style']['typography']['fontStyle'] ) ); $typography_styles[] = sprintf( 'font-style: %s;', $attributes['style']['typography']['fontStyle'] );
} }
if ( ! empty( $attributes['style']['typography']['lineHeight'] ) ) { if ( ! empty( $attributes['style']['typography']['lineHeight'] ) ) {
$typography_styles[] = sprintf( 'line-height: %s;', esc_attr( $attributes['style']['typography']['lineHeight'] ) ); $typography_styles[] = sprintf( 'line-height: %s;', $attributes['style']['typography']['lineHeight'] );
} }
if ( ! empty( $attributes['style']['typography']['textTransform'] ) ) { if ( ! empty( $attributes['style']['typography']['textTransform'] ) ) {
$typography_styles[] = sprintf( 'text-transform: %s;', esc_attr( $attributes['style']['typography']['textTransform'] ) ); $typography_styles[] = sprintf( 'text-transform: %s;', $attributes['style']['typography']['textTransform'] );
} }
return implode( '', $typography_styles ); return implode( '', $typography_styles );

View File

@ -189,6 +189,11 @@ function build_template_part_block_area_variations() {
* @return array Array containing the block variation objects. * @return array Array containing the block variation objects.
*/ */
function build_template_part_block_instance_variations() { function build_template_part_block_instance_variations() {
// Block themes are unavailable during installation.
if ( wp_installing() ) {
return array();
}
$variations = array(); $variations = array();
$template_parts = get_block_templates( $template_parts = get_block_templates(
array( array(

View File

@ -172,52 +172,77 @@
/** /**
* Cross-Block Selection * Cross-Block Selection
*/ */
@keyframes selection-overlay__fade-in-animation {
from {
opacity: 0;
}
to {
opacity: 0.4;
}
}
.block-editor-block-list__layout { .block-editor-block-list__layout {
position: relative; position: relative;
} }
.block-editor-block-list__layout::selection { .block-editor-block-list__layout::selection {
background: transparent; background: transparent;
} }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after, .has-multi-selection .block-editor-block-list__layout::selection {
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, background: transparent;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after { }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
background: transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
content: "";
position: absolute; position: absolute;
z-index: 1; z-index: 1;
pointer-events: none; pointer-events: none;
content: "";
top: 1px; top: 1px;
left: 1px;
bottom: 1px; bottom: 1px;
right: 1px; right: 1px;
background: var(--wp-admin-theme-color);
opacity: 0.4;
animation: selection-overlay__fade-in-animation 0.1s ease-out;
animation-fill-mode: forwards;
outline: 2px solid transparent;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
animation-duration: 1ms;
animation-delay: 0s;
}
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
border-radius: 2px;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 2px solid transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
outline: none;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
content: "";
position: absolute;
z-index: 1;
pointer-events: none;
top: 1px;
left: 1px; left: 1px;
bottom: 1px;
right: 1px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 1px; border-radius: 1px;
outline: 2px solid transparent; outline: 2px solid transparent;
} }
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after, .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
box-shadow: 0 0 0 1px #fff;
} }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected {
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection, box-shadow: none;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection, outline: none;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
background: transparent;
} }
.has-multi-selection .block-editor-block-list__layout::selection { .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
background: transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 1px solid transparent;
}
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 2px solid transparent;
}
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::before {
content: ""; content: "";
position: absolute; position: absolute;
z-index: 0; z-index: 0;
@ -229,10 +254,7 @@
border-radius: 2px; border-radius: 2px;
border-top: 4px solid #ccc; border-top: 4px solid #ccc;
} }
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after { .block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
content: none;
}
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::before {
border-color: var(--wp-admin-theme-color); border-color: var(--wp-admin-theme-color);
} }
.has-multi-selection .block-editor-block-list__layout { .has-multi-selection .block-editor-block-list__layout {
@ -266,24 +288,6 @@
/** /**
* Notices * Notices
*/ */
/**
* Block Layout
*/
/**
* Block styles and alignments
*/
}
.block-editor-block-list__layout .block-editor-block-list__block.is-partially-selected::after {
top: -0.5px;
left: -0.5px;
bottom: -0.5px;
right: -0.5px;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
top: 0;
left: 0;
bottom: 0;
right: 0;
} }
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * { .block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
z-index: 1; z-index: 1;
@ -302,43 +306,6 @@
.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content { .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
font-size: 13px; font-size: 13px;
} }
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
outline: none;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
position: absolute;
z-index: 1;
pointer-events: none;
content: "";
top: 1px;
bottom: 1px;
right: 1px;
left: 1px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 1px;
outline: 2px solid transparent;
}
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
}
.block-editor-block-list__layout .block-editor-block-list__block::after {
content: "";
pointer-events: none;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
border-radius: 2px;
box-shadow: 0 0 0 0 transparent;
transition: box-shadow 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__layout .block-editor-block-list__block::after {
transition-duration: 0s;
transition-delay: 0s;
}
}
.block-editor-block-list__layout .block-editor-block-list__block.has-warning { .block-editor-block-list__layout .block-editor-block-list__block.has-warning {
min-height: 48px; min-height: 48px;
} }
@ -378,31 +345,19 @@
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
cursor: default; cursor: default;
} box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered::after { border-radius: 2px;
top: 1px;
right: 1px;
left: 1px;
bottom: 1px;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
border-radius: 1px;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
cursor: default; cursor: default;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 2px;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
cursor: unset; cursor: unset;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
top: 1px;
right: 1px;
left: 1px;
bottom: 1px;
border-radius: 1px;
}
.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);
} }
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) { .is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
@ -1757,10 +1712,10 @@
color: #000; color: #000;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
pointer-events: none; pointer-events: none;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
@ -1771,7 +1726,7 @@
border: 1px dashed currentColor; border: 1px dashed currentColor;
border-radius: 2px; border-radius: 2px;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
visibility: hidden; visibility: hidden;
} }

File diff suppressed because one or more lines are too long

View File

@ -172,52 +172,77 @@
/** /**
* Cross-Block Selection * Cross-Block Selection
*/ */
@keyframes selection-overlay__fade-in-animation {
from {
opacity: 0;
}
to {
opacity: 0.4;
}
}
.block-editor-block-list__layout { .block-editor-block-list__layout {
position: relative; position: relative;
} }
.block-editor-block-list__layout::selection { .block-editor-block-list__layout::selection {
background: transparent; background: transparent;
} }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after, .has-multi-selection .block-editor-block-list__layout::selection {
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, background: transparent;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after { }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
background: transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
content: "";
position: absolute; position: absolute;
z-index: 1; z-index: 1;
pointer-events: none; pointer-events: none;
content: "";
top: 1px; top: 1px;
right: 1px;
bottom: 1px; bottom: 1px;
left: 1px; left: 1px;
background: var(--wp-admin-theme-color);
opacity: 0.4;
animation: selection-overlay__fade-in-animation 0.1s ease-out;
animation-fill-mode: forwards;
outline: 2px solid transparent;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
animation-duration: 1ms;
animation-delay: 0s;
}
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
border-radius: 2px;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 2px solid transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
outline: none;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
content: "";
position: absolute;
z-index: 1;
pointer-events: none;
top: 1px;
right: 1px; right: 1px;
bottom: 1px;
left: 1px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 1px; border-radius: 1px;
outline: 2px solid transparent; outline: 2px solid transparent;
} }
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after, .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
box-shadow: 0 0 0 1px #fff;
} }
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected {
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection, box-shadow: none;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection, outline: none;
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection,
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
background: transparent;
} }
.has-multi-selection .block-editor-block-list__layout::selection { .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
background: transparent;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 1px solid transparent;
}
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
outline: 2px solid transparent;
}
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::before {
content: ""; content: "";
position: absolute; position: absolute;
z-index: 0; z-index: 0;
@ -229,10 +254,7 @@
border-radius: 2px; border-radius: 2px;
border-top: 4px solid #ccc; border-top: 4px solid #ccc;
} }
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after { .block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
content: none;
}
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::before {
border-color: var(--wp-admin-theme-color); border-color: var(--wp-admin-theme-color);
} }
.has-multi-selection .block-editor-block-list__layout { .has-multi-selection .block-editor-block-list__layout {
@ -266,24 +288,6 @@
/** /**
* Notices * Notices
*/ */
/**
* Block Layout
*/
/**
* Block styles and alignments
*/
}
.block-editor-block-list__layout .block-editor-block-list__block.is-partially-selected::after {
top: -0.5px;
right: -0.5px;
bottom: -0.5px;
left: -0.5px;
}
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
top: 0;
right: 0;
bottom: 0;
left: 0;
} }
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * { .block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
z-index: 1; z-index: 1;
@ -302,43 +306,6 @@
.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content { .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
font-size: 13px; font-size: 13px;
} }
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
outline: none;
}
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
position: absolute;
z-index: 1;
pointer-events: none;
content: "";
top: 1px;
bottom: 1px;
left: 1px;
right: 1px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 1px;
outline: 2px solid transparent;
}
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
}
.block-editor-block-list__layout .block-editor-block-list__block::after {
content: "";
pointer-events: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 2px;
box-shadow: 0 0 0 0 transparent;
transition: box-shadow 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
.block-editor-block-list__layout .block-editor-block-list__block::after {
transition-duration: 0s;
transition-delay: 0s;
}
}
.block-editor-block-list__layout .block-editor-block-list__block.has-warning { .block-editor-block-list__layout .block-editor-block-list__block.has-warning {
min-height: 48px; min-height: 48px;
} }
@ -378,31 +345,19 @@
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
cursor: default; cursor: default;
} box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered::after { border-radius: 2px;
top: 1px;
left: 1px;
right: 1px;
bottom: 1px;
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
border-radius: 1px;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
cursor: default; cursor: default;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
border-radius: 2px;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
cursor: unset; cursor: unset;
} }
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected::after { .is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color); box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
top: 1px;
left: 1px;
right: 1px;
bottom: 1px;
border-radius: 1px;
}
.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);
} }
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) { .is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
@ -1757,10 +1712,10 @@
color: #000; color: #000;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
pointer-events: none; pointer-events: none;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0; top: 0;
@ -1771,7 +1726,7 @@
border: 1px dashed currentColor; border: 1px dashed currentColor;
border-radius: 2px; border-radius: 2px;
} }
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter { .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
visibility: hidden; visibility: hidden;
} }

File diff suppressed because one or more lines are too long

View File

@ -3314,6 +3314,7 @@ __webpack_require__.d(__webpack_exports__, {
"getColorClassName": function() { return /* reexport */ getColorClassName; }, "getColorClassName": function() { return /* reexport */ getColorClassName; },
"getColorObjectByAttributeValues": function() { return /* reexport */ getColorObjectByAttributeValues; }, "getColorObjectByAttributeValues": function() { return /* reexport */ getColorObjectByAttributeValues; },
"getColorObjectByColorValue": function() { return /* reexport */ getColorObjectByColorValue; }, "getColorObjectByColorValue": function() { return /* reexport */ getColorObjectByColorValue; },
"getComputedFluidTypographyValue": function() { return /* reexport */ getComputedFluidTypographyValue; },
"getFontSize": function() { return /* reexport */ getFontSize; }, "getFontSize": function() { return /* reexport */ getFontSize; },
"getFontSizeClass": function() { return /* reexport */ getFontSizeClass; }, "getFontSizeClass": function() { return /* reexport */ getFontSizeClass; },
"getFontSizeObjectByValue": function() { return /* reexport */ getFontSizeObjectByValue; }, "getFontSizeObjectByValue": function() { return /* reexport */ getFontSizeObjectByValue; },
@ -12137,10 +12138,10 @@ function MarginVisualizer(_ref2) {
borderRightWidth: marginRight, borderRightWidth: marginRight,
borderBottomWidth: marginBottom, borderBottomWidth: marginBottom,
borderLeftWidth: marginLeft, borderLeftWidth: marginLeft,
top: marginTop !== 0 ? `-${marginTop}` : 0, top: marginTop !== 0 ? `calc(${marginTop} * -1)` : 0,
right: marginRight !== 0 ? `-${marginRight}` : 0, right: marginRight !== 0 ? `calc(${marginRight} * -1)` : 0,
bottom: marginBottom !== 0 ? `-${marginBottom}` : 0, bottom: marginBottom !== 0 ? `calc(${marginBottom} * -1)` : 0,
left: marginLeft !== 0 ? `-${marginLeft}` : 0 left: marginLeft !== 0 ? `calc(${marginLeft} * -1)` : 0
}; };
}, [margin]); }, [margin]);
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false); const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
@ -20810,17 +20811,17 @@ const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)((select,
isSelected isSelected
}; };
}); });
const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref4) => { const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => {
let {
select
} = _ref4;
const { const {
updateBlockAttributes, updateBlockAttributes,
insertBlocks, insertBlocks,
mergeBlocks, mergeBlocks,
replaceBlocks, replaceBlocks,
toggleSelection, toggleSelection,
__unstableMarkLastChangeAsPersistent __unstableMarkLastChangeAsPersistent,
moveBlocksToPosition,
removeBlock,
selectBlock
} = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid } = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid
// leaking new props to the public API (editor.BlockListBlock filter). // leaking new props to the public API (editor.BlockListBlock filter).
@ -20828,7 +20829,7 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
setAttributes(newAttributes) { setAttributes(newAttributes) {
const { const {
getMultiSelectedBlockClientIds getMultiSelectedBlockClientIds
} = select(store); } = registry.select(store);
const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds();
const { const {
clientId clientId
@ -20851,7 +20852,7 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
} = ownProps; } = ownProps;
const { const {
getBlockIndex getBlockIndex
} = select(store); } = registry.select(store);
const index = getBlockIndex(clientId); const index = getBlockIndex(clientId);
insertBlocks(blocks, index + 1, rootClientId); insertBlocks(blocks, index + 1, rootClientId);
}, },
@ -20864,13 +20865,52 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
const { const {
getPreviousBlockClientId, getPreviousBlockClientId,
getNextBlockClientId, getNextBlockClientId,
getBlock getBlock,
} = select(store); getBlockAttributes,
getBlockName,
getBlockOrder
} = registry.select(store); // For `Delete` or forward merge, we should do the exact same thing
// as `Backspace`, but from the other block.
if (forward) { if (forward) {
if (rootClientId) {
const nextRootClientId = getNextBlockClientId(rootClientId);
if (nextRootClientId) {
// If there is a block that follows with the same parent
// block name and the same attributes, merge the inner
// blocks.
if (getBlockName(rootClientId) === getBlockName(nextRootClientId)) {
const rootAttributes = getBlockAttributes(rootClientId);
const previousRootAttributes = getBlockAttributes(nextRootClientId);
if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) {
registry.batch(() => {
moveBlocksToPosition(getBlockOrder(nextRootClientId), nextRootClientId, rootClientId);
removeBlock(nextRootClientId, false);
});
return;
}
} else {
mergeBlocks(rootClientId, nextRootClientId);
return;
}
}
}
const nextBlockClientId = getNextBlockClientId(clientId); const nextBlockClientId = getNextBlockClientId(clientId);
if (nextBlockClientId) { if (!nextBlockClientId) {
return;
} // Check if it's possibile to "unwrap" the following block
// before trying to merge.
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(nextBlockClientId), '*');
if (replacement && replacement.length) {
replaceBlocks(nextBlockClientId, replacement);
} else {
mergeBlocks(clientId, nextBlockClientId); mergeBlocks(clientId, nextBlockClientId);
} }
} else { } else {
@ -20879,12 +20919,31 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
if (previousBlockClientId) { if (previousBlockClientId) {
mergeBlocks(previousBlockClientId, clientId); mergeBlocks(previousBlockClientId, clientId);
} else if (rootClientId) { } else if (rootClientId) {
// Attempt to "unwrap" the block contents when there's no const previousRootClientId = getPreviousBlockClientId(rootClientId); // If there is a preceding block with the same parent block
// name and the same attributes, merge the inner blocks.
if (previousRootClientId && getBlockName(rootClientId) === getBlockName(previousRootClientId)) {
const rootAttributes = getBlockAttributes(rootClientId);
const previousRootAttributes = getBlockAttributes(previousRootClientId);
if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) {
registry.batch(() => {
moveBlocksToPosition(getBlockOrder(rootClientId), rootClientId, previousRootClientId);
removeBlock(rootClientId, false);
});
return;
}
} // Attempt to "unwrap" the block contents when there's no
// preceding block to merge with. // preceding block to merge with.
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), '*'); const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), '*');
if (replacement && replacement.length) { if (replacement && replacement.length) {
replaceBlocks(rootClientId, replacement, 0); registry.batch(() => {
replaceBlocks(rootClientId, replacement);
selectBlock(replacement[0].clientId, 0);
});
} }
} }
} }
@ -20907,10 +20966,10 @@ const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dis
/* harmony default export */ var block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // Block is sometimes not mounted at the right time, causing it be undefined /* harmony default export */ var block = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.pure, applyWithSelect, applyWithDispatch, // Block is sometimes not mounted at the right time, causing it be undefined
// see issue for more info // see issue for more info
// https://github.com/WordPress/gutenberg/issues/17013 // https://github.com/WordPress/gutenberg/issues/17013
(0,external_wp_compose_namespaceObject.ifCondition)(_ref5 => { (0,external_wp_compose_namespaceObject.ifCondition)(_ref4 => {
let { let {
block block
} = _ref5; } = _ref4;
return !!block; return !!block;
}), (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock)); }), (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock));
@ -26009,87 +26068,6 @@ function useInsertionPoint(_ref) {
/* harmony default export */ var use_insertion_point = (useInsertionPoint); /* harmony default export */ var use_insertion_point = (useInsertionPoint);
;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
/**
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
*/
var SUPPORTED_LOCALE = {
tr: {
regexp: /\u0130|\u0049|\u0049\u0307/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
az: {
regexp: /\u0130/g,
map: {
İ: "\u0069",
I: "\u0131",
İ: "\u0069",
},
},
lt: {
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
map: {
I: "\u0069\u0307",
J: "\u006A\u0307",
Į: "\u012F\u0307",
Ì: "\u0069\u0307\u0300",
Í: "\u0069\u0307\u0301",
Ĩ: "\u0069\u0307\u0303",
},
},
};
/**
* Localized lower case.
*/
function localeLowerCase(str, locale) {
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
if (lang)
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
return lowerCase(str);
}
/**
* Lower case as a function.
*/
function lowerCase(str) {
return str.toLowerCase();
}
;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
// Remove all non-word characters.
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
/**
* Normalize the string into something other libraries can manipulate easier.
*/
function noCase(input, options) {
if (options === void 0) { options = {}; }
var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
var start = 0;
var end = result.length;
// Trim the delimiter from around the output string.
while (result.charAt(start) === "\0")
start++;
while (result.charAt(end - 1) === "\0")
end--;
// Transform each token independently.
return result.slice(start, end).split("\0").map(transform).join(delimiter);
}
/**
* Replace `re` in the input string with the replacement value.
*/
function replace(input, re, value) {
if (re instanceof RegExp)
return input.replace(re, value);
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
}
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js // EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(4793); var remove_accents = __webpack_require__(4793);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
@ -26098,7 +26076,6 @@ var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
* External dependencies * External dependencies
*/ */
// Default search helpers. // Default search helpers.
const defaultGetName = item => item.name || ''; const defaultGetName = item => item.name || '';
@ -26134,19 +26111,6 @@ function normalizeSearchInput() {
input = input.toLowerCase(); input = input.toLowerCase();
return input; return input;
} }
/**
* Extracts words from an input string.
*
* @param {string} input The input string.
*
* @return {Array} Words, extracted from the input string.
*/
function extractWords() {
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return noCase(input).split(' ').filter(Boolean);
}
/** /**
* Converts the search term into a list of normalized terms. * Converts the search term into a list of normalized terms.
* *
@ -26158,7 +26122,7 @@ function extractWords() {
const getNormalizedSearchTerms = function () { const getNormalizedSearchTerms = function () {
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return extractWords(normalizeSearchInput(input)); return (0,external_lodash_namespaceObject.words)(normalizeSearchInput(input));
}; };
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
@ -26264,7 +26228,7 @@ function getItemSearchRank(item, searchTerm) {
rank += 20; rank += 20;
} else { } else {
const terms = [name, title, description, ...keywords, category, collection].join(' '); const terms = [name, title, description, ...keywords, category, collection].join(' ');
const normalizedSearchTerms = extractWords(normalizedSearchInput); const normalizedSearchTerms = (0,external_lodash_namespaceObject.words)(normalizedSearchInput);
const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms);
if (unmatchedTerms.length === 0) { if (unmatchedTerms.length === 0) {
@ -37662,6 +37626,204 @@ function FontSizePicker(props) {
/* harmony default export */ var font_size_picker = (FontSizePicker); /* harmony default export */ var font_size_picker = (FontSizePicker);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/fluid-utils.js
/**
* The fluid utilities must match the backend equivalent.
* See: gutenberg_get_typography_font_size_value() in lib/block-supports/typography.php
* ---------------------------------------------------------------
*/
// Defaults.
const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
const DEFAULT_SCALE_FACTOR = 1;
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
/**
* Computes a fluid font-size value that uses clamp(). A minimum and maxinmum
* font size OR a single font size can be specified.
*
* If a single font size is specified, it is scaled up and down by
* minimumFontSizeFactor and maximumFontSizeFactor to arrive at the minimum and
* maximum sizes.
*
* @example
* ```js
* // Calculate fluid font-size value from a minimum and maximum value.
* const fontSize = getComputedFluidTypographyValue( {
* minimumFontSize: '20px',
* maximumFontSize: '45px'
* } );
* // Calculate fluid font-size value from a single font size.
* const fontSize = getComputedFluidTypographyValue( {
* fontSize: '30px',
* } );
* ```
*
* @param {Object} args
* @param {?string} args.minimumViewPortWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.
* @param {?string} args.maximumViewPortWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.
* @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified.
* @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional.
* @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
* @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
* @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
* @param {?number} args.maximumFontSizeFactor How much to scale defaultFontSize by to derive maximumFontSize. Optional.
*
* @return {string|null} A font-size value using clamp().
*/
function getComputedFluidTypographyValue(_ref) {
let {
minimumFontSize,
maximumFontSize,
fontSize,
minimumViewPortWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,
maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
scaleFactor = DEFAULT_SCALE_FACTOR,
minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
maximumFontSizeFactor = DEFAULT_MAXIMUM_FONT_SIZE_FACTOR
} = _ref;
// Calculate missing minimumFontSize and maximumFontSize from
// defaultFontSize if provided.
if (fontSize && (!minimumFontSize || !maximumFontSize)) {
// Parse default font size.
const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units.
if (!(fontSizeParsed !== null && fontSizeParsed !== void 0 && fontSizeParsed.unit)) {
return null;
} // If no minimumFontSize is provided, derive using min scale factor.
if (!minimumFontSize) {
minimumFontSize = fontSizeParsed.value * minimumFontSizeFactor + fontSizeParsed.unit;
} // If no maximumFontSize is provided, derive using max scale factor.
if (!maximumFontSize) {
maximumFontSize = fontSizeParsed.value * maximumFontSizeFactor + fontSizeParsed.unit;
}
} // Return early if one of the provided inputs is not provided.
if (!minimumFontSize || !maximumFontSize) {
return null;
} // Grab the minimum font size and normalize it in order to use the value for calculations.
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); // We get a 'preferred' unit to keep units consistent when calculating,
// otherwise the result will not be accurate.
const fontSizeUnit = (minimumFontSizeParsed === null || minimumFontSizeParsed === void 0 ? void 0 : minimumFontSizeParsed.unit) || 'rem'; // Grab the maximum font size and normalize it in order to use the value for calculations.
const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, {
coerceTo: fontSizeUnit
}); // Protect against unsupported units.
if (!minimumFontSizeParsed || !maximumFontSizeParsed) {
return null;
} // Use rem for accessible fluid target font scaling.
const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, {
coerceTo: 'rem'
}); // Viewport widths defined for fluid typography. Normalize units
const maximumViewPortWidthParsed = getTypographyValueAndUnit(maximumViewPortWidth, {
coerceTo: fontSizeUnit
});
const minumumViewPortWidthParsed = getTypographyValueAndUnit(minimumViewPortWidth, {
coerceTo: fontSizeUnit
}); // Protect against unsupported units.
if (!maximumViewPortWidthParsed || !minumumViewPortWidthParsed || !minimumFontSizeRem) {
return null;
} // Build CSS rule.
// Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.
const minViewPortWidthOffsetValue = roundToPrecision(minumumViewPortWidthParsed.value / 100, 3);
const viewPortWidthOffset = minViewPortWidthOffsetValue + fontSizeUnit;
let linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
linearFactor = roundToPrecision(linearFactor, 3) || 1;
const linearFactorScaled = linearFactor * scaleFactor;
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`;
}
/**
* Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].
* A raw font size of `value + unit` is expected. If the value is an integer, it will convert to `value + 'px'`.
*
* @param {string|number} rawValue Raw size value from theme.json.
* @param {Object|undefined} options Calculation options.
*
* @return {{ unit: string, value: number }|null} An object consisting of `'value'` and `'unit'` properties.
*/
function getTypographyValueAndUnit(rawValue) {
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (typeof rawValue !== 'string' && typeof rawValue !== 'number') {
return null;
} // Converts numeric values to pixel values by default.
if (isFinite(rawValue)) {
rawValue = `${rawValue}px`;
}
const {
coerceTo,
rootSizeValue,
acceptableUnits
} = {
coerceTo: '',
// Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`.
rootSizeValue: 16,
acceptableUnits: ['rem', 'px', 'em'],
...options
};
const acceptableUnitsGroup = acceptableUnits === null || acceptableUnits === void 0 ? void 0 : acceptableUnits.join('|');
const regexUnits = new RegExp(`^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$`);
const matches = rawValue.match(regexUnits); // We need a number value and a unit.
if (!matches || matches.length < 3) {
return null;
}
let [, value, unit] = matches;
let returnValue = parseFloat(value);
if ('px' === coerceTo && ('em' === unit || 'rem' === unit)) {
returnValue = returnValue * rootSizeValue;
unit = coerceTo;
}
if ('px' === unit && ('em' === coerceTo || 'rem' === coerceTo)) {
returnValue = returnValue / rootSizeValue;
unit = coerceTo;
}
return {
value: returnValue,
unit
};
}
/**
* Returns a value rounded to defined precision.
* Returns `undefined` if the value is not a valid finite number.
*
* @param {number} value Raw value.
* @param {number} digits The number of digits to appear after the decimal point
*
* @return {number|undefined} Value rounded to standard precision.
*/
function roundToPrecision(value) {
let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
return Number.isFinite(value) ? parseFloat(value.toFixed(digits)) : undefined;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js
@ -37672,6 +37834,7 @@ function FontSizePicker(props) {
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -37680,6 +37843,7 @@ function FontSizePicker(props) {
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize'; const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
/** /**
* Filters registered block settings, extending attributes to include * Filters registered block settings, extending attributes to include
@ -37914,11 +38078,67 @@ function font_size_addTransforms(result, source, index, results) {
}; };
return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results); return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results);
} }
/**
* Allow custom font sizes to appear fluid when fluid typography is enabled at
* the theme level.
*
* Adds a custom getEditWrapperProps() callback to all block types that support
* font sizes. Then, if fluid typography is enabled, this callback will swap any
* custom font size in style.fontSize with a fluid font size (i.e. one that uses
* clamp()).
*
* It's important that this hook runs after 'core/style/addEditProps' sets
* style.fontSize as otherwise fontSize will be overwritten.
*
* @param {Object} blockType Block settings object.
*/
function addEditPropsForFluidCustomFontSizes(blockType) {
if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontSize')) {
return blockType;
}
const existingGetEditWrapperProps = blockType.getEditWrapperProps;
blockType.getEditWrapperProps = attributes => {
var _wrapperProps$style, _select$getSettings$_, _select$getSettings$_2;
const wrapperProps = existingGetEditWrapperProps ? existingGetEditWrapperProps(attributes) : {};
const fontSize = wrapperProps === null || wrapperProps === void 0 ? void 0 : (_wrapperProps$style = wrapperProps.style) === null || _wrapperProps$style === void 0 ? void 0 : _wrapperProps$style.fontSize; // TODO: This sucks! We should be using useSetting( 'typography.fluid' )
// or even useSelect( blockEditorStore ). We can't do either here
// because getEditWrapperProps is a plain JavaScript function called by
// BlockListBlock and not a React component rendered within
// BlockListContext.Provider. If we set fontSize using editor.
// BlockListBlock instead of using getEditWrapperProps then the value is
// clobbered when the core/style/addEditProps filter runs.
const isFluidTypographyEnabled = !!((_select$getSettings$_ = (0,external_wp_data_namespaceObject.select)(store).getSettings().__experimentalFeatures) !== null && _select$getSettings$_ !== void 0 && (_select$getSettings$_2 = _select$getSettings$_.typography) !== null && _select$getSettings$_2 !== void 0 && _select$getSettings$_2.fluid);
const newFontSize = fontSize && isFluidTypographyEnabled ? getComputedFluidTypographyValue({
fontSize
}) : null;
if (newFontSize === null) {
return wrapperProps;
}
return { ...wrapperProps,
style: { ...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style),
fontSize: newFontSize
}
};
};
return blockType;
}
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font-size/addEditPropsForFluidCustomFontSizes', addEditPropsForFluidCustomFontSizes, // Run after 'core/style/addEditProps' so that the style object has already
// been translated into inline CSS.
11);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/reset.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/reset.js
@ -40091,6 +40311,7 @@ function getSpacingClassesAndStyles(attributes) {
*/ */
// This utility is intended to assist where the serialization of the typography // This utility is intended to assist where the serialization of the typography
// block support is being skipped for a block but the typography related CSS // block support is being skipped for a block but the typography related CSS
// styles still need to be generated so they can be applied to inner elements. // styles still need to be generated so they can be applied to inner elements.
@ -40099,15 +40320,27 @@ function getSpacingClassesAndStyles(attributes) {
* Provides the CSS class names and inline styles for a block's typography support * Provides the CSS class names and inline styles for a block's typography support
* attributes. * attributes.
* *
* @param {Object} attributes Block attributes. * @param {Object} attributes Block attributes.
* @param {boolean} isFluidFontSizeActive Whether the function should try to convert font sizes to fluid values.
* *
* @return {Object} Typography block support derived CSS classes & styles. * @return {Object} Typography block support derived CSS classes & styles.
*/ */
function getTypographyClassesAndStyles(attributes) { function getTypographyClassesAndStyles(attributes, isFluidFontSizeActive) {
var _attributes$style; var _attributes$style;
const typographyStyles = (attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography) || {}; let typographyStyles = (attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography) || {};
if (isFluidFontSizeActive) {
var _attributes$style2, _attributes$style2$ty;
typographyStyles = { ...typographyStyles,
fontSize: getComputedFluidTypographyValue({
fontSize: attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : (_attributes$style2$ty = _attributes$style2.typography) === null || _attributes$style2$ty === void 0 ? void 0 : _attributes$style2$ty.fontSize
})
};
}
const style = getInlineStyles({ const style = getInlineStyles({
typography: typographyStyles typography: typographyStyles
}); });
@ -40552,6 +40785,7 @@ const with_font_sizes_upperFirst = _ref => {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/duotone/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/duotone/index.js
@ -51601,7 +51835,7 @@ function DefaultStylePicker(_ref) {
function useContentBlocks(blockTypes, block) { function useContentBlocks(blockTypes, block) {
const contenBlocksObjectAux = (0,external_wp_element_namespaceObject.useMemo)(() => { const contenBlocksObjectAux = (0,external_wp_element_namespaceObject.useMemo)(() => {
return blockTypes.reduce((result, blockType) => { return blockTypes.reduce((result, blockType) => {
if (Object.entries(blockType.attributes).some(_ref => { if (blockType.name !== 'core/list-item' && Object.entries(blockType.attributes).some(_ref => {
let [, { let [, {
__experimentalRole __experimentalRole
}] = _ref; }] = _ref;
@ -51711,8 +51945,7 @@ const BlockInspector = _ref5 => {
getSelectedBlockClientId, getSelectedBlockClientId,
getSelectedBlockCount, getSelectedBlockCount,
getBlockName, getBlockName,
__unstableGetContentLockingParent, __unstableGetContentLockingParent
getTemplateLock
} = select(store); } = select(store);
const _selectedBlockClientId = getSelectedBlockClientId(); const _selectedBlockClientId = getSelectedBlockClientId();
@ -51726,7 +51959,7 @@ const BlockInspector = _ref5 => {
selectedBlockClientId: _selectedBlockClientId, selectedBlockClientId: _selectedBlockClientId,
selectedBlockName: _selectedBlockName, selectedBlockName: _selectedBlockName,
blockType: _blockType, blockType: _blockType,
topLevelLockedBlock: getTemplateLock(_selectedBlockClientId) === 'contentOnly' ? _selectedBlockClientId : __unstableGetContentLockingParent(_selectedBlockClientId) topLevelLockedBlock: __unstableGetContentLockingParent(_selectedBlockClientId)
}; };
}, []); }, []);

File diff suppressed because one or more lines are too long

View File

@ -10177,6 +10177,7 @@ const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/com
* *
* @param {Object} settings Discussion Settings. * @param {Object} settings Discussion Settings.
* @param {number} [settings.perPage] - Comments per page setting or block attribute. * @param {number} [settings.perPage] - Comments per page setting or block attribute.
* @param {boolean} [settings.pageComments] - Enable break comments into pages setting.
* @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting.
* @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments.
* *
@ -10187,44 +10188,49 @@ const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/com
const getCommentsPlaceholder = _ref => { const getCommentsPlaceholder = _ref => {
let { let {
perPage, perPage,
pageComments,
threadComments, threadComments,
threadCommentsDepth threadCommentsDepth
} = _ref; } = _ref;
// In case that `threadCommentsDepth` is falsy, we default to a somewhat // Limit commentsDepth to 3
// arbitrary value of 3. const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3);
// In case that the value is set but larger than 3 we truncate it to 3.
const commentsDepth = Math.min(threadCommentsDepth || 3, 3); // We set a limit in order not to overload the editor of empty comments.
const defaultCommentsToShow = perPage <= commentsDepth ? perPage : commentsDepth; const buildChildrenComment = commentsLevel => {
// Render children comments until commentsDepth is reached
if (commentsLevel < commentsDepth) {
const nextLevel = commentsLevel + 1;
return [{
commentId: -(commentsLevel + 3),
children: buildChildrenComment(nextLevel)
}];
}
if (!threadComments || defaultCommentsToShow === 1) { return [];
// If displaying threaded comments is disabled, we only show one comment }; // Add the first comment and its children
// A commentId is negative in order to avoid conflicts with the actual comments.
return [{
commentId: -1, const placeholderComments = [{
commentId: -1,
children: buildChildrenComment(1)
}]; // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max
if ((!pageComments || perPage >= 2) && commentsDepth < 3) {
placeholderComments.push({
commentId: -2,
children: [] children: []
}]; });
} else if (defaultCommentsToShow === 2) { } // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments
return [{
commentId: -1,
children: [{ if ((!pageComments || perPage >= 3) && commentsDepth < 2) {
commentId: -2, placeholderComments.push({
children: [] commentId: -3,
}] children: []
}]; });
} // In case that the value is set but larger than 3 we truncate it to 3. } // In case that the value is set but larger than 3 we truncate it to 3.
return [{ return placeholderComments;
commentId: -1,
children: [{
commentId: -2,
children: [{
commentId: -3,
children: []
}]
}]
}];
}; };
/** /**
* Component which renders the inner blocks of the Comment Template. * Component which renders the inner blocks of the Comment Template.
@ -10369,7 +10375,8 @@ function CommentTemplateEdit(_ref6) {
commentOrder, commentOrder,
threadCommentsDepth, threadCommentsDepth,
threadComments, threadComments,
commentsPerPage commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)(select => { } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const { const {
getSettings getSettings
@ -10406,6 +10413,7 @@ function CommentTemplateEdit(_ref6) {
if (!postId) { if (!postId) {
commentTree = getCommentsPlaceholder({ commentTree = getCommentsPlaceholder({
perPage: commentsPerPage, perPage: commentsPerPage,
pageComments,
threadComments, threadComments,
threadCommentsDepth threadCommentsDepth
}); });
@ -11233,6 +11241,7 @@ function HeadingLevelDropdown(_ref) {
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -11261,9 +11270,24 @@ function comments_title_edit_Edit(_ref) {
[`has-text-align-${textAlign}`]: textAlign [`has-text-align-${textAlign}`]: textAlign
}) })
}); });
const {
threadCommentsDepth,
threadComments,
commentsPerPage,
pageComments
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
} = select(external_wp_blockEditor_namespaceObject.store);
return getSettings().__experimentalDiscussionSettings;
});
(0,external_wp_element_namespaceObject.useEffect)(() => { (0,external_wp_element_namespaceObject.useEffect)(() => {
if (isSiteEditor) { if (isSiteEditor) {
setCommentsCount(3); // Match the number of comments that will be shown in the comment-template/edit.js placeholder
const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0;
const topLevelCommentsNumber = pageComments ? commentsPerPage : 3;
const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber);
setCommentsCount(Math.min(commentsNumber, 3));
return; return;
} }
@ -20493,7 +20517,7 @@ function GroupEdit(_ref) {
const { const {
type = 'default' type = 'default'
} = usedLayout; } = usedLayout;
const layoutSupportEnabled = themeSupportsLayout || type !== 'default'; const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : { const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
className: 'wp-block-group__inner-container' className: 'wp-block-group__inner-container'
@ -25449,7 +25473,15 @@ const list_transforms_transforms = {
content content
})); }));
} }
}))] })), {
type: 'block',
blocks: ['*'],
transform: (_attributes, childBlocks) => {
return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content
}));
}
}]
}; };
/* harmony default export */ var list_transforms = (list_transforms_transforms); /* harmony default export */ var list_transforms = (list_transforms_transforms);
@ -26013,7 +26045,6 @@ function useSplit(clientId) {
*/ */
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -26047,21 +26078,18 @@ const {
__experimentalSelector: "li" __experimentalSelector: "li"
} }
}; };
function useMerge(clientId) { function useMerge(clientId, onMerge) {
const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const registry = (0,external_wp_data_namespaceObject.useRegistry)();
const { const {
getPreviousBlockClientId, getPreviousBlockClientId,
getNextBlockClientId, getNextBlockClientId,
getBlockOrder, getBlockOrder,
getBlockRootClientId, getBlockRootClientId,
getBlockName, getBlockName
getBlock
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const { const {
mergeBlocks, mergeBlocks,
moveBlocksToPosition, moveBlocksToPosition
replaceBlock,
selectBlock
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const [, outdentListItem] = useOutdentListItem(clientId); const [, outdentListItem] = useOutdentListItem(clientId);
@ -26119,23 +26147,12 @@ function useMerge(clientId) {
return getBlockOrder(order[0])[0]; return getBlockOrder(order[0])[0];
} }
function switchToDefaultBlockType(forward) {
const rootClientId = getBlockRootClientId(clientId);
const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(rootClientId), (0,external_wp_blocks_namespaceObject.getDefaultBlockName)());
const indexToSelect = forward ? replacement.length - 1 : 0;
const initialPosition = forward ? -1 : 0;
registry.batch(() => {
replaceBlock(rootClientId, replacement);
selectBlock(replacement[indexToSelect].clientId, initialPosition);
});
}
return forward => { return forward => {
if (forward) { if (forward) {
const nextBlockClientId = getNextId(clientId); const nextBlockClientId = getNextId(clientId);
if (!nextBlockClientId) { if (!nextBlockClientId) {
switchToDefaultBlockType(forward); onMerge(forward);
return; return;
} }
@ -26161,7 +26178,7 @@ function useMerge(clientId) {
mergeBlocks(trailingId, clientId); mergeBlocks(trailingId, clientId);
}); });
} else { } else {
switchToDefaultBlockType(forward); onMerge(forward);
} }
} }
}; };
@ -26343,7 +26360,8 @@ function ListItemEdit(_ref2) {
attributes, attributes,
setAttributes, setAttributes,
onReplace, onReplace,
clientId clientId,
mergeBlocks
} = _ref2; } = _ref2;
const { const {
placeholder, placeholder,
@ -26361,7 +26379,7 @@ function ListItemEdit(_ref2) {
}); });
const useSpaceRef = useSpace(clientId); const useSpaceRef = useSpace(clientId);
const onSplit = useSplit(clientId); const onSplit = useSplit(clientId);
const onMerge = useMerge(clientId); const onMerge = useMerge(clientId, mergeBlocks);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, { return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]), ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]),
identifier: "content", identifier: "content",
@ -31666,7 +31684,6 @@ const navigation_metadata = {
}, },
supports: { supports: {
align: ["wide", "full"], align: ["wide", "full"],
anchor: true,
html: false, html: false,
inserter: true, inserter: true,
typography: { typography: {
@ -34435,11 +34452,7 @@ const page_list_metadata = {
description: "Display a list of all pages.", description: "Display a list of all pages.",
keywords: ["menu", "navigation"], keywords: ["menu", "navigation"],
textdomain: "default", textdomain: "default",
attributes: { attributes: {},
__unstableMaxPages: {
type: "number"
}
},
usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"],
supports: { supports: {
reusable: false, reusable: false,
@ -44372,7 +44385,8 @@ function SearchEdit(_ref) {
} }
const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes); const fluidTypographyEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.fluid');
const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, fluidTypographyEnabled);
const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl);
const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`; const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
const isButtonPositionInside = 'button-inside' === buttonPosition; const isButtonPositionInside = 'button-inside' === buttonPosition;

File diff suppressed because one or more lines are too long

View File

@ -55100,7 +55100,7 @@ function getSelectOptions(optionsArray, disableCustomFontSizes) {
} = _ref; } = _ref;
return { return {
key: slug, key: slug,
name, name: name || slug,
size, size,
__experimentalHint: size && isSimpleCssValue(size) && parseFloat(size) __experimentalHint: size && isSimpleCssValue(size) && parseFloat(size)
}; };

File diff suppressed because one or more lines are too long

View File

@ -6703,68 +6703,63 @@ const layout = (0,external_wp_element_namespaceObject.createElement)(external_wp
* --------------------------------------------------------------- * ---------------------------------------------------------------
*/ */
/**
* WordPress dependencies
*/
/**
* @typedef {Object} FluidPreset
* @property {string|undefined} max A maximum font size value.
* @property {?string|undefined} min A minimum font size value.
*/
/**
* @typedef {Object} Preset
* @property {?string|?number} size A default font size.
* @property {string} name A font size name, displayed in the UI.
* @property {string} slug A font size slug
* @property {boolean|FluidPreset|undefined} fluid A font size slug
*/
/** /**
* Returns a font-size value based on a given font-size preset. * Returns a font-size value based on a given font-size preset.
* Takes into account fluid typography parameters and attempts to return a css formula depending on available, valid values. * Takes into account fluid typography parameters and attempts to return a css formula depending on available, valid values.
* *
* @param {Object} preset * @param {Preset} preset
* @param {string} preset.size A default font size. * @param {Object} typographySettings
* @param {string} preset.name A font size name, displayed in the UI. * @param {boolean} typographySettings.fluid Whether fluid typography is enabled.
* @param {string} preset.slug A font size slug.
* @param {Object} preset.fluid
* @param {string|undefined} preset.fluid.max A maximum font size value.
* @param {string|undefined} preset.fluid.min A minimum font size value.
* @param {Object} typographySettings
* @param {boolean} typographySettings.fluid Whether fluid typography is enabled.
* *
* @return {string} An font-size value * @return {string|*} A font-size value or the value of preset.size.
*/ */
function getTypographyFontSizeValue(preset, typographySettings) { function getTypographyFontSizeValue(preset, typographySettings) {
var _preset$fluid, _preset$fluid2;
const { const {
size: defaultSize size: defaultSize
} = preset; } = preset;
/*
* Catches falsy values and 0/'0'.
* Fluid calculations cannot be performed on 0.
*/
if (!defaultSize || '0' === defaultSize) {
return defaultSize;
}
if (true !== (typographySettings === null || typographySettings === void 0 ? void 0 : typographySettings.fluid)) { if (true !== (typographySettings === null || typographySettings === void 0 ? void 0 : typographySettings.fluid)) {
return defaultSize; return defaultSize;
} // Defaults. } // A font size has explicitly bypassed fluid calculations.
const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
const DEFAULT_SCALE_FACTOR = 1; // Font sizes.
// A font size has explicitly bypassed fluid calculations.
if (false === (preset === null || preset === void 0 ? void 0 : preset.fluid)) { if (false === (preset === null || preset === void 0 ? void 0 : preset.fluid)) {
return defaultSize; return defaultSize;
} }
const fluidFontSizeSettings = (preset === null || preset === void 0 ? void 0 : preset.fluid) || {}; // Try to grab explicit min and max fluid font sizes. const fluidFontSizeValue = (0,external_wp_blockEditor_namespaceObject.getComputedFluidTypographyValue)({
minimumFontSize: preset === null || preset === void 0 ? void 0 : (_preset$fluid = preset.fluid) === null || _preset$fluid === void 0 ? void 0 : _preset$fluid.min,
let minimumFontSizeRaw = fluidFontSizeSettings === null || fluidFontSizeSettings === void 0 ? void 0 : fluidFontSizeSettings.min; maximumFontSize: preset === null || preset === void 0 ? void 0 : (_preset$fluid2 = preset.fluid) === null || _preset$fluid2 === void 0 ? void 0 : _preset$fluid2.max,
let maximumFontSizeRaw = fluidFontSizeSettings === null || fluidFontSizeSettings === void 0 ? void 0 : fluidFontSizeSettings.max; fontSize: defaultSize
const preferredSize = getTypographyValueAndUnit(defaultSize); // Protect against unsupported units.
if (!(preferredSize !== null && preferredSize !== void 0 && preferredSize.unit)) {
return defaultSize;
} // If no fluid min or max font sizes are available, create some using min/max font size factors.
if (!minimumFontSizeRaw) {
minimumFontSizeRaw = preferredSize.value * DEFAULT_MINIMUM_FONT_SIZE_FACTOR + preferredSize.unit;
}
if (!maximumFontSizeRaw) {
maximumFontSizeRaw = preferredSize.value * DEFAULT_MAXIMUM_FONT_SIZE_FACTOR + preferredSize.unit;
}
const fluidFontSizeValue = getComputedFluidTypographyValue({
maximumViewPortWidth: DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
minimumViewPortWidth: DEFAULT_MINIMUM_VIEWPORT_WIDTH,
maximumFontSize: maximumFontSizeRaw,
minimumFontSize: minimumFontSizeRaw,
scaleFactor: DEFAULT_SCALE_FACTOR
}); });
if (!!fluidFontSizeValue) { if (!!fluidFontSizeValue) {
@ -6773,133 +6768,6 @@ function getTypographyFontSizeValue(preset, typographySettings) {
return defaultSize; return defaultSize;
} }
/**
* Internal implementation of clamp() based on available min/max viewport width, and min/max font sizes.
*
* @param {Object} args
* @param {string} args.maximumViewPortWidth Maximum size up to which type will have fluidity.
* @param {string} args.minimumViewPortWidth Minimum viewport size from which type will have fluidity.
* @param {string} args.maximumFontSize Maximum font size for any clamp() calculation.
* @param {string} args.minimumFontSize Minimum font size for any clamp() calculation.
* @param {number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries.
*
* @return {string|null} A font-size value using clamp().
*/
function getComputedFluidTypographyValue(_ref) {
let {
maximumViewPortWidth,
minimumViewPortWidth,
maximumFontSize,
minimumFontSize,
scaleFactor
} = _ref;
// Grab the minimum font size and normalize it in order to use the value for calculations.
const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); // We get a 'preferred' unit to keep units consistent when calculating,
// otherwise the result will not be accurate.
const fontSizeUnit = (minimumFontSizeParsed === null || minimumFontSizeParsed === void 0 ? void 0 : minimumFontSizeParsed.unit) || 'rem'; // Grab the maximum font size and normalize it in order to use the value for calculations.
const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, {
coerceTo: fontSizeUnit
}); // Protect against unsupported units.
if (!minimumFontSizeParsed || !maximumFontSizeParsed) {
return null;
} // Use rem for accessible fluid target font scaling.
const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, {
coerceTo: 'rem'
}); // Viewport widths defined for fluid typography. Normalize units
const maximumViewPortWidthParsed = getTypographyValueAndUnit(maximumViewPortWidth, {
coerceTo: fontSizeUnit
});
const minumumViewPortWidthParsed = getTypographyValueAndUnit(minimumViewPortWidth, {
coerceTo: fontSizeUnit
}); // Protect against unsupported units.
if (!maximumViewPortWidthParsed || !minumumViewPortWidthParsed || !minimumFontSizeRem) {
return null;
} // Build CSS rule.
// Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.
const minViewPortWidthOffsetValue = roundToPrecision(minumumViewPortWidthParsed.value / 100, 3);
const viewPortWidthOffset = minViewPortWidthOffsetValue + fontSizeUnit;
let linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
linearFactor = roundToPrecision(linearFactor, 3) || 1;
const linearFactorScaled = linearFactor * scaleFactor;
const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`;
}
/**
*
* @param {string} rawValue Raw size value from theme.json.
* @param {Object|undefined} options Calculation options.
*
* @return {{ unit: string, value: number }|null} An object consisting of `'value'` and `'unit'` properties.
*/
function getTypographyValueAndUnit(rawValue) {
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
if (!rawValue) {
return null;
}
const {
coerceTo,
rootSizeValue,
acceptableUnits
} = {
coerceTo: '',
// Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`.
rootSizeValue: 16,
acceptableUnits: ['rem', 'px', 'em'],
...options
};
const acceptableUnitsGroup = acceptableUnits === null || acceptableUnits === void 0 ? void 0 : acceptableUnits.join('|');
const regexUnits = new RegExp(`^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$`);
const matches = rawValue.match(regexUnits); // We need a number value and a unit.
if (!matches || matches.length < 3) {
return null;
}
let [, value, unit] = matches;
let returnValue = parseFloat(value);
if ('px' === coerceTo && ('em' === unit || 'rem' === unit)) {
returnValue = returnValue * rootSizeValue;
unit = coerceTo;
}
if ('px' === unit && ('em' === coerceTo || 'rem' === coerceTo)) {
returnValue = returnValue / rootSizeValue;
unit = coerceTo;
}
return {
value: returnValue,
unit
};
}
/**
* Returns a value rounded to defined precision.
* Returns `undefined` if the value is not a valid finite number.
*
* @param {number} value Raw value.
* @param {number} digits The number of digits to appear after the decimal point
*
* @return {number|undefined} Value rounded to standard precision.
*/
function roundToPrecision(value) {
let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
return Number.isFinite(value) ? parseFloat(value.toFixed(digits)) : undefined;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/global-styles/utils.js
/** /**
@ -8107,6 +7975,7 @@ function DimensionsPanel(_ref) {
*/ */
function useHasTypographyPanel(name) { function useHasTypographyPanel(name) {
const hasLineHeight = useHasLineHeightControl(name); const hasLineHeight = useHasLineHeightControl(name);
const hasFontAppearance = useHasAppearanceControl(name); const hasFontAppearance = useHasAppearanceControl(name);
@ -8172,7 +8041,18 @@ function TypographyPanel(_ref) {
prefix = `elements.${element}.`; prefix = `elements.${element}.`;
} }
const [fontSizes] = useSetting('typography.fontSizes', name); const [fluidTypography] = useSetting('typography.fluid', name);
const [fontSizes] = useSetting('typography.fontSizes', name); // Convert static font size values to fluid font sizes if fluidTypography is activated.
const fontSizesWithFluidValues = fontSizes.map(font => {
if (!!fluidTypography) {
font.size = getTypographyFontSizeValue(font, {
fluid: fluidTypography
});
}
return font;
});
const disableCustomFontSizes = !useSetting('typography.customFontSize', name)[0]; const disableCustomFontSizes = !useSetting('typography.customFontSize', name)[0];
const [fontFamilies] = useSetting('typography.fontFamilies', name); const [fontFamilies] = useSetting('typography.fontFamilies', name);
const hasFontStyles = useSetting('typography.fontStyle', name)[0] && supports.includes('fontStyle'); const hasFontStyles = useSetting('typography.fontStyle', name)[0] && supports.includes('fontStyle');
@ -8268,7 +8148,7 @@ function TypographyPanel(_ref) {
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FontSizePicker, { }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FontSizePicker, {
value: fontSize, value: fontSize,
onChange: setFontSize, onChange: setFontSize,
fontSizes: fontSizes, fontSizes: fontSizesWithFluidValues,
disableCustomFontSizes: disableCustomFontSizes, disableCustomFontSizes: disableCustomFontSizes,
size: "__unstable-large", size: "__unstable-large",
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
@ -8382,6 +8262,7 @@ var external_wp_styleEngine_namespaceObject = window["wp"]["styleEngine"];
// List of block support features that can have their related styles // List of block support features that can have their related styles
// generated under their own feature level selector rather than the block's. // generated under their own feature level selector rather than the block's.
@ -8608,6 +8489,22 @@ function getStylesDeclarations() {
if (!ruleValue || !!((_ruleValue2 = ruleValue) !== null && _ruleValue2 !== void 0 && _ruleValue2.ref)) { if (!ruleValue || !!((_ruleValue2 = ruleValue) !== null && _ruleValue2 !== void 0 && _ruleValue2.ref)) {
return; return;
} }
} // Calculate fluid typography rules where available.
if (cssProperty === 'font-size') {
var _tree$settings;
/*
* getTypographyFontSizeValue() will check
* if fluid typography has been activated and also
* whether the incoming value can be converted to a fluid value.
* Values that already have a "clamp()" function will not pass the test,
* and therefore the original $value will be returned.
*/
ruleValue = getTypographyFontSizeValue({
size: ruleValue
}, tree === null || tree === void 0 ? void 0 : (_tree$settings = tree.settings) === null || _tree$settings === void 0 ? void 0 : _tree$settings.typography);
} }
output.push(`${cssProperty}: ${ruleValue}`); output.push(`${cssProperty}: ${ruleValue}`);
@ -8629,7 +8526,7 @@ function getStylesDeclarations() {
*/ */
function getLayoutStyles(_ref6) { function getLayoutStyles(_ref6) {
var _style$spacing, _tree$settings, _tree$settings$layout, _tree$settings2, _tree$settings2$layou; var _style$spacing, _tree$settings2, _tree$settings2$layou, _tree$settings3, _tree$settings3$layou;
let { let {
tree, tree,
@ -8651,7 +8548,7 @@ function getLayoutStyles(_ref6) {
} }
} }
if (gapValue && tree !== null && tree !== void 0 && (_tree$settings = tree.settings) !== null && _tree$settings !== void 0 && (_tree$settings$layout = _tree$settings.layout) !== null && _tree$settings$layout !== void 0 && _tree$settings$layout.definitions) { if (gapValue && tree !== null && tree !== void 0 && (_tree$settings2 = tree.settings) !== null && _tree$settings2 !== void 0 && (_tree$settings2$layou = _tree$settings2.layout) !== null && _tree$settings2$layou !== void 0 && _tree$settings2$layou.definitions) {
Object.values(tree.settings.layout.definitions).forEach(_ref7 => { Object.values(tree.settings.layout.definitions).forEach(_ref7 => {
let { let {
className, className,
@ -8697,7 +8594,7 @@ function getLayoutStyles(_ref6) {
} // Output base styles } // Output base styles
if (selector === ROOT_BLOCK_SELECTOR && tree !== null && tree !== void 0 && (_tree$settings2 = tree.settings) !== null && _tree$settings2 !== void 0 && (_tree$settings2$layou = _tree$settings2.layout) !== null && _tree$settings2$layou !== void 0 && _tree$settings2$layou.definitions) { if (selector === ROOT_BLOCK_SELECTOR && tree !== null && tree !== void 0 && (_tree$settings3 = tree.settings) !== null && _tree$settings3 !== void 0 && (_tree$settings3$layou = _tree$settings3.layout) !== null && _tree$settings3$layou !== void 0 && _tree$settings3$layou.definitions) {
const validDisplayModes = ['block', 'flex', 'grid']; const validDisplayModes = ['block', 'flex', 'grid'];
Object.values(tree.settings.layout.definitions).forEach(_ref9 => { Object.values(tree.settings.layout.definitions).forEach(_ref9 => {
let { let {
@ -8802,7 +8699,7 @@ const getNodesWithStyles = (tree, blockSelectors) => {
return nodes; return nodes;
}; };
const getNodesWithSettings = (tree, blockSelectors) => { const getNodesWithSettings = (tree, blockSelectors) => {
var _tree$settings3, _tree$settings$blocks, _tree$settings4; var _tree$settings4, _tree$settings$blocks, _tree$settings5;
const nodes = []; const nodes = [];
@ -8827,7 +8724,7 @@ const getNodesWithSettings = (tree, blockSelectors) => {
const presets = pickPresets(tree.settings); const presets = pickPresets(tree.settings);
const custom = (_tree$settings3 = tree.settings) === null || _tree$settings3 === void 0 ? void 0 : _tree$settings3.custom; const custom = (_tree$settings4 = tree.settings) === null || _tree$settings4 === void 0 ? void 0 : _tree$settings4.custom;
if (!(0,external_lodash_namespaceObject.isEmpty)(presets) || !!custom) { if (!(0,external_lodash_namespaceObject.isEmpty)(presets) || !!custom) {
nodes.push({ nodes.push({
@ -8838,7 +8735,7 @@ const getNodesWithSettings = (tree, blockSelectors) => {
} // Blocks. } // Blocks.
Object.entries((_tree$settings$blocks = (_tree$settings4 = tree.settings) === null || _tree$settings4 === void 0 ? void 0 : _tree$settings4.blocks) !== null && _tree$settings$blocks !== void 0 ? _tree$settings$blocks : {}).forEach(_ref15 => { Object.entries((_tree$settings$blocks = (_tree$settings5 = tree.settings) === null || _tree$settings5 === void 0 ? void 0 : _tree$settings5.blocks) !== null && _tree$settings$blocks !== void 0 ? _tree$settings$blocks : {}).forEach(_ref15 => {
let [blockName, node] = _ref15; let [blockName, node] = _ref15;
const blockPresets = pickPresets(node); const blockPresets = pickPresets(node);
const blockCustom = node.custom; const blockCustom = node.custom;
@ -8876,16 +8773,16 @@ const toCustomProperties = (tree, blockSelectors) => {
return ruleset; return ruleset;
}; };
const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport) { const toStyles = function (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport) {
var _tree$settings5, _tree$settings6; var _tree$settings6, _tree$settings7;
let disableLayoutStyles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; let disableLayoutStyles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
const nodesWithStyles = getNodesWithStyles(tree, blockSelectors); const nodesWithStyles = getNodesWithStyles(tree, blockSelectors);
const nodesWithSettings = getNodesWithSettings(tree, blockSelectors); const nodesWithSettings = getNodesWithSettings(tree, blockSelectors);
const useRootPaddingAlign = tree === null || tree === void 0 ? void 0 : (_tree$settings5 = tree.settings) === null || _tree$settings5 === void 0 ? void 0 : _tree$settings5.useRootPaddingAwareAlignments; const useRootPaddingAlign = tree === null || tree === void 0 ? void 0 : (_tree$settings6 = tree.settings) === null || _tree$settings6 === void 0 ? void 0 : _tree$settings6.useRootPaddingAwareAlignments;
const { const {
contentSize, contentSize,
wideSize wideSize
} = (tree === null || tree === void 0 ? void 0 : (_tree$settings6 = tree.settings) === null || _tree$settings6 === void 0 ? void 0 : _tree$settings6.layout) || {}; } = (tree === null || tree === void 0 ? void 0 : (_tree$settings7 = tree.settings) === null || _tree$settings7 === void 0 ? void 0 : _tree$settings7.layout) || {};
/* /*
* Reset default browser margin on the root body element. * Reset default browser margin on the root body element.
* This is set on the root selector **before** generating the ruleset * This is set on the root selector **before** generating the ruleset
@ -12608,34 +12505,14 @@ function ResizableEditor(_ref) {
const mouseMoveTypingResetRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseMouseMoveTypingReset)(); const mouseMoveTypingResetRef = (0,external_wp_blockEditor_namespaceObject.__unstableUseMouseMoveTypingReset)();
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([iframeRef, mouseMoveTypingResetRef]); const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([iframeRef, mouseMoveTypingResetRef]);
(0,external_wp_element_namespaceObject.useEffect)(function autoResizeIframeHeight() { (0,external_wp_element_namespaceObject.useEffect)(function autoResizeIframeHeight() {
const iframe = iframeRef.current; if (!iframeRef.current || !enableResizing) {
if (!iframe || !enableResizing) {
return; return;
} }
let timeoutId = null; const iframe = iframeRef.current;
function resizeHeight() { function setFrameHeight() {
if (!timeoutId) { setHeight(iframe.contentDocument.body.scrollHeight);
// Throttle the updates on timeout. This code previously
// used `requestAnimationFrame`, but that seems to not
// always work before an iframe is ready.
timeoutId = iframe.contentWindow.setTimeout(() => {
const {
readyState
} = iframe.contentDocument; // Continue deferring the timeout until the document is ready.
// Only then will it have a height.
if (readyState !== 'interactive' && readyState !== 'complete') {
resizeHeight();
return;
}
setHeight(iframe.contentDocument.body.scrollHeight);
timeoutId = null; // 30 frames per second.
}, 1000 / 30);
}
} }
let resizeObserver; let resizeObserver;
@ -12644,25 +12521,21 @@ function ResizableEditor(_ref) {
var _resizeObserver; var _resizeObserver;
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect(); (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.disconnect();
resizeObserver = new iframe.contentWindow.ResizeObserver(resizeHeight); // Observe the body, since the `html` element seems to always resizeObserver = new iframe.contentWindow.ResizeObserver(setFrameHeight); // Observe the body, since the `html` element seems to always
// have a height of `100%`. // have a height of `100%`.
resizeObserver.observe(iframe.contentDocument.body); resizeObserver.observe(iframe.contentDocument.body);
resizeHeight(); setFrameHeight();
} // This is only required in Firefox for some unknown reasons. }
iframe.addEventListener('load', registerObserver);
iframe.addEventListener('load', registerObserver); // This is required in Chrome and Safari.
registerObserver();
return () => { return () => {
var _iframe$contentWindow, _resizeObserver2; var _resizeObserver2;
(_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow.clearTimeout(timeoutId);
(_resizeObserver2 = resizeObserver) === null || _resizeObserver2 === void 0 ? void 0 : _resizeObserver2.disconnect(); (_resizeObserver2 = resizeObserver) === null || _resizeObserver2 === void 0 ? void 0 : _resizeObserver2.disconnect();
iframe.removeEventListener('load', registerObserver); iframe.removeEventListener('load', registerObserver);
}; };
}, [enableResizing]); }, [enableResizing, iframeRef.current]);
const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => { const resizeWidthBy = (0,external_wp_element_namespaceObject.useCallback)(deltaPixels => {
if (iframeRef.current) { if (iframeRef.current) {
setWidth(iframeRef.current.offsetWidth + deltaPixels); setWidth(iframeRef.current.offsetWidth + deltaPixels);

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-beta3-54482'; $wp_version = '6.1-beta3-54483';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.