Skip to content

Commit

Permalink
Merge branch 'trunk' into add/latest-comments-color
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Jul 16, 2024
2 parents 6888aad + c54c002 commit 1253f3d
Show file tree
Hide file tree
Showing 173 changed files with 3,765 additions and 2,395 deletions.
18 changes: 6 additions & 12 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,19 @@ body:
validations:
required: false

- type: dropdown
- type: checkboxes
id: existing
attributes:
label: Please confirm that you have searched existing issues in the repo.
description: You can do this by searching https://github.com/WordPress/gutenberg/issues and making sure the bug is not related to another plugin.
multiple: true
options:
- 'Yes'
- 'No'
validations:
required: true
- label: 'Yes'
required: true

- type: dropdown
- type: checkboxes
id: plugins
attributes:
label: Please confirm that you have tested with all plugins deactivated except Gutenberg.
multiple: true
options:
- 'Yes'
- 'No'
validations:
required: true
- label: 'Yes'
required: true
3 changes: 3 additions & 0 deletions backport-changelog/6.6/7012.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7012

* https://github.com/WordPress/gutenberg/pull/63403
3 changes: 2 additions & 1 deletion backport-changelog/6.7/6910.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ https://github.com/WordPress/wordpress-develop/pull/6910
* https://github.com/WordPress/gutenberg/pull/59483
* https://github.com/WordPress/gutenberg/pull/60652
* https://github.com/WordPress/gutenberg/pull/62777
* https://github.com/WordPress/gutenberg/pull/63108
* https://github.com/WordPress/gutenberg/pull/63108
* https://github.com/WordPress/gutenberg/pull/63464
30 changes: 30 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
== Changelog ==

= 18.8.0-rc.2 =


## Changelog

### Bug Fixes

- Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))


### Various

#### CSS & Styling
- Only add customizer additional CSS to global styles in block themes. ([63331](https://github.com/WordPress/gutenberg/pull/63331))


## First-time contributors

The following PRs were merged by first-time contributors:

- @sejas: Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))


## Contributors

The following contributors merged PRs in this release:

@sejas @tellthemachines


= 18.8.0-rc.1 =


Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Display a list of all categories. ([Source](https://github.com/WordPress/gutenbe
- **Name:** core/categories
- **Category:** widgets
- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** displayAsDropdown, showEmpty, showHierarchy, showOnlyTopLevel, showPostCounts
- **Attributes:** displayAsDropdown, label, showEmpty, showHierarchy, showLabel, showOnlyTopLevel, showPostCounts

## Code

Expand Down
15 changes: 15 additions & 0 deletions docs/reference-guides/interactivity-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ You can start creating interactions once you set up a block development environm

### Code requirements

#### Add `interactivity` to your project

Install the Interactivity API to your project with the following command:

```bash
npm install @wordpress/interactivity --save
```

Import the store into your `view.js`. Refer to the [store documentation](https://developer.wordpress.org/block-editor/reference-guides/interactivity-api/api-reference/#the-store) for more information.

```js
import { store } from '@wordpress/interactivity';
```


#### Add `interactivity` support to `block.json`

To indicate that the block [supports](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/) the Interactivity API features, add `"interactivity": true` to the `supports` attribute of the block's `block.json` file.
Expand Down
12 changes: 11 additions & 1 deletion docs/reference-guides/interactivity-api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,12 @@ Apart from the store function, there are also some methods that allows the devel

#### getContext()

Retrieves the context inherited by the element evaluating a function from the store. The returned value depends on the element and the namespace where the function calling `getContext()` exists.
Retrieves the context inherited by the element evaluating a function from the store. The returned value depends on the element and the namespace where the function calling `getContext()` exists. It can also take an optional namespace argument to retrieve the context of a specific interactive region.

```js
const context = getContext('namespace');
```
- `namespace` (optional): A string that matches the namespace of an interactive region. If not provided, it retrieves the context of the current interactive region.

```php
// render.php
Expand All @@ -1073,6 +1078,11 @@ store( "myPlugin", {
const context = getContext();
// Logs "false"
console.log('context => ', context.isOpen)

// With namespace argument.
const myPluginContext = getContext("myPlugin");
// Logs "false"
console.log('myPlugin isOpen => ', myPluginContext.isOpen);
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.4
* Requires PHP: 7.2
* Version: 18.8.0-rc.1
* Version: 18.8.0-rc.2
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
12 changes: 10 additions & 2 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,11 +646,19 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
if ( ( $column_span || $column_start ) && ( $minimum_column_width || ! $column_count ) ) {
$column_span_number = floatval( $column_span );
$column_start_number = floatval( $column_start );
$highest_number = max( $column_span_number, $column_start_number );
$parent_column_width = $minimum_column_width ? $minimum_column_width : '12rem';
$parent_column_value = floatval( $parent_column_width );
$parent_column_unit = explode( $parent_column_value, $parent_column_width );

$num_cols_to_break_at = 2;
if ( $column_span_number && $column_start_number ) {
$num_cols_to_break_at = $column_start_number + $column_span_number - 1;
} elseif ( $column_span_number ) {
$num_cols_to_break_at = $column_span_number;
} else {
$num_cols_to_break_at = $column_start_number;
}

/*
* If there is no unit, the width has somehow been mangled so we reset both unit and value
* to defaults.
Expand All @@ -672,7 +680,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
* viable to use in the computation of the container query value.
*/
$default_gap_value = 'px' === $parent_column_unit ? 24 : 1.5;
$container_query_value = $highest_number * $parent_column_value + ( $highest_number - 1 ) * $default_gap_value;
$container_query_value = $num_cols_to_break_at * $parent_column_value + ( $num_cols_to_break_at - 1 ) * $default_gap_value;
$minimum_container_query_value = $parent_column_value * 2 + $default_gap_value - 1;
$container_query_value = max( $container_query_value, $minimum_container_query_value ) . $parent_column_unit;
// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.
Expand Down
17 changes: 16 additions & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -2918,8 +2918,23 @@ static function ( $pseudo_selector ) use ( $selector ) {
$declarations = static::update_separator_declarations( $declarations );
}

/*
* Top-level element styles using element-only specificity selectors should
* not get wrapped in `:root :where()` to maintain backwards compatibility.
*
* Pseudo classes, e.g. :hover, :focus etc., are a class-level selector so
* still need to be wrapped in `:root :where` to cap specificity for nested
* variations etc. Pseudo selectors won't match the ELEMENTS selector exactly.
*/
$element_only_selector = $current_element &&
isset( static::ELEMENTS[ $current_element ] ) &&
// buttons, captions etc. still need `:root :where()` as they are class based selectors.
! isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $current_element ] ) &&
static::ELEMENTS[ $current_element ] === $selector;

// 2. Generate and append the rules that use the general selector.
$block_rules .= static::to_ruleset( ":root :where($selector)", $declarations );
$general_selector = $element_only_selector ? $selector : ":root :where($selector)";
$block_rules .= static::to_ruleset( $general_selector, $declarations );

// 3. Generate and append the rules that use the duotone selector.
if ( isset( $block_metadata['duotone'] ) && ! empty( $declarations_duotone ) ) {
Expand Down
Loading

0 comments on commit 1253f3d

Please sign in to comment.