From de23bb92851806318267a657753d7acaff770d83 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 15 Jul 2024 12:15:56 +0400 Subject: [PATCH 01/36] Upgrade Playwright to v1.45 (#61443) * Upgrade Playwright to v1.44 * Use new accessibility assertions * Bump to latest * Bump to v1.45 * Bump to v1.45.1 * Skip failing RichText tests on Firefox Co-authored-by: Mamaduka Co-authored-by: swissspidy Co-authored-by: afercia Co-authored-by: WunderBart Co-authored-by: ellatrix --- package-lock.json | 54 +++++++++---------- package.json | 2 +- packages/scripts/package.json | 2 +- .../specs/editor/various/rich-text.spec.js | 4 +- .../site-editor/navigation-editor.spec.js | 8 ++- 5 files changed, 34 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe39c663c3107..1cc4fb4bd8647 100644 --- a/package-lock.json +++ b/package-lock.json @@ -98,7 +98,7 @@ "@octokit/rest": "16.26.0", "@octokit/types": "6.34.0", "@octokit/webhooks-types": "5.8.0", - "@playwright/test": "1.43.0", + "@playwright/test": "1.45.1", "@pmmmwh/react-refresh-webpack-plugin": "0.5.11", "@react-native/babel-preset": "0.73.10", "@react-native/metro-babel-transformer": "0.73.10", @@ -6927,18 +6927,18 @@ } }, "node_modules/@playwright/test": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0.tgz", - "integrity": "sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", + "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", "dev": true, "dependencies": { - "playwright": "1.43.0" + "playwright": "1.45.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { @@ -41994,33 +41994,33 @@ "dev": true }, "node_modules/playwright": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0.tgz", - "integrity": "sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", + "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", "dev": true, "dependencies": { - "playwright-core": "1.43.0" + "playwright-core": "1.45.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0.tgz", - "integrity": "sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", + "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", "dev": true, "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/please-upgrade-node": { @@ -55671,7 +55671,7 @@ "npm": ">=8.19.2" }, "peerDependencies": { - "@playwright/test": "^1.43.0", + "@playwright/test": "^1.45.1", "react": "^18.0.0", "react-dom": "^18.0.0" } @@ -60996,12 +60996,12 @@ } }, "@playwright/test": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.43.0.tgz", - "integrity": "sha512-Ebw0+MCqoYflop7wVKj711ccbNlrwTBCtjY5rlbiY9kHL2bCYxq+qltK6uPsVBGGAOb033H2VO0YobcQVxoW7Q==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.45.1.tgz", + "integrity": "sha512-Wo1bWTzQvGA7LyKGIZc8nFSTFf2TkthGIFBR+QVNilvwouGzFd4PYukZe3rvf5PSqjHi1+1NyKSDZKcQWETzaA==", "dev": true, "requires": { - "playwright": "1.43.0" + "playwright": "1.45.1" } }, "@pmmmwh/react-refresh-webpack-plugin": { @@ -88856,19 +88856,19 @@ "dev": true }, "playwright": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0.tgz", - "integrity": "sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.1.tgz", + "integrity": "sha512-Hjrgae4kpSQBr98nhCj3IScxVeVUixqj+5oyif8TdIn2opTCPEzqAqNMeK42i3cWDCVu9MI+ZsGWw+gVR4ISBg==", "dev": true, "requires": { "fsevents": "2.3.2", - "playwright-core": "1.43.0" + "playwright-core": "1.45.1" } }, "playwright-core": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.43.0.tgz", - "integrity": "sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==", + "version": "1.45.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.1.tgz", + "integrity": "sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==", "dev": true }, "please-upgrade-node": { diff --git a/package.json b/package.json index 2922cc799aee0..2ed3f7c108354 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "@octokit/rest": "16.26.0", "@octokit/types": "6.34.0", "@octokit/webhooks-types": "5.8.0", - "@playwright/test": "1.43.0", + "@playwright/test": "1.45.1", "@pmmmwh/react-refresh-webpack-plugin": "0.5.11", "@react-native/babel-preset": "0.73.10", "@react-native/metro-babel-transformer": "0.73.10", diff --git a/packages/scripts/package.json b/packages/scripts/package.json index b0a9eb957983c..6d735745977da 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -92,7 +92,7 @@ "webpack-dev-server": "^4.15.1" }, "peerDependencies": { - "@playwright/test": "^1.43.0", + "@playwright/test": "^1.45.1", "react": "^18.0.0", "react-dom": "^18.0.0" }, diff --git a/test/e2e/specs/editor/various/rich-text.spec.js b/test/e2e/specs/editor/various/rich-text.spec.js index aa56639281b49..29b4fb3d58901 100644 --- a/test/e2e/specs/editor/various/rich-text.spec.js +++ b/test/e2e/specs/editor/various/rich-text.spec.js @@ -119,7 +119,7 @@ test.describe( 'RichText (@firefox, @webkit)', () => { expect( count ).toBe( 1 ); } ); - test( 'should return focus when pressing formatting button', async ( { + test( 'should return focus when pressing formatting button (-firefox)', async ( { page, editor, } ) => { @@ -415,7 +415,7 @@ test.describe( 'RichText (@firefox, @webkit)', () => { ] ); } ); - test( 'should update internal selection after fresh focus', async ( { + test( 'should update internal selection after fresh focus (-firefox)', async ( { page, editor, pageUtils, diff --git a/test/e2e/specs/site-editor/navigation-editor.spec.js b/test/e2e/specs/site-editor/navigation-editor.spec.js index 2813ceb13748a..64a80e814d629 100644 --- a/test/e2e/specs/site-editor/navigation-editor.spec.js +++ b/test/e2e/specs/site-editor/navigation-editor.spec.js @@ -62,11 +62,9 @@ test.describe( 'Editing Navigation Menus', () => { await expect( navBlockNode ).toBeVisible(); // The Navigation block description should contain the locked state information. - const navBlockNodeDescriptionId = - await navBlockNode.getAttribute( 'aria-describedby' ); - await expect( - listView.locator( `id=${ navBlockNodeDescriptionId }` ) - ).toHaveText( /This block is locked./ ); + await expect( navBlockNode ).toHaveAccessibleDescription( + /This block is locked./ + ); // The block should have no options menu. await expect( From 653759abf19b996da2c830024841691125505175 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 15 Jul 2024 10:33:30 +0200 Subject: [PATCH 02/36] Gallery: Add border block support (#63428) Add border block support to the gallery block, Co-authored-by: carolinan Co-authored-by: aaronrobertshaw Co-authored-by: andrewserong Co-authored-by: paaljoachim Co-authored-by: jasmussen --- packages/block-library/src/gallery/block.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/block-library/src/gallery/block.json b/packages/block-library/src/gallery/block.json index e9018704bf6bf..6a2129ec1e056 100644 --- a/packages/block-library/src/gallery/block.json +++ b/packages/block-library/src/gallery/block.json @@ -112,6 +112,16 @@ "supports": { "anchor": true, "align": true, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true + } + }, "html": false, "units": [ "px", "em", "rem", "vh", "vw" ], "spacing": { From 469f37959f9cff3b62d843bf04c052a468b0f3f1 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 15 Jul 2024 11:48:33 +0200 Subject: [PATCH 03/36] Show visual label for Categories block in dropdown mode (#56364) Categories: Add an option for making the label for the select element visible, and make the label editable. Unlinked contributors: tofumatt. Co-authored-by: carolinan Co-authored-by: afercia Co-authored-by: jasmussen --- docs/reference-guides/core-blocks.md | 2 +- .../block-library/src/categories/block.json | 8 +++++ packages/block-library/src/categories/edit.js | 36 ++++++++++++++++--- .../block-library/src/categories/editor.scss | 4 +++ .../block-library/src/categories/index.php | 5 ++- .../block-library/src/categories/style.scss | 4 +++ .../fixtures/blocks/core__categories.json | 3 +- 7 files changed, 55 insertions(+), 7 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 67cebe47fc41b..492aae535f42c 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -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 diff --git a/packages/block-library/src/categories/block.json b/packages/block-library/src/categories/block.json index 820ac8945f50f..7f74befa3b681 100644 --- a/packages/block-library/src/categories/block.json +++ b/packages/block-library/src/categories/block.json @@ -26,6 +26,14 @@ "showEmpty": { "type": "boolean", "default": false + }, + "label": { + "type": "string", + "__experimentalRole": "content" + }, + "showLabel": { + "type": "boolean", + "default": true } }, "supports": { diff --git a/packages/block-library/src/categories/edit.js b/packages/block-library/src/categories/edit.js index 0c4df48d7c3dc..48d505eeb75ae 100644 --- a/packages/block-library/src/categories/edit.js +++ b/packages/block-library/src/categories/edit.js @@ -14,7 +14,11 @@ import { VisuallyHidden, } from '@wordpress/components'; import { useInstanceId } from '@wordpress/compose'; -import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; +import { + InspectorControls, + useBlockProps, + RichText, +} from '@wordpress/block-editor'; import { decodeEntities } from '@wordpress/html-entities'; import { __ } from '@wordpress/i18n'; import { pin } from '@wordpress/icons'; @@ -27,6 +31,8 @@ export default function CategoriesEdit( { showPostCounts, showOnlyTopLevel, showEmpty, + label, + showLabel, }, setAttributes, className, @@ -92,9 +98,22 @@ export default function CategoriesEdit( { const categoriesList = getCategoriesList( parentId ); return ( <> - - { __( 'Categories' ) } - + { showLabel ? ( + + setAttributes( { label: html } ) + } + /> + ) : ( + + { label ? label : __( 'Categories' ) } + + ) }