Skip to content

Commit 0f1cafe

Browse files
committed
prep build 07/12
2 parents b88d2d4 + 0f2c94b commit 0f1cafe

File tree

116 files changed

+2334
-2345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2334
-2345
lines changed

backport-changelog/6.6/7012.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7012
2+
3+
* https://github.com/WordPress/gutenberg/pull/63403

backport-changelog/6.7/6910.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ https://github.com/WordPress/wordpress-develop/pull/6910
33
* https://github.com/WordPress/gutenberg/pull/59483
44
* https://github.com/WordPress/gutenberg/pull/60652
55
* https://github.com/WordPress/gutenberg/pull/62777
6-
* https://github.com/WordPress/gutenberg/pull/63108
6+
* https://github.com/WordPress/gutenberg/pull/63108
7+
* https://github.com/WordPress/gutenberg/pull/63464

docs/reference-guides/data/data-core.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ _Parameters_
1818

1919
- _state_ `State`: Data state.
2020
- _action_ `string`: Action to check. One of: 'create', 'read', 'update', 'delete'.
21-
- _resource_ `string`: REST resource to check, e.g. 'media' or 'posts'.
21+
- _resource_ `string | EntityResource`: Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }` or REST base as a string - `media`.
2222
- _id_ `EntityRecordKey`: Optional ID of the rest resource to check.
2323

2424
_Returns_

docs/reference-guides/interactivity-api/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ You can start creating interactions once you set up a block development environm
4242

4343
### Code requirements
4444

45+
#### Add `interactivity` to your project
46+
47+
Install the Interactivity API to your project with the following command:
48+
49+
```bash
50+
npm install @wordpress/interactivity --save
51+
```
52+
53+
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.
54+
55+
```js
56+
import { store } from '@wordpress/interactivity';
57+
```
58+
59+
4560
#### Add `interactivity` support to `block.json`
4661

4762
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.

docs/reference-guides/interactivity-api/api-reference.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,12 @@ Apart from the store function, there are also some methods that allows the devel
10541054

10551055
#### getContext()
10561056

1057-
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.
1057+
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.
1058+
1059+
```js
1060+
const context = getContext('namespace');
1061+
```
1062+
- `namespace` (optional): A string that matches the namespace of an interactive region. If not provided, it retrieves the context of the current interactive region.
10581063

10591064
```php
10601065
// render.php
@@ -1073,6 +1078,11 @@ store( "myPlugin", {
10731078
const context = getContext();
10741079
// Logs "false"
10751080
console.log('context => ', context.isOpen)
1081+
1082+
// With namespace argument.
1083+
const myPluginContext = getContext("myPlugin");
1084+
// Logs "false"
1085+
console.log('myPlugin isOpen => ', myPluginContext.isOpen);
10761086
},
10771087
},
10781088
});

lib/block-supports/layout.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,19 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
646646
if ( ( $column_span || $column_start ) && ( $minimum_column_width || ! $column_count ) ) {
647647
$column_span_number = floatval( $column_span );
648648
$column_start_number = floatval( $column_start );
649-
$highest_number = max( $column_span_number, $column_start_number );
650649
$parent_column_width = $minimum_column_width ? $minimum_column_width : '12rem';
651650
$parent_column_value = floatval( $parent_column_width );
652651
$parent_column_unit = explode( $parent_column_value, $parent_column_width );
653652

653+
$num_cols_to_break_at = 2;
654+
if ( $column_span_number && $column_start_number ) {
655+
$num_cols_to_break_at = $column_start_number + $column_span_number - 1;
656+
} elseif ( $column_span_number ) {
657+
$num_cols_to_break_at = $column_span_number;
658+
} else {
659+
$num_cols_to_break_at = $column_start_number;
660+
}
661+
654662
/*
655663
* If there is no unit, the width has somehow been mangled so we reset both unit and value
656664
* to defaults.
@@ -672,7 +680,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
672680
* viable to use in the computation of the container query value.
673681
*/
674682
$default_gap_value = 'px' === $parent_column_unit ? 24 : 1.5;
675-
$container_query_value = $highest_number * $parent_column_value + ( $highest_number - 1 ) * $default_gap_value;
683+
$container_query_value = $num_cols_to_break_at * $parent_column_value + ( $num_cols_to_break_at - 1 ) * $default_gap_value;
676684
$minimum_container_query_value = $parent_column_value * 2 + $default_gap_value - 1;
677685
$container_query_value = max( $container_query_value, $minimum_container_query_value ) . $parent_column_unit;
678686
// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.

lib/class-wp-theme-json-gutenberg.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2918,8 +2918,23 @@ static function ( $pseudo_selector ) use ( $selector ) {
29182918
$declarations = static::update_separator_declarations( $declarations );
29192919
}
29202920

2921+
/*
2922+
* Top-level element styles using element-only specificity selectors should
2923+
* not get wrapped in `:root :where()` to maintain backwards compatibility.
2924+
*
2925+
* Pseudo classes, e.g. :hover, :focus etc., are a class-level selector so
2926+
* still need to be wrapped in `:root :where` to cap specificity for nested
2927+
* variations etc. Pseudo selectors won't match the ELEMENTS selector exactly.
2928+
*/
2929+
$element_only_selector = $current_element &&
2930+
isset( static::ELEMENTS[ $current_element ] ) &&
2931+
// buttons, captions etc. still need `:root :where()` as they are class based selectors.
2932+
! isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $current_element ] ) &&
2933+
static::ELEMENTS[ $current_element ] === $selector;
2934+
29212935
// 2. Generate and append the rules that use the general selector.
2922-
$block_rules .= static::to_ruleset( ":root :where($selector)", $declarations );
2936+
$general_selector = $element_only_selector ? $selector : ":root :where($selector)";
2937+
$block_rules .= static::to_ruleset( $general_selector, $declarations );
29232938

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

