From c4e10d39507ed44fc91814275cee1a847b9f27b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor?= <27339341+priethor@users.noreply.github.com> Date: Wed, 4 Oct 2023 18:28:23 +0200 Subject: [PATCH 01/13] Docs: Add a callout to the `wp-now` documentation to mention it's still experimental (#55044) * Add a callout to the 'wp-now' documentation to mention it's still experimental * Fix wp-now repository link * Update get-started-with-wp-now.md * Update docs/getting-started/devenv/get-started-with-wp-now.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> * Update docs/getting-started/devenv/get-started-with-wp-now.md Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --------- Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- docs/getting-started/devenv/get-started-with-wp-now.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/devenv/get-started-with-wp-now.md b/docs/getting-started/devenv/get-started-with-wp-now.md index f4549735fcbdce..ddcf4c300b4a29 100644 --- a/docs/getting-started/devenv/get-started-with-wp-now.md +++ b/docs/getting-started/devenv/get-started-with-wp-now.md @@ -1,3 +1,7 @@ +
+wp-now is still experimental. For a more comprehensive overview of their current status and roadmap, please check WordPress Playground's repository and wp-now's. +
+ # Get started with wp-now The [@wp-now/wp-now](https://www.npmjs.com/package/@wordpress/env) package (`wp-now`) is a lightweight tool powered by [WordPress Playground](https://developer.wordpress.org/playground/) that streamlines setting up a local WordPress environment. @@ -63,4 +67,4 @@ Here are a few instructions if you need to start over or want to remove what was ## Additional resources - [@wp-now/wp-now](https://github.com/WordPress/playground-tools/tree/trunk/packages/wp-now) (Official documentation) -- [WordPress Playground](https://developer.wordpress.org/playground/) (Developer overview) \ No newline at end of file +- [WordPress Playground](https://developer.wordpress.org/playground/) (Developer overview) From fff4d563335c6fc8f5e801b85e7bc002c9195b82 Mon Sep 17 00:00:00 2001 From: Ella <4710635+ellatrix@users.noreply.github.com> Date: Wed, 4 Oct 2023 20:31:44 +0300 Subject: [PATCH 02/13] Rich text: use getPasteEventData (#55048) --- .../components/rich-text/use-paste-handler.js | 90 +------------------ packages/block-editor/src/utils/pasting.js | 51 +++++++++++ 2 files changed, 55 insertions(+), 86 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/use-paste-handler.js b/packages/block-editor/src/components/rich-text/use-paste-handler.js index 5494b96a43eb7b..23eb6fcd5808a7 100644 --- a/packages/block-editor/src/components/rich-text/use-paste-handler.js +++ b/packages/block-editor/src/components/rich-text/use-paste-handler.js @@ -3,7 +3,6 @@ */ import { useRef } from '@wordpress/element'; import { useRefEffect } from '@wordpress/compose'; -import { getFilesFromDataTransfer } from '@wordpress/dom'; import { pasteHandler, findTransform, @@ -17,7 +16,7 @@ import { isURL } from '@wordpress/url'; */ import { addActiveFormats, isShortcode } from './utils'; import { splitValue } from './split-value'; -import { shouldDismissPastedFiles } from '../../utils/pasting'; +import { getPasteEventData } from '../../utils/pasting'; /** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */ @@ -44,33 +43,7 @@ export function usePasteHandler( props ) { return; } - const { clipboardData } = event; - - let plainText = ''; - let html = ''; - - // IE11 only supports `Text` as an argument for `getData` and will - // otherwise throw an invalid argument error, so we try the standard - // arguments first, then fallback to `Text` if they fail. - try { - plainText = clipboardData.getData( 'text/plain' ); - html = clipboardData.getData( 'text/html' ); - } catch ( error1 ) { - try { - html = clipboardData.getData( 'Text' ); - } catch ( error2 ) { - // Some browsers like UC Browser paste plain text by default and - // don't support clipboardData at all, so allow default - // behaviour. - return; - } - } - - // Remove Windows-specific metadata appended within copied HTML text. - html = removeWindowsFragments( html ); - - // Strip meta tag. - html = removeCharsetMetaTag( html ); + const { plainText, html, files } = getPasteEventData( event ); event.preventDefault(); @@ -103,8 +76,8 @@ export function usePasteHandler( props ) { return; } - const files = [ ...getFilesFromDataTransfer( clipboardData ) ]; - const isInternal = clipboardData.getData( 'rich-text' ) === 'true'; + const isInternal = + event.clipboardData.getData( 'rich-text' ) === 'true'; // If the data comes from a rich text instance, we can directly use it // without filtering the data. The filters are only meant for externally @@ -128,17 +101,7 @@ export function usePasteHandler( props ) { // Allows us to ask for this information when we get a report. // eslint-disable-next-line no-console window.console.log( 'Received items:\n\n', files ); - } - // Process any attached files, unless we infer that the files in - // question are redundant "screenshots" of the actual HTML payload, - // as created by certain office-type programs. - // - // @see shouldDismissPastedFiles - if ( - files?.length && - ! shouldDismissPastedFiles( files, html, plainText ) - ) { const fromTransforms = getBlockTransforms( 'from' ); const blocks = files .reduce( ( accumulator, file ) => { @@ -228,48 +191,3 @@ export function usePasteHandler( props ) { }; }, [] ); } - -/** - * Normalizes a given string of HTML to remove the Windows-specific "Fragment" - * comments and any preceding and trailing content. - * - * @param {string} html the html to be normalized - * @return {string} the normalized html - */ -function removeWindowsFragments( html ) { - const startStr = ''; - const startIdx = html.indexOf( startStr ); - if ( startIdx > -1 ) { - html = html.substring( startIdx + startStr.length ); - } else { - // No point looking for EndFragment - return html; - } - - const endStr = ''; - const endIdx = html.indexOf( endStr ); - if ( endIdx > -1 ) { - html = html.substring( 0, endIdx ); - } - - return html; -} - -/** - * Removes the charset meta tag inserted by Chromium. - * See: - * - https://github.com/WordPress/gutenberg/issues/33585 - * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 - * - * @param {string} html the html to be stripped of the meta tag. - * @return {string} the cleaned html - */ -function removeCharsetMetaTag( html ) { - const metaTag = ``; - - if ( html.startsWith( metaTag ) ) { - return html.slice( metaTag.length ); - } - - return html; -} diff --git a/packages/block-editor/src/utils/pasting.js b/packages/block-editor/src/utils/pasting.js index e962e11050a1d9..f9612aad20f140 100644 --- a/packages/block-editor/src/utils/pasting.js +++ b/packages/block-editor/src/utils/pasting.js @@ -3,6 +3,51 @@ */ import { getFilesFromDataTransfer } from '@wordpress/dom'; +/** + * Normalizes a given string of HTML to remove the Windows-specific "Fragment" + * comments and any preceding and trailing content. + * + * @param {string} html the html to be normalized + * @return {string} the normalized html + */ +function removeWindowsFragments( html ) { + const startStr = ''; + const startIdx = html.indexOf( startStr ); + if ( startIdx > -1 ) { + html = html.substring( startIdx + startStr.length ); + } else { + // No point looking for EndFragment + return html; + } + + const endStr = ''; + const endIdx = html.indexOf( endStr ); + if ( endIdx > -1 ) { + html = html.substring( 0, endIdx ); + } + + return html; +} + +/** + * Removes the charset meta tag inserted by Chromium. + * See: + * - https://github.com/WordPress/gutenberg/issues/33585 + * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 + * + * @param {string} html the html to be stripped of the meta tag. + * @return {string} the cleaned html + */ +function removeCharsetMetaTag( html ) { + const metaTag = ``; + + if ( html.startsWith( metaTag ) ) { + return html.slice( metaTag.length ); + } + + return html; +} + export function getPasteEventData( { clipboardData } ) { let plainText = ''; let html = ''; @@ -24,6 +69,12 @@ export function getPasteEventData( { clipboardData } ) { } } + // Remove Windows-specific metadata appended within copied HTML text. + html = removeWindowsFragments( html ); + + // Strip meta tag. + html = removeCharsetMetaTag( html ); + const files = getFilesFromDataTransfer( clipboardData ); if ( From f06e1a8ad70910499b2113ce65a3f9a3bf97864a Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 4 Oct 2023 21:40:05 +0400 Subject: [PATCH 03/13] Migrate 'Global styles sidebar' test to Playwright (#55045) * Migrate 'Global styles sidebar' test to Playwright * Remove old test file --- .../site-editor/global-styles-sidebar.test.js | 45 ----------------- .../site-editor/global-styles-sidebar.spec.js | 49 +++++++++++++++++++ 2 files changed, 49 insertions(+), 45 deletions(-) delete mode 100644 packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js create mode 100644 test/e2e/specs/site-editor/global-styles-sidebar.spec.js diff --git a/packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js b/packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js deleted file mode 100644 index d833926c88001b..00000000000000 --- a/packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * WordPress dependencies - */ -import { - deleteAllTemplates, - activateTheme, - visitSiteEditor, - enterEditMode, - toggleGlobalStyles, - openGlobalStylesPanel, -} from '@wordpress/e2e-test-utils'; - -describe( 'Global styles sidebar', () => { - beforeAll( async () => { - await activateTheme( 'emptytheme' ); - await Promise.all( [ - deleteAllTemplates( 'wp_template' ), - deleteAllTemplates( 'wp_template_part' ), - ] ); - } ); - afterAll( async () => { - await Promise.all( [ - deleteAllTemplates( 'wp_template' ), - deleteAllTemplates( 'wp_template_part' ), - ] ); - await activateTheme( 'twentytwentyone' ); - } ); - beforeEach( async () => { - await visitSiteEditor(); - await enterEditMode(); - } ); - describe( 'blocks list', () => { - it( 'should filter results properly', async () => { - await toggleGlobalStyles(); - await openGlobalStylesPanel( 'Blocks' ); - await page.focus( '.edit-site-block-types-search input' ); - await page.keyboard.type( 'heading' ); - const results = await page.$$( - '.edit-site-block-types-item-list div[role="listitem"]' - ); - // Matches both Heading and Table of Contents blocks. (The latter contains "heading" in its description.) - expect( results.length ).toEqual( 2 ); - } ); - } ); -} ); diff --git a/test/e2e/specs/site-editor/global-styles-sidebar.spec.js b/test/e2e/specs/site-editor/global-styles-sidebar.spec.js new file mode 100644 index 00000000000000..02717f1b194327 --- /dev/null +++ b/test/e2e/specs/site-editor/global-styles-sidebar.spec.js @@ -0,0 +1,49 @@ +/** + * WordPress dependencies + */ +const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); + +test.describe( 'Global styles sidebar', () => { + test.beforeAll( async ( { requestUtils } ) => { + await requestUtils.activateTheme( 'emptytheme' ); + } ); + + test.afterAll( async ( { requestUtils } ) => { + await requestUtils.activateTheme( 'twentytwentyone' ); + } ); + + test.beforeEach( async ( { admin, editor } ) => { + await admin.visitSiteEditor( { + postId: 'emptytheme//index', + postType: 'wp_template', + } ); + await editor.canvas.click( 'body' ); + } ); + + test( 'should filter blocks list results', async ( { page } ) => { + // Navigate to Styles -> Blocks. + await page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { name: 'Styles' } ) + .click(); + await page + .getByRole( 'region', { name: 'Editor settings' } ) + .getByRole( 'button', { name: 'Blocks styles' } ) + .click(); + + await page + .getByRole( 'searchbox', { name: 'Search for blocks' } ) + .fill( 'heading' ); + + // Matches both Heading and Table of Contents blocks. + // The latter contains "heading" in its description. + await expect( + page.getByRole( 'button', { name: 'Heading block styles' } ) + ).toBeVisible(); + await expect( + page.getByRole( 'button', { + name: 'Table of Contents block styles', + } ) + ).toBeVisible(); + } ); +} ); From cf08b629597121b3caa26156647c741a22b81648 Mon Sep 17 00:00:00 2001 From: Matias Ventura Date: Wed, 4 Oct 2023 19:54:44 +0200 Subject: [PATCH 04/13] Show confirmation dialog when moving a post to the trash (#50219) * Show confirmation dialog when moving a post to the trash * Update change detection e2e test --------- Co-authored-by: George Mamadashvili --- .../editor/various/change-detection.test.js | 1 + .../editor/src/components/post-trash/index.js | 45 ++++++++++++++----- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/packages/e2e-tests/specs/editor/various/change-detection.test.js b/packages/e2e-tests/specs/editor/various/change-detection.test.js index 32e51150945330..62057c4cbb2bc0 100644 --- a/packages/e2e-tests/specs/editor/various/change-detection.test.js +++ b/packages/e2e-tests/specs/editor/various/change-detection.test.js @@ -349,6 +349,7 @@ describe( 'Change detection', () => { // Trash post. await openDocumentSettingsSidebar(); await page.click( '.editor-post-trash.components-button' ); + await page.click( '.components-confirm-dialog .is-primary' ); await Promise.all( [ // Wait for "Saved" to confirm save complete. diff --git a/packages/editor/src/components/post-trash/index.js b/packages/editor/src/components/post-trash/index.js index 08628689fc1451..e775944b5d69ed 100644 --- a/packages/editor/src/components/post-trash/index.js +++ b/packages/editor/src/components/post-trash/index.js @@ -2,8 +2,12 @@ * WordPress dependencies */ import { __ } from '@wordpress/i18n'; -import { Button } from '@wordpress/components'; +import { + Button, + __experimentalConfirmDialog as ConfirmDialog, +} from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; +import { useState } from '@wordpress/element'; /** * Internal dependencies @@ -20,21 +24,40 @@ export default function PostTrash() { }; }, [] ); const { trashPost } = useDispatch( editorStore ); + const [ showConfirmDialog, setShowConfirmDialog ] = useState( false ); if ( isNew || ! postId ) { return null; } + const handleConfirm = () => { + setShowConfirmDialog( false ); + trashPost(); + }; + return ( - + <> + + setShowConfirmDialog( false ) } + > + { __( + 'Are you sure you want to move this post to the trash?' + ) } + + ); } From e0b5514836c53dd6ab0e4008c93a37c6fd259916 Mon Sep 17 00:00:00 2001 From: Ella <4710635+ellatrix@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:35:18 +0300 Subject: [PATCH 05/13] Rich text: avoid shortcode logic, adjust paste handler instead (#55052) --- package-lock.json | 2 -- packages/block-editor/package.json | 1 - .../src/components/rich-text/index.native.js | 13 -------- .../components/rich-text/use-paste-handler.js | 14 +------- .../src/components/rich-text/utils.js | 3 -- .../src/api/raw-handling/paste-handler.js | 33 +++++++++++-------- .../blocks-raw-handling.test.js.snap | 2 +- 7 files changed, 21 insertions(+), 47 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc0ac9a5d4bbda..55c2112fe38807 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56013,7 +56013,6 @@ "@wordpress/preferences": "file:../preferences", "@wordpress/private-apis": "file:../private-apis", "@wordpress/rich-text": "file:../rich-text", - "@wordpress/shortcode": "file:../shortcode", "@wordpress/style-engine": "file:../style-engine", "@wordpress/token-list": "file:../token-list", "@wordpress/url": "file:../url", @@ -69423,7 +69422,6 @@ "@wordpress/preferences": "file:../preferences", "@wordpress/private-apis": "file:../private-apis", "@wordpress/rich-text": "file:../rich-text", - "@wordpress/shortcode": "file:../shortcode", "@wordpress/style-engine": "file:../style-engine", "@wordpress/token-list": "file:../token-list", "@wordpress/url": "file:../url", diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json index 14a3bce7d84656..c1488675d546bc 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -59,7 +59,6 @@ "@wordpress/preferences": "file:../preferences", "@wordpress/private-apis": "file:../private-apis", "@wordpress/rich-text": "file:../rich-text", - "@wordpress/shortcode": "file:../shortcode", "@wordpress/style-engine": "file:../style-engine", "@wordpress/token-list": "file:../token-list", "@wordpress/url": "file:../url", diff --git a/packages/block-editor/src/components/rich-text/index.native.js b/packages/block-editor/src/components/rich-text/index.native.js index 67f41f9ae8c108..8c1afdd8903bd0 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -41,7 +41,6 @@ import { addActiveFormats, getMultilineTag, getAllowedFormats, - isShortcode, createLinkInParagraph, } from './utils'; import EmbedHandlerPicker from './embed-handler-picker'; @@ -417,18 +416,6 @@ function RichTextWrapper( let mode = onReplace && onSplit ? 'AUTO' : 'INLINE'; - // Force the blocks mode when the user is pasting - // on a new line & the content resembles a shortcode. - // Otherwise it's going to be detected as inline - // and the shortcode won't be replaced. - if ( - mode === 'AUTO' && - isEmpty( value ) && - isShortcode( plainText ) - ) { - mode = 'BLOCKS'; - } - const isPastedURL = isURL( plainText.trim() ); const presentEmbedHandlerPicker = () => embedHandlerPickerRef.current?.presentPicker( { diff --git a/packages/block-editor/src/components/rich-text/use-paste-handler.js b/packages/block-editor/src/components/rich-text/use-paste-handler.js index 23eb6fcd5808a7..5f3b93a0ecc0e9 100644 --- a/packages/block-editor/src/components/rich-text/use-paste-handler.js +++ b/packages/block-editor/src/components/rich-text/use-paste-handler.js @@ -14,7 +14,7 @@ import { isURL } from '@wordpress/url'; /** * Internal dependencies */ -import { addActiveFormats, isShortcode } from './utils'; +import { addActiveFormats } from './utils'; import { splitValue } from './split-value'; import { getPasteEventData } from '../../utils/pasting'; @@ -139,18 +139,6 @@ export function usePasteHandler( props ) { let mode = onReplace && onSplit ? 'AUTO' : 'INLINE'; - // Force the blocks mode when the user is pasting - // on a new line & the content resembles a shortcode. - // Otherwise it's going to be detected as inline - // and the shortcode won't be replaced. - if ( - mode === 'AUTO' && - isEmpty( value ) && - isShortcode( plainText ) - ) { - mode = 'BLOCKS'; - } - if ( __unstableEmbedURLOnPaste && isEmpty( value ) && diff --git a/packages/block-editor/src/components/rich-text/utils.js b/packages/block-editor/src/components/rich-text/utils.js index 2d6805776e3d2b..975e152ff81778 100644 --- a/packages/block-editor/src/components/rich-text/utils.js +++ b/packages/block-editor/src/components/rich-text/utils.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { regexp } from '@wordpress/shortcode'; import { renderToString } from '@wordpress/element'; import { createBlock } from '@wordpress/blocks'; @@ -43,8 +42,6 @@ export function getAllowedFormats( { allowedFormats, disableFormats } ) { getAllowedFormats.EMPTY_ARRAY = []; -export const isShortcode = ( text ) => regexp( '.*' ).test( text ); - /** * Creates a link from pasted URL. * Creates a paragraph block containing a link to the URL, and calls `onReplace`. diff --git a/packages/blocks/src/api/raw-handling/paste-handler.js b/packages/blocks/src/api/raw-handling/paste-handler.js index c4ad40e0b1f509..c63b207c1dbad6 100644 --- a/packages/blocks/src/api/raw-handling/paste-handler.js +++ b/packages/blocks/src/api/raw-handling/paste-handler.js @@ -121,17 +121,34 @@ export function pasteHandler( { HTML = HTML.normalize(); } - // Parse Markdown (and encoded HTML) if: + // Must be run before checking if it's inline content. + HTML = deepFilterHTML( HTML, [ slackParagraphCorrector ] ); + + // Consider plain text if: // * There is a plain text version. // * There is no HTML version, or it has no formatting. - if ( plainText && ( ! HTML || isPlain( HTML ) ) ) { + const isPlainText = plainText && ( ! HTML || isPlain( HTML ) ); + + // Parse Markdown (and encoded HTML) if it's considered plain text. + if ( isPlainText ) { HTML = plainText; // The markdown converter (Showdown) trims whitespace. if ( ! /^\s+$/.test( plainText ) ) { HTML = markdownConverter( HTML ); } + } + + // An array of HTML strings and block objects. The blocks replace matched + // shortcodes. + const pieces = shortcodeConverter( HTML ); + + // The call to shortcodeConverter will always return more than one element + // if shortcodes are matched. The reason is when shortcodes are matched + // empty HTML strings are included. + const hasShortcodes = pieces.length > 1; + if ( isPlainText && ! hasShortcodes ) { // Switch to inline mode if: // * The current mode is AUTO. // * The original plain text had no line breaks. @@ -151,18 +168,6 @@ export function pasteHandler( { return filterInlineHTML( HTML, preserveWhiteSpace ); } - // Must be run before checking if it's inline content. - HTML = deepFilterHTML( HTML, [ slackParagraphCorrector ] ); - - // An array of HTML strings and block objects. The blocks replace matched - // shortcodes. - const pieces = shortcodeConverter( HTML ); - - // The call to shortcodeConverter will always return more than one element - // if shortcodes are matched. The reason is when shortcodes are matched - // empty HTML strings are included. - const hasShortcodes = pieces.length > 1; - if ( mode === 'AUTO' && ! hasShortcodes && diff --git a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap index 178a57b8755535..121382d942f268 100644 --- a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap +++ b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap @@ -68,7 +68,7 @@ exports[`Blocks raw handling pasteHandler should strip windows data 1`] = ` " `; -exports[`Blocks raw handling pasteHandler slack-paragraphs 1`] = `"test with link
a new linea new paragraph
another new lineanother paragraph"`; +exports[`Blocks raw handling pasteHandler slack-paragraphs 1`] = `"test with link
a new line

