Skip to content

Commit

Permalink
prep build 0301
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Mar 1, 2023
2 parents ee2e090 + 0a6c5e8 commit cde62e6
Show file tree
Hide file tree
Showing 110 changed files with 909 additions and 654 deletions.
15 changes: 15 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
== Changelog ==

= 15.2.3 =

## Changelog

### Bug Fixes

- useAsyncList: flush state updates when processing queue (https://github.com/WordPress/gutenberg/pull/48238).

## Contributors

The following contributors merged PRs in this release:

@jsnajdr


= 15.2.2 =


Expand Down
4 changes: 3 additions & 1 deletion docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1496,11 +1496,13 @@ _Parameters_
### selectPreviousBlock

Yields action objects used in signalling that the block preceding the given
clientId should be selected.
clientId (or optionally, its first parent from bottom to top)
should be selected.

_Parameters_

- _clientId_ `string`: Block client ID.
- _orFirstParent_ `boolean`: If true, select the first parent if there is no previous block.

### setBlockMovingClientId

Expand Down
13 changes: 8 additions & 5 deletions lib/block-supports/duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ function gutenberg_get_duotone_filter_id( $preset ) {
* @return string Duotone CSS filter property url value.
*/
function gutenberg_get_duotone_filter_property( $preset ) {
if ( isset( $preset['colors'] ) && 'unset' === $preset['colors'] ) {
return 'none';
}
$filter_id = gutenberg_get_duotone_filter_id( $preset );
return "url('#" . $filter_id . "')";
}
Expand Down Expand Up @@ -449,16 +452,16 @@ function gutenberg_render_duotone_support( $block_content, $block ) {
$duotone_attr = $block['attrs']['style']['color']['duotone'];

$is_duotone_colors_array = is_array( $duotone_attr );
$is_duotone_unset = 'unset' === $duotone_attr;
$is_duotone_preset = ! $is_duotone_colors_array && ! $is_duotone_unset;
$is_duotone_preset = ! $is_duotone_colors_array && strpos( $duotone_attr, 'var:preset|duotone|' ) === 0;

if ( $is_duotone_preset ) {
$slug = str_replace( 'var:preset|duotone|', '', $duotone_attr );
$filter_preset = array(
'slug' => $duotone_attr,
'slug' => $slug,
);

// Utilise existing CSS custom property.
$filter_property = "var(--wp--preset--duotone--$duotone_attr)";
$filter_property = "var(--wp--preset--duotone--$slug)";
} else {
// Handle when Duotone is either:
// - "unset"
Expand All @@ -472,7 +475,7 @@ function gutenberg_render_duotone_support( $block_content, $block ) {
);

// Build a customised CSS filter property for unique slug.
$filter_property = $is_duotone_unset ? 'none' : gutenberg_get_duotone_filter_property( $filter_preset );
$filter_property = gutenberg_get_duotone_filter_property( $filter_preset );
}

// - Applied as a class attribute to the block wrapper.
Expand Down
29 changes: 11 additions & 18 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,6 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support
return '';
}

/**
* Gets classname from last tag in a string of HTML.
*
* @param string $html markup to be processed.
* @return string String of inner wrapper classnames.
*/
function gutenberg_get_classnames_from_last_tag( $html ) {
$tags = new WP_HTML_Tag_Processor( $html );
$last_classnames = '';

while ( $tags->next_tag() ) {
$last_classnames = $tags->get_attribute( 'class' );
}

return (string) $last_classnames;
}

/**
* Renders the layout config to the block wrapper.
*
Expand Down Expand Up @@ -502,7 +485,17 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
* The first chunk of innerContent contains the block markup up until the inner blocks start.
* We want to target the opening tag of the inner blocks wrapper, which is the last tag in that chunk.
*/
$inner_content_classnames = isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) ? gutenberg_get_classnames_from_last_tag( $block['innerContent'][0] ) : '';
$inner_content_classnames = '';

if ( isset( $block['innerContent'][0] ) && 'string' === gettype( $block['innerContent'][0] ) && count( $block['innerContent'] ) > 1 ) {
$tags = new WP_HTML_Tag_Processor( $block['innerContent'][0] );
$last_classnames = '';
while ( $tags->next_tag() ) {
$last_classnames = $tags->get_attribute( 'class' );
}

$inner_content_classnames = (string) $last_classnames;
}

$content = $content_with_outer_classnames ? new WP_HTML_Tag_Processor( $content_with_outer_classnames ) : new WP_HTML_Tag_Processor( $block_content );

Expand Down
Loading

0 comments on commit cde62e6

Please sign in to comment.