Editor: update Wordpress npm packages.

Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.

Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.
Built from https://develop.svn.wordpress.org/trunk@56065


git-svn-id: http://core.svn.wordpress.org/trunk@55577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Bernhard Reiter 2023-06-27 14:24:19 +00:00
parent c009f9d719
commit 00401e16b3
477 changed files with 97192 additions and 56477 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/archives",
"title": "Archives",
"category": "widgets",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/audio",
"title": "Audio",
"category": "media",

View File

@ -16,67 +16,19 @@
function render_block_core_avatar( $attributes, $content, $block ) {
$size = isset( $attributes['size'] ) ? $attributes['size'] : 96;
$wrapper_attributes = get_block_wrapper_attributes();
$border_attributes = get_block_core_avatar_border_attributes( $attributes );
$image_styles = array();
// Class gets passed through `esc_attr` via `get_avatar`.
$image_classes = ! empty( $border_attributes['class'] )
? "wp-block-avatar__image {$border_attributes['class']}"
: 'wp-block-avatar__image';
// Add border width styles.
$has_border_width = ! empty( $attributes['style']['border']['width'] );
if ( $has_border_width ) {
$border_width = $attributes['style']['border']['width'];
$image_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
}
// Add border radius styles.
$has_border_radius = ! empty( $attributes['style']['border']['radius'] );
if ( $has_border_radius ) {
$border_radius = $attributes['style']['border']['radius'];
if ( is_array( $border_radius ) ) {
// Apply styles for individual corner border radii.
foreach ( $border_radius as $key => $value ) {
if ( null !== $value ) {
$name = _wp_to_kebab_case( $key );
// Add shared styles for individual border radii.
$border_style = sprintf(
'border-%s-radius: %s;',
esc_attr( $name ),
esc_attr( $value )
);
$image_styles[] = $border_style;
}
}
} else {
$border_style = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) );
$image_styles[] = $border_style;
}
}
// Add border color styles.
$has_border_color = ! empty( $attributes['style']['border']['color'] );
if ( $has_border_color ) {
$border_color = $attributes['style']['border']['color'];
$image_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
}
// Add border style (solid, dashed, dotted ).
$has_border_style = ! empty( $attributes['style']['border']['style'] );
if ( $has_border_style ) {
$border_style = $attributes['style']['border']['style'];
$image_styles[] = sprintf( 'border-style: %s;', esc_attr( $border_style ) );
}
// Add border classes to the avatar image for both custom colors and palette colors.
$image_classes = '';
if ( $has_border_color || isset( $attributes['borderColor'] ) ) {
$image_classes .= 'has-border-color';
}
if ( isset( $attributes['borderColor'] ) ) {
$image_classes .= ' has-' . $attributes['borderColor'] . '-border-color';
}
// Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`.
// The style engine does pass the border styles through
// `safecss_filter_attr` however.
$image_styles = ! empty( $border_attributes['style'] )
? sprintf( ' style="%s"', esc_attr( $border_attributes['style'] ) )
: '';
if ( ! isset( $block->context['commentId'] ) ) {
$author_id = isset( $attributes['userId'] ) ? $attributes['userId'] : get_post_field( 'post_author', $block->context['postId'] );
@ -89,8 +41,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
'',
$alt,
array(
'extra_attr' => isset( $image_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $image_styles ) ) ) : '',
'class' => "wp-block-avatar__image $image_classes ",
'extra_attr' => $image_styles,
'class' => $image_classes,
)
);
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
@ -116,8 +68,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
'',
$alt,
array(
'extra_attr' => isset( $image_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $image_styles ) ) ) : '',
'class' => "wp-block-avatar__image $image_classes",
'extra_attr' => $image_styles,
'class' => $image_classes,
)
);
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $comment->comment_author_url ) && '' !== $comment->comment_author_url ) {
@ -132,6 +84,58 @@ function render_block_core_avatar( $attributes, $content, $block ) {
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
}
/**
* Generates class names and styles to apply the border support styles for
* the Avatar block.
*
* @param array $attributes The block attributes.
* @return array The border-related classnames and styles for the block.
*/
function get_block_core_avatar_border_attributes( $attributes ) {
$border_styles = array();
$sides = array( 'top', 'right', 'bottom', 'left' );
// Border radius.
if ( isset( $attributes['style']['border']['radius'] ) ) {
$border_styles['radius'] = $attributes['style']['border']['radius'];
}
// Border style.
if ( isset( $attributes['style']['border']['style'] ) ) {
$border_styles['style'] = $attributes['style']['border']['style'];
}
// Border width.
if ( isset( $attributes['style']['border']['width'] ) ) {
$border_styles['width'] = $attributes['style']['border']['width'];
}
// Border color.
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
$custom_color = _wp_array_get( $attributes, array( 'style', 'border', 'color' ), null );
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
// Individual border styles e.g. top, left etc.
foreach ( $sides as $side ) {
$border = _wp_array_get( $attributes, array( 'style', 'border', $side ), null );
$border_styles[ $side ] = array(
'color' => isset( $border['color'] ) ? $border['color'] : null,
'style' => isset( $border['style'] ) ? $border['style'] : null,
'width' => isset( $border['width'] ) ? $border['width'] : null,
);
}
$styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) );
$attributes = array();
if ( ! empty( $styles['classnames'] ) ) {
$attributes['class'] = $styles['classnames'];
}
if ( ! empty( $styles['css'] ) ) {
$attributes['style'] = $styles['css'];
}
return $attributes;
}
/**
* Registers the `core/avatar` block on the server.
*/

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/avatar",
"title": "Avatar",
"category": "theme",
@ -48,6 +48,6 @@
"__experimentalDuotone": "img"
}
},
"editorStyle": "wp-block-avatar",
"editorStyle": "wp-block-avatar-editor",
"style": "wp-block-avatar"
}

View File