a new paragraph
another new line

another paragraph"`; exports[`Blocks raw handling pasteHandler slack-quote 1`] = `"Test with link."`; From 41e996300a41b7dd14e5339384a9153a7f8cf238 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 4 Oct 2023 13:47:02 -0700 Subject: [PATCH 06/13] Add some @types packages as proper dependencies of @wordpress/components (#50231) * Move a couple @types packages to packages/components/package.json --- package-lock.json | 32 +++++++++++++-------------- package.json | 2 -- packages/components/CHANGELOG.md | 1 + packages/components/package.json | 2 ++ packages/components/src/text/types.ts | 3 ++- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 55c2112fe38807..d4ed57f012c0fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "hasInstallScript": true, "license": "GPL-2.0-or-later", "dependencies": { - "@types/gradient-parser": "0.1.2", "@wordpress/a11y": "file:packages/a11y", "@wordpress/annotations": "file:packages/annotations", "@wordpress/api-fetch": "file:packages/api-fetch", @@ -114,7 +113,6 @@ "@testing-library/user-event": "14.4.3", "@types/eslint": "7.28.0", "@types/estree": "0.0.50", - "@types/highlight-words-core": "1.2.1", "@types/istanbul-lib-report": "3.0.0", "@types/mime": "2.0.3", "@types/npm-package-arg": "6.1.1", @@ -14375,11 +14373,6 @@ "@types/node": "*" } }, - "node_modules/@types/gradient-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@types/gradient-parser/-/gradient-parser-0.1.2.tgz", - "integrity": "sha512-e2s1svCYJY8JDr2t/OoB/H4aWZy4sXUOAZ0NdSSHjKACw1jeU54gf4xj38di0AgVIObgzN1JSikJ5oSo3vxwgA==" - }, "node_modules/@types/hammerjs": { "version": "2.0.41", "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz", @@ -14388,8 +14381,7 @@ "node_modules/@types/highlight-words-core": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@types/highlight-words-core/-/highlight-words-core-1.2.1.tgz", - "integrity": "sha512-9VZUA5omXBfn+hDxFjUDu1FOJTBM3LmvqfDey+Z6Aa8B8/JmF5SMj6FBrjfgJ/Q3YXOZd3qyTDfJyMZSs/wCUA==", - "dev": true + "integrity": "sha512-9VZUA5omXBfn+hDxFjUDu1FOJTBM3LmvqfDey+Z6Aa8B8/JmF5SMj6FBrjfgJ/Q3YXOZd3qyTDfJyMZSs/wCUA==" }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", @@ -56222,6 +56214,8 @@ "@emotion/utils": "^1.0.0", "@floating-ui/react-dom": "^2.0.1", "@radix-ui/react-dropdown-menu": "2.0.4", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", "@wordpress/a11y": "file:../a11y", "@wordpress/compose": "file:../compose", @@ -56317,6 +56311,11 @@ "react-dom": ">=16.8.0" } }, + "packages/components/node_modules/@types/gradient-parser": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@types/gradient-parser/-/gradient-parser-0.1.3.tgz", + "integrity": "sha512-XDbrTSBlQV9nxE1GiDL3FaOPy4G/KaJkhDutBX48Kg8CYZMBARyyDFGCWfWJn4pobmInmwud1xxH7VJMAr0CKQ==" + }, "packages/components/node_modules/framer-motion": { "version": "10.13.0", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.13.0.tgz", @@ -68262,11 +68261,6 @@ "@types/node": "*" } }, - "@types/gradient-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@types/gradient-parser/-/gradient-parser-0.1.2.tgz", - "integrity": "sha512-e2s1svCYJY8JDr2t/OoB/H4aWZy4sXUOAZ0NdSSHjKACw1jeU54gf4xj38di0AgVIObgzN1JSikJ5oSo3vxwgA==" - }, "@types/hammerjs": { "version": "2.0.41", "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz", @@ -68275,8 +68269,7 @@ "@types/highlight-words-core": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@types/highlight-words-core/-/highlight-words-core-1.2.1.tgz", - "integrity": "sha512-9VZUA5omXBfn+hDxFjUDu1FOJTBM3LmvqfDey+Z6Aa8B8/JmF5SMj6FBrjfgJ/Q3YXOZd3qyTDfJyMZSs/wCUA==", - "dev": true + "integrity": "sha512-9VZUA5omXBfn+hDxFjUDu1FOJTBM3LmvqfDey+Z6Aa8B8/JmF5SMj6FBrjfgJ/Q3YXOZd3qyTDfJyMZSs/wCUA==" }, "@types/html-minifier-terser": { "version": "6.1.0", @@ -69576,6 +69569,8 @@ "@emotion/utils": "^1.0.0", "@floating-ui/react-dom": "^2.0.1", "@radix-ui/react-dropdown-menu": "2.0.4", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", "@wordpress/a11y": "file:../a11y", "@wordpress/compose": "file:../compose", @@ -69648,6 +69643,11 @@ "@floating-ui/dom": "^1.3.0" } }, + "@types/gradient-parser": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@types/gradient-parser/-/gradient-parser-0.1.3.tgz", + "integrity": "sha512-XDbrTSBlQV9nxE1GiDL3FaOPy4G/KaJkhDutBX48Kg8CYZMBARyyDFGCWfWJn4pobmInmwud1xxH7VJMAr0CKQ==" + }, "framer-motion": { "version": "10.13.0", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.13.0.tgz", diff --git a/package.json b/package.json index b5eee1c26704cf..7fab93a80d580f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,6 @@ "IS_GUTENBERG_PLUGIN": true }, "dependencies": { - "@types/gradient-parser": "0.1.2", "@wordpress/a11y": "file:packages/a11y", "@wordpress/annotations": "file:packages/annotations", "@wordpress/api-fetch": "file:packages/api-fetch", @@ -126,7 +125,6 @@ "@testing-library/user-event": "14.4.3", "@types/eslint": "7.28.0", "@types/estree": "0.0.50", - "@types/highlight-words-core": "1.2.1", "@types/istanbul-lib-report": "3.0.0", "@types/mime": "2.0.3", "@types/npm-package-arg": "6.1.1", diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 42ba2a8fc9c9d6..b29e40ba900d9c 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -31,6 +31,7 @@ - `ContextSystemProvider`: Move out of `ui/` ([#54847](https://github.com/WordPress/gutenberg/pull/54847)). - `SlotFill`: Migrate to TypeScript and Convert to Functional Component ``. ([#51350](https://github.com/WordPress/gutenberg/pull/51350)). - `Components`: move `ui/utils` to `utils` and remove `ui/` folder ([#54922](https://github.com/WordPress/gutenberg/pull/54922)). +- Ensure `@types/` dependencies used by final type files are included in the main dependency field ([#50231](https://github.com/WordPress/gutenberg/pull/50231)). ## 25.8.0 (2023-09-20) diff --git a/packages/components/package.json b/packages/components/package.json index 805b105e4934d7..926f99de3c6278 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -40,6 +40,8 @@ "@emotion/utils": "^1.0.0", "@floating-ui/react-dom": "^2.0.1", "@radix-ui/react-dropdown-menu": "2.0.4", + "@types/gradient-parser": "0.1.3", + "@types/highlight-words-core": "1.2.1", "@use-gesture/react": "^10.2.24", "@wordpress/a11y": "file:../a11y", "@wordpress/compose": "file:../compose", diff --git a/packages/components/src/text/types.ts b/packages/components/src/text/types.ts index 05b1488cd8c6ff..df60f4ee0e2d7b 100644 --- a/packages/components/src/text/types.ts +++ b/packages/components/src/text/types.ts @@ -7,6 +7,7 @@ import type { TruncateProps } from '../truncate/types'; * External dependencies */ import type { CSSProperties } from 'react'; +import type { FindAllArgs } from 'highlight-words-core'; export type TextSize = | 'body' @@ -59,7 +60,7 @@ export interface Props extends TruncateProps { /** * Array of search words. String search terms are automatically cast to RegExps unless `highlightEscape` is true. */ - highlightSanitize?: import('highlight-words-core').FindAllArgs[ 'sanitize' ]; + highlightSanitize?: FindAllArgs[ 'sanitize' ]; /** * Sets `Text` to have `display: block`. */ From 61a2517c50034dc4c75c47a106bf28adb2deeb0e Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 4 Oct 2023 21:24:09 +0000 Subject: [PATCH 07/13] Bump plugin version to 16.8.0-rc.1 --- gutenberg.php | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index ea22c8c7ad82d8..eea2231a57183a 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -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.2 * Requires PHP: 7.0 - * Version: 16.7.0 + * Version: 16.8.0-rc.1 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index d4ed57f012c0fe..8147f4027d7870 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gutenberg", - "version": "16.7.0", + "version": "16.8.0-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gutenberg", - "version": "16.7.0", + "version": "16.8.0-rc.1", "hasInstallScript": true, "license": "GPL-2.0-or-later", "dependencies": { diff --git a/package.json b/package.json index 7fab93a80d580f..8dc209f87351ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "16.7.0", + "version": "16.8.0-rc.1", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", From 7741cc25b78d4301b69506162a462511858a3f85 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 4 Oct 2023 22:12:59 +0000 Subject: [PATCH 08/13] Update Changelog for 16.8.0-rc.1 --- changelog.txt | 286 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) diff --git a/changelog.txt b/changelog.txt index 67f16cbcb90266..25b25bfa296f36 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,291 @@ == Changelog == += 16.8.0-rc.1 = + +## Changelog + +### Features + +#### Block Editor +- Adds 'nofollow' setting to Button block. ([54110](https://github.com/WordPress/gutenberg/pull/54110)) + +#### Site Editor +- Add 'Show template' toggle when editing pages. ([52674](https://github.com/WordPress/gutenberg/pull/52674)) + + +### Enhancements + +- Update pattern import menu item. ([54782](https://github.com/WordPress/gutenberg/pull/54782)) + +#### Components +- Adding label/description to `BlockEditor/DuotoneControl`. ([54473](https://github.com/WordPress/gutenberg/pull/54473)) +- Deprecating `isPressed` in `Button` component. ([54740](https://github.com/WordPress/gutenberg/pull/54740)) +- Follow ariakit best practices. ([54696](https://github.com/WordPress/gutenberg/pull/54696)) +- InputControl-based components: Add opt-in prop for next 40px default size. ([53819](https://github.com/WordPress/gutenberg/pull/53819)) +- Modal: Add `contentWidth` prop to support a selection of preset modal sizes. ([54471](https://github.com/WordPress/gutenberg/pull/54471)) +- Remove unused components from `ui/`. ([54573](https://github.com/WordPress/gutenberg/pull/54573)) +- Update ariakit to 0.3.3. ([54818](https://github.com/WordPress/gutenberg/pull/54818)) +- Update compact search control metrics. ([54663](https://github.com/WordPress/gutenberg/pull/54663)) +- Wrapped `TextareaControl` in a `forwardRef` call. ([54975](https://github.com/WordPress/gutenberg/pull/54975)) + +#### Block Library +- Add a brief description to the Footnotes block. ([54613](https://github.com/WordPress/gutenberg/pull/54613)) +- Footnotes: Use core’s meta revisioning if available. ([52988](https://github.com/WordPress/gutenberg/pull/52988)) +- Login/out: Add spacing support. ([45147](https://github.com/WordPress/gutenberg/pull/45147)) +- Query view.js: Code quality. ([54982](https://github.com/WordPress/gutenberg/pull/54982)) +- Set custom color when applying initial background image. ([54054](https://github.com/WordPress/gutenberg/pull/54054)) +- Use `wp_get_inline_script_tag()` in `build_dropdown_script_block_core_categories()`. ([54637](https://github.com/WordPress/gutenberg/pull/54637)) + +#### Block Editor +- Default suggested links to pages. ([54622](https://github.com/WordPress/gutenberg/pull/54622)) +- Remove base URL from link control search results. ([54553](https://github.com/WordPress/gutenberg/pull/54553)) +- Simplify `BlockHTMLConvertButton`. ([54972](https://github.com/WordPress/gutenberg/pull/54972)) +- Update strings in blocks 'RenameModal' component. ([54887](https://github.com/WordPress/gutenberg/pull/54887)) + +#### Post Editor +- Edit Post: Use hooks instead of HoCs in 'PostStatus' components. ([54951](https://github.com/WordPress/gutenberg/pull/54951)) +- Editor: Use hooks instead of HoCs in 'PostSticky' components. ([54949](https://github.com/WordPress/gutenberg/pull/54949)) +- Editor: Use hooks instead of HoCs in 'PostSwitchToDraftButton'. ([54695](https://github.com/WordPress/gutenberg/pull/54695)) +- Show confirmation dialog when moving a post to the trash. ([50219](https://github.com/WordPress/gutenberg/pull/50219)) + +#### Site Editor +- Add template replace flow to template inspector. ([54609](https://github.com/WordPress/gutenberg/pull/54609)) +- [Site Editor]: Update copy of using the default template in a page. ([54728](https://github.com/WordPress/gutenberg/pull/54728)) + +#### Patterns +- Remove category description in inserter panel. ([54894](https://github.com/WordPress/gutenberg/pull/54894)) + +#### Typography +- Font Library: Refactor endpoint permissions. ([54829](https://github.com/WordPress/gutenberg/pull/54829)) + + +### Bug Fixes + +- Fix the ShortcutProvider usage. ([54851](https://github.com/WordPress/gutenberg/pull/54851)) +- Fix warning when a template calls a template area twice. ([54861](https://github.com/WordPress/gutenberg/pull/54861)) +- Revert "Fix warning when a template calls a template area twice". ([54926](https://github.com/WordPress/gutenberg/pull/54926)) + +#### Block Library +- All Nav block items to break long titles. ([54866](https://github.com/WordPress/gutenberg/pull/54866)) +- Fallback to Twitter provider when embedding X URLs. ([54876](https://github.com/WordPress/gutenberg/pull/54876)) +- Fix Deleted Navigation Menu warning string. ([55033](https://github.com/WordPress/gutenberg/pull/55033)) +- Fix Search Block not updating in Nav block. ([54823](https://github.com/WordPress/gutenberg/pull/54823)) +- Fix left and right aligmnent in children of Post Template. ([54997](https://github.com/WordPress/gutenberg/pull/54997)) +- Fix output of Navigation block classnames in the editor. ([54992](https://github.com/WordPress/gutenberg/pull/54992)) +- Fix overwriting of published post meta when previewing footnote changes. ([54339](https://github.com/WordPress/gutenberg/pull/54339)) +- Image: Ensure Expand on Click toggle is shown if block-level lightbox setting exists. ([54878](https://github.com/WordPress/gutenberg/pull/54878)) +- Image: Fix layout shift when lightbox is opened and closed. ([53026](https://github.com/WordPress/gutenberg/pull/53026)) +- Media & Text: Fix React warning. ([55038](https://github.com/WordPress/gutenberg/pull/55038)) +- Search block: Allow space for input field only when form expanded. ([54846](https://github.com/WordPress/gutenberg/pull/54846)) +- Search block: Update alignment and icon button width. ([54773](https://github.com/WordPress/gutenberg/pull/54773)) + +#### Site Editor +- Avoid same key warnings in template parts area listings. ([54863](https://github.com/WordPress/gutenberg/pull/54863)) +- Avoid stale navigation block values when parsing entity record. ([54996](https://github.com/WordPress/gutenberg/pull/54996)) +- Don't display the navigation section in template parts details when a menu is missing. ([54993](https://github.com/WordPress/gutenberg/pull/54993)) +- Fix ToolSelector popover variant. ([54840](https://github.com/WordPress/gutenberg/pull/54840)) +- Reset 'Show template' toggle when leaving edit mode. ([54679](https://github.com/WordPress/gutenberg/pull/54679)) +- remove `overflow: Hidden` from the entity title in the site editor sidebar. ([54769](https://github.com/WordPress/gutenberg/pull/54769)) + +#### Components +- FormTokenField: Add `box-sizing` reset style and reset default padding. ([54734](https://github.com/WordPress/gutenberg/pull/54734)) +- Popover: Fix the styles for components that use emotion within popovers. ([54912](https://github.com/WordPress/gutenberg/pull/54912)) +- Remove hover style for secondary Button when aria-disabled is set. ([54978](https://github.com/WordPress/gutenberg/pull/54978)) +- Reverting addition of `aria-selected` style hook in `Button`. ([54931](https://github.com/WordPress/gutenberg/pull/54931)) +- `SlotFill`: Pass `Component` instance to unregisterSlot. ([54765](https://github.com/WordPress/gutenberg/pull/54765)) + +#### Block Editor +- Avoid double-wrapping selectors when transforming the styles. ([54981](https://github.com/WordPress/gutenberg/pull/54981)) +- [Inserter]: Fix reset of registered media categories. ([55012](https://github.com/WordPress/gutenberg/pull/55012)) + +#### Typography +- Font Library: Changed the OTF mime type expected value to be what PHP returns. ([54886](https://github.com/WordPress/gutenberg/pull/54886)) +- Font Library: Move font uploads to a new tab. ([54655](https://github.com/WordPress/gutenberg/pull/54655)) + +#### Global Styles +- Block custom CSS: Fix incorrect CSS when multiple root selectors. ([53602](https://github.com/WordPress/gutenberg/pull/53602)) +- Image: Ensure `false` values are preserved in memory when defined in `theme.json`. ([54639](https://github.com/WordPress/gutenberg/pull/54639)) + +#### List View +- Fix performance issue when selecting all blocks. ([54900](https://github.com/WordPress/gutenberg/pull/54900)) + +#### Colors +- Format Library: Try to fix highlight popover jumping. ([54736](https://github.com/WordPress/gutenberg/pull/54736)) + +#### Interactivity API +- Image: Fix duotone not being applied to lightbox image. ([54670](https://github.com/WordPress/gutenberg/pull/54670)) + + +### Accessibility + +#### Block Library +- Footnotes: Add aria-label to return links. ([54843](https://github.com/WordPress/gutenberg/pull/54843)) +- Table of contents block accessibility improvements. ([54322](https://github.com/WordPress/gutenberg/pull/54322)) + +#### Components +- HTML block: Fix accessibility issues on back-end. ([54408](https://github.com/WordPress/gutenberg/pull/54408)) +- `Modal`: Accessibly hide/show outer modal when nested. ([54743](https://github.com/WordPress/gutenberg/pull/54743)) + +#### Patterns +- Use list role instead of listbox in patterns list. ([54884](https://github.com/WordPress/gutenberg/pull/54884)) + +#### Post Editor +- Editor: Always render the 'Switch to Draft' button to avoid focus loss. ([54722](https://github.com/WordPress/gutenberg/pull/54722)) + +#### Block Editor +- Block Switcher: Use a different label for multi-selection. ([54692](https://github.com/WordPress/gutenberg/pull/54692)) + + +### Performance + +- Tests: Support the Site Editor's legacy spinner. ([54784](https://github.com/WordPress/gutenberg/pull/54784)) +- Use instanceOf over property_exists. ([54835](https://github.com/WordPress/gutenberg/pull/54835)) + +#### Block Editor +- Subscribe only to block editor store in `useBlockSync`. ([55041](https://github.com/WordPress/gutenberg/pull/55041)) + + +### Experiments + +#### Site Editor +- al]: First version of pages list in site editor. ([54966](https://github.com/WordPress/gutenberg/pull/54966)) + +#### Block Editor +- Expose `getDuotoneFilter()` as private API. ([54905](https://github.com/WordPress/gutenberg/pull/54905)) + + +### Documentation + +- Add a documentation page about the block editor settings. ([54870](https://github.com/WordPress/gutenberg/pull/54870)) +- Add a page about the format library to the platform documentation site. ([55037](https://github.com/WordPress/gutenberg/pull/55037)) +- Docs: Add a callout to the `wp-now` documentation to mention it's still experimental. ([55044](https://github.com/WordPress/gutenberg/pull/55044)) +- Docs: Remove outdated info. ([54707](https://github.com/WordPress/gutenberg/pull/54707)) +- Docs: Remove the Full Site Editing doc. ([54516](https://github.com/WordPress/gutenberg/pull/54516)) +- Docs: Rename Block Hooks handbook page to Block Filters. ([54862](https://github.com/WordPress/gutenberg/pull/54862)) +- Document the current state of the Real-Time collaboration experiment. ([54932](https://github.com/WordPress/gutenberg/pull/54932)) +- Fix a broken MD link in callout. ([54772](https://github.com/WordPress/gutenberg/pull/54772)) +- Platform Docs: Add a documentation page explaining how to use the block library. ([54967](https://github.com/WordPress/gutenberg/pull/54967)) +- Update the documentation of the block editor and replace @wordpress/element with react. ([54908](https://github.com/WordPress/gutenberg/pull/54908)) +- Update versions in WP for 6.4. ([54890](https://github.com/WordPress/gutenberg/pull/54890)) + + +### Code Quality + +- Add a unit test for the "ValidBlockLibraryFunctionNameSniff" sniff. ([53928](https://github.com/WordPress/gutenberg/pull/53928)) +- Move dependencies to the right place. ([54597](https://github.com/WordPress/gutenberg/pull/54597)) +- Move mime-type collection generation to a function that can be tested…. ([54844](https://github.com/WordPress/gutenberg/pull/54844)) +- Post Title block should use esc_url(). ([53981](https://github.com/WordPress/gutenberg/pull/53981)) +- Rich text: Use getPasteEventData. ([55048](https://github.com/WordPress/gutenberg/pull/55048)) +- Writing flow: Absorb clipboard handler. ([55006](https://github.com/WordPress/gutenberg/pull/55006)) + +#### Block Library +- Footnotes: Avoid regexes in entity provider. ([54505](https://github.com/WordPress/gutenberg/pull/54505)) +- Image Block: Fix browser console error when clicking "Expand on Click". ([54938](https://github.com/WordPress/gutenberg/pull/54938)) +- Removed unwanted space from the string. ([54654](https://github.com/WordPress/gutenberg/pull/54654)) +- Update CODEOWNERS for `core/image` block. ([54793](https://github.com/WordPress/gutenberg/pull/54793)) + +#### Patterns +- Add a new spec for for adding an unsynced pattern. ([54892](https://github.com/WordPress/gutenberg/pull/54892)) +- Add end-to-end tests for filtering and searching patterns. ([54906](https://github.com/WordPress/gutenberg/pull/54906)) +- Add new end-to-end test for creating a pattern. ([54855](https://github.com/WordPress/gutenberg/pull/54855)) +- Include pattern category in main end-to-end critical path test. ([54923](https://github.com/WordPress/gutenberg/pull/54923)) + +#### Components +- Consolidate utils to remove `ui/`. ([54922](https://github.com/WordPress/gutenberg/pull/54922)) +- Move `ContextSystemProvider` out of `/ui`. ([54847](https://github.com/WordPress/gutenberg/pull/54847)) +- SlotFill: Migrate to Typescript. ([51350](https://github.com/WordPress/gutenberg/pull/51350)) +- Tidying `CircularOptionPicker.Option`. ([54903](https://github.com/WordPress/gutenberg/pull/54903)) + +#### Typography +- Font Library: Syntax refactor repace strpos with str_contains. ([54832](https://github.com/WordPress/gutenberg/pull/54832)) +- Font Library: Use snake_case instead of camelCase on fontFamilies endpoint param. ([54977](https://github.com/WordPress/gutenberg/pull/54977)) + +#### Block Editor +- Rich text: Avoid shortcode logic, adjust paste handler instead. ([55052](https://github.com/WordPress/gutenberg/pull/55052)) + +#### Plugin +- Remove legacy logic for '__unstableResolvedAssets' setting. ([54812](https://github.com/WordPress/gutenberg/pull/54812)) + +#### Data Layer +- createResolversCacheMiddleware: Remove dependency on core/data store. ([54733](https://github.com/WordPress/gutenberg/pull/54733)) + +#### Site Editor +- Use constants rather than hard coded template strings (round 3). ([54705](https://github.com/WordPress/gutenberg/pull/54705)) + + +### Tools + +- Label enforcer workflow: Make accessibility a focus instead of a type. ([54941](https://github.com/WordPress/gutenberg/pull/54941)) +- Scripts: Update webpack and related dependencies to the latest version. ([54657](https://github.com/WordPress/gutenberg/pull/54657)) +- Update changelog automation and test fixtures to match the last a11y label renaming. ([54974](https://github.com/WordPress/gutenberg/pull/54974)) + +#### Testing +- Don’t use TypeScript files in scripts package. ([54856](https://github.com/WordPress/gutenberg/pull/54856)) +- ESLint: Update eslint-plugin-testing-library to v6. ([54910](https://github.com/WordPress/gutenberg/pull/54910)) +- Fix end-to-end test: ”WP Editor Meta Boxes > Should save the changes”. ([51884](https://github.com/WordPress/gutenberg/pull/51884)) +- Font Library: Avoid deprected error in test. ([54802](https://github.com/WordPress/gutenberg/pull/54802)) +- Make `editor.getBlocks` to return only testing-related properties. ([54901](https://github.com/WordPress/gutenberg/pull/54901)) +- Migrate 'Global styles sidebar' test to Playwright. ([55045](https://github.com/WordPress/gutenberg/pull/55045)) +- Migrate 'iframed block editor settings styles' tests to Playwright. ([55014](https://github.com/WordPress/gutenberg/pull/55014)) +- Migrate 'iframed inline styles' tests to Playwright. ([55009](https://github.com/WordPress/gutenberg/pull/55009)) +- Migrate 'iframed masonry block' tests to Playwright. ([55016](https://github.com/WordPress/gutenberg/pull/55016)) +- Migrate 'iframed multiple block stylesheets' tests to Playwright. ([55003](https://github.com/WordPress/gutenberg/pull/55003)) +- Migrate keyboard-navigable-blocks end-to-end tests from puppeteer to playwright. ([54944](https://github.com/WordPress/gutenberg/pull/54944)) +- Scripts: Properly use CommonJS for default Playwright configuration. ([54988](https://github.com/WordPress/gutenberg/pull/54988)) +- Try fixing the flaky 'Toolbar roving tabindex' end-to-end test. ([54785](https://github.com/WordPress/gutenberg/pull/54785)) +- end-to-end Tests: Revert temporary fixes. ([54865](https://github.com/WordPress/gutenberg/pull/54865)) +- end-to-end Utils: Allow overriding username/password. ([53267](https://github.com/WordPress/gutenberg/pull/53267)) + +#### Build Tooling +- Add some @types packages as proper dependencies. ([50231](https://github.com/WordPress/gutenberg/pull/50231)) +- Update the default JSX pragma to React instead of @wordpress/element. ([54494](https://github.com/WordPress/gutenberg/pull/54494)) +- Upgrade wp-prettier to v3.0.3 (final). ([54775](https://github.com/WordPress/gutenberg/pull/54775)) + + +### Security + +#### Data Layer +- Replace turbo-combine-reducers with combineReducers from Redux. ([54606](https://github.com/WordPress/gutenberg/pull/54606)) + + +### Various + +- (chore) Revert the 16.7 RC2 release in order to release it again due to wrong changelog. ([54744](https://github.com/WordPress/gutenberg/pull/54744)) + +#### Design Tools +- Background image block support: Add tests, adjust injection logic slightly. ([54489](https://github.com/WordPress/gutenberg/pull/54489)) +- Background support: Backport fix for undefined array key. ([54850](https://github.com/WordPress/gutenberg/pull/54850)) + +#### Typography +- Revert "Font Library: Avoid rendering font library ui outisde gutenberg plugin". ([54947](https://github.com/WordPress/gutenberg/pull/54947)) + +#### Commands +- Make the reset styles command consistent. ([54841](https://github.com/WordPress/gutenberg/pull/54841)) + +#### Patterns +- Use "Not synced" in place of "Standard" nomenclature for patterns. ([54839](https://github.com/WordPress/gutenberg/pull/54839)) + +#### Block Editor +- Simplify BlockPatternsSyncFilter with clearer labels and additional context. ([54838](https://github.com/WordPress/gutenberg/pull/54838)) + +#### Site Editor +- Use consistent capitalization for template parts in Site Editor constants. ([54709](https://github.com/WordPress/gutenberg/pull/54709)) + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @leemyongpakvn: Fix a broken MD link in callout. ([54772](https://github.com/WordPress/gutenberg/pull/54772)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @adamsilverstein @alexstine @andrewhayward @andrewserong @annezazu @anton-vlasenko @artemiomorales @aurooba @bangank36 @brookewp @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @dcalhoun @derekblank @draganescu @ellatrix @fluiddot @fullofcaffeine @geriux @getdave @glendaviesnz @gziolo @jameskoster @jeryj @jsnajdr @juhi123 @kevin940726 @leemyongpakvn @madhusudhand @MaggieCabrera @Mamaduka @matiasbenedetto @michalczaplinski @mirka @mtias @mujuonly @ndiego @noahtallen @noisysocks @ntsekouras @oandregal @ockham @pbking @priethor @ramonjd @richtabor @scruffian @SiobhyB @spacedmonkey @stokesman @swissspidy @t-hamano @tellthemachines @tellyworth @them-es @torounit @tyxla @westonruter @WunderBart @youknowriad + + = 16.7.0 = ## Changelog From 827f10bbc0c46be119e8c23b85fd887cda32099d Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Thu, 5 Oct 2023 08:22:00 +0900 Subject: [PATCH 09/13] Block Style: Display default style labels correctly in the block sidebar (#55008) --- packages/block-editor/src/components/block-styles/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/block-styles/index.js b/packages/block-editor/src/components/block-styles/index.js index b998614e4b0892..f598b35f890f15 100644 --- a/packages/block-editor/src/components/block-styles/index.js +++ b/packages/block-editor/src/components/block-styles/index.js @@ -14,7 +14,6 @@ import { Popover, } from '@wordpress/components'; import deprecated from '@wordpress/deprecated'; -import { __ } from '@wordpress/i18n'; /** * Internal dependencies @@ -65,9 +64,7 @@ function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
{ stylesToRender.map( ( style ) => { - const buttonText = style.isDefault - ? __( 'Default' ) - : style.label || style.name; + const buttonText = style.label || style.name; return (