Block Editor: Package updates for 5.8 beta 1.

This includes the following fixes:


Widgets Editor:
  - Load widgets.php https://github.com/WordPress/gutenberg/pull/32299
 - Fix Legacy Widget Preview https://github.com/WordPress/gutenberg/pull/32300
 - Fix error when saving empty Legacy Widget block https://github.com/WordPress/gutenberg/pull/32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open https://github.com/WordPress/gutenberg/pull/32361
 - Display wide widgets as popovers https://github.com/WordPress/gutenberg/pull/31736

Global Styles:
 - Align classNames generation between client and server https://github.com/WordPress/gutenberg/pull/32352
 - Group typography block supports https://github.com/WordPress/gutenberg/pull/32252 https://github.com/WordPress/gutenberg/pull/32444 https://github.com/WordPress/gutenberg/pull/32459
 - Make theme.json syntax errors more visible to the users https://github.com/WordPress/gutenberg/pull/32404


Template Editor:
  - Update the appearance of the template details https://github.com/WordPress/gutenberg/pull/32042
  - Fix layout definition https://github.com/WordPress/gutenberg/pull/32425
  - Fix grouping post content block https://github.com/WordPress/gutenberg/pull/32453

Miscellaneous:
 - Prevent saving when the post is locked https://github.com/WordPress/gutenberg/pull/32341
 - Fix allowed block patterns selector https://github.com/WordPress/gutenberg/pull/32376
 - Fix wrong results in the Post Author picker https://github.com/WordPress/gutenberg/pull/32344
 - Fix notices position in top toolbar mode https://github.com/WordPress/gutenberg/pull/32238
 - Allow non-latin characters in post slugs https://github.com/WordPress/gutenberg/pull/32232
 - Fix Random collapse of the color settings panel https://github.com/WordPress/gutenberg/pull/32388
 - Fix theme logo theme mode not being removed on theme removal https://github.com/WordPress/gutenberg/pull/32370
 - Fix block alignment styles in the editor https://github.com/WordPress/gutenberg/pull/32454
 - Fix some block toolbar overlaps https://github.com/WordPress/gutenberg/pull/32424
 - Fix content loss when switching list types https://github.com/WordPress/gutenberg/pull/32432


Performance:
 - Improve the performance of buttons block https://github.com/WordPress/gutenberg/pull/32356
 - Improve the performance of the container blocks https://github.com/WordPress/gutenberg/pull/32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2021-06-08 08:09:53 +00:00
parent bbc2d09a9f
commit 1516d05128
64 changed files with 872 additions and 633 deletions

File diff suppressed because one or more lines are too long

View File