@ -1,4 +1,7 @@
.wp-block-avatar{
line-height:0;
}
.wp-block-avatar,.wp-block-avatar img{
box-sizing:border-box;
}
.wp-block-avatar.aligncenter{

View File

@ -1 +1 @@
.wp-block-avatar{box-sizing:border-box}.wp-block-avatar.aligncenter{text-align:center}
.wp-block-avatar{line-height:0}.wp-block-avatar,.wp-block-avatar img{box-sizing:border-box}.wp-block-avatar.aligncenter{text-align:center}

View File

@ -1,4 +1,7 @@
.wp-block-avatar{
line-height:0;
}
.wp-block-avatar,.wp-block-avatar img{
box-sizing:border-box;
}
.wp-block-avatar.aligncenter{

View File

@ -1 +1 @@
.wp-block-avatar{box-sizing:border-box}.wp-block-avatar.aligncenter{text-align:center}
.wp-block-avatar{line-height:0}.wp-block-avatar,.wp-block-avatar img{box-sizing:border-box}.wp-block-avatar.aligncenter{text-align:center}

View File

@ -1,8 +1,8 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/block",
"title": "Reusable block",
"title": "Pattern",
"category": "reusable",
"description": "Create and save content to reuse across your site. Update the block, and the changes apply everywhere its used.",
"textdomain": "default",

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/button",
"title": "Button",
"category": "design",
@ -16,30 +16,35 @@
"type": "string",
"source": "attribute",
"selector": "a",
"attribute": "href"
"attribute": "href",
"__experimentalRole": "content"
},
"title": {
"type": "string",
"source": "attribute",
"selector": "a",
"attribute": "title"
"attribute": "title",
"__experimentalRole": "content"
},
"text": {
"type": "string",
"source": "html",
"selector": "a"
"selector": "a",
"__experimentalRole": "content"
},
"linkTarget": {
"type": "string",
"source": "attribute",
"selector": "a",
"attribute": "target"
"attribute": "target",
"__experimentalRole": "content"
},
"rel": {
"type": "string",
"source": "attribute",
"selector": "a",
"attribute": "rel"
"attribute": "rel",
"__experimentalRole": "content"
},
"placeholder": {
"type": "string"
@ -92,10 +97,16 @@
}
},
"__experimentalBorder": {
"color": true,
"radius": true,
"style": true,
"width": true,
"__experimentalSkipSerialization": true,
"__experimentalDefaultControls": {
"radius": true
"color": true,
"radius": true,
"style": true,
"width": true
}
},
"__experimentalSelector": ".wp-block-button .wp-block-button__link"

View File

@ -58,4 +58,35 @@ div[data-type="core/button"]{
.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{
text-decoration:inherit;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where(.has-border-color){
border-width:initial;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-color]){
border-top-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-color]){
border-left-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){
border-bottom-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-color]){
border-right-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-style]){
border-width:initial;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-style]){
border-top-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-style]){
border-left-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){
border-bottom-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-style]){
border-right-width:medium;
}

View File

@ -1 +1 @@
.wp-block[data-align=center]>.wp-block-button{margin-left:auto;margin-right:auto;text-align:center}.wp-block[data-align=right]>.wp-block-button{text-align:right}.wp-block-button{cursor:text;position:relative}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;max-width:290px;overflow:hidden}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}
.wp-block[data-align=center]>.wp-block-button{margin-left:auto;margin-right:auto;text-align:center}.wp-block[data-align=right]>.wp-block-button{text-align:right}.wp-block-button{cursor:text;position:relative}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;max-width:290px;overflow:hidden}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where(.has-border-color){border-width:initial}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-color]){border-top-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-color]){border-left-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){border-bottom-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-color]){border-right-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-style]){border-width:initial}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-style]){border-top-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-style]){border-left-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){border-bottom-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-style]){border-right-width:medium}

View File

@ -58,4 +58,35 @@ div[data-type="core/button"]{
.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{
text-decoration:inherit;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where(.has-border-color){
border-width:initial;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-color]){
border-top-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-color]){
border-right-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){
border-bottom-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-color]){
border-left-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-style]){
border-width:initial;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-style]){
border-top-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-style]){
border-right-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){
border-bottom-width:medium;
}
.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-style]){
border-left-width:medium;
}

View File

@ -1,2 +1,2 @@
.wp-block[data-align=center]>.wp-block-button{margin-left:auto;margin-right:auto;text-align:center}.wp-block[data-align=right]>.wp-block-button{
/*!rtl:ignore*/text-align:right}.wp-block-button{cursor:text;position:relative}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;max-width:290px;overflow:hidden}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}
/*!rtl:ignore*/text-align:right}.wp-block-button{cursor:text;position:relative}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;max-width:290px;overflow:hidden}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}.editor-styles-wrapper .wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where(.has-border-color){border-width:initial}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-color]){border-top-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-color]){border-right-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){border-bottom-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-color]){border-left-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-style]){border-width:initial}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-top-style]){border-top-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-right-style]){border-right-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){border-bottom-width:medium}.editor-styles-wrapper .wp-block-button .wp-block-button__link:where([style*=border-left-style]){border-left-width:medium}

View File

@ -76,4 +76,35 @@
.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){
background-color:initial;
background-image:none;
}
.wp-block-button .wp-block-button__link:where(.has-border-color){
border-width:initial;
}
.wp-block-button .wp-block-button__link:where([style*=border-top-color]){
border-top-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-right-color]){
border-left-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){
border-bottom-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-left-color]){
border-right-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-style]){
border-width:initial;
}
.wp-block-button .wp-block-button__link:where([style*=border-top-style]){
border-top-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-right-style]){
border-left-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){
border-bottom-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-left-style]){
border-right-width:medium;
}

View File

