Skip to content

Commit 8adc648

Browse files
committed
prep build 07/19
2 parents 38e65ec + e685f68 commit 8adc648

File tree

51 files changed

+537
-334
lines changed

Some content is hidden

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

51 files changed

+537
-334
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ module.exports = {
290290
...restrictedSyntax,
291291
...restrictedSyntaxComponents,
292292
...[
293+
'CheckboxControl',
294+
'ComboboxControl',
293295
'FocalPointPicker',
296+
'SearchControl',
294297
'TextareaControl',
295298
'TreeSelect',
296299
].map( ( componentName ) => ( {

.github/workflows/create-block.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ concurrency:
1414

1515
jobs:
1616
checks:
17-
name: Checks w/Node.js ${{ matrix.node }} on ${{ matrix.os }}
17+
name: Checks w/Node.js ${{ matrix.node.name }} on ${{ matrix.os }}
1818
runs-on: ${{ matrix.os }}
1919
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
node: ['20', '22']
23+
node:
24+
- name: 20
25+
version: 20
26+
- name: 22
27+
version: 22.4
2428
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
2529

2630
steps:
@@ -31,7 +35,7 @@ jobs:
3135
- name: Setup Node.js and install dependencies
3236
uses: ./.github/setup-node
3337
with:
34-
node-version: ${{ matrix.node }}
38+
node-version: ${{ matrix.node.version }}
3539

3640
- name: Create block
3741
shell: bash

.github/workflows/unit-test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ concurrency:
2121

2222
jobs:
2323
unit-js:
24-
name: JavaScript (Node.js ${{ matrix.node }}) ${{ matrix.shard }}
24+
name: JavaScript (Node.js ${{ matrix.node.name }}) ${{ matrix.shard }}
2525
runs-on: ubuntu-latest
2626
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
node: ['20', '22']
30+
node:
31+
- name: 20
32+
version: 20
33+
- name: 22
34+
version: 22.4
3135
shard: ['1/4', '2/4', '3/4', '4/4']
3236

3337
steps:
@@ -39,7 +43,7 @@ jobs:
3943
- name: Setup Node.js and install dependencies
4044
uses: ./.github/setup-node
4145
with:
42-
node-version: ${{ matrix.node }}
46+
node-version: ${{ matrix.node.version }}
4347

4448
- name: Determine the number of CPU cores
4549
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0
@@ -60,13 +64,17 @@ jobs:
6064
--cacheDirectory="$HOME/.jest-cache"
6165
6266
unit-js-date:
63-
name: JavaScript Date Tests (Node.js ${{ matrix.node }})
67+
name: JavaScript Date Tests (Node.js ${{ matrix.node.name }})
6468
runs-on: ubuntu-latest
6569
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
6670
strategy:
6771
fail-fast: false
6872
matrix:
69-
node: ['20', '22']
73+
node:
74+
- name: 20
75+
version: 20
76+
- name: 22
77+
version: 22.4
7078

7179
steps:
7280
- name: Checkout repository
@@ -77,7 +85,7 @@ jobs:
7785
- name: Setup Node.js and install dependencies
7886
uses: ./.github/setup-node
7987
with:
80-
node-version: ${{ matrix.node }}
88+
node-version: ${{ matrix.node.version }}
8189

8290
- name: Determine the number of CPU cores
8391
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0

backport-changelog/6.6/7061.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/7061
2+
3+
* https://github.com/WordPress/gutenberg/pull/63726

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,18 @@ _Returns_
562562

563563
- `number`: Number of blocks in the post, or number of blocks with name equal to blockName.
564564

565+
### getHoveredBlockClientId
566+
567+
Returns the currently hovered block.
568+
569+
_Parameters_
570+
571+
- _state_ `Object`: Global application state.
572+
573+
_Returns_
574+
575+
- `Object`: Client Id of the hovered block.
576+
565577
### getInserterItems
566578

567579
Determines the items that appear in the inserter. Includes both static items (e.g. a regular block type) and dynamic items (e.g. a reusable block).
@@ -1257,6 +1269,18 @@ _Parameters_
12571269

12581270
Action that hides the insertion point.
12591271

1272+
### hoverBlock
1273+
1274+
Returns an action object used in signalling that the block with the specified client ID has been hovered.
1275+
1276+
_Parameters_
1277+
1278+
- _clientId_ `string`: Block client ID.
1279+
1280+
_Returns_
1281+
1282+
- `Object`: Action object.
1283+
12601284
### insertAfterBlock
12611285

12621286
Action that inserts a default block after a given block.

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,18 +2921,23 @@ static function ( $pseudo_selector ) use ( $selector ) {
29212921
}
29222922

29232923
/*
2924+
* Root selector (body) styles should not be wrapped in `:root where()` to keep
2925+
* specificity at (0,0,1) and maintain backwards compatibility.
2926+
*
29242927
* Top-level element styles using element-only specificity selectors should
29252928
* not get wrapped in `:root :where()` to maintain backwards compatibility.
29262929
*
29272930
* Pseudo classes, e.g. :hover, :focus etc., are a class-level selector so
29282931
* still need to be wrapped in `:root :where` to cap specificity for nested
29292932
* variations etc. Pseudo selectors won't match the ELEMENTS selector exactly.
29302933
*/
2931-
$element_only_selector = $current_element &&
2932-
isset( static::ELEMENTS[ $current_element ] ) &&
2933-
// buttons, captions etc. still need `:root :where()` as they are class based selectors.
2934-
! isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $current_element ] ) &&
2935-
static::ELEMENTS[ $current_element ] === $selector;
2934+
$element_only_selector = $is_root_selector || (
2935+
$current_element &&
2936+
isset( static::ELEMENTS[ $current_element ] ) &&
2937+
// buttons, captions etc. still need `:root :where()` as they are class based selectors.
2938+
! isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $current_element ] ) &&
2939+
static::ELEMENTS[ $current_element ] === $selector
2940+
);
29362941