package-lock.json

Lines changed: 0 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/block-editor/src/components/date-format-picker/index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,9 @@ import {
1010
VisuallyHidden,
1111
ToggleControl,
1212
__experimentalVStack as VStack,
13-
privateApis as componentsPrivateApis,
13+
CustomSelectControl,
1414
} from '@wordpress/components';
1515

16-
/**
17-
* Internal dependencies
18-
*/
19-
import { unlock } from '../../lock-unlock';
20-
21-
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
22-
componentsPrivateApis
23-
);
24-
2516
// So that we illustrate the different formats in the dropdown properly, show a date that is
2617
// somwhat recent, has a day greater than 12, and a month with more than three letters.
2718
const exampleDate = new Date();

packages/block-editor/src/components/font-appearance-control/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { privateApis as componentsPrivateApis } from '@wordpress/components';
4+
import { CustomSelectControl } from '@wordpress/components';
55
import { useMemo } from '@wordpress/element';
66
import { __, sprintf } from '@wordpress/i18n';
77

88
/**
99
* Internal dependencies
1010
*/
1111
import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';
12-
import { unlock } from '../../lock-unlock';
1312

14-
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
15-
componentsPrivateApis
16-
);
1713
/**
1814
* Adjusts font appearance field label in case either font styles or weights
1915
* are disabled.

packages/block-editor/src/components/global-styles/test/use-global-styles-output.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ describe( 'global styles renderer', () => {
128128
},
129129
},
130130
selector: ELEMENTS.link,
131+
skipSelectorWrapper: true,
131132
},
132133
{
133134
styles: {
@@ -480,7 +481,7 @@ describe( 'global styles renderer', () => {
480481
};
481482

482483
expect( toStyles( tree, blockSelectors ) ).toEqual(
483-
':where(body) {margin: 0;}.is-layout-flow > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }.is-layout-flow > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }.is-layout-flow > .aligncenter { margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }.is-layout-constrained > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }.is-layout-constrained > .aligncenter { margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) { max-width: var(--wp--style--global--content-size); margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > .alignwide { max-width: var(--wp--style--global--wide-size); }body .is-layout-flex { display:flex; }.is-layout-flex { flex-wrap: wrap; align-items: center; }.is-layout-flex > :is(*, div) { margin: 0; }body .is-layout-grid { display:grid; }.is-layout-grid > :is(*, div) { margin: 0; }:root :where(body){background-color: red;margin: 10px;padding: 10px;}:root :where(a:where(:not(.wp-element-button))){color: blue;}a:where(:not(.wp-element-button)):hover{color: orange;}a:where(:not(.wp-element-button)):focus{color: orange;}:root :where(h1){font-size: 42px;}:root :where(.wp-block-group){margin-top: 10px;margin-right: 20px;margin-bottom: 30px;margin-left: 40px;padding-top: 11px;padding-right: 22px;padding-bottom: 33px;padding-left: 44px;}:root :where(h1,h2,h3,h4,h5,h6){color: orange;}:root :where(h1 a:where(:not(.wp-element-button)),h2 a:where(:not(.wp-element-button)),h3 a:where(:not(.wp-element-button)),h4 a:where(:not(.wp-element-button)),h5 a:where(:not(.wp-element-button)),h6 a:where(:not(.wp-element-button))){color: hotpink;}h1 a:where(:not(.wp-element-button)):hover,h2 a:where(:not(.wp-element-button)):hover,h3 a:where(:not(.wp-element-button)):hover,h4 a:where(:not(.wp-element-button)):hover,h5 a:where(:not(.wp-element-button)):hover,h6 a:where(:not(.wp-element-button)):hover{color: red;}h1 a:where(:not(.wp-element-button)):focus,h2 a:where(:not(.wp-element-button)):focus,h3 a:where(:not(.wp-element-button)):focus,h4 a:where(:not(.wp-element-button)):focus,h5 a:where(:not(.wp-element-button)):focus,h6 a:where(:not(.wp-element-button)):focus{color: red;}:root :where(.wp-block-image img, .wp-block-image .wp-crop-area){border-radius: 9999px;}:root :where(.wp-block-image){color: red;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.has-white-color{color: var(--wp--preset--color--white) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}h1.has-blue-color,h2.has-blue-color,h3.has-blue-color,h4.has-blue-color,h5.has-blue-color,h6.has-blue-color{color: var(--wp--preset--color--blue) !important;}h1.has-blue-background-color,h2.has-blue-background-color,h3.has-blue-background-color,h4.has-blue-background-color,h5.has-blue-background-color,h6.has-blue-background-color{background-color: var(--wp--preset--color--blue) !important;}h1.has-blue-border-color,h2.has-blue-border-color,h3.has-blue-border-color,h4.has-blue-border-color,h5.has-blue-border-color,h6.has-blue-border-color{border-color: var(--wp--preset--color--blue) !important;}'
484+
':where(body) {margin: 0;}.is-layout-flow > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }.is-layout-flow > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }.is-layout-flow > .aligncenter { margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }.is-layout-constrained > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }.is-layout-constrained > .aligncenter { margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) { max-width: var(--wp--style--global--content-size); margin-left: auto !important; margin-right: auto !important; }.is-layout-constrained > .alignwide { max-width: var(--wp--style--global--wide-size); }body .is-layout-flex { display:flex; }.is-layout-flex { flex-wrap: wrap; align-items: center; }.is-layout-flex > :is(*, div) { margin: 0; }body .is-layout-grid { display:grid; }.is-layout-grid > :is(*, div) { margin: 0; }:root :where(body){background-color: red;margin: 10px;padding: 10px;}a:where(:not(.wp-element-button)){color: blue;}:root :where(a:where(:not(.wp-element-button)):hover){color: orange;}:root :where(a:where(:not(.wp-element-button)):focus){color: orange;}h1{font-size: 42px;}:root :where(.wp-block-group){margin-top: 10px;margin-right: 20px;margin-bottom: 30px;margin-left: 40px;padding-top: 11px;padding-right: 22px;padding-bottom: 33px;padding-left: 44px;}:root :where(h1,h2,h3,h4,h5,h6){color: orange;}:root :where(h1 a:where(:not(.wp-element-button)),h2 a:where(:not(.wp-element-button)),h3 a:where(:not(.wp-element-button)),h4 a:where(:not(.wp-element-button)),h5 a:where(:not(.wp-element-button)),h6 a:where(:not(.wp-element-button))){color: hotpink;}:root :where(h1 a:where(:not(.wp-element-button)):hover,h2 a:where(:not(.wp-element-button)):hover,h3 a:where(:not(.wp-element-button)):hover,h4 a:where(:not(.wp-element-button)):hover,h5 a:where(:not(.wp-element-button)):hover,h6 a:where(:not(.wp-element-button)):hover){color: red;}:root :where(h1 a:where(:not(.wp-element-button)):focus,h2 a:where(:not(.wp-element-button)):focus,h3 a:where(:not(.wp-element-button)):focus,h4 a:where(:not(.wp-element-button)):focus,h5 a:where(:not(.wp-element-button)):focus,h6 a:where(:not(.wp-element-button)):focus){color: red;}:root :where(.wp-block-image img, .wp-block-image .wp-crop-area){border-radius: 9999px;}:root :where(.wp-block-image){color: red;}.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.has-white-color{color: var(--wp--preset--color--white) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}h1.has-blue-color,h2.has-blue-color,h3.has-blue-color,h4.has-blue-color,h5.has-blue-color,h6.has-blue-color{color: var(--wp--preset--color--blue) !important;}h1.has-blue-background-color,h2.has-blue-background-color,h3.has-blue-background-color,h4.has-blue-background-color,h5.has-blue-background-color,h6.has-blue-background-color{background-color: var(--wp--preset--color--blue) !important;}h1.has-blue-border-color,h2.has-blue-border-color,h3.has-blue-border-color,h4.has-blue-border-color,h5.has-blue-border-color,h6.has-blue-border-color{border-color: var(--wp--preset--color--blue) !important;}'
484485
);
485486
} );
486487

0 commit comments

Comments
 (0)