@ -1 +1 @@
.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.wp-block-button .wp-block-button__link.is-style-outline,.wp-block-button.is-style-outline>.wp-block-button__link{border:2px solid;padding:.667em 1.333em}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color){color:currentColor}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){background-color:initial;background-image:none}
.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.wp-block-button .wp-block-button__link.is-style-outline,.wp-block-button.is-style-outline>.wp-block-button__link{border:2px solid;padding:.667em 1.333em}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color){color:currentColor}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){background-color:initial;background-image:none}.wp-block-button .wp-block-button__link:where(.has-border-color){border-width:initial}.wp-block-button .wp-block-button__link:where([style*=border-top-color]){border-top-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-right-color]){border-left-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){border-bottom-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-left-color]){border-right-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-style]){border-width:initial}.wp-block-button .wp-block-button__link:where([style*=border-top-style]){border-top-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-right-style]){border-left-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){border-bottom-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-left-style]){border-right-width:medium}

View File

@ -76,4 +76,35 @@
.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){
background-color:initial;
background-image:none;
}
.wp-block-button .wp-block-button__link:where(.has-border-color){
border-width:initial;
}
.wp-block-button .wp-block-button__link:where([style*=border-top-color]){
border-top-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-right-color]){
border-right-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){
border-bottom-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-left-color]){
border-left-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-style]){
border-width:initial;
}
.wp-block-button .wp-block-button__link:where([style*=border-top-style]){
border-top-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-right-style]){
border-right-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){
border-bottom-width:medium;
}
.wp-block-button .wp-block-button__link:where([style*=border-left-style]){
border-left-width:medium;
}

View File

@ -1 +1 @@
.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.wp-block-button .wp-block-button__link.is-style-outline,.wp-block-button.is-style-outline>.wp-block-button__link{border:2px solid;padding:.667em 1.333em}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color){color:currentColor}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){background-color:initial;background-image:none}
.wp-block-button__link{box-sizing:border-box;cursor:pointer;display:inline-block;text-align:center;word-break:break-word}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}:where(.wp-block-button__link){border-radius:9999px;box-shadow:none;padding:calc(.667em + 2px) calc(1.333em + 2px);text-decoration:none}.wp-block-button[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{flex-basis:100%;width:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.wp-block-button .wp-block-button__link.is-style-outline,.wp-block-button.is-style-outline>.wp-block-button__link{border:2px solid;padding:.667em 1.333em}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-text-color),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-text-color){color:currentColor}.wp-block-button .wp-block-button__link.is-style-outline:not(.has-background),.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background){background-color:initial;background-image:none}.wp-block-button .wp-block-button__link:where(.has-border-color){border-width:initial}.wp-block-button .wp-block-button__link:where([style*=border-top-color]){border-top-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-right-color]){border-right-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-bottom-color]){border-bottom-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-left-color]){border-left-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-style]){border-width:initial}.wp-block-button .wp-block-button__link:where([style*=border-top-style]){border-top-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-right-style]){border-right-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-bottom-style]){border-bottom-width:medium}.wp-block-button .wp-block-button__link:where([style*=border-left-style]){border-left-width:medium}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/buttons",
"title": "Buttons",
"category": "design",
@ -10,6 +10,7 @@
"supports": {
"anchor": true,
"align": [ "wide", "full" ],
"html": false,
"__experimentalExposeControlsToChildren": true,
"spacing": {
"blockGap": true,
@ -31,7 +32,7 @@
"fontSize": true
}
},
"__experimentalLayout": {
"layout": {
"allowSwitching": false,
"allowInheriting": false,
"default": {

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/calendar",
"title": "Calendar",
"category": "widgets",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/categories",
"title": "Categories List",
"category": "widgets",

View File

@ -3,4 +3,7 @@
}
.wp-block-categories ul ul{
margin-top:6px;
}
[data-align=center] .wp-block-categories{
text-align:center;
}

View File

@ -1 +1 @@
.wp-block-categories ul{padding-right:2.5em}.wp-block-categories ul ul{margin-top:6px}
.wp-block-categories ul{padding-right:2.5em}.wp-block-categories ul ul{margin-top:6px}[data-align=center] .wp-block-categories{text-align:center}

View File

@ -3,4 +3,7 @@
}
.wp-block-categories ul ul{
margin-top:6px;
}
[data-align=center] .wp-block-categories{
text-align:center;
}

View File

@ -1 +1 @@
.wp-block-categories ul{padding-left:2.5em}.wp-block-categories ul ul{margin-top:6px}
.wp-block-categories ul{padding-left:2.5em}.wp-block-categories ul ul{margin-top:6px}[data-align=center] .wp-block-categories{text-align:center}

View File

@ -6,4 +6,7 @@
}
.wp-block-categories.alignright{
margin-left:2em;
}
.wp-block-categories.wp-block-categories-dropdown.aligncenter{
text-align:center;
}

View File

@ -1 +1 @@
.wp-block-categories{box-sizing:border-box}.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}
.wp-block-categories{box-sizing:border-box}.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}.wp-block-categories.wp-block-categories-dropdown.aligncenter{text-align:center}

View File

@ -6,4 +6,7 @@
}
.wp-block-categories.alignright{
margin-left:2em;
}
.wp-block-categories.wp-block-categories-dropdown.aligncenter{
text-align:center;
}

View File