29372942
// 2. Generate and append the rules that use the general selector.
29382943
$general_selector = $element_only_selector ? $selector : ":root :where($selector)";

packages/block-editor/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,6 @@ _Returns_
730730

731731
- `JSX.Element`: A React element.
732732

733-
### ReusableBlocksRenameHint
734-
735-
Undocumented declaration.
736-
737733
### RichText
738734

739735
_Related_

packages/block-editor/src/components/block-list/use-block-props/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
115115
useFocusHandler( clientId ),
116116
useEventHandlers( { clientId, isSelected } ),
117117
useNavModeExit( clientId ),
118-
useIsHovered(),
118+
useIsHovered( { clientId } ),
119119
useIntersectionObserver(),
120120
useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
121121
useDisabled( { isDisabled: ! hasOverlay } ),

packages/block-editor/src/components/block-list/use-block-props/use-is-hovered.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,37 @@
22
* WordPress dependencies
33
*/
44
import { useRefEffect } from '@wordpress/compose';
5+
import { useDispatch } from '@wordpress/data';
56

6-
function listener( event ) {
7-
if ( event.defaultPrevented ) {
8-
return;
9-
}
10-
11-
const action = event.type === 'mouseover' ? 'add' : 'remove';
12-
13-
event.preventDefault();
14-
event.currentTarget.classList[ action ]( 'is-hovered' );
15-
}
7+
/**
8+
* Internal dependencies
9+
*/
10+
import { store as blockEditorStore } from '../../../store';
1611

1712
/*
1813
* Adds `is-hovered` class when the block is hovered and in navigation or
1914
* outline mode.
2015
*/
21-
export function useIsHovered() {
16+
export function useIsHovered( { clientId } ) {
17+
const { hoverBlock } = useDispatch( blockEditorStore );
18+
19+
function listener( event ) {
20+
if ( event.defaultPrevented ) {
21+
return;
22+
}
23+
24+
const action = event.type === 'mouseover' ? 'add' : 'remove';
25+
26+
event.preventDefault();
27+
event.currentTarget.classList[ action ]( 'is-hovered' );
28+
29+
if ( action === 'add' ) {
30+
hoverBlock( clientId );
31+
} else {
32+
hoverBlock( null );
33+
}
34+
}
35+
2236
return useRefEffect( ( node ) => {
2337
node.addEventListener( 'mouseout', listener );
2438
node.addEventListener( 'mouseover', listener );
@@ -29,6 +43,7 @@ export function useIsHovered() {
2943

3044
// Remove class in case it lingers.
3145
node.classList.remove( 'is-hovered' );
46+
hoverBlock( null );
3247
};
3348
}, [] );
3449
}

packages/block-editor/src/components/block-tools/style.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,11 @@
285285
border: none;
286286
}
287287
}
288+
289+
.block-editor-block-tools__zoom-out-mode-inserter-button {
290+
visibility: hidden;
291+
292+
&.is-visible {
293+
visibility: visible;
294+
}
295+
}

0 commit comments

Comments
 (0)