@ -19,19 +19,26 @@ function wp_register_typography_support( $block_type ) {
return; return;
} }
$has_font_size_support = _wp_array_get( $block_type->supports, array( 'fontSize' ), false ); $typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false );
$has_font_style_support = _wp_array_get( $block_type->supports, array( '__experimentalFontStyle' ), false ); if ( ! $typography_supports ) {
$has_font_weight_support = _wp_array_get( $block_type->supports, array( '__experimentalFontWeight' ), false ); return;
$has_line_height_support = _wp_array_get( $block_type->supports, array( 'lineHeight' ), false ); }
$has_text_decoration_support = _wp_array_get( $block_type->supports, array( '__experimentalTextDecoration' ), false );
$has_text_transform_support = _wp_array_get( $block_type->supports, array( '__experimentalTextTransform' ), false );
$has_typography_support = $has_font_size_support $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false );
|| $has_font_weight_support $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false );
$has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false );
$has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false );
$has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false );
$has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false );
$has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false );
$has_typography_support = $has_font_family_support
|| $has_font_size_support
|| $has_font_style_support || $has_font_style_support
|| $has_font_weight_support
|| $has_line_height_support || $has_line_height_support
|| $has_text_transform_support || $has_text_decoration_support
|| $has_text_decoration_support; || $has_text_transform_support;
if ( ! $block_type->attributes ) { if ( ! $block_type->attributes ) {
$block_type->attributes = array(); $block_type->attributes = array();
@ -68,29 +75,32 @@ function wp_apply_typography_support( $block_type, $block_attributes ) {
return array(); return array();
} }
$typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false );
if ( ! $typography_supports ) {
return array();
}
$skip_typography_serialization = _wp_array_get( $typography_supports, array( '__experimentalSkipSerialization' ), false );
if ( $skip_typography_serialization ) {
return array();
}
$attributes = array(); $attributes = array();
$classes = array(); $classes = array();
$styles = array(); $styles = array();
$has_font_family_support = _wp_array_get( $block_type->supports, array( '__experimentalFontFamily' ), false ); $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false );
$has_font_style_support = _wp_array_get( $block_type->supports, array( '__experimentalFontStyle' ), false ); $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false );
$has_font_weight_support = _wp_array_get( $block_type->supports, array( '__experimentalFontWeight' ), false ); $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false );
$has_font_size_support = _wp_array_get( $block_type->supports, array( 'fontSize' ), false ); $has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false );
$has_line_height_support = _wp_array_get( $block_type->supports, array( 'lineHeight' ), false ); $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false );
$has_text_decoration_support = _wp_array_get( $block_type->supports, array( '__experimentalTextDecoration' ), false ); $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false );
$has_text_transform_support = _wp_array_get( $block_type->supports, array( '__experimentalTextTransform' ), false ); $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false );
$skip_font_size_support_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipFontSizeSerialization' ), false ); if ( $has_font_size_support ) {
// Covers all typography features _except_ font size.
$skip_typography_serialization = _wp_array_get( $block_type->supports, array( '__experimentalSkipTypographySerialization' ), false );
// Font Size.
if ( $has_font_size_support && ! $skip_font_size_support_serialization ) {
$has_named_font_size = array_key_exists( 'fontSize', $block_attributes ); $has_named_font_size = array_key_exists( 'fontSize', $block_attributes );
$has_custom_font_size = isset( $block_attributes['style']['typography']['fontSize'] ); $has_custom_font_size = isset( $block_attributes['style']['typography']['fontSize'] );
// Apply required class or style.
if ( $has_named_font_size ) { if ( $has_named_font_size ) {
$classes[] = sprintf( 'has-%s-font-size', $block_attributes['fontSize'] ); $classes[] = sprintf( 'has-%s-font-size', $block_attributes['fontSize'] );
} elseif ( $has_custom_font_size ) { } elseif ( $has_custom_font_size ) {
@ -98,10 +108,8 @@ function wp_apply_typography_support( $block_type, $block_attributes ) {
} }
} }
// Font Family. if ( $has_font_family_support ) {
if ( $has_font_family_support && ! $skip_typography_serialization ) {
$has_font_family = isset( $block_attributes['style']['typography']['fontFamily'] ); $has_font_family = isset( $block_attributes['style']['typography']['fontFamily'] );
// Apply required class and style.
if ( $has_font_family ) { if ( $has_font_family ) {
$font_family = $block_attributes['style']['typography']['fontFamily']; $font_family = $block_attributes['style']['typography']['fontFamily'];
if ( strpos( $font_family, 'var:preset|font-family' ) !== false ) { if ( strpos( $font_family, 'var:preset|font-family' ) !== false ) {
@ -115,44 +123,36 @@ function wp_apply_typography_support( $block_type, $block_attributes ) {
} }
} }
// Font style. if ( $has_font_style_support ) {
if ( $has_font_style_support && ! $skip_typography_serialization ) { $font_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'fontStyle', 'font-style' );
// Apply font style.
$font_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontStyle', 'font-style' );
if ( $font_style ) { if ( $font_style ) {
$styles[] = $font_style; $styles[] = $font_style;
} }
} }
// Font weight. if ( $has_font_weight_support ) {
if ( $has_font_weight_support && ! $skip_typography_serialization ) { $font_weight = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'fontWeight', 'font-weight' );
// Apply font weight.
$font_weight = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontWeight', 'font-weight' );
if ( $font_weight ) { if ( $font_weight ) {
$styles[] = $font_weight; $styles[] = $font_weight;
} }
} }
// Line Height. if ( $has_line_height_support ) {
if ( $has_line_height_support && ! $skip_typography_serialization ) {
$has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] ); $has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] );
// Add the style (no classes for line-height).
if ( $has_line_height ) { if ( $has_line_height ) {
$styles[] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] ); $styles[] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] );
} }
} }
// Text Decoration. if ( $has_text_decoration_support ) {
if ( $has_text_decoration_support && ! $skip_typography_serialization ) { $text_decoration_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'textDecoration', 'text-decoration' );
$text_decoration_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textDecoration', 'text-decoration' );
if ( $text_decoration_style ) { if ( $text_decoration_style ) {
$styles[] = $text_decoration_style; $styles[] = $text_decoration_style;
} }
} }
// Text Transform. if ( $has_text_transform_support ) {
if ( $has_text_transform_support && ! $skip_typography_serialization ) { $text_transform_style = gutenberg_typography_get_css_variable_inline_style( $block_attributes, 'textTransform', 'text-transform' );
$text_transform_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textTransform', 'text-transform' );
if ( $text_transform_style ) { if ( $text_transform_style ) {
$styles[] = $text_transform_style; $styles[] = $text_transform_style;
} }

View File

@ -956,6 +956,32 @@ function block_has_support( $block_type, $feature, $default = false ) {
return true === $block_support || is_array( $block_support ); return true === $block_support || is_array( $block_support );
} }
function wp_migrate_old_typography_shape( $metadata ) {
$typography_keys = array(
'__experimentalFontFamily',
'__experimentalFontStyle',
'__experimentalFontWeight',
'__experimentalLetterSpacing',
'__experimentalTextDecoration',
'__experimentalTextTransform',
'fontSize',
'lineHeight',
);
foreach ( $typography_keys as $typography_key ) {
$support_for_key = _wp_array_get( $metadata['supports'], array( $typography_key ), null );
if ( null !== $support_for_key ) {
trigger_error(
/* translators: %1$s: Block type, %2$s: typography supports key e.g: fontSize, lineHeight etc... */
sprintf( __( 'Block %1$s is declaring %2$s support on block.json under supports.%2$s. %2$s support is now declared under supports.typography.%2$s.', 'gutenberg' ), $metadata['name'], $typography_key ),
headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
);
gutenberg_experimental_set( $metadata['supports'], array( 'typography', $typography_key ), $support_for_key );
unset( $metadata['supports'][ $typography_key ] );
}
}
return $metadata;
}
/** /**
* Helper function that constructs a WP_Query args array from * Helper function that constructs a WP_Query args array from
* a `Query` block properties. * a `Query` block properties.

View File

@ -61,13 +61,15 @@
"__experimentalSkipSerialization": true, "__experimentalSkipSerialization": true,
"gradients": true "gradients": true
}, },
"fontSize": true, "typography": {
"fontSize": true,
"__experimentalFontFamily": true
},
"reusable": false, "reusable": false,
"__experimentalBorder": { "__experimentalBorder": {
"radius": true, "radius": true,
"__experimentalSkipSerialization": true "__experimentalSkipSerialization": true
}, },
"__experimentalFontFamily": true,
"__experimentalSelector": ".wp-block-button__link" "__experimentalSelector": ".wp-block-button__link"
}, },
"styles": [ "styles": [

View File

@ -14,7 +14,9 @@
}, },
"supports": { "supports": {
"anchor": true, "anchor": true,
"fontSize": true "typography": {
"fontSize": true
}
}, },
"style": "wp-block-code" "style": "wp-block-code"
} }

View File

@ -32,8 +32,11 @@
"color": { "color": {
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"lineHeight": true,
"__experimentalFontWeight": true
},
"__experimentalSelector": "h1,h2,h3,h4,h5,h6", "__experimentalSelector": "h1,h2,h3,h4,h5,h6",
"__unstablePasteTextInline": true "__unstablePasteTextInline": true
}, },

View File

@ -147,3 +147,8 @@
margin: 0 0 5px; margin: 0 0 5px;
font-weight: 500; font-weight: 500;
} }
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}

View File

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

View File

@ -147,3 +147,8 @@
margin: 0 0 5px; margin: 0 0 5px;
font-weight: 500; font-weight: 500;
} }
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}

View File

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

View File

@ -37,7 +37,10 @@
"supports": { "supports": {
"anchor": true, "anchor": true,
"className": false, "className": false,
"fontSize": true, "typography": {
"fontSize": true,
"__experimentalFontFamily": true
},
"color": { "color": {
"gradients": true "gradients": true
}, },

View File

@ -18,6 +18,8 @@
}, },
"supports": { "supports": {
"className": true, "className": true,
"fontSize": false "typography": {
"fontSize": false
}
} }
} }

View File

@ -35,8 +35,10 @@
"color": { "color": {
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"lineHeight": true
},
"__experimentalSelector": "p", "__experimentalSelector": "p",
"__unstablePasteTextInline": true "__unstablePasteTextInline": true
}, },

View File

@ -24,7 +24,9 @@
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true "fontSize": true,
"lineHeight": true
}
} }
} }

View File

@ -24,12 +24,14 @@
"usesContext": [ "postId", "postType" ], "usesContext": [ "postId", "postType" ],
"supports": { "supports": {
"html": false, "html": false,
"fontSize": true,
"color": { "color": {
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"lineHeight": true "typography": {
"fontSize": true,
"lineHeight": true
}
}, },
"editorStyle": "wp-block-post-excerpt-editor", "editorStyle": "wp-block-post-excerpt-editor",
"style": "wp-block-post-excerpt" "style": "wp-block-post-excerpt"

View File

@ -16,11 +16,13 @@
"usesContext": [ "postId", "postType" ], "usesContext": [ "postId", "postType" ],
"supports": { "supports": {
"html": false, "html": false,
"fontSize": true,
"color": { "color": {
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"lineHeight": true "typography": {
"lineHeight": true,
"fontSize": true
}
} }
} }

View File

@ -35,9 +35,11 @@
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"__experimentalFontFamily": true "lineHeight": true,
"__experimentalFontFamily": true
}
}, },
"style": "wp-block-post-title" "style": "wp-block-post-title"
} }

View File

@ -20,7 +20,9 @@
"color": { "color": {
"gradients": true "gradients": true
}, },
"fontSize": true "typography": {
"fontSize": true
}
}, },
"style": "wp-block-preformatted" "style": "wp-block-preformatted"
} }

View File

@ -19,7 +19,9 @@
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true "fontSize": true,
"lineHeight": true
}
} }
} }

View File

@ -19,7 +19,9 @@
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"fontSize": true, "typography": {
"lineHeight": true "fontSize": true,
"lineHeight": true
}
} }
} }

View File

@ -23,9 +23,11 @@
"color": { "color": {
"gradients": true "gradients": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"__experimentalFontFamily": true "lineHeight": true,
"__experimentalFontFamily": true
}
}, },
"editorStyle": "wp-block-query-title-editor" "editorStyle": "wp-block-query-title-editor"
} }

View File

@ -20,9 +20,11 @@
"margin": true, "margin": true,
"padding": true "padding": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"__experimentalFontFamily": true, "lineHeight": true,
"__experimentalTextTransform": true "__experimentalFontFamily": true,
"__experimentalTextTransform": true
}
} }
} }

View File

@ -26,11 +26,13 @@
"padding": true, "padding": true,
"margin": true "margin": true
}, },
"fontSize": true, "typography": {
"lineHeight": true, "fontSize": true,
"__experimentalFontFamily": true, "lineHeight": true,
"__experimentalTextTransform": true, "__experimentalFontFamily": true,
"__experimentalFontStyle": true, "__experimentalTextTransform": true,
"__experimentalFontWeight": true "__experimentalFontStyle": true,
"__experimentalFontWeight": true
}
} }
} }

View File

@ -25,8 +25,10 @@
"gradients": true, "gradients": true,
"link": true "link": true
}, },
"__experimentalFontFamily": true, "typography": {
"fontSize": true, "fontSize": true,
"__experimentalFontFamily": true
},
"spacing": { "spacing": {
"padding": true "padding": true
} }

View File

@ -66,7 +66,7 @@ class WP_Theme_JSON_Resolver {
$json_decoding_error = json_last_error(); $json_decoding_error = json_last_error();
if ( JSON_ERROR_NONE !== $json_decoding_error ) { if ( JSON_ERROR_NONE !== $json_decoding_error ) {
error_log( 'Error when decoding file schema: ' . json_last_error_msg() ); trigger_error( "Error when decoding a theme.json schema at path $file_path " . json_last_error_msg() );
return $config; return $config;
} }

View File

@ -655,7 +655,11 @@ class WP_Theme_JSON {
foreach ( $values as $value ) { foreach ( $values as $value ) {
foreach ( $preset['classes'] as $class ) { foreach ( $preset['classes'] as $class ) {
$stylesheet .= self::to_ruleset( $stylesheet .= self::to_ruleset(
self::append_to_selector( $selector, '.has-' . $value['slug'] . '-' . $class['class_suffix'] ), // We don't want to use kebabCase here,
// see https://github.com/WordPress/gutenberg/issues/32347
// However, we need to make sure the generated class
// doesn't contain spaces.
self::append_to_selector( $selector, '.has-' . preg_replace( '/\s+/', '-', $value['slug'] ) . '-' . $class['class_suffix'] ),
array( array(
array( array(
'name' => $class['property_name'], 'name' => $class['property_name'],

View File

@ -565,6 +565,7 @@
* Block Toolbar when contextual. * Block Toolbar when contextual.
*/ */
.block-editor-block-contextual-toolbar { .block-editor-block-contextual-toolbar {
display: inline-flex;
border: 1px solid #1e1e1e; border: 1px solid #1e1e1e;
border-radius: 2px; border-radius: 2px;
background-color: #fff; background-color: #fff;

File diff suppressed because one or more lines are too long

View File

@ -565,6 +565,7 @@
* Block Toolbar when contextual. * Block Toolbar when contextual.
*/ */
.block-editor-block-contextual-toolbar { .block-editor-block-contextual-toolbar {
display: inline-flex;
border: 1px solid #1e1e1e; border: 1px solid #1e1e1e;
border-radius: 2px; border-radius: 2px;
background-color: #fff; background-color: #fff;

File diff suppressed because one or more lines are too long

View File

@ -1118,6 +1118,11 @@ figure.wp-block-image:not(.wp-block) {
font-weight: 500; font-weight: 500;
} }
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}
.wp-block-media-text .__resizable_base__ { .wp-block-media-text .__resizable_base__ {
grid-column: 1/span 2; grid-column: 1/span 2;
grid-row: 2; grid-row: 2;

File diff suppressed because one or more lines are too long

View File

@ -1123,6 +1123,11 @@ figure.wp-block-image:not(.wp-block) {
font-weight: 500; font-weight: 500;
} }
.is-selected .wp-block-legacy-widget__container {
padding: 8px 12px;
min-height: 50px;
}
.wp-block-media-text .__resizable_base__ { .wp-block-media-text .__resizable_base__ {
grid-column: 1/span 2; grid-column: 1/span 2;
grid-row: 2; grid-row: 2;

File diff suppressed because one or more lines are too long

View File

@ -3541,7 +3541,6 @@ body.is-dragging-components-draggable {
.components-notice-list { .components-notice-list {
max-width: 100vw; max-width: 100vw;
box-sizing: border-box; box-sizing: border-box;
z-index: 29;
} }
.components-notice-list .components-notice__content { .components-notice-list .components-notice__content {
margin-top: 12px; margin-top: 12px;

File diff suppressed because one or more lines are too long

View File

@ -3551,7 +3551,6 @@ body.is-dragging-components-draggable {
.components-notice-list { .components-notice-list {
max-width: 100vw; max-width: 100vw;
box-sizing: border-box; box-sizing: border-box;
z-index: 29;
} }
.components-notice-list .components-notice__content { .components-notice-list .components-notice__content {
margin-top: 12px; margin-top: 12px;

File diff suppressed because one or more lines are too long

View File

@ -872,7 +872,22 @@ body.is-fullscreen-mode .interface-interface-skeleton {
} }
.edit-post-template-top-area__popover .components-popover__content { .edit-post-template-top-area__popover .components-popover__content {
min-width: 360px; min-width: 280px;
}
.edit-post-template-top-area__second-menu-group {
margin-right: -12px;
margin-left: -12px;
padding: 12px;
padding-bottom: 0;
border-top: 1px solid #ddd;
}
.edit-post-template-top-area__second-menu-group .edit-post-template-top-area__delete-template-button {
display: flex;
justify-content: center;
}
.edit-post-template-top-area__second-menu-group .edit-post-template-top-area__delete-template-button .components-menu-item__item {
margin-left: 0;
} }
.edit-post-keyboard-shortcut-help-modal__section { .edit-post-keyboard-shortcut-help-modal__section {

File diff suppressed because one or more lines are too long

View File

@ -872,7 +872,22 @@ body.is-fullscreen-mode .interface-interface-skeleton {
} }
.edit-post-template-top-area__popover .components-popover__content { .edit-post-template-top-area__popover .components-popover__content {
min-width: 360px; min-width: 280px;
}
.edit-post-template-top-area__second-menu-group {
margin-left: -12px;
margin-right: -12px;
padding: 12px;
padding-bottom: 0;
border-top: 1px solid #ddd;
}
.edit-post-template-top-area__second-menu-group .edit-post-template-top-area__delete-template-button {
display: flex;
justify-content: center;
}
.edit-post-template-top-area__second-menu-group .edit-post-template-top-area__delete-template-button .components-menu-item__item {
margin-right: 0;
} }
.edit-post-keyboard-shortcut-help-modal__section { .edit-post-keyboard-shortcut-help-modal__section {

File diff suppressed because one or more lines are too long

View File

@ -190,13 +190,7 @@
padding: 1px 0; padding: 1px 0;
} }
.components-editor-notices__dismissible { .components-editor-notices__dismissible,
position: sticky;
top: 0;
left: 0;
color: #1e1e1e;
}
.components-editor-notices__pinned { .components-editor-notices__pinned {
position: relative; position: relative;
right: 0; right: 0;
@ -204,7 +198,6 @@
left: 0; left: 0;
color: #1e1e1e; color: #1e1e1e;
} }
.components-editor-notices__dismissible .components-notice, .components-editor-notices__dismissible .components-notice,
.components-editor-notices__pinned .components-notice { .components-editor-notices__pinned .components-notice {
box-sizing: border-box; box-sizing: border-box;

File diff suppressed because one or more lines are too long

View File

@ -190,13 +190,7 @@
padding: 1px 0; padding: 1px 0;
} }
.components-editor-notices__dismissible { .components-editor-notices__dismissible,
position: sticky;
top: 0;
right: 0;
color: #1e1e1e;
}
.components-editor-notices__pinned { .components-editor-notices__pinned {
position: relative; position: relative;
left: 0; left: 0;
@ -204,7 +198,6 @@
right: 0; right: 0;
color: #1e1e1e; color: #1e1e1e;
} }
.components-editor-notices__dismissible .components-notice, .components-editor-notices__dismissible .components-notice,
.components-editor-notices__pinned .components-notice { .components-editor-notices__pinned .components-notice {
box-sizing: border-box; box-sizing: border-box;

File diff suppressed because one or more lines are too long

View File

@ -217,6 +217,8 @@ add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop()
add_filter( 'widget_block_content', 'do_blocks', 9 ); add_filter( 'widget_block_content', 'do_blocks', 9 );
add_filter( 'widget_block_content', 'do_shortcode', 11 ); add_filter( 'widget_block_content', 'do_shortcode', 11 );
add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' );
add_filter( 'wp_get_custom_css', 'wp_replace_insecure_home_url' ); add_filter( 'wp_get_custom_css', 'wp_replace_insecure_home_url' );
// RSS filters. // RSS filters.

View File

@ -6313,13 +6313,6 @@ module.exports = computedStyle;
/***/ }), /***/ }),
/***/ "ouCq":
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["blockSerializationDefaultParser"]; }());
/***/ }),
/***/ "pPDe": /***/ "pPDe":
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -7236,7 +7229,7 @@ __webpack_require__.d(selectors_namespaceObject, "getInserterItems", function()
__webpack_require__.d(selectors_namespaceObject, "getBlockTransformItems", function() { return selectors_getBlockTransformItems; }); __webpack_require__.d(selectors_namespaceObject, "getBlockTransformItems", function() { return selectors_getBlockTransformItems; });
__webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return selectors_hasInserterItems; }); __webpack_require__.d(selectors_namespaceObject, "hasInserterItems", function() { return selectors_hasInserterItems; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedBlocks", function() { return selectors_experimentalGetAllowedBlocks; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedBlocks", function() { return selectors_experimentalGetAllowedBlocks; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetParsedPattern", function() { return selectors_experimentalGetParsedPattern; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetParsedPattern", function() { return __experimentalGetParsedPattern; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedPatterns", function() { return selectors_experimentalGetAllowedPatterns; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetAllowedPatterns", function() { return selectors_experimentalGetAllowedPatterns; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternsByBlockTypes", function() { return selectors_experimentalGetPatternsByBlockTypes; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternsByBlockTypes", function() { return selectors_experimentalGetPatternsByBlockTypes; });
__webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternTransformItems", function() { return selectors_experimentalGetPatternTransformItems; }); __webpack_require__.d(selectors_namespaceObject, "__experimentalGetPatternTransformItems", function() { return selectors_experimentalGetPatternTransformItems; });
@ -9209,9 +9202,6 @@ function lastBlockInserted(state = {}, action) {
// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js // EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
var rememo = __webpack_require__("pPDe"); var rememo = __webpack_require__("pPDe");
// EXTERNAL MODULE: external ["wp","blockSerializationDefaultParser"]
var external_wp_blockSerializationDefaultParser_ = __webpack_require__("ouCq");
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
@ -9227,7 +9217,6 @@ var external_wp_blockSerializationDefaultParser_ = __webpack_require__("ouCq");
/** /**
* A block selection object. * A block selection object.
* *
@ -10856,7 +10845,7 @@ const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
return true; return true;
}; };
const selectors_experimentalGetParsedPattern = Object(rememo["a" /* default */])((state, patternName) => { const __experimentalGetParsedPattern = Object(rememo["a" /* default */])((state, patternName) => {
const patterns = state.settings.__experimentalBlockPatterns; const patterns = state.settings.__experimentalBlockPatterns;
const pattern = patterns.find(({ const pattern = patterns.find(({
name name
@ -10875,17 +10864,12 @@ const getAllAllowedPatterns = Object(rememo["a" /* default */])(state => {
const { const {
allowedBlockTypes allowedBlockTypes
} = selectors_getSettings(state); } = selectors_getSettings(state);
const parsedPatterns = patterns.map(pattern => ({ ...pattern, const parsedPatterns = patterns.map(({
// We only need the overall block structure of the pattern. So, for name
// performance reasons, we can parse the pattern's content using }) => __experimentalGetParsedPattern(state, name));
// the raw blocks parser, also known as the "stage I" block parser.
// This is about 250x faster than the full parse that the Block API
// offers.
blockNodes: Object(external_wp_blockSerializationDefaultParser_["parse"])(pattern.content)
}));
const allowedPatterns = parsedPatterns.filter(({ const allowedPatterns = parsedPatterns.filter(({
blockNodes blocks
}) => checkAllowListRecursive(blockNodes, allowedBlockTypes)); }) => checkAllowListRecursive(blocks, allowedBlockTypes));
return allowedPatterns; return allowedPatterns;
}, state => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes]); }, state => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes]);
/** /**
@ -10900,10 +10884,10 @@ const getAllAllowedPatterns = Object(rememo["a" /* default */])(state => {
const selectors_experimentalGetAllowedPatterns = Object(rememo["a" /* default */])((state, rootClientId = null) => { const selectors_experimentalGetAllowedPatterns = Object(rememo["a" /* default */])((state, rootClientId = null) => {
const availableParsedPatterns = getAllAllowedPatterns(state); const availableParsedPatterns = getAllAllowedPatterns(state);
const patternsAllowed = Object(external_lodash_["filter"])(availableParsedPatterns, ({ const patternsAllowed = Object(external_lodash_["filter"])(availableParsedPatterns, ({
blockNodes blocks
}) => blockNodes.every(({ }) => blocks.every(({
blockName name
}) => selectors_canInsertBlockType(state, blockName, rootClientId))); }) => selectors_canInsertBlockType(state, name, rootClientId)));
return patternsAllowed; return patternsAllowed;
}, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId]]); }, (state, rootClientId) => [state.settings.__experimentalBlockPatterns, state.settings.allowedBlockTypes, state.settings.templateLock, state.blockListSettings[rootClientId], state.blocks.byClientId[rootClientId]]);
/** /**
@ -13659,9 +13643,13 @@ const getColorObjectByColorValue = (colors, colorValue) => {
function getColorClassName(colorContextName, colorSlug) { function getColorClassName(colorContextName, colorSlug) {
if (!colorContextName || !colorSlug) { if (!colorContextName || !colorSlug) {
return undefined; return undefined;
} } // We don't want to use kebabCase from lodash here
// see https://github.com/WordPress/gutenberg/issues/32347
// However, we need to make sure the generated class
// doesn't contain spaces.
return `has-${Object(external_lodash_["kebabCase"])(colorSlug)}-${colorContextName}`;
return `has-${colorSlug.replace(/\s+/g, '-')}-${colorContextName.replace(/\s+/g, '-')}`;
} }
/** /**
* Given an array of color objects and a color value returns the color value of the most readable color in the array. * Given an array of color objects and a color value returns the color value of the most readable color in the array.
@ -15223,306 +15211,6 @@ Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'cor
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps); Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps);
Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles); Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles);
// EXTERNAL MODULE: external ["wp","tokenList"]
var external_wp_tokenList_ = __webpack_require__("BLeD");
var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js
/**
* External dependencies
*/
/**
* Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.
* If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.
*
* @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties.
* @param {?string} fontSizeAttribute Content of the font size attribute (slug).
* @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value).
*
* @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug.
* Otherwise, an object with just the size value based on customFontSize is returned.
*/
const getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => {
if (fontSizeAttribute) {
const fontSizeObject = Object(external_lodash_["find"])(fontSizes, {
slug: fontSizeAttribute
});
if (fontSizeObject) {
return fontSizeObject;
}
}
return {
size: customFontSizeAttribute
};
};
/**
* Returns the corresponding font size object for a given value.
*
* @param {Array} fontSizes Array of font size objects.
* @param {number} value Font size value.
*
* @return {Object} Font size object.
*/
function getFontSizeObjectByValue(fontSizes, value) {
const fontSizeObject = Object(external_lodash_["find"])(fontSizes, {
size: value
});
if (fontSizeObject) {
return fontSizeObject;
}
return {
size: value
};
}
/**
* Returns a class based on fontSizeName.
*
* @param {string} fontSizeSlug Slug of the fontSize.
*
* @return {string} String with the class corresponding to the fontSize passed.
* The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'.
*/
function getFontSizeClass(fontSizeSlug) {
if (!fontSizeSlug) {
return;
}
return `has-${Object(external_lodash_["kebabCase"])(fontSizeSlug)}-font-size`;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function FontSizePicker(props) {
const fontSizes = useSetting('typography.fontSizes');
const disableCustomFontSizes = !useSetting('typography.customFontSize');
return Object(external_wp_element_["createElement"])(external_wp_components_["FontSizePicker"], Object(esm_extends["a" /* default */])({}, props, {
fontSizes: fontSizes,
disableCustomFontSizes: disableCustomFontSizes
}));
}
/* harmony default export */ var font_size_picker = (FontSizePicker);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const FONT_SIZE_SUPPORT_KEY = 'fontSize';
/**
* Filters registered block settings, extending attributes to include
* `fontSize` and `fontWeight` attributes.
*
* @param {Object} settings Original block settings
* @return {Object} Filtered block settings
*/
function font_size_addAttributes(settings) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) {
return settings;
} // Allow blocks to specify a default value if needed.
if (!settings.attributes.fontSize) {
Object.assign(settings.attributes, {
fontSize: {
type: 'string'
}
});
}
return settings;
}
/**
* Override props assigned to save component to inject font size.
*
* @param {Object} props Additional props applied to save element
* @param {Object} blockType Block type
* @param {Object} attributes Block attributes
* @return {Object} Filtered props applied to save element
*/
function font_size_addSaveProps(props, blockType, attributes) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, FONT_SIZE_SUPPORT_KEY)) {
return props;
}
if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, '__experimentalSkipFontSizeSerialization')) {
return props;
} // Use TokenList to dedupe classes.
const classes = new external_wp_tokenList_default.a(props.className);
classes.add(getFontSizeClass(attributes.fontSize));
const newClassName = classes.value;
props.className = newClassName ? newClassName : undefined;
return props;
}
/**
* Filters registered block settings to expand the block edit wrapper
* by applying the desired styles and classnames.
*
* @param {Object} settings Original block settings
* @return {Object} Filtered block settings
*/
function font_size_addEditProps(settings) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) {
return settings;
}
const existingGetEditWrapperProps = settings.getEditWrapperProps;
settings.getEditWrapperProps = attributes => {
let props = {};
if (existingGetEditWrapperProps) {
props = existingGetEditWrapperProps(attributes);
}
return font_size_addSaveProps(props, settings, attributes);
};
return settings;
}
/**
* Inspector control panel containing the font size related configuration
*
* @param {Object} props
*
* @return {WPElement} Font size edit element.
*/
function FontSizeEdit(props) {
var _style$typography, _style$typography2;
const {
attributes: {
fontSize,
style
},
setAttributes
} = props;
const isDisabled = useIsFontSizeDisabled(props);
const fontSizes = useSetting('typography.fontSizes');
const onChange = value => {
const fontSizeSlug = getFontSizeObjectByValue(fontSizes, value).slug;
setAttributes({
style: cleanEmptyObject({ ...style,
typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
fontSize: fontSizeSlug ? undefined : value
}
}),
fontSize: fontSizeSlug
});
};
if (isDisabled) {
return null;
}
const fontSizeObject = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize);
const fontSizeValue = (fontSizeObject === null || fontSizeObject === void 0 ? void 0 : fontSizeObject.size) || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontSize) || fontSize;
return Object(external_wp_element_["createElement"])(font_size_picker, {
onChange: onChange,
value: fontSizeValue
});
}
/**
* Custom hook that checks if font-size settings have been disabled.
*
* @param {string} name The name of the block.
* @return {boolean} Whether setting is disabled.
*/
function useIsFontSizeDisabled({
name: blockName
} = {}) {
const fontSizes = useSetting('typography.fontSizes');
const hasFontSizes = !!(fontSizes !== null && fontSizes !== void 0 && fontSizes.length);
return !Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes;
}
/**
* Add inline styles for font sizes.
* Ideally, this is not needed and themes load the font-size classes on the
* editor.
*
* @param {Function} BlockListBlock Original component
* @return {Function} Wrapped component
*/
const withFontSizeInlineStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
var _style$typography3, _style$typography4;
const fontSizes = useSetting('typography.fontSizes');
const {
name: blockName,
attributes: {
fontSize,
style
},
wrapperProps
} = props; // Only add inline styles if the block supports font sizes,
// doesn't skip serialization of font sizes,
// doesn't already have an inline font size,
// and does have a class to extract the font size from.
if (!Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || Object(external_wp_blocks_["hasBlockSupport"])(blockName, '__experimentalSkipFontSizeSerialization') || !fontSize || style !== null && style !== void 0 && (_style$typography3 = style.typography) !== null && _style$typography3 !== void 0 && _style$typography3.fontSize) {
return Object(external_wp_element_["createElement"])(BlockListBlock, props);
}
const fontSizeValue = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography4 = style.typography) === null || _style$typography4 === void 0 ? void 0 : _style$typography4.fontSize).size;
const newProps = { ...props,
wrapperProps: { ...wrapperProps,
style: {
fontSize: fontSizeValue,
...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style)
}
}
};
return Object(external_wp_element_["createElement"])(BlockListBlock, newProps);
}, 'withFontSizeInlineStyles');
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js
@ -15607,7 +15295,7 @@ function TextDecorationControl({
* decorations e.g. settings found in `block.json`. * decorations e.g. settings found in `block.json`.
*/ */
const TEXT_DECORATION_SUPPORT_KEY = '__experimentalTextDecoration'; const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
/** /**
* Inspector control panel containing the text decoration options. * Inspector control panel containing the text decoration options.
* *
@ -15775,7 +15463,7 @@ function TextTransformControl({
* transforms e.g. settings found in `block.json`. * transforms e.g. settings found in `block.json`.
*/ */
const TEXT_TRANSFORM_SUPPORT_KEY = '__experimentalTextTransform'; const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
/** /**
* Inspector control panel containing the text transform options. * Inspector control panel containing the text transform options.
* *
@ -15985,7 +15673,7 @@ function LineHeightControl({
const LINE_HEIGHT_SUPPORT_KEY = 'lineHeight'; const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
/** /**
* Inspector control panel containing the line height related configuration * Inspector control panel containing the line height related configuration
* *
@ -16227,12 +15915,12 @@ function FontAppearanceControl(props) {
* Key within block settings' support array indicating support for font style. * Key within block settings' support array indicating support for font style.
*/ */
const FONT_STYLE_SUPPORT_KEY = '__experimentalFontStyle'; const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
/** /**
* Key within block settings' support array indicating support for font weight. * Key within block settings' support array indicating support for font weight.
*/ */
const FONT_WEIGHT_SUPPORT_KEY = '__experimentalFontWeight'; const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
/** /**
* Inspector control panel containing the font appearance options. * Inspector control panel containing the font appearance options.
* *
@ -16399,7 +16087,7 @@ function FontFamilyControl({
const FONT_FAMILY_SUPPORT_KEY = '__experimentalFontFamily'; const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
const getFontFamilyFromAttributeValue = (fontFamilies, value) => { const getFontFamilyFromAttributeValue = (fontFamilies, value) => {
const attributeParsed = /var:preset\|font-family\|(.+)/.exec(value); const attributeParsed = /var:preset\|font-family\|(.+)/.exec(value);
@ -16473,6 +16161,310 @@ function useIsFontFamilyDisabled({
return !fontFamilies || fontFamilies.length === 0 || !Object(external_wp_blocks_["hasBlockSupport"])(name, FONT_FAMILY_SUPPORT_KEY); return !fontFamilies || fontFamilies.length === 0 || !Object(external_wp_blocks_["hasBlockSupport"])(name, FONT_FAMILY_SUPPORT_KEY);
} }
// EXTERNAL MODULE: external ["wp","tokenList"]
var external_wp_tokenList_ = __webpack_require__("BLeD");
var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js
/**
* External dependencies
*/
/**
* Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.
* If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.
*
* @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties.
* @param {?string} fontSizeAttribute Content of the font size attribute (slug).
* @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value).
*
* @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug.
* Otherwise, an object with just the size value based on customFontSize is returned.
*/
const getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => {
if (fontSizeAttribute) {
const fontSizeObject = Object(external_lodash_["find"])(fontSizes, {
slug: fontSizeAttribute
});
if (fontSizeObject) {
return fontSizeObject;
}
}
return {
size: customFontSizeAttribute
};
};
/**
* Returns the corresponding font size object for a given value.
*
* @param {Array} fontSizes Array of font size objects.
* @param {number} value Font size value.
*
* @return {Object} Font size object.
*/
function getFontSizeObjectByValue(fontSizes, value) {
const fontSizeObject = Object(external_lodash_["find"])(fontSizes, {
size: value
});
if (fontSizeObject) {
return fontSizeObject;
}
return {
size: value
};
}
/**
* Returns a class based on fontSizeName.
*
* @param {string} fontSizeSlug Slug of the fontSize.
*
* @return {string} String with the class corresponding to the fontSize passed.
* The class is generated by appending 'has-' followed by fontSizeSlug and ending with '-font-size'.
*/
function getFontSizeClass(fontSizeSlug) {
if (!fontSizeSlug) {
return;
} // We don't want to use kebabCase from lodash here
// see https://github.com/WordPress/gutenberg/issues/32347
// However, we need to make sure the generated class
// doesn't contain spaces.
return `has-${fontSizeSlug.replace(/\s+/g, '-')}-font-size`;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function FontSizePicker(props) {
const fontSizes = useSetting('typography.fontSizes');
const disableCustomFontSizes = !useSetting('typography.customFontSize');
return Object(external_wp_element_["createElement"])(external_wp_components_["FontSizePicker"], Object(esm_extends["a" /* default */])({}, props, {
fontSizes: fontSizes,
disableCustomFontSizes: disableCustomFontSizes
}));
}
/* harmony default export */ var font_size_picker = (FontSizePicker);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
/**
* Filters registered block settings, extending attributes to include
* `fontSize` and `fontWeight` attributes.
*
* @param {Object} settings Original block settings
* @return {Object} Filtered block settings
*/
function font_size_addAttributes(settings) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) {
return settings;
} // Allow blocks to specify a default value if needed.
if (!settings.attributes.fontSize) {
Object.assign(settings.attributes, {
fontSize: {
type: 'string'
}
});
}
return settings;
}
/**
* Override props assigned to save component to inject font size.
*
* @param {Object} props Additional props applied to save element
* @param {Object} blockType Block type
* @param {Object} attributes Block attributes
* @return {Object} Filtered props applied to save element
*/
function font_size_addSaveProps(props, blockType, attributes) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, FONT_SIZE_SUPPORT_KEY)) {
return props;
}
if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'typography.__experimentalSkipSerialization')) {
return props;
} // Use TokenList to dedupe classes.
const classes = new external_wp_tokenList_default.a(props.className);
classes.add(getFontSizeClass(attributes.fontSize));
const newClassName = classes.value;
props.className = newClassName ? newClassName : undefined;
return props;
}
/**
* Filters registered block settings to expand the block edit wrapper
* by applying the desired styles and classnames.
*
* @param {Object} settings Original block settings
* @return {Object} Filtered block settings
*/
function font_size_addEditProps(settings) {
if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) {
return settings;
}
const existingGetEditWrapperProps = settings.getEditWrapperProps;
settings.getEditWrapperProps = attributes => {
let props = {};
if (existingGetEditWrapperProps) {
props = existingGetEditWrapperProps(attributes);
}
return font_size_addSaveProps(props, settings, attributes);
};
return settings;
}
/**
* Inspector control panel containing the font size related configuration
*
* @param {Object} props
*
* @return {WPElement} Font size edit element.
*/
function FontSizeEdit(props) {
var _style$typography, _style$typography2;
const {
attributes: {
fontSize,
style
},
setAttributes
} = props;
const isDisabled = useIsFontSizeDisabled(props);
const fontSizes = useSetting('typography.fontSizes');
const onChange = value => {
const fontSizeSlug = getFontSizeObjectByValue(fontSizes, value).slug;
setAttributes({
style: cleanEmptyObject({ ...style,
typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
fontSize: fontSizeSlug ? undefined : value
}
}),
fontSize: fontSizeSlug
});
};
if (isDisabled) {
return null;
}
const fontSizeObject = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.fontSize);
const fontSizeValue = (fontSizeObject === null || fontSizeObject === void 0 ? void 0 : fontSizeObject.size) || (style === null || style === void 0 ? void 0 : (_style$typography2 = style.typography) === null || _style$typography2 === void 0 ? void 0 : _style$typography2.fontSize) || fontSize;
return Object(external_wp_element_["createElement"])(font_size_picker, {
onChange: onChange,
value: fontSizeValue
});
}
/**
* Custom hook that checks if font-size settings have been disabled.
*
* @param {string} name The name of the block.
* @return {boolean} Whether setting is disabled.
*/
function useIsFontSizeDisabled({
name: blockName
} = {}) {
const fontSizes = useSetting('typography.fontSizes');
const hasFontSizes = !!(fontSizes !== null && fontSizes !== void 0 && fontSizes.length);
return !Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes;
}
/**
* Add inline styles for font sizes.
* Ideally, this is not needed and themes load the font-size classes on the
* editor.
*
* @param {Function} BlockListBlock Original component
* @return {Function} Wrapped component
*/
const withFontSizeInlineStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
var _style$typography3, _style$typography4;
const fontSizes = useSetting('typography.fontSizes');
const {
name: blockName,
attributes: {
fontSize,
style
},
wrapperProps
} = props; // Only add inline styles if the block supports font sizes,
// doesn't skip serialization of font sizes,
// doesn't already have an inline font size,
// and does have a class to extract the font size from.
if (!Object(external_wp_blocks_["hasBlockSupport"])(blockName, FONT_SIZE_SUPPORT_KEY) || Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'typography.__experimentalSkipSerialization') || !fontSize || style !== null && style !== void 0 && (_style$typography3 = style.typography) !== null && _style$typography3 !== void 0 && _style$typography3.fontSize) {
return Object(external_wp_element_["createElement"])(BlockListBlock, props);
}
const fontSizeValue = getFontSize(fontSizes, fontSize, style === null || style === void 0 ? void 0 : (_style$typography4 = style.typography) === null || _style$typography4 === void 0 ? void 0 : _style$typography4.fontSize).size;
const newProps = { ...props,
wrapperProps: { ...wrapperProps,
style: {
fontSize: fontSizeValue,
...(wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style)
}
}
};
return Object(external_wp_element_["createElement"])(BlockListBlock, newProps);
}, 'withFontSizeInlineStyles');
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
Object(external_wp_hooks_["addFilter"])('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js
@ -16499,6 +16491,7 @@ function useIsFontFamilyDisabled({
const TYPOGRAPHY_SUPPORT_KEY = 'typography';
const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY]; const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY];
function TypographyPanel(props) { function TypographyPanel(props) {
const isDisabled = useIsTypographyDisabled(props); const isDisabled = useIsTypographyDisabled(props);
@ -16838,7 +16831,6 @@ function useCustomSides(blockName, feature) {
const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY]; const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
const hasStyleSupport = blockType => styleSupportKeys.some(key => Object(external_wp_blocks_["hasBlockSupport"])(blockType, key)); const hasStyleSupport = blockType => styleSupportKeys.some(key => Object(external_wp_blocks_["hasBlockSupport"])(blockType, key));
@ -16921,12 +16913,7 @@ function style_addAttribute(settings) {
const skipSerializationPaths = { const skipSerializationPaths = {
[`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'], [`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'],
[`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY], [`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY],
[`__experimentalSkipFontSizeSerialization`]: ['typography', 'fontSize'], [`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY]
[`__experimentalSkipTypographySerialization`]: Object(external_lodash_["without"])(TYPOGRAPHY_SUPPORT_KEYS, FONT_SIZE_SUPPORT_KEY).map(feature => {
var _find;
return (_find = Object(external_lodash_["find"])(external_wp_blocks_["__EXPERIMENTAL_STYLE_PROPERTY"], property => Object(external_lodash_["isEqual"])(property.support, [feature]))) === null || _find === void 0 ? void 0 : _find.value;
})
}; };
/** /**
* Override props assigned to save component to inject the CSS variables definition. * Override props assigned to save component to inject the CSS variables definition.
@ -17005,19 +16992,14 @@ const withElementsStyles = Object(external_wp_compose_["createHigherOrderCompone
var _props$attributes$sty, _props$attributes$sty2; var _props$attributes$sty, _props$attributes$sty2;
const elements = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements; const elements = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements;
if (!elements) {
return Object(external_wp_element_["createElement"])(BlockListBlock, props);
}
const blockElementsContainerIdentifier = `wp-elements-${Object(external_wp_compose_["useInstanceId"])(BlockListBlock)}`; const blockElementsContainerIdentifier = `wp-elements-${Object(external_wp_compose_["useInstanceId"])(BlockListBlock)}`;
const styles = compileElementsStyles(blockElementsContainerIdentifier, (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements); const styles = compileElementsStyles(blockElementsContainerIdentifier, (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("style", { return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, elements && Object(external_wp_element_["createElement"])("style", {
dangerouslySetInnerHTML: { dangerouslySetInnerHTML: {
__html: styles __html: styles
} }
}), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, { }), Object(external_wp_element_["createElement"])(BlockListBlock, Object(esm_extends["a" /* default */])({}, props, {
className: classnames_default()(props.classname, blockElementsContainerIdentifier) className: elements ? classnames_default()(props.className, blockElementsContainerIdentifier) : props.className
}))); })));
}); });
Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/style/addAttribute', style_addAttribute); Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/style/addAttribute', style_addAttribute);
@ -17326,7 +17308,7 @@ const withDuotoneStyles = Object(external_wp_compose_["createHigherOrderComponen
const selectors = duotoneSupport.split(','); const selectors = duotoneSupport.split(',');
const selectorsScoped = selectors.map(selector => `.${id} ${selector.trim()}`); const selectorsScoped = selectors.map(selector => `.${id} ${selector.trim()}`);
const selectorsGroup = selectorsScoped.join(', '); const selectorsGroup = selectorsScoped.join(', ');
const className = classnames_default()(props === null || props === void 0 ? void 0 : props.classname, id); const className = classnames_default()(props === null || props === void 0 ? void 0 : props.className, id);
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(DuotoneFilter, { return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(DuotoneFilter, {
selector: selectorsGroup, selector: selectorsGroup,
id: id, id: id,
@ -20498,9 +20480,7 @@ function BlockHTML({
/* harmony default export */ var block_html = (BlockHTML); /* harmony default export */ var block_html = (BlockHTML);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/dom.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/dom.js
// Consider the block appender to be a child block of its own, which also has const BLOCK_SELECTOR = '.block-editor-block-list__block';
// this class.
const BLOCK_SELECTOR = '.wp-block';
/** /**
* Returns true if two elements are contained within the same block. * Returns true if two elements are contained within the same block.
* *
@ -26394,13 +26374,11 @@ const getRetainedBlockAttributes = (name, attributes) => {
*/ */
/** /**
* Internal dependencies * Internal dependencies
*/ */
/** /**
* Mutate the matched block's attributes by getting * Mutate the matched block's attributes by getting
* which block type's attributes to retain and prioritize * which block type's attributes to retain and prioritize
@ -26480,10 +26458,7 @@ const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => {
// TODO tests // TODO tests
const useTransformedPatterns = (patterns, selectedBlocks) => { const useTransformedPatterns = (patterns, selectedBlocks) => {
const parsedPatterns = Object(external_wp_data_["useSelect"])(select => patterns.map(({ return Object(external_wp_element_["useMemo"])(() => patterns.reduce((accumulator, _pattern) => {
name
}) => select(store).__experimentalGetParsedPattern(name)), [patterns]);
return Object(external_wp_element_["useMemo"])(() => parsedPatterns.reduce((accumulator, _pattern) => {
const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks); const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks);
if (transformedBlocks) { if (transformedBlocks) {
@ -26493,7 +26468,7 @@ const useTransformedPatterns = (patterns, selectedBlocks) => {
} }
return accumulator; return accumulator;
}, []), [parsedPatterns, selectedBlocks]); }, []), [patterns, selectedBlocks]);
}; };
/* harmony default export */ var use_transformed_patterns = (useTransformedPatterns); /* harmony default export */ var use_transformed_patterns = (useTransformedPatterns);
@ -28442,7 +28417,8 @@ function useBlockProps(props = {}, {
const { const {
clientId, clientId,
className, className,
wrapperProps = {} wrapperProps = {},
isAligned
} = Object(external_wp_element_["useContext"])(BlockListBlockContext); } = Object(external_wp_element_["useContext"])(BlockListBlockContext);
const { const {
index, index,
@ -28500,7 +28476,9 @@ function useBlockProps(props = {}, {
'data-type': name, 'data-type': name,
'data-title': blockTitle, 'data-title': blockTitle,
className: classnames_default()( // The wp-block className is important for editor styles. className: classnames_default()( // The wp-block className is important for editor styles.
'wp-block block-editor-block-list__block', className, props.className, wrapperProps.className, useBlockClassNames(clientId), useBlockDefaultClassName(clientId), useBlockCustomClassName(clientId), useBlockMovingModeClassNames(clientId)), classnames_default()('block-editor-block-list__block', {
'wp-block': !isAligned
}), className, props.className, wrapperProps.className, useBlockClassNames(clientId), useBlockDefaultClassName(clientId), useBlockCustomClassName(clientId), useBlockMovingModeClassNames(clientId)),
style: { ...wrapperProps.style, style: { ...wrapperProps.style,
...props.style ...props.style
} }
@ -28664,7 +28642,8 @@ function block_BlockListBlock({
const value = { const value = {
clientId, clientId,
className, className,
wrapperProps: Object(external_lodash_["omit"])(wrapperProps, ['data-align']) wrapperProps: Object(external_lodash_["omit"])(wrapperProps, ['data-align']),
isAligned
}; };
const memoizedValue = Object(external_wp_element_["useMemo"])(() => value, Object.values(value)); const memoizedValue = Object(external_wp_element_["useMemo"])(() => value, Object.values(value));
return Object(external_wp_element_["createElement"])(BlockListBlockContext.Provider, { return Object(external_wp_element_["createElement"])(BlockListBlockContext.Provider, {
@ -31119,7 +31098,7 @@ function RichTextWrapper({
__unstableMultilineTag: multilineTag, __unstableMultilineTag: multilineTag,
__unstableDisableFormats: disableFormats, __unstableDisableFormats: disableFormats,
preserveWhiteSpace, preserveWhiteSpace,
__unstableDependencies: dependencies, __unstableDependencies: [...dependencies, tagName],
__unstableAfterParse: addEditorOnlyFormats, __unstableAfterParse: addEditorOnlyFormats,
__unstableBeforeSerialize: removeEditorOnlyFormats, __unstableBeforeSerialize: removeEditorOnlyFormats,
__unstableAddInvisibleFormats: addInvisibleFormats __unstableAddInvisibleFormats: addInvisibleFormats
@ -31486,21 +31465,15 @@ function usePatternsSetup(clientId, blockName, filterPatternsFn) {
const { const {
getBlockRootClientId, getBlockRootClientId,
__experimentalGetPatternsByBlockTypes, __experimentalGetPatternsByBlockTypes,
__experimentalGetParsedPattern,
__experimentalGetAllowedPatterns __experimentalGetAllowedPatterns
} = select(store); } = select(store);
const rootClientId = getBlockRootClientId(clientId); const rootClientId = getBlockRootClientId(clientId);
let patterns = [];
if (filterPatternsFn) { if (filterPatternsFn) {
patterns = __experimentalGetAllowedPatterns(rootClientId).filter(filterPatternsFn); return __experimentalGetAllowedPatterns(rootClientId).filter(filterPatternsFn);
} else {
patterns = __experimentalGetPatternsByBlockTypes(blockName, rootClientId);
} }
return patterns.map(({ return __experimentalGetPatternsByBlockTypes(blockName, rootClientId);
name
}) => __experimentalGetParsedPattern(name));
}, [clientId, blockName, filterPatternsFn]); }, [clientId, blockName, filterPatternsFn]);
} }

File diff suppressed because one or more lines are too long

View File

@ -2212,8 +2212,10 @@ const {
color: { color: {
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
lineHeight: true
},
__experimentalSelector: "p", __experimentalSelector: "p",
__unstablePasteTextInline: true __unstablePasteTextInline: true
}, },
@ -2307,8 +2309,10 @@ const paragraph_metadata = {
color: { color: {
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
lineHeight: true
},
__experimentalSelector: "p", __experimentalSelector: "p",
__unstablePasteTextInline: true __unstablePasteTextInline: true
}, },
@ -3932,7 +3936,6 @@ function (_super) {
muted: true, muted: true,
className: index_module_classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) className: index_module_classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
}, mediaProps, { }, mediaProps, {
src: video,
ref: function ref(el) { ref: function ref(el) {
return _this.videoRef = el; return _this.videoRef = el;
}, },
@ -3941,6 +3944,12 @@ function (_super) {
transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")" transform: transform || "translate(" + x + "px, " + y + "px) rotate(" + rotation + "deg) scale(" + zoom + ")"
}), }),
controls: false controls: false
}), (Array.isArray(video) ? video : [{
src: video
}]).map(function (item) {
return /*#__PURE__*/external_React_default.a.createElement("source", __assign({
key: item.src
}, item));
})), this.state.cropSize && /*#__PURE__*/external_React_default.a.createElement("div", { })), this.state.cropSize && /*#__PURE__*/external_React_default.a.createElement("div", {
style: __assign(__assign({}, cropAreaStyle), { style: __assign(__assign({}, cropAreaStyle), {
width: this.state.cropSize.width, width: this.state.cropSize.width,
@ -6377,8 +6386,11 @@ const {
color: { color: {
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
lineHeight: true,
__experimentalFontWeight: true
},
__experimentalSelector: "h1,h2,h3,h4,h5,h6", __experimentalSelector: "h1,h2,h3,h4,h5,h6",
__unstablePasteTextInline: true __unstablePasteTextInline: true
}, },
@ -6521,8 +6533,11 @@ const heading_metadata = {
color: { color: {
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
lineHeight: true,
__experimentalFontWeight: true
},
__experimentalSelector: "h1,h2,h3,h4,h5,h6", __experimentalSelector: "h1,h2,h3,h4,h5,h6",
__unstablePasteTextInline: true __unstablePasteTextInline: true
}, },
@ -10707,13 +10722,15 @@ const button_metadata = {
__experimentalSkipSerialization: true, __experimentalSkipSerialization: true,
gradients: true gradients: true
}, },
fontSize: true, typography: {
fontSize: true,
__experimentalFontFamily: true
},
reusable: false, reusable: false,
__experimentalBorder: { __experimentalBorder: {
radius: true, radius: true,
__experimentalSkipSerialization: true __experimentalSkipSerialization: true
}, },
__experimentalFontFamily: true,
__experimentalSelector: ".wp-block-button__link" __experimentalSelector: ".wp-block-button__link"
}, },
styles: [{ styles: [{
@ -10770,6 +10787,12 @@ const button_settings = {
const ALLOWED_BLOCKS = [button_name]; const ALLOWED_BLOCKS = [button_name];
const BUTTONS_TEMPLATE = [['core/button']]; const BUTTONS_TEMPLATE = [['core/button']];
const LAYOUT = {
type: 'default',
alignments: []
};
const VERTICAL_JUSTIFY_CONTROLS = ['left', 'center', 'right'];
const HORIZONTAL_JUSTIFY_CONTROLS = ['left', 'center', 'right', 'space-between'];
function ButtonsEdit({ function ButtonsEdit({
attributes: { attributes: {
@ -10788,13 +10811,10 @@ function ButtonsEdit({
allowedBlocks: ALLOWED_BLOCKS, allowedBlocks: ALLOWED_BLOCKS,
template: BUTTONS_TEMPLATE, template: BUTTONS_TEMPLATE,
orientation, orientation,
__experimentalLayout: { __experimentalLayout: LAYOUT,
type: 'default',
alignments: []
},
templateInsertUpdatesSelection: true templateInsertUpdatesSelection: true
}); });
const justifyControls = orientation === 'vertical' ? ['left', 'center', 'right'] : ['left', 'center', 'right', 'space-between']; const justifyControls = orientation === 'vertical' ? VERTICAL_JUSTIFY_CONTROLS : HORIZONTAL_JUSTIFY_CONTROLS;
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], { return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
group: "block" group: "block"
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["JustifyContentControl"], { }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["JustifyContentControl"], {
@ -11433,7 +11453,9 @@ const code_metadata = {
}, },
supports: { supports: {
anchor: true, anchor: true,
fontSize: true typography: {
fontSize: true
}
}, },
style: "wp-block-code" style: "wp-block-code"
}; };
@ -19049,6 +19071,10 @@ function serializeForm(form) {
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/legacy-widget/edit/form.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/legacy-widget/edit/form.js
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -19056,6 +19082,9 @@ function serializeForm(form) {
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -19067,10 +19096,12 @@ function Form({
id, id,
idBase, idBase,
instance, instance,
isWide,
onChangeInstance, onChangeInstance,
onChangeHasPreview onChangeHasPreview
}) { }) {
const ref = Object(external_wp_element_["useRef"])(); // We only want to remount the control when the instance changes const ref = Object(external_wp_element_["useRef"])();
const isMediumLargeViewport = Object(external_wp_compose_["useViewportMatch"])('small'); // We only want to remount the control when the instance changes
// *externally*. For example, if the user performs an undo. To do this, we // *externally*. For example, if the user performs an undo. To do this, we
// keep track of changes made to instance by the control itself and then // keep track of changes made to instance by the control itself and then
// ignore those. // ignore those.
@ -19115,7 +19146,26 @@ function Form({
control.destroy(); control.destroy();
}; };
}, [id, idBase, instance, onChangeInstance, onChangeHasPreview]); }, [id, idBase, instance, onChangeInstance, onChangeHasPreview, isMediumLargeViewport]);
if (isWide && isMediumLargeViewport) {
return Object(external_wp_element_["createElement"])("div", {
className: classnames_default()({
'wp-block-legacy-widget__container': isVisible
})
}, isVisible && Object(external_wp_element_["createElement"])("h3", {
className: "wp-block-legacy-widget__edit-form-title"
}, title), Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
focusOnMount: false,
position: "middle right",
__unstableForceXAlignment: true
}, Object(external_wp_element_["createElement"])("div", {
ref: ref,
className: "wp-block-legacy-widget__edit-form",
hidden: !isVisible
})));
}
return Object(external_wp_element_["createElement"])("div", { return Object(external_wp_element_["createElement"])("div", {
ref: ref, ref: ref,
className: "wp-block-legacy-widget__edit-form", className: "wp-block-legacy-widget__edit-form",
@ -19188,8 +19238,7 @@ function Preview({
// Ideally, we'd render a <ServerSideRender>. Maybe by // Ideally, we'd render a <ServerSideRender>. Maybe by
// rendering one in an iframe via a portal. // rendering one in an iframe via a portal.
, ,
src: Object(external_wp_url_["addQueryArgs"])('themes.php', { src: Object(external_wp_url_["addQueryArgs"])('widgets.php', {
page: 'gutenberg-widgets',
'legacy-widget-preview': { 'legacy-widget-preview': {
idBase, idBase,
instance instance
@ -19252,6 +19301,10 @@ function ConvertToBlocksButton({
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/legacy-widget/edit/index.js // CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/legacy-widget/edit/index.js
/**
* External dependencies
*/
/** /**
* WordPress dependencies * WordPress dependencies
*/ */
@ -19262,6 +19315,7 @@ function ConvertToBlocksButton({
/** /**
* Internal dependencies * Internal dependencies
*/ */
@ -19277,7 +19331,15 @@ function Edit(props) {
id, id,
idBase idBase
} = props.attributes; } = props.attributes;
return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), !id && !idBase ? Object(external_wp_element_["createElement"])(Empty, props) : Object(external_wp_element_["createElement"])(NotEmpty, props)); const {
isWide = false
} = props;
const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
className: classnames_default()({
'is-wide-widget': isWide
})
});
return Object(external_wp_element_["createElement"])("div", blockProps, !id && !idBase ? Object(external_wp_element_["createElement"])(Empty, props) : Object(external_wp_element_["createElement"])(NotEmpty, props));
} }
function Empty({ function Empty({
@ -19329,7 +19391,8 @@ function NotEmpty({
}, },
setAttributes, setAttributes,
clientId, clientId,
isSelected isSelected,
isWide = false
}) { }) {
const [hasPreview, setHasPreview] = Object(external_wp_element_["useState"])(null); const [hasPreview, setHasPreview] = Object(external_wp_element_["useState"])(null);
const { const {
@ -19393,6 +19456,7 @@ function NotEmpty({
id: id, id: id,
idBase: idBase, idBase: idBase,
instance: instance, instance: instance,
isWide: isWide,
onChangeInstance: setInstance, onChangeInstance: setInstance,
onChangeHasPreview: setHasPreview onChangeHasPreview: setHasPreview
}), idBase && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasPreview === null && mode === 'preview' && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)), hasPreview === true && Object(external_wp_element_["createElement"])(Preview, { }), idBase && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasPreview === null && mode === 'preview' && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)), hasPreview === true && Object(external_wp_element_["createElement"])(Preview, {
@ -19752,7 +19816,9 @@ const loginout_metadata = {
}, },
supports: { supports: {
className: true, className: true,
fontSize: false typography: {
fontSize: false
}
} }
}; };
const { const {
@ -20365,7 +20431,10 @@ const list_metadata = {
supports: { supports: {
anchor: true, anchor: true,
className: false, className: false,
fontSize: true, typography: {
fontSize: true,
__experimentalFontFamily: true
},
color: { color: {
gradients: true gradients: true
}, },
@ -21254,7 +21323,9 @@ const preformatted_metadata = {
color: { color: {
gradients: true gradients: true
}, },
fontSize: true typography: {
fontSize: true
}
}, },
style: "wp-block-preformatted" style: "wp-block-preformatted"
}; };
@ -23101,6 +23172,7 @@ const group_deprecated_deprecated = [// Version of the block with the double div
function GroupEdit({ function GroupEdit({
attributes, attributes,
setAttributes, setAttributes,
@ -23133,18 +23205,27 @@ function GroupEdit({
contentSize, contentSize,
wideSize wideSize
} = usedLayout; } = usedLayout;
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
const _layout = Object(external_wp_element_["useMemo"])(() => {
if (themeSupportsLayout) {
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
return {
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments
};
}
return undefined;
}, [themeSupportsLayout, contentSize, wideSize]);
const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
const innerBlocksProps = Object(external_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(themeSupportsLayout ? blockProps : { const innerBlocksProps = Object(external_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(themeSupportsLayout ? blockProps : {
className: 'wp-block-group__inner-container' className: 'wp-block-group__inner-container'
}, { }, {
templateLock, templateLock,
renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender, renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender,
__experimentalLayout: { __experimentalLayout: _layout
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments: themeSupportsLayout ? alignments : undefined
}
}); });
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorAdvancedControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], { return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorAdvancedControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
label: Object(external_wp_i18n_["__"])('HTML element'), label: Object(external_wp_i18n_["__"])('HTML element'),
@ -25990,8 +26071,10 @@ const verse_metadata = {
gradients: true, gradients: true,
link: true link: true
}, },
__experimentalFontFamily: true, typography: {
fontSize: true, fontSize: true,
__experimentalFontFamily: true
},
spacing: { spacing: {
padding: true padding: true
} }
@ -29469,10 +29552,12 @@ const site_tagline_metadata = {
margin: true, margin: true,
padding: true padding: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
__experimentalFontFamily: true, lineHeight: true,
__experimentalTextTransform: true __experimentalFontFamily: true,
__experimentalTextTransform: true
}
} }
}; };
@ -29674,12 +29759,14 @@ const site_title_metadata = {
padding: true, padding: true,
margin: true margin: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
__experimentalFontFamily: true, lineHeight: true,
__experimentalTextTransform: true, __experimentalFontFamily: true,
__experimentalFontStyle: true, __experimentalTextTransform: true,
__experimentalFontWeight: true __experimentalFontStyle: true,
__experimentalFontWeight: true
}
} }
}; };
@ -30305,15 +30392,24 @@ function QueryContent({
contentSize, contentSize,
wideSize wideSize
} = usedLayout; } = usedLayout;
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
const blockProps = Object(external_wp_blockEditor_["useBlockProps"])(); const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
const _layout = Object(external_wp_element_["useMemo"])(() => {
if (themeSupportsLayout) {
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
return {
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments
};
}
return undefined;
}, [themeSupportsLayout, contentSize, wideSize]);
const innerBlocksProps = Object(external_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(blockProps, { const innerBlocksProps = Object(external_wp_blockEditor_["__experimentalUseInnerBlocksProps"])(blockProps, {
template: edit_TEMPLATE, template: edit_TEMPLATE,
__experimentalLayout: { __experimentalLayout: _layout
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments: themeSupportsLayout ? alignments : undefined
}
}); });
const { const {
postsPerPage postsPerPage
@ -31055,9 +31151,11 @@ const query_title_metadata = {
color: { color: {
gradients: true gradients: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
__experimentalFontFamily: true lineHeight: true,
__experimentalFontFamily: true
}
}, },
editorStyle: "wp-block-query-title-editor" editorStyle: "wp-block-query-title-editor"
}; };
@ -31268,8 +31366,10 @@ const query_pagination_next_metadata = {
gradients: true, gradients: true,
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true fontSize: true,
lineHeight: true
}
} }
}; };
@ -31454,8 +31554,10 @@ const query_pagination_previous_metadata = {
gradients: true, gradients: true,
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true fontSize: true,
lineHeight: true
}
} }
}; };
@ -31650,9 +31752,11 @@ const post_title_metadata = {
gradients: true, gradients: true,
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true, fontSize: true,
__experimentalFontFamily: true lineHeight: true,
__experimentalFontFamily: true
}
}, },
style: "wp-block-post-title" style: "wp-block-post-title"
}; };
@ -31692,6 +31796,7 @@ const postContent = Object(external_wp_element_["createElement"])(external_wp_pr
function Content({ function Content({
layout, layout,
postType, postType,
@ -31711,7 +31816,20 @@ function Content({
contentSize, contentSize,
wideSize wideSize
} = usedLayout; } = usedLayout;
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
const _layout = Object(external_wp_element_["useMemo"])(() => {
if (themeSupportsLayout) {
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
return {
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments
};
}
return undefined;
}, [themeSupportsLayout, contentSize, wideSize]);
const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', postType, { const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', postType, {
id: postId id: postId
}); });
@ -31721,11 +31839,7 @@ function Content({
value: blocks, value: blocks,
onInput, onInput,
onChange, onChange,
__experimentalLayout: { __experimentalLayout: _layout
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments: themeSupportsLayout ? alignments : undefined
}
}); });
return Object(external_wp_element_["createElement"])("div", props); return Object(external_wp_element_["createElement"])("div", props);
} }
@ -31959,8 +32073,10 @@ const post_date_metadata = {
gradients: true, gradients: true,
link: true link: true
}, },
fontSize: true, typography: {
lineHeight: true fontSize: true,
lineHeight: true
}
} }
}; };
@ -32123,12 +32239,14 @@ const post_excerpt_metadata = {
usesContext: ["postId", "postType"], usesContext: ["postId", "postType"],
supports: { supports: {
html: false, html: false,
fontSize: true,
color: { color: {
gradients: true, gradients: true,
link: true link: true
}, },
lineHeight: true typography: {
fontSize: true,
lineHeight: true
}
}, },
editorStyle: "wp-block-post-excerpt-editor", editorStyle: "wp-block-post-excerpt-editor",
style: "wp-block-post-excerpt" style: "wp-block-post-excerpt"
@ -32503,12 +32621,14 @@ const post_terms_metadata = {
usesContext: ["postId", "postType"], usesContext: ["postId", "postType"],
supports: { supports: {
html: false, html: false,
fontSize: true,
color: { color: {
gradients: true, gradients: true,
link: true link: true
}, },
lineHeight: true typography: {
lineHeight: true,
fontSize: true
}
} }
}; };

File diff suppressed because one or more lines are too long

View File

@ -1361,23 +1361,23 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
}, },
fontFamily: { fontFamily: {
value: ['typography', 'fontFamily'], value: ['typography', 'fontFamily'],
support: ['__experimentalFontFamily'] support: ['typography', '__experimentalFontFamily']
}, },
fontSize: { fontSize: {
value: ['typography', 'fontSize'], value: ['typography', 'fontSize'],
support: ['fontSize'] support: ['typography', 'fontSize']
}, },
fontStyle: { fontStyle: {
value: ['typography', 'fontStyle'], value: ['typography', 'fontStyle'],
support: ['__experimentalFontStyle'] support: ['typography', '__experimentalFontStyle']
}, },
fontWeight: { fontWeight: {
value: ['typography', 'fontWeight'], value: ['typography', 'fontWeight'],
support: ['__experimentalFontWeight'] support: ['typography', '__experimentalFontWeight']
}, },
lineHeight: { lineHeight: {
value: ['typography', 'lineHeight'], value: ['typography', 'lineHeight'],
support: ['lineHeight'] support: ['typography', 'lineHeight']
}, },
margin: { margin: {
value: ['spacing', 'margin'], value: ['spacing', 'margin'],
@ -1391,11 +1391,11 @@ const __EXPERIMENTAL_STYLE_PROPERTY = {
}, },
textDecoration: { textDecoration: {
value: ['typography', 'textDecoration'], value: ['typography', 'textDecoration'],
support: ['__experimentalTextDecoration'] support: ['typography', '__experimentalTextDecoration']
}, },
textTransform: { textTransform: {
value: ['typography', 'textTransform'], value: ['typography', 'textTransform'],
support: ['__experimentalTextTransform'] support: ['typography', '__experimentalTextTransform']
} }
}; };
const __EXPERIMENTAL_ELEMENTS = { const __EXPERIMENTAL_ELEMENTS = {
@ -2475,19 +2475,14 @@ function switchToBlockType(blocks, name) {
return null; return null;
} }
const firstSwitchedBlock = Object(external_lodash_["findIndex"])(transformationResults, result => result.name === name); // Ensure that at least one block object returned by the transformation has const hasSwitchedBlock = Object(external_lodash_["some"])(transformationResults, result => result.name === name); // Ensure that at least one block object returned by the transformation has
// the expected "destination" block type. // the expected "destination" block type.
if (firstSwitchedBlock < 0) { if (!hasSwitchedBlock) {
return null; return null;
} }
return transformationResults.map((result, index) => { const ret = transformationResults.map(result => {
const transformedBlock = { ...result,
// The first transformed block whose type matches the "destination"
// type gets to keep the existing client ID of the first block.
clientId: index === firstSwitchedBlock ? firstBlock.clientId : result.clientId
};
/** /**
* Filters an individual transform result from block transformation. * Filters an individual transform result from block transformation.
* All of the original blocks are passed, since transformations are * All of the original blocks are passed, since transformations are
@ -2496,9 +2491,9 @@ function switchToBlockType(blocks, name) {
* @param {Object} transformedBlock The transformed block. * @param {Object} transformedBlock The transformed block.
* @param {Object[]} blocks Original blocks transformed. * @param {Object[]} blocks Original blocks transformed.
*/ */
return Object(external_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', result, blocks);
return Object(external_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', transformedBlock, blocks);
}); });
return ret;
} }
/** /**
* Create a block object from the example API. * Create a block object from the example API.

File diff suppressed because one or more lines are too long

View File

@ -25340,7 +25340,7 @@ class suggestions_list_SuggestionsList extends external_wp_element_["Component"]
id: `components-form-token-suggestions-${this.props.instanceId}-${index}`, id: `components-form-token-suggestions-${this.props.instanceId}-${index}`,
role: "option", role: "option",
className: classeName, className: classeName,
key: this.props.displayTransform(suggestion), key: suggestion !== null && suggestion !== void 0 && suggestion.value ? suggestion.value : this.props.displayTransform(suggestion),
onMouseDown: this.handleMouseDown, onMouseDown: this.handleMouseDown,
onClick: this.handleClick(suggestion), onClick: this.handleClick(suggestion),
onMouseEnter: this.handleHover(suggestion), onMouseEnter: this.handleHover(suggestion),
@ -55403,11 +55403,12 @@ const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
* @param {string} chosenYAxis yAxis to be used. * @param {string} chosenYAxis yAxis to be used.
* @param {Element} boundaryElement Boundary element. * @param {Element} boundaryElement Boundary element.
* @param {boolean} forcePosition Don't adjust position based on anchor. * @param {boolean} forcePosition Don't adjust position based on anchor.
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
* *
* @return {Object} Popover xAxis position and constraints. * @return {Object} Popover xAxis position and constraints.
*/ */
function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition) { function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
const { const {
width width
} = contentSize; // Correct xAxis for RTL support } = contentSize; // Correct xAxis for RTL support
@ -55434,7 +55435,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
if (corner === 'right') { if (corner === 'right') {
leftAlignmentX = anchorRect.right; leftAlignmentX = anchorRect.right;
} else if (chosenYAxis !== 'middle') { } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
leftAlignmentX = anchorMidPoint; leftAlignmentX = anchorMidPoint;
} }
@ -55442,7 +55443,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
if (corner === 'left') { if (corner === 'left') {
rightAlignmentX = anchorRect.left; rightAlignmentX = anchorRect.left;
} else if (chosenYAxis !== 'middle') { } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
rightAlignmentX = anchorMidPoint; rightAlignmentX = anchorMidPoint;
} }
@ -55613,14 +55614,15 @@ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sti
* relative positioned parent container. * relative positioned parent container.
* @param {Element} boundaryElement Boundary element. * @param {Element} boundaryElement Boundary element.
* @param {boolean} forcePosition Don't adjust position based on anchor. * @param {boolean} forcePosition Don't adjust position based on anchor.
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
* *
* @return {Object} Popover position and constraints. * @return {Object} Popover position and constraints.
*/ */
function computePopoverPosition(anchorRect, contentSize, position = 'top', stickyBoundaryElement, anchorRef, relativeOffsetTop, boundaryElement, forcePosition) { function computePopoverPosition(anchorRect, contentSize, position = 'top', stickyBoundaryElement, anchorRef, relativeOffsetTop, boundaryElement, forcePosition, forceXAlignment) {
const [yAxis, xAxis = 'center', corner] = position.split(' '); const [yAxis, xAxis = 'center', corner] = position.split(' ');
const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition); const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition);
const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition); const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment);
return { ...xAxisPosition, return { ...xAxisPosition,
...yAxisPosition ...yAxisPosition
}; };
@ -55896,6 +55898,7 @@ const Popover = ({
__unstableObserveElement, __unstableObserveElement,
__unstableBoundaryParent, __unstableBoundaryParent,
__unstableForcePosition, __unstableForcePosition,
__unstableForceXAlignment,
/* eslint-enable no-unused-vars */ /* eslint-enable no-unused-vars */
...contentProps ...contentProps
@ -55965,7 +55968,7 @@ const Popover = ({
yAxis, yAxis,
contentHeight, contentHeight,
contentWidth contentWidth
} = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition); } = computePopoverPosition(anchor, usedContentSize, position, __unstableStickyBoundaryElement, containerRef.current, relativeOffsetTop, boundaryElement, __unstableForcePosition, __unstableForceXAlignment);
if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') { if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') {
setStyle(containerRef.current, 'top', popoverTop + 'px'); setStyle(containerRef.current, 'top', popoverTop + 'px');

File diff suppressed because one or more lines are too long

View File

@ -1578,7 +1578,7 @@ function useClearSelectedBlock(sidebarControl, popoverRef) {
} = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
Object(external_wp_element_["useEffect"])(() => { Object(external_wp_element_["useEffect"])(() => {
if (popoverRef.current && sidebarControl) { if (popoverRef.current && sidebarControl) {
const inspectorContainer = sidebarControl.inspector.contentContainer[0]; const inspector = sidebarControl.inspector;
const container = sidebarControl.container[0]; const container = sidebarControl.container[0];
const ownerDocument = container.ownerDocument; const ownerDocument = container.ownerDocument;
const ownerWindow = ownerDocument.defaultView; const ownerWindow = ownerDocument.defaultView;
@ -1586,8 +1586,9 @@ function useClearSelectedBlock(sidebarControl, popoverRef) {
function handleClearSelectedBlock(element) { function handleClearSelectedBlock(element) {
if ( // 1. Make sure there are blocks being selected. if ( // 1. Make sure there are blocks being selected.
(hasSelectedBlock() || hasMultiSelection()) && // 2. The element should exist in the DOM (not deleted). (hasSelectedBlock() || hasMultiSelection()) && // 2. The element should exist in the DOM (not deleted).
element && ownerDocument.contains(element) && // 3. It should also not exist in the container, inspector, nor the popover. element && ownerDocument.contains(element) && // 3. It should also not exist in the container, the popover, nor the dialog.
!container.contains(element) && !popoverRef.current.contains(element) && !inspectorContainer.contains(element) && !element.closest('[role="dialog"]')) { !container.contains(element) && !popoverRef.current.contains(element) && !element.closest('[role="dialog"]') && // 4. The inspector should not be opened.
!inspector.expanded()) {
clearSelectedBlock(); clearSelectedBlock();
} }
} // Handle focusing in the same document. } // Handle focusing in the same document.
@ -2357,6 +2358,31 @@ const replaceMediaUpload = () => external_wp_mediaUtils_["MediaUpload"];
Object(external_wp_hooks_["addFilter"])('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload); Object(external_wp_hooks_["addFilter"])('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload);
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/wide-widget-display.js
/**
* WordPress dependencies
*/
const {
wp: wide_widget_display_wp
} = window;
const withWideWidgetDisplay = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => {
var _wp$customize$Widgets, _wp$customize$Widgets2;
const {
idBase
} = props.attributes;
const isWide = (_wp$customize$Widgets = (_wp$customize$Widgets2 = wide_widget_display_wp.customize.Widgets.data.availableWidgets.find(widget => widget.id_base === idBase)) === null || _wp$customize$Widgets2 === void 0 ? void 0 : _wp$customize$Widgets2.is_wide) !== null && _wp$customize$Widgets !== void 0 ? _wp$customize$Widgets : false;
return Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({}, props, {
isWide: isWide
}));
}, 'withWideWidgetDisplay');
Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/customize-widgets/wide-widget-display', withWideWidgetDisplay);
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/index.js // CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/filters/index.js
/** /**
* Internal dependencies * Internal dependencies
@ -2364,6 +2390,7 @@ Object(external_wp_hooks_["addFilter"])('editor.MediaUpload', 'core/edit-widgets
// CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/index.js // CONCATENATED MODULE: ./node_modules/@wordpress/customize-widgets/build-module/index.js

File diff suppressed because one or more lines are too long

View File

@ -13152,7 +13152,6 @@ function VisualEditor({
contentSize, contentSize,
wideSize wideSize
} = defaultLayout || {}; } = defaultLayout || {};
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles; let animatedStyles = isTemplateMode ? templateModeStyles : desktopCanvasStyles;
if (resizedCanvasStyles) { if (resizedCanvasStyles) {
@ -13170,6 +13169,24 @@ function VisualEditor({
const contentRef = Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_blockEditor_["__unstableUseClipboardHandler"])(), Object(external_wp_blockEditor_["__unstableUseCanvasClickRedirect"])(), Object(external_wp_blockEditor_["__unstableUseTypewriter"])(), Object(external_wp_blockEditor_["__unstableUseTypingObserver"])(), Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])()]); const contentRef = Object(external_wp_compose_["useMergeRefs"])([ref, Object(external_wp_blockEditor_["__unstableUseClipboardHandler"])(), Object(external_wp_blockEditor_["__unstableUseCanvasClickRedirect"])(), Object(external_wp_blockEditor_["__unstableUseTypewriter"])(), Object(external_wp_blockEditor_["__unstableUseTypingObserver"])(), Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])()]);
const blockSelectionClearerRef = Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])(); const blockSelectionClearerRef = Object(external_wp_blockEditor_["__unstableUseBlockSelectionClearer"])();
const [, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(wrapperUniqueId, wrapperBlockName); const [, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(wrapperUniqueId, wrapperBlockName);
const layout = Object(external_wp_element_["useMemo"])(() => {
if (isTemplateMode) {
return {
type: 'default'
};
}
if (themeSupportsLayout) {
const alignments = contentSize || wideSize ? ['wide', 'full'] : ['left', 'center', 'right'];
return {
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments
};
}
return undefined;
}, [isTemplateMode, themeSupportsLayout, contentSize, wideSize]);
return Object(external_wp_element_["createElement"])("div", { return Object(external_wp_element_["createElement"])("div", {
className: classnames_default()('edit-post-visual-editor', { className: classnames_default()('edit-post-visual-editor', {
'is-template-mode': isTemplateMode 'is-template-mode': isTemplateMode
@ -13199,17 +13216,13 @@ function VisualEditor({
style: { style: {
paddingBottom paddingBottom
} }
}, themeSupportsLayout && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLayoutStyle"], { }, themeSupportsLayout && !isTemplateMode && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLayoutStyle"], {
selector: ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container", selector: ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",
layout: defaultLayout layout: defaultLayout
}), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, !isTemplateMode && Object(external_wp_element_["createElement"])("div", { }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["WritingFlow"], null, !isTemplateMode && Object(external_wp_element_["createElement"])("div", {
className: "edit-post-visual-editor__post-title-wrapper" className: "edit-post-visual-editor__post-title-wrapper"
}, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null)), Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], { }, Object(external_wp_element_["createElement"])(external_wp_editor_["PostTitle"], null)), Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockList"], {
__experimentalLayout: themeSupportsLayout ? { __experimentalLayout: layout
type: 'default',
// Find a way to inject this in the support flag code (hooks).
alignments: themeSupportsLayout ? alignments : undefined
} : undefined
}))))))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, ({ }))))))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__unstableBlockSettingsMenuFirstItem"], null, ({
onClose onClose
}) => Object(external_wp_element_["createElement"])(block_inspector_button, { }) => Object(external_wp_element_["createElement"])(block_inspector_button, {
@ -14550,9 +14563,9 @@ function DeleteTemplate() {
return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], { return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
className: "edit-post-template-top-area__second-menu-group" className: "edit-post-template-top-area__second-menu-group"
}, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], { }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
className: "edit-post-template-top-area__delete-template-button",
isDestructive: true, isDestructive: true,
isTertiary: true, isSecondary: true,
isLink: true,
"aria-label": Object(external_wp_i18n_["__"])('Delete template'), "aria-label": Object(external_wp_i18n_["__"])('Delete template'),
onClick: () => { onClick: () => {
if ( // eslint-disable-next-line no-alert if ( // eslint-disable-next-line no-alert
@ -14630,6 +14643,7 @@ function EditTemplateTitle() {
return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], { return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
label: Object(external_wp_i18n_["__"])('Title'), label: Object(external_wp_i18n_["__"])('Title'),
value: templateTitle, value: templateTitle,
help: Object(external_wp_i18n_["__"])('Give the template a title that indicates its purpose, e.g. "Full Width".'),
onChange: newTitle => { onChange: newTitle => {
const settings = getEditorSettings(); const settings = getEditorSettings();
const newAvailableTemplates = Object(external_lodash_["mapValues"])(settings.availableTemplates, (existingTitle, id) => { const newAvailableTemplates = Object(external_lodash_["mapValues"])(settings.availableTemplates, (existingTitle, id) => {
@ -16786,7 +16800,11 @@ function PostTemplateActions() {
const defaultTitle = Object(external_wp_i18n_["__"])('Custom Template'); const defaultTitle = Object(external_wp_i18n_["__"])('Custom Template');
const templateContent = [Object(external_wp_blocks_["createBlock"])('core/site-title'), Object(external_wp_blocks_["createBlock"])('core/site-tagline'), Object(external_wp_blocks_["createBlock"])('core/separator'), Object(external_wp_blocks_["createBlock"])('core/post-title'), Object(external_wp_blocks_["createBlock"])('core/post-content')]; const templateContent = [Object(external_wp_blocks_["createBlock"])('core/site-title'), Object(external_wp_blocks_["createBlock"])('core/site-tagline'), Object(external_wp_blocks_["createBlock"])('core/separator'), Object(external_wp_blocks_["createBlock"])('core/post-title'), Object(external_wp_blocks_["createBlock"])('core/post-content', {
layout: {
inherit: true
}
})];
__unstableSwitchToTemplateMode({ __unstableSwitchToTemplateMode({
slug: 'wp-custom-template-' + Object(external_lodash_["kebabCase"])(title !== null && title !== void 0 ? title : defaultTitle), slug: 'wp-custom-template-' + Object(external_lodash_["kebabCase"])(title !== null && title !== void 0 ? title : defaultTitle),

File diff suppressed because one or more lines are too long

View File

@ -649,8 +649,9 @@ function transformWidgetToBlock(widget) {
} }
function transformBlockToWidget(block, relatedWidget = {}) { function transformBlockToWidget(block, relatedWidget = {}) {
let widget; let widget;
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
if (block.name === 'core/legacy-widget') { if (isValidLegacyWidgetBlock) {
var _block$attributes$id, _block$attributes$idB, _block$attributes$ins; var _block$attributes$id, _block$attributes$idB, _block$attributes$ins;
widget = { ...relatedWidget, widget = { ...relatedWidget,
@ -667,15 +668,9 @@ function transformBlockToWidget(block, relatedWidget = {}) {
} }
} }
}; };
} // Delete deprecated properties. } // Delete read-only properties.
delete widget.description;
delete widget.name;
delete widget.number;
delete widget.settings;
delete widget.widget_class; // Delete read-only properties.
delete widget.rendered; delete widget.rendered;
delete widget.rendered_form; delete widget.rendered_form;
return widget; return widget;
@ -1905,7 +1900,7 @@ function WidgetAreas({
}), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])("p", null, description), (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.length) === 0 && Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], { }), Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])("p", null, description), (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.length) === 0 && Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Your theme does not contain any Widget Areas.')), !selectedWidgetArea && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
href: Object(external_wp_url_["addQueryArgs"])('customize.php', { href: Object(external_wp_url_["addQueryArgs"])('customize.php', {
'autofocus[panel]': 'widgets', 'autofocus[panel]': 'widgets',
return: 'themes.php?page=gutenberg-widgets' return: window.location.pathname
}), }),
isTertiary: true isTertiary: true
}, Object(external_wp_i18n_["__"])('Manage with live preview'))))); }, Object(external_wp_i18n_["__"])('Manage with live preview')))));

File diff suppressed because one or more lines are too long

View File

@ -938,7 +938,7 @@ __webpack_require__.d(selectors_namespaceObject, "isPermalinkEditable", function
__webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; }); __webpack_require__.d(selectors_namespaceObject, "getPermalink", function() { return getPermalink; });
__webpack_require__.d(selectors_namespaceObject, "getEditedPostSlug", function() { return getEditedPostSlug; }); __webpack_require__.d(selectors_namespaceObject, "getEditedPostSlug", function() { return getEditedPostSlug; });
__webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return getPermalinkParts; }); __webpack_require__.d(selectors_namespaceObject, "getPermalinkParts", function() { return getPermalinkParts; });
__webpack_require__.d(selectors_namespaceObject, "isPostLocked", function() { return isPostLocked; }); __webpack_require__.d(selectors_namespaceObject, "isPostLocked", function() { return selectors_isPostLocked; });
__webpack_require__.d(selectors_namespaceObject, "isPostSavingLocked", function() { return selectors_isPostSavingLocked; }); __webpack_require__.d(selectors_namespaceObject, "isPostSavingLocked", function() { return selectors_isPostSavingLocked; });
__webpack_require__.d(selectors_namespaceObject, "isPostAutosavingLocked", function() { return isPostAutosavingLocked; }); __webpack_require__.d(selectors_namespaceObject, "isPostAutosavingLocked", function() { return isPostAutosavingLocked; });
__webpack_require__.d(selectors_namespaceObject, "isPostLockTakeover", function() { return isPostLockTakeover; }); __webpack_require__.d(selectors_namespaceObject, "isPostLockTakeover", function() { return isPostLockTakeover; });
@ -1711,11 +1711,11 @@ function getWPAdminURL(page, query) {
* This replicates some of what sanitize_title() does in WordPress core, but * This replicates some of what sanitize_title() does in WordPress core, but
* is only designed to approximate what the slug will be. * is only designed to approximate what the slug will be.
* *
* Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin * Converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters.
* letters. Removes combining diacritical marks. Converts whitespace, periods, * Removes combining diacritical marks. Converts whitespace, periods,
* and forward slashes to hyphens. Removes any remaining non-word characters * and forward slashes to hyphens. Removes any remaining non-word characters
* except hyphens. Converts remaining string to lowercase. It does not account * except hyphens and underscores. Converts remaining string to lowercase.
* for octets, HTML entities, or other encoded characters. * It does not account for octets, HTML entities, or other encoded characters.
* *
* @param {string} string Title or slug to be processed * @param {string} string Title or slug to be processed
* *
@ -1727,7 +1727,7 @@ function cleanForSlug(string) {
return ''; return '';
} }
return Object(external_lodash_["trim"])(Object(external_lodash_["deburr"])(string).replace(/[\s\./]+/g, '-').replace(/[^\w-]+/g, '').toLowerCase(), '-'); return Object(external_lodash_["trim"])(Object(external_lodash_["deburr"])(string).replace(/[\s\./]+/g, '-').replace(/[^\p{L}\p{N}_-]+/gu, '').toLowerCase(), '-');
} }
// EXTERNAL MODULE: external ["wp","primitives"] // EXTERNAL MODULE: external ["wp","primitives"]
@ -2784,7 +2784,7 @@ function getPermalinkParts(state) {
* @return {boolean} Is locked. * @return {boolean} Is locked.
*/ */
function isPostLocked(state) { function selectors_isPostLocked(state) {
return state.postLock.isLocked; return state.postLock.isLocked;
} }
/** /**
@ -7014,10 +7014,12 @@ class post_preview_button_PostPreviewButton extends external_wp_element_["Compon
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus // https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
this.previewWindow.focus(); // If we don't need to autosave the post before previewing, then we simply this.previewWindow.focus();
// load the Preview URL in the Preview tab.
if (!this.props.isAutosaveable) { if ( // If we don't need to autosave the post before previewing, then we simply
// load the Preview URL in the Preview tab.
!this.props.isAutosaveable || // Do not save or overwrite the post, if the post is already locked.
this.props.isPostLocked) {
this.setPreviewWindowLink(event.target.href); this.setPreviewWindowLink(event.target.href);
return; return;
} // Request an autosave. This happens asynchronously and causes the component } // Request an autosave. This happens asynchronously and causes the component
@ -7080,7 +7082,8 @@ class post_preview_button_PostPreviewButton extends external_wp_element_["Compon
getEditedPostAttribute, getEditedPostAttribute,
isEditedPostSaveable, isEditedPostSaveable,
isEditedPostAutosaveable, isEditedPostAutosaveable,
getEditedPostPreviewLink getEditedPostPreviewLink,
isPostLocked
} = select('core/editor'); } = select('core/editor');
const { const {
getPostType getPostType
@ -7094,7 +7097,8 @@ class post_preview_button_PostPreviewButton extends external_wp_element_["Compon
isSaveable: isEditedPostSaveable(), isSaveable: isEditedPostSaveable(),
isAutosaveable: forceIsAutosaveable || isEditedPostAutosaveable(), isAutosaveable: forceIsAutosaveable || isEditedPostAutosaveable(),
isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false), isViewable: Object(external_lodash_["get"])(postType, ['viewable'], false),
isDraft: ['draft', 'auto-draft'].indexOf(getEditedPostAttribute('status')) !== -1 isDraft: ['draft', 'auto-draft'].indexOf(getEditedPostAttribute('status')) !== -1,
isPostLocked: isPostLocked()
}; };
}), Object(external_wp_data_["withDispatch"])(dispatch => ({ }), Object(external_wp_data_["withDispatch"])(dispatch => ({
autosave: dispatch('core/editor').autosave, autosave: dispatch('core/editor').autosave,

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.8-alpha-51088'; $wp_version = '5.8-alpha-51089';
/** /**
* 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.