@ -1 +1 @@
.wp-block-categories{box-sizing:border-box}.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}
.wp-block-categories{box-sizing:border-box}.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}.wp-block-categories.wp-block-categories-dropdown.aligncenter{text-align:center}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/code",
"title": "Code",
"category": "text",
@ -14,6 +14,7 @@
}
},
"supports": {
"align": [ "wide" ],
"anchor": true,
"typography": {
"fontSize": true,

View File

@ -1,9 +1,9 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/column",
"title": "Column",
"category": "text",
"category": "design",
"parent": [ "core/columns" ],
"description": "A single column within a columns block.",
"textdomain": "default",
@ -38,7 +38,8 @@
"blockGap": true,
"padding": true,
"__experimentalDefaultControls": {
"padding": true
"padding": true,
"blockGap": true
}
},
"__experimentalBorder": {
@ -64,6 +65,6 @@
"fontSize": true
}
},
"__experimentalLayout": true
"layout": true
}
}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/columns",
"title": "Columns",
"category": "design",
@ -13,6 +13,10 @@
"isStackedOnMobile": {
"type": "boolean",
"default": true
},
"templateLock": {
"type": [ "string", "boolean" ],
"enum": [ "all", "insert", "contentOnly", false ]
}
},
"supports": {
@ -35,10 +39,11 @@
"margin": [ "top", "bottom" ],
"padding": true,
"__experimentalDefaultControls": {
"padding": true
"padding": true,
"blockGap": true
}
},
"__experimentalLayout": {
"layout": {
"allowSwitching": false,
"allowInheriting": false,
"allowEditing": false,

View File

@ -3,7 +3,6 @@
box-sizing:border-box;
display:flex;
flex-wrap:wrap !important;
margin-bottom:1.75em;
}
@media (min-width:782px){
.wp-block-columns{
@ -44,6 +43,10 @@
flex-grow:0;
}
:where(.wp-block-columns){
margin-bottom:1.75em;
}
:where(.wp-block-columns.has-background){
padding:1.25em 2.375em;
}

View File

@ -1 +1 @@
.wp-block-columns{align-items:normal!important;box-sizing:border-box;display:flex;flex-wrap:wrap!important;margin-bottom:1.75em}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;overflow-wrap:break-word;word-break:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
.wp-block-columns{align-items:normal!important;box-sizing:border-box;display:flex;flex-wrap:wrap!important}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns){margin-bottom:1.75em}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;overflow-wrap:break-word;word-break:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}

View File

@ -3,7 +3,6 @@
box-sizing:border-box;
display:flex;
flex-wrap:wrap !important;
margin-bottom:1.75em;
}
@media (min-width:782px){
.wp-block-columns{
@ -44,6 +43,10 @@
flex-grow:0;
}
:where(.wp-block-columns){
margin-bottom:1.75em;
}
:where(.wp-block-columns.has-background){
padding:1.25em 2.375em;
}

View File

@ -1 +1 @@
.wp-block-columns{align-items:normal!important;box-sizing:border-box;display:flex;flex-wrap:wrap!important;margin-bottom:1.75em}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;overflow-wrap:break-word;word-break:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
.wp-block-columns{align-items:normal!important;box-sizing:border-box;display:flex;flex-wrap:wrap!important}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns){margin-bottom:1.75em}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;overflow-wrap:break-word;word-break:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-author-name",
"title": "Comment Author Name",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-content",
"title": "Comment Content",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-date",
"title": "Comment Date",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-edit-link",
"title": "Comment Edit Link",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-reply-link",
"title": "Comment Reply Link",
"category": "theme",

View File

@ -25,13 +25,26 @@ function block_core_comment_template_render_comments( $comments, $block ) {
$content = '';
foreach ( $comments as $comment ) {
$comment_id = $comment->comment_ID;
$filter_block_context = static function( $context ) use ( $comment_id ) {
$context['commentId'] = $comment_id;
return $context;
};
$block_content = ( new WP_Block(
$block->parsed_block,
array(
'commentId' => $comment->comment_ID,
)
) )->render( array( 'dynamic' => false ) );
/*
* We set commentId context through the `render_block_context` filter so
* that dynamically inserted blocks (at `render_block` filter stage)
* will also receive that context.
*/
add_filter( 'render_block_context', $filter_block_context );
/*
* We construct a new WP_Block instance from the parsed block so that
* it'll receive any changes made by the `render_block_data` filter.
*/
$block_content = ( new WP_Block( $block->parsed_block ) )->render( array( 'dynamic' => false ) );
remove_filter( 'render_block_context', $filter_block_context );
$children = $comment->get_children();

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comment-template",
"title": "Comment Template",
"category": "design",

View File

@ -26,7 +26,7 @@ function render_block_core_comments_pagination_next( $attributes, $content, $blo
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? $attributes['label'] : $default_label;
$pagination_arrow = get_comments_pagination_arrow( $block, 'next' );
$filter_link_attributes = function() {
$filter_link_attributes = static function() {
return get_block_wrapper_attributes();
};
add_filter( 'next_comments_link_attributes', $filter_link_attributes );

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments-pagination-next",
"title": "Comments Next Page",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments-pagination-numbers",
"title": "Comments Page Numbers",
"category": "theme",

View File

@ -22,7 +22,7 @@ function render_block_core_comments_pagination_previous( $attributes, $content,
$label = $pagination_arrow . $label;
}
$filter_link_attributes = function() {
$filter_link_attributes = static function() {
return get_block_wrapper_attributes();
};
add_filter( 'previous_comments_link_attributes', $filter_link_attributes );

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments-pagination-previous",
"title": "Comments Previous Page",
"category": "theme",

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments-pagination",
"title": "Comments Pagination",
"category": "theme",
@ -29,7 +29,7 @@
"link": true
}
},
"__experimentalLayout": {
"layout": {
"allowSwitching": false,
"allowInheriting": false,
"default": {

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments-title",
"title": "Comments Title",
"category": "theme",

View File

@ -29,13 +29,8 @@ function render_block_core_comments( $attributes, $content, $block ) {
return '';
}
$comment_args = array(
'post_id' => $post_id,
'count' => true,
'status' => 'approve',
);
// Return early if there are no comments and comments are closed.
if ( ! comments_open( $post_id ) && get_comments( $comment_args ) === 0 ) {
if ( ! comments_open( $post_id ) && (int) get_comments_number( $post_id ) === 0 ) {
return '';
}
@ -212,6 +207,7 @@ function register_legacy_post_comments_block() {
* like `_wp_multiple_block_styles`, which is required in this case because
* the block has multiple styles.
*/
/** This filter is documented in wp-includes/blocks.php */
$metadata = apply_filters( 'block_type_metadata', $metadata );
register_block_type( 'core/post-comments', $metadata );

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/comments",
"title": "Comments",
"category": "theme",
@ -18,6 +18,7 @@
},
"supports": {
"align": [ "wide", "full" ],
"html": false,
"color": {
"gradients": true,
"link": true,
@ -27,7 +28,6 @@
"link": true
}
},
"html": false,
"spacing": {
"margin": true,
"padding": true

View File

@ -1,10 +1,10 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/cover",
"title": "Cover",
"category": "media",
"description": "Add an image or video with a text overlay — great for headers.",
"description": "Add an image or video with a text overlay.",
"textdomain": "default",
"attributes": {
"url": {
@ -88,14 +88,29 @@
"spacing": {
"padding": true,
"margin": [ "top", "bottom" ],
"blockGap": true,
"__experimentalDefaultControls": {
"padding": true
"padding": true,
"blockGap": true
}
},
"__experimentalBorder": {
"color": true,
"radius": true,
"style": true,
"width": true,
"__experimentalDefaultControls": {
"color": true,
"radius": true,
"style": true,
"width": true
}
},
"color": {
"__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
"text": false,
"background": false
"text": true,
"background": false,
"__experimentalSkipSerialization": [ "gradients" ]
},
"typography": {
"fontSize": true,
@ -109,6 +124,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
},
"layout": {
"allowJustification": false
}
},
"editorStyle": "wp-block-cover-editor",

View File

@ -2,20 +2,17 @@
box-sizing:border-box;
}
.wp-block-cover.is-placeholder{
min-height:auto !important;
align-items:stretch;
display:flex;
min-height:240px;
padding:0 !important;
}
.wp-block-cover.is-placeholder .block-library-cover__resize-container{
display:none;
}
.wp-block-cover.is-placeholder .components-placeholder.is-large{
justify-content:flex-start;
min-height:240px;
z-index:1;
}
.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{
display:block;
min-height:240px;
.wp-block-cover.is-placeholder:focus:after{
min-height:auto;
}
.wp-block-cover.components-placeholder h2{
color:inherit;
@ -66,8 +63,9 @@
top:0;
}
.block-library-cover__resize-container:not(.is-resizing){
height:auto !important;
.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{
overflow:visible;
pointer-events:none;
}
.wp-block-cover>.components-drop-zone .components-drop-zone__content{

View File

@ -1 +1 @@
.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{min-height:auto!important;padding:0!important}.wp-block-cover.is-placeholder .block-library-cover__resize-container{display:none}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;min-height:240px;z-index:1}.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{display:block;min-height:240px}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{margin:0;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:right}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-right:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.block-library-cover__resize-container:not(.is-resizing){height:auto!important}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px}.wp-block-cover:after{min-height:auto}
.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{margin:0;position:absolute;right:50%;top:50%;transform:translate(50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:right}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-right:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px}.wp-block-cover:after{min-height:auto}

View File

@ -2,20 +2,17 @@
box-sizing:border-box;
}
.wp-block-cover.is-placeholder{
min-height:auto !important;
align-items:stretch;
display:flex;
min-height:240px;
padding:0 !important;
}
.wp-block-cover.is-placeholder .block-library-cover__resize-container{
display:none;
}
.wp-block-cover.is-placeholder .components-placeholder.is-large{
justify-content:flex-start;
min-height:240px;
z-index:1;
}
.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{
display:block;
min-height:240px;
.wp-block-cover.is-placeholder:focus:after{
min-height:auto;
}
.wp-block-cover.components-placeholder h2{
color:inherit;
@ -66,8 +63,9 @@
top:0;
}
.block-library-cover__resize-container:not(.is-resizing){
height:auto !important;
.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{
overflow:visible;
pointer-events:none;
}
.wp-block-cover>.components-drop-zone .components-drop-zone__content{

View File

@ -1 +1 @@
.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{min-height:auto!important;padding:0!important}.wp-block-cover.is-placeholder .block-library-cover__resize-container{display:none}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;min-height:240px;z-index:1}.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{display:block;min-height:240px}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:left}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-left:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.block-library-cover__resize-container:not(.is-resizing){height:auto!important}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px}.wp-block-cover:after{min-height:auto}
.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{align-items:stretch;display:flex;min-height:240px;padding:0!important}.wp-block-cover.is-placeholder .components-placeholder.is-large{justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder:focus:after{min-height:auto}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.wp-block-cover .wp-block-cover__inner-container{margin-left:0;margin-right:0;text-align:left}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}.wp-block-cover .wp-block-cover__image--placeholder-image{bottom:0;left:0;position:absolute;right:0;top:0}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-left:auto}.block-library-cover__resize-container{bottom:0;left:0;min-height:50px;position:absolute!important;right:0;top:0}.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .block-library-cover__resize-container,.components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover .components-popover__content>div{overflow:visible;pointer-events:none}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}.color-block-support-panel__inner-wrapper>:not(.block-editor-tools-panel-color-gradient-settings__item){margin-top:24px}.wp-block-cover:after{min-height:auto}

View File

@ -5,6 +5,8 @@
display:flex;
justify-content:center;
min-height:430px;
overflow:hidden;
overflow:clip;
padding:1em;
position:relative;
}
@ -109,13 +111,10 @@
display:flex;
}
.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{
color:#fff; direction:rtl;
color:inherit; direction:rtl;
width:100%;
z-index:1;
}
.wp-block-cover-image.is-light .wp-block-cover__inner-container,.wp-block-cover.is-light .wp-block-cover__inner-container{
color:#000;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
color:inherit;
}
@ -168,8 +167,7 @@
margin:0;
max-height:none;
max-width:none;
-o-object-fit:cover;
object-fit:cover;
object-fit:cover;
outline:none;
padding:0;
position:absolute;
@ -183,7 +181,7 @@
background-repeat:no-repeat;
background-size:cover;
}
@supports (-webkit-overflow-scrolling:touch){
@supports (-webkit-touch-callout:inherit){
.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{
background-attachment:scroll;
}
@ -230,4 +228,12 @@
padding:.44em;
text-align:center;
z-index:1;
}
:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){
color:#fff;
}
:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){
color:#000;
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,8 @@
display:flex;
justify-content:center;
min-height:430px;
overflow:hidden;
overflow:clip;
padding:1em;
position:relative;
}
@ -109,13 +111,10 @@
display:flex;
}
.wp-block-cover .wp-block-cover__inner-container,.wp-block-cover-image .wp-block-cover__inner-container{
color:#fff;
color:inherit;
width:100%;
z-index:1;
}
.wp-block-cover-image.is-light .wp-block-cover__inner-container,.wp-block-cover.is-light .wp-block-cover__inner-container{
color:#000;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
color:inherit;
}
@ -168,8 +167,7 @@
margin:0;
max-height:none;
max-width:none;
-o-object-fit:cover;
object-fit:cover;
object-fit:cover;
outline:none;
padding:0;
position:absolute;
@ -183,7 +181,7 @@
background-repeat:no-repeat;
background-size:cover;
}
@supports (-webkit-overflow-scrolling:touch){
@supports (-webkit-touch-callout:inherit){
.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax,.wp-block-cover__image-background.has-parallax,video.wp-block-cover__video-background.has-parallax{
background-attachment:scroll;
}
@ -230,4 +228,12 @@
padding:.44em;
text-align:center;
z-index:1;
}
:where(.wp-block-cover-image:not(.has-text-color)),:where(.wp-block-cover:not(.has-text-color)){
color:#fff;
}
:where(.wp-block-cover-image.is-light:not(.has-text-color)),:where(.wp-block-cover.is-light:not(.has-text-color)){
color:#000;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,55 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "core/details",
"title": "Details",
"category": "text",
"description": "Hide and show additional content.",
"keywords": [ "disclosure", "summary", "hide" ],
"textdomain": "default",
"attributes": {
"showContent": {
"type": "boolean",
"default": false
},
"summary": {
"type": "string"
}
},
"supports": {
"align": [ "wide", "full" ],
"color": {
"gradients": true,
"link": true,
"__experimentalDefaultControls": {
"background": true,
"text": true
}
},
"__experimentalBorder": {
"color": true,
"width": true,
"style": true
},
"html": false,
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"editorStyle": "wp-block-details-editor",
"style": "wp-block-details"
}

View File

@ -0,0 +1,3 @@
.wp-block-details summary div{
display:inline;
}

View File

@ -0,0 +1 @@
.wp-block-details summary div{display:inline}

View File

@ -0,0 +1,3 @@
.wp-block-details summary div{
display:inline;
}

View File

@ -0,0 +1 @@
.wp-block-details summary div{display:inline}

View File

@ -0,0 +1,17 @@
.wp-block-details{
box-sizing:border-box;
overflow:hidden;
}
.wp-block-details summary{
cursor:pointer;
}
.wp-block-details>:not(summary){
margin-block-end:0;
margin-block-start:var(--wp--style--block-gap);
}
.wp-block-details>:last-child{
margin-bottom:0;
}

View File

@ -0,0 +1 @@
.wp-block-details{box-sizing:border-box;overflow:hidden}.wp-block-details summary{cursor:pointer}.wp-block-details>:not(summary){margin-block-end:0;margin-block-start:var(--wp--style--block-gap)}.wp-block-details>:last-child{margin-bottom:0}

View File

@ -0,0 +1,17 @@
.wp-block-details{
box-sizing:border-box;
overflow:hidden;
}
.wp-block-details summary{
cursor:pointer;
}
.wp-block-details>:not(summary){
margin-block-end:0;
margin-block-start:var(--wp--style--block-gap);
}
.wp-block-details>:last-child{
margin-bottom:0;
}

View File

@ -0,0 +1 @@
.wp-block-details{box-sizing:border-box;overflow:hidden}.wp-block-details summary{cursor:pointer}.wp-block-details>:not(summary){margin-block-end:0;margin-block-start:var(--wp--style--block-gap)}.wp-block-details>:last-child{margin-bottom:0}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/embed",
"title": "Embed",
"category": "embed",
@ -41,7 +41,10 @@
}
},
"supports": {
"align": true
"align": true,
"spacing": {
"margin": true
}
},
"editorStyle": "wp-block-embed-editor",
"style": "wp-block-embed"

View File

@ -5,18 +5,47 @@
* @package WordPress
*/
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
/**
* Replaces view script for the File block with version using Interactivity API.
*
* @param array $metadata Block metadata as read in via block.json.
*
* @return array Filtered block type metadata.
*/
function gutenberg_block_core_file_update_interactive_view_script( $metadata ) {
if ( 'core/file' === $metadata['name'] ) {
$metadata['viewScript'] = array( 'file:./interactivity.min.js' );
}
return $metadata;
}
add_filter( 'block_type_metadata', 'gutenberg_block_core_file_update_interactive_view_script', 10, 1 );
}
/**
* When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script.
*
* @param array $attributes The block attributes.
* @param string $content The block content.
* @param array $attributes The block attributes.
* @param string $content The block content.
* @param WP_Block $block The parsed block.
*
* @return string Returns the block content.
*/
function render_block_core_file( $attributes, $content ) {
$should_load_view_script = ! empty( $attributes['displayPreview'] ) && ! wp_script_is( 'wp-block-file-view' );
if ( $should_load_view_script ) {
wp_enqueue_script( 'wp-block-file-view' );
function render_block_core_file( $attributes, $content, $block ) {
$should_load_view_script = ! empty( $attributes['displayPreview'] );
$view_js_file = 'wp-block-file-view';
// If the script already exists, there is no point in removing it from viewScript.
if ( ! wp_script_is( $view_js_file ) ) {
$script_handles = $block->block_type->view_script_handles;
// If the script is not needed, and it is still in the `view_script_handles`, remove it.
if ( ! $should_load_view_script && in_array( $view_js_file, $script_handles, true ) ) {
$block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
}
// If the script is needed, but it was previously removed, add it again.
if ( $should_load_view_script && ! in_array( $view_js_file, $script_handles, true ) ) {
$block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
}
}
// Update object's aria-label attribute if present in block HTML.
@ -25,7 +54,7 @@ function render_block_core_file( $attributes, $content ) {
$pattern = '@<object.+(?<attribute>aria-label="(?<filename>[^"]+)?")@i';
$content = preg_replace_callback(
$pattern,
function ( $matches ) {
static function ( $matches ) {
$filename = ! empty( $matches['filename'] ) ? $matches['filename'] : '';
$has_filename = ! empty( $filename ) && 'PDF embed' !== $filename;
$label = $has_filename ?
@ -41,6 +70,17 @@ function render_block_core_file( $attributes, $content ) {
$content
);
// If it uses the Interactivity API, add the directives.
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && $should_load_view_script ) {
$processor = new WP_HTML_Tag_Processor( $content );
$processor->next_tag();
$processor->set_attribute( 'data-wp-interactive', '' );
$processor->next_tag( 'object' );
$processor->set_attribute( 'data-wp-bind--hidden', '!selectors.core.file.hasPdfPreview' );
$processor->set_attribute( 'hidden', true );
return $processor->get_updated_html();
}
return $content;
}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/file",
"title": "File",
"category": "media",
@ -56,7 +56,16 @@
},
"supports": {
"anchor": true,
"align": true
"align": true,
"color": {
"gradients": true,
"link": true,
"text": false,
"__experimentalDefaultControls": {
"background": true,
"link": true
}
}
},
"viewScript": "file:./view.min.js",
"editorStyle": "wp-block-file-editor",

View File

@ -29,6 +29,9 @@
.wp-block-file a{
min-width:1em;
}
.wp-block-file a:not(.wp-block-file__button){
display:inline-block;
}
.wp-block-file .wp-block-file__button-richtext-wrapper{
display:inline-block;
margin-right:.75em;

View File

@ -1 +1 @@
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-right:.75em}
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file a:not(.wp-block-file__button){display:inline-block}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-right:.75em}

View File

@ -29,6 +29,9 @@
.wp-block-file a{
min-width:1em;
}
.wp-block-file a:not(.wp-block-file__button){
display:inline-block;
}
.wp-block-file .wp-block-file__button-richtext-wrapper{
display:inline-block;
margin-left:.75em;

View File

@ -1 +1 @@
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-left:.75em}
.wp-block-file{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{height:100%;margin-bottom:1em;width:100%}.wp-block-file .wp-block-file__preview-overlay{bottom:0;left:0;position:absolute;right:0;top:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file a:not(.wp-block-file__button){display:inline-block}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-left:.75em}

View File

@ -1,6 +1,3 @@
.wp-block-file{
margin-bottom:1.5em;
}
.wp-block-file:not(.wp-element-button){
font-size:.8em;
}
@ -14,12 +11,17 @@
margin-right:.75em;
}
:where(.wp-block-file){
margin-bottom:1.5em;
}
.wp-block-file__embed{
margin-bottom:1em;
}
:where(.wp-block-file__button){
border-radius:2em;
display:inline-block;
padding:.5em 1em;
}
:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{

View File

@ -1 +1 @@
.wp-block-file{margin-bottom:1.5em}.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-right:.75em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}
.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-right:.75em}:where(.wp-block-file){margin-bottom:1.5em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;display:inline-block;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}

View File

@ -1,6 +1,3 @@
.wp-block-file{
margin-bottom:1.5em;
}
.wp-block-file:not(.wp-element-button){
font-size:.8em;
}
@ -14,12 +11,17 @@
margin-left:.75em;
}
:where(.wp-block-file){
margin-bottom:1.5em;
}
.wp-block-file__embed{
margin-bottom:1em;
}
:where(.wp-block-file__button){
border-radius:2em;
display:inline-block;
padding:.5em 1em;
}
:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{

View File

@ -1 +1 @@
.wp-block-file{margin-bottom:1.5em}.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-left:.75em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}
.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-left:.75em}:where(.wp-block-file){margin-bottom:1.5em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;display:inline-block;padding:.5em 1em}:where(.wp-block-file__button):is(a):active,:where(.wp-block-file__button):is(a):focus,:where(.wp-block-file__button):is(a):hover,:where(.wp-block-file__button):is(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '30e42a0eeaa76bba673e');
<?php return array('dependencies' => array(), 'version' => '4d04e0384ecd085abe4c');

View File

@ -2,7 +2,7 @@
/******/ "use strict";
var __webpack_exports__ = {};
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils/index.js
/**
* Uses a combination of user agent matching and feature detection to determine whether
* the current browser supports rendering PDFs inline.
@ -71,7 +71,7 @@ const hidePdfEmbedsOnUnsupportedBrowsers = () => {
* Internal dependencies
*/
hidePdfEmbedsOnUnsupportedBrowsers();
document.addEventListener('DOMContentLoaded', hidePdfEmbedsOnUnsupportedBrowsers);
/******/ })()
;

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '2a20786ca914ea00891f');
<?php return array('dependencies' => array(), 'version' => '9d287166f699a66eff3b');

View File

@ -1 +1 @@
!function(){"use strict";const n=n=>{let i;try{i=new window.ActiveXObject(n)}catch(n){i=void 0}return i};(()=>{if(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!n("AcroPDF.PDF")&&!n("PDF.PdfCtrl")){const n=document.getElementsByClassName("wp-block-file__embed");Array.from(n).forEach((n=>{n.style.display="none"}))}})()}();
!function(){"use strict";const n=n=>{let t;try{t=new window.ActiveXObject(n)}catch(n){t=void 0}return t};document.addEventListener("DOMContentLoaded",(()=>{if(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!n("AcroPDF.PDF")&&!n("PDF.PdfCtrl")){const n=document.getElementsByClassName("wp-block-file__embed");Array.from(n).forEach((n=>{n.style.display="none"}))}}))}();

View File

@ -0,0 +1,78 @@
<?php
/**
* Server-side rendering of the `core/footnotes` block.
*
* @package WordPress
*/
/**
* Renders the `core/footnotes` block on the server.
*
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
*
* @return string Returns the HTML representing the footnotes.
*/
function render_block_core_footnotes( $attributes, $content, $block ) {
// Bail out early if the post ID is not set for some reason.
if ( empty( $block->context['postId'] ) ) {
return '';
}
if ( post_password_required( $block->context['postId'] ) ) {
return;
}
$footnotes = get_post_meta( $block->context['postId'], 'footnotes', true );
if ( ! $footnotes ) {
return;
}
$footnotes = json_decode( $footnotes, true );
if ( count( $footnotes ) === 0 ) {
return '';
}
$wrapper_attributes = get_block_wrapper_attributes();
$block_content = '';
foreach ( $footnotes as $footnote ) {
$block_content .= sprintf(
'<li id="%1$s">%2$s <a href="#%1$s-link">↩︎</a></li>',
$footnote['id'],
$footnote['content']
);
}
return sprintf(
'<ol %1$s>%2$s</ol>',
$wrapper_attributes,
$block_content
);
}
/**
* Registers the `core/footnotes` block on the server.
*/
function register_block_core_footnotes() {
register_post_meta(
'post',
'footnotes',
array(
'show_in_rest' => true,
'single' => true,
'type' => 'string',
)
);
register_block_type_from_metadata(
__DIR__ . '/footnotes',
array(
'render_callback' => 'render_block_core_footnotes',
)
);
}
add_action( 'init', 'register_block_core_footnotes' );

View File

@ -0,0 +1,18 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "core/footnotes",
"title": "Footnotes",
"category": "text",
"description": "",
"keywords": [ "references" ],
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"supports": {
"html": false,
"multiple": false,
"inserter": false,
"reusable": false
},
"style": "wp-block-footnotes"
}

View File

@ -0,0 +1,17 @@
.editor-styles-wrapper,.entry-content{
counter-reset:footnotes;
}
.fn{
counter-increment:footnotes;
display:inline-block;
font-size:smaller;
text-indent:-9999999px;
vertical-align:super;
}
.fn:after{
content:"[" counter(footnotes) "]";
float:right;
text-indent:0;
}

View File

@ -0,0 +1 @@
.editor-styles-wrapper,.entry-content{counter-reset:footnotes}.fn{counter-increment:footnotes;display:inline-block;font-size:smaller;text-indent:-9999999px;vertical-align:super}.fn:after{content:"[" counter(footnotes) "]";float:right;text-indent:0}

View File

@ -0,0 +1,17 @@
.editor-styles-wrapper,.entry-content{
counter-reset:footnotes;
}
.fn{
counter-increment:footnotes;
display:inline-block;
font-size:smaller;
text-indent:-9999999px;
vertical-align:super;
}
.fn:after{
content:"[" counter(footnotes) "]";
float:left;
text-indent:0;
}

View File

@ -0,0 +1 @@
.editor-styles-wrapper,.entry-content{counter-reset:footnotes}.fn{counter-increment:footnotes;display:inline-block;font-size:smaller;text-indent:-9999999px;vertical-align:super}.fn:after{content:"[" counter(footnotes) "]";float:left;text-indent:0}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/freeform",
"title": "Classic",
"category": "text",
@ -9,7 +9,7 @@
"attributes": {
"content": {
"type": "string",
"source": "html"
"source": "raw"
}
},
"supports": {

View File

@ -299,4 +299,33 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{
}
.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{
display:block;
}
@media (min-width:960px){
.block-editor-freeform-modal .components-modal__frame{
height:9999rem;
}
.block-editor-freeform-modal .components-modal__frame .components-modal__header+div{
height:100%;
}
.block-editor-freeform-modal .components-modal__frame .mce-tinymce{
height:calc(100% - 52px);
}
.block-editor-freeform-modal .components-modal__frame .mce-container-body{
display:flex;
flex-direction:column;
height:100%;
}
.block-editor-freeform-modal .components-modal__frame .mce-edit-area{
display:flex;
flex-direction:column;
flex-grow:1;
}
.block-editor-freeform-modal .components-modal__frame .mce-edit-area iframe{
flex-grow:1;
height:10px !important;
}
}
.block-editor-freeform-modal__actions{
margin-top:16px;
}

File diff suppressed because one or more lines are too long

View File

@ -299,4 +299,33 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{
}
.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{
display:block;
}
@media (min-width:960px){
.block-editor-freeform-modal .components-modal__frame{
height:9999rem;
}
.block-editor-freeform-modal .components-modal__frame .components-modal__header+div{
height:100%;
}
.block-editor-freeform-modal .components-modal__frame .mce-tinymce{
height:calc(100% - 52px);
}
.block-editor-freeform-modal .components-modal__frame .mce-container-body{
display:flex;
flex-direction:column;
height:100%;
}
.block-editor-freeform-modal .components-modal__frame .mce-edit-area{
display:flex;
flex-direction:column;
flex-grow:1;
}
.block-editor-freeform-modal .components-modal__frame .mce-edit-area iframe{
flex-grow:1;
height:10px !important;
}
}
.block-editor-freeform-modal__actions{
margin-top:16px;
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "core/gallery",
"title": "Gallery",
"category": "media",
@ -123,7 +123,7 @@
"background": true,
"gradients": true
},
"__experimentalLayout": {
"layout": {
"allowSwitching": false,
"allowInheriting": false,
"allowEditing": false,

Some files were not shown because too many files have changed in this diff Show More