From 936068f5ad0f8fc96d3f42902f83b3c1e7435ba7 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 26 Jan 2022 09:56:41 +0100 Subject: [PATCH 01/14] Document the Global Styles Presets (#38129) --- .../themes/block-theme-overview.md | 4 ++ .../themes/create-block-theme.md | 40 ++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/how-to-guides/themes/block-theme-overview.md b/docs/how-to-guides/themes/block-theme-overview.md index 16812bed7f572a..a123358ef335ce 100644 --- a/docs/how-to-guides/themes/block-theme-overview.md +++ b/docs/how-to-guides/themes/block-theme-overview.md @@ -27,6 +27,10 @@ theme |__ footer.html |__ sidebar.html |__ ... +|__ styles + |__ red.json + |__ blue.json + |__ ... ``` The difference with existing WordPress themes is that the different templates in the template hierarchy, and template parts, are block templates instead of php files. In addition, this example includes a [`theme.json`](/docs/how-to-guides/themes/theme-json.md) file for some styles. diff --git a/docs/how-to-guides/themes/create-block-theme.md b/docs/how-to-guides/themes/create-block-theme.md index cc3c399d329878..68f57ce298ccb4 100644 --- a/docs/how-to-guides/themes/create-block-theme.md +++ b/docs/how-to-guides/themes/create-block-theme.md @@ -13,7 +13,8 @@ Block themes require WordPress 5.9. To use block themes in earlier versions of W 3. [Creating the templates and template parts](#creating-the-templates-and-template-parts) 4. [Theme.json - Global styles](#themejson---global-styles) 5. [Custom templates](#custom-templates) -6. [Example themes](#example-themes) +6. [Global styles presets](#global-styles-presets) +7. [Example themes](#example-themes) ## What is needed to create a block theme? @@ -27,6 +28,7 @@ inside a folder called `templates`. The theme may optionally include a `functions.php` file and a [theme.json file](/docs/how-to-guides/themes/theme-json.md) to manage global styles. Template parts are optional. If they are included they must be placed inside a `parts` folder. +The theme may optionally include a `styles` folder to provide [global styles presets](#global-styles-presets). File structure: @@ -43,6 +45,10 @@ theme |__ header.html |__ footer.html |__ ... +|__ styles + |__ red.json + |__ blue.json + |__ ... ``` ## Theme setup @@ -840,6 +846,38 @@ The key is `postTypes`, followed by the name of the post type: ] ``` +## Global styles presets + +In addition to the default theme.json file, Block Themes can define multiple global styles presets for users to pick from. For example, a theme author might provide multiple theme color variations for the theme. + +To provide a global styles preset, themes can add multiple JSON files inside their `/styles` folder. Each one of these JSON file is a mini theme.json file containing `styles` and/or `settings` that overrides any of the default `theme.json` file settings or styles. + +**Example** + +```json +// styles/red.json +{ + styles: { + colors: { + text: 'red', + background: 'white' + } + } +} +``` + +```json +// styles/dark.json +{ + styles: { + colors: { + text: 'white', + background: 'black' + } + } +} +``` + ## Example themes You can find a basic starter theme called "emptytheme" and other example themes From 7ea91b88c1f675c99ac5b7f005d874e0a61be94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:00:20 +0100 Subject: [PATCH 02/14] Add note about server-side registration and __experimentalSelector (#37984) --- docs/how-to-guides/themes/theme-json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/how-to-guides/themes/theme-json.md b/docs/how-to-guides/themes/theme-json.md index 85d44bcd7387c1..015a7b2c3cba2d 100644 --- a/docs/how-to-guides/themes/theme-json.md +++ b/docs/how-to-guides/themes/theme-json.md @@ -805,7 +805,7 @@ body { Styles found within a block will be enqueued using the block selector. -By default, the block selector is generated based on its name such as `.wp-block-`. For example, `.wp-block-group` for the `core/group` block. There are some blocks that want to opt-out from this default behavior. They can do so by explicitly telling the system which selector to use for them via the `__experimentalSelector` key within the `supports` section of its `block.json` file. +By default, the block selector is generated based on its name such as `.wp-block-`. For example, `.wp-block-group` for the `core/group` block. There are some blocks that want to opt-out from this default behavior. They can do so by explicitly telling the system which selector to use for them via the `__experimentalSelector` key within the `supports` section of its `block.json` file. Note that the block needs to be registered server-side for the `__experimentalSelector` field to be available to the style engine. {% codetabs %} {% Input %} From d76bf90f8a9d3d91ed38777f7d1d5b42dd4734b8 Mon Sep 17 00:00:00 2001 From: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:07:33 +0100 Subject: [PATCH 03/14] Fix inconsistent response when preloading OPTIONS type requests (#38051) * Return window.response object for OPTIONS type requests. * Move duplicate code into a function. * Make sure parse is a boolean. * Fix bug in the createPreloadingMiddleware function. * Fix the unit test. * Update the changelog. * Update the changelog. * Add description for the prepareResponse function. --- packages/api-fetch/CHANGELOG.md | 4 ++ .../api-fetch/src/middlewares/preloading.js | 68 +++++++++++-------- .../src/middlewares/test/preloading.js | 14 ++++ 3 files changed, 57 insertions(+), 29 deletions(-) diff --git a/packages/api-fetch/CHANGELOG.md b/packages/api-fetch/CHANGELOG.md index bc846e17fd0078..3722ff9f769cb7 100644 --- a/packages/api-fetch/CHANGELOG.md +++ b/packages/api-fetch/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking changes + + `OPTIONS` requests handled by the preloading middleware are now resolved as `window.Response` objects if you explicitly set `parse: false` (for consistency with how GET requests are resolved). They used to be resolved as `Plain Old JavaScript Objects`. + ## 5.2.5 (2021-11-07) ### Internal diff --git a/packages/api-fetch/src/middlewares/preloading.js b/packages/api-fetch/src/middlewares/preloading.js index 761c295cac78a2..4183ad58ec6b42 100644 --- a/packages/api-fetch/src/middlewares/preloading.js +++ b/packages/api-fetch/src/middlewares/preloading.js @@ -23,44 +23,54 @@ function createPreloadingMiddleware( preloadedData ) { rawPath = pathFromQuery; } } - if ( typeof rawPath === 'string' ) { - const method = options.method || 'GET'; - const path = normalizePath( rawPath ); + if ( typeof rawPath !== 'string' ) { + return next( options ); + } - if ( 'GET' === method && cache[ path ] ) { - const cacheData = cache[ path ]; + const method = options.method || 'GET'; + const path = normalizePath( rawPath ); - // Unsetting the cache key ensures that the data is only used a single time - delete cache[ path ]; + if ( 'GET' === method && cache[ path ] ) { + const cacheData = cache[ path ]; - return Promise.resolve( - parse - ? cacheData.body - : new window.Response( - JSON.stringify( cacheData.body ), - { - status: 200, - statusText: 'OK', - headers: cacheData.headers, - } - ) - ); - } else if ( - 'OPTIONS' === method && - cache[ method ] && - cache[ method ][ path ] - ) { - const cacheData = cache[ method ][ path ]; + // Unsetting the cache key ensures that the data is only used a single time + delete cache[ path ]; - // Unsetting the cache key ensures that the data is only used a single time - delete cache[ method ][ path ]; + return prepareResponse( cacheData, !! parse ); + } else if ( + 'OPTIONS' === method && + cache[ method ] && + cache[ method ][ path ] + ) { + const cacheData = cache[ method ][ path ]; - return Promise.resolve( parse ? cacheData.body : cacheData ); - } + // Unsetting the cache key ensures that the data is only used a single time + delete cache[ method ][ path ]; + + return prepareResponse( cacheData, !! parse ); } return next( options ); }; } +/** + * This is a helper function that sends a success response. + * + * @param {Record} responseData + * @param {boolean} parse + * @return {Promise} Promise with the response. + */ +function prepareResponse( responseData, parse ) { + return Promise.resolve( + parse + ? responseData.body + : new window.Response( JSON.stringify( responseData.body ), { + status: 200, + statusText: 'OK', + headers: responseData.headers, + } ) + ); +} + export default createPreloadingMiddleware; diff --git a/packages/api-fetch/src/middlewares/test/preloading.js b/packages/api-fetch/src/middlewares/test/preloading.js index b266ec5e488c47..1dad68638d8ca3 100644 --- a/packages/api-fetch/src/middlewares/test/preloading.js +++ b/packages/api-fetch/src/middlewares/test/preloading.js @@ -59,6 +59,17 @@ describe( 'Preloading Middleware', () => { describe( 'and the OPTIONS request has a parse flag', () => { it( 'should return the full response if parse: false', () => { + const noResponseMock = + 'undefined' === typeof window.Response; + if ( noResponseMock ) { + window.Response = class { + constructor( body, options ) { + this.body = JSON.parse( body ); + this.headers = options.headers; + } + }; + } + const data = { body: { status: 'this is the preloaded response', @@ -85,6 +96,9 @@ describe( 'Preloading Middleware', () => { }; const response = preloadingMiddleware( requestOptions ); + if ( noResponseMock ) { + delete window.Response; + } return response.then( ( value ) => { expect( value ).toEqual( data ); } ); From ce179fca9aedc0329836d414210b33e3302fe0fb Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:30:33 +0100 Subject: [PATCH 04/14] Paragraph: Try to avoid a trailing word in the description. (#37483) --- docs/how-to-guides/designers/block-design.md | 2 +- packages/block-editor/src/components/block-card/README.md | 2 +- packages/block-library/src/paragraph/block.json | 2 +- .../e2e-tests/specs/editor/plugins/block-variations.test.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/how-to-guides/designers/block-design.md b/docs/how-to-guides/designers/block-design.md index 2a71b611b94270..ef733a08eb4706 100644 --- a/docs/how-to-guides/designers/block-design.md +++ b/docs/how-to-guides/designers/block-design.md @@ -92,7 +92,7 @@ You can add a description by using the description attribute in the [registerBlo Stick to a single imperative sentence with an action + subject format. Examples: -- Start with the building block of all narrative. +- Start with the basic building block of all narrative. - Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content. - Create a bulleted or numbered list. diff --git a/packages/block-editor/src/components/block-card/README.md b/packages/block-editor/src/components/block-card/README.md index 4594ff6438facd..8aab2a45f612bd 100644 --- a/packages/block-editor/src/components/block-card/README.md +++ b/packages/block-editor/src/components/block-card/README.md @@ -25,7 +25,7 @@ const MyBlockCard = () => ( ); ``` diff --git a/packages/block-library/src/paragraph/block.json b/packages/block-library/src/paragraph/block.json index 79b7185e920191..29fdcce2b6adf9 100644 --- a/packages/block-library/src/paragraph/block.json +++ b/packages/block-library/src/paragraph/block.json @@ -4,7 +4,7 @@ "name": "core/paragraph", "title": "Paragraph", "category": "text", - "description": "Start with the building block of all narrative.", + "description": "Start with the basic building block of all narrative.", "keywords": [ "text" ], "textdomain": "default", "attributes": { diff --git a/packages/e2e-tests/specs/editor/plugins/block-variations.test.js b/packages/e2e-tests/specs/editor/plugins/block-variations.test.js index 51431ef9a6a418..76da267f97f431 100644 --- a/packages/e2e-tests/specs/editor/plugins/block-variations.test.js +++ b/packages/e2e-tests/specs/editor/plugins/block-variations.test.js @@ -181,7 +181,7 @@ describe( 'Block variations', () => { ).toBeTruthy(); const description = await getBlockCardDescription(); expect( description ).toEqual( - 'Start with the building block of all narrative.' + 'Start with the basic building block of all narrative.' ); } ); } ); From b56b40d1d8e18af25b698e0518c54a5ffa976668 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 26 Jan 2022 10:21:41 +0000 Subject: [PATCH 05/14] Add '.git-blame-ignore-revs' to the project (#37822) * Add '.git-blame-ignore-revs' to the project * Add another commit to the list * Add documentation section --- .git-blame-ignore-revs | 5 +++++ docs/contributors/code/git-workflow.md | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000000000..1f31dda7e18261 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,5 @@ +# Set line width to 80. +4857ad58c1241b3d63d21a6880c989b85746c3dc + +# ESLint updates. +f63053cace3c02e284f00918e1854284c85b9132 diff --git a/docs/contributors/code/git-workflow.md b/docs/contributors/code/git-workflow.md index 16db71ffc7127b..4e4e886f670a80 100644 --- a/docs/contributors/code/git-workflow.md +++ b/docs/contributors/code/git-workflow.md @@ -135,3 +135,21 @@ git push ``` The above commands will update your `trunk` branch from _upstream_. To update any other branch replace `trunk` with the respective branch name. + +## Miscellaneous + +### Git Archeology + +When looking for a commit that introduced a specific change, it might be helpful to ignore revisions that only contain styling or formatting changes. + +Fortunately, newer versions of `git` gained the ability to skip commits in history: + +``` +git blame --ignore-rev f63053cace3c02e284f00918e1854284c85b9132 -L 66,73 packages/api-fetch/src/middlewares/media-upload.js +``` + +All styling and formatting revisions are tracked using the `.git-blame-ignore-revs` file in the Gutenberg repository. You can use this file to ignore them all at once: + +``` +git blame --ignore-revs-file .git-blame-ignore-revs -L 66,73 packages/api-fetch/src/middlewares/media-upload.js +``` From 33af5c0206566c8d76d17e21c11ad7635991881c Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 26 Jan 2022 11:39:02 +0100 Subject: [PATCH 06/14] Fix performance job --- .github/workflows/performance.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index ac7761583acdb9..77be4e1966ec14 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -54,11 +54,14 @@ jobs: - name: Compare performance with base branch if: github.event_name == 'push' + # The base hash used here need to be a commit that is compatible with the current WP version + # The current one is debd225d007f4e441ceec80fbd6fa96653f94737 and it needs to be updated every WP major release. + # It is used as a base comparison point to avoid fluctuation in the performance metrics. run: | WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt) IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION" WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" - ./bin/plugin/cli.js perf --ci $GITHUB_SHA wp/5.8 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" + ./bin/plugin/cli.js perf --ci $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" - uses: actions/github-script@0.3.0 if: github.event_name == 'push' From 60bff622fd6e159675b8101fad0a03b650474838 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 26 Jan 2022 12:26:53 +0100 Subject: [PATCH 07/14] Fix docs regression. (#38235) --- docs/reference-guides/core-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index b0f8b35ac12603..f121f20204fd17 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -415,7 +415,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr ## Paragraph -Start with the building block of all narrative. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/paragraph)) +Start with the basic building block of all narrative. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/paragraph)) - **Name:** core/paragraph - **Category:** text From a4ab23bfc20817092b05cf9d8d88134e8f9b47d8 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 26 Jan 2022 12:07:31 +0000 Subject: [PATCH 08/14] Override Site Editor URLs to use plugin page (#38232) * Override Site Editor URLs to use plugin page * For the love of baby Yoda --- lib/compat/wordpress-5.9/admin-menu.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/compat/wordpress-5.9/admin-menu.php b/lib/compat/wordpress-5.9/admin-menu.php index f8c276daab3755..9b3df44cb71368 100644 --- a/lib/compat/wordpress-5.9/admin-menu.php +++ b/lib/compat/wordpress-5.9/admin-menu.php @@ -77,9 +77,24 @@ function gutenberg_adminbar_items( $wp_admin_bar ) { ); } } - add_action( 'admin_bar_menu', 'gutenberg_adminbar_items', 50 ); +/** + * Override Site Editor URLs to use plugin page. + * + * @param string $url Admin URL link with path. + * @param string $path Path relative to the admin URL. + * @return string Modified Admin URL link. + */ +function gutenberg_override_site_editor_urls( $url, $path ) { + if ( 'site-editor.php' === $path ) { + $url = str_replace( $path, 'themes.php?page=gutenberg-edit-site', $url ); + } + + return $url; +} +add_filter( 'admin_url', 'gutenberg_override_site_editor_urls', 10, 2 ); + /** * Check if any plugin, or theme features, are using the Customizer. * From 26c1ab4bcc05d78dfe8146af190ac62e54e0867e Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 26 Jan 2022 12:47:48 +0000 Subject: [PATCH 09/14] Bump plugin version to 12.5.0-rc.1 --- gutenberg.php | 2 +- package-lock.json | 2 +- package.json | 2 +- readme.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index 1336d394510cdd..b3190df1940444 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -5,7 +5,7 @@ * Description: Printing since 1440. This is the development plugin for the new block editor in core. * Requires at least: 5.7 * Requires PHP: 5.6 - * Version: 12.4.1 + * Version: 12.5.0-rc.1 * Author: Gutenberg Team * Text Domain: gutenberg * diff --git a/package-lock.json b/package-lock.json index 10f2992a6660fd..df3e7dca52e6a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "12.4.1", + "version": "12.5.0-rc.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 336abb58389e59..57557e433b1340 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gutenberg", - "version": "12.4.1", + "version": "12.5.0-rc.1", "private": true, "description": "A new WordPress editor experience.", "author": "The WordPress Contributors", diff --git a/readme.txt b/readme.txt index 3646f713bc7387..4562a56c3b2ada 100644 --- a/readme.txt +++ b/readme.txt @@ -56,4 +56,4 @@ The four phases of the project are Editing, Customization, Collaboration, and Mu == Changelog == -To read the changelog for Gutenberg 12.4.1, please navigate to the release page. +To read the changelog for Gutenberg 12.5.0-rc.1, please navigate to the release page. From 00aea001988f2a8cbd70eeff975d0efebacf1019 Mon Sep 17 00:00:00 2001 From: Mustaque Ahmed Date: Wed, 26 Jan 2022 19:44:15 +0530 Subject: [PATCH 10/14] `DateTimePicker`: fix date format when switching to 12-hour time format (#37465) * remove condition from `dayMonthFormat` variable * fix unit test case to validate dayMonthFormat * invert `is12Hour` condition * add changelog entry * update README.md for `is12Hour` props * Write proper changelog message Co-authored-by: Marco Ciampini * better is12Hour props explanation Co-authored-by: Marco Ciampini Co-authored-by: Marco Ciampini --- packages/components/CHANGELOG.md | 1 + packages/components/src/date-time/README.md | 8 ++++---- packages/components/src/date-time/test/time.js | 4 ++-- packages/components/src/date-time/time.js | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 1c97725b5bdc67..80c9884c565712 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -46,6 +46,7 @@ - Normalized label line-height and spacing within the `ToolsPanel` ([36387](https://github.com/WordPress/gutenberg/pull/36387)) - Remove unused `reakit-utils` from peer dependencies ([#37369](https://github.com/WordPress/gutenberg/pull/37369)). - Update all Emotion dependencies to the latest version to ensure they work correctly with React types ([#37365](https://github.com/WordPress/gutenberg/pull/37365)). +- `DateTimePicker`: Fix the date format associated to the `is12Hour` prop ([#37465](https://github.com/WordPress/gutenberg/pull/37465)) - Allowed `ToolsPanel` to register items when `panelId` is `null` due to multiple block selection ([37216](https://github.com/WordPress/gutenberg/pull/37216)). ### Enhancements diff --git a/packages/components/src/date-time/README.md b/packages/components/src/date-time/README.md index acf927d12c51d7..a3567c27198800 100644 --- a/packages/components/src/date-time/README.md +++ b/packages/components/src/date-time/README.md @@ -28,7 +28,7 @@ const MyDateTimePicker = () => { is12Hour={ true } /> ); -} +}; ``` ## Props @@ -52,7 +52,7 @@ The function called when a new date or time has been selected. It is passed the ### is12Hour -Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is displayed and the time format is assumed to be MM-DD-YYYY. +Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is displayed and the time format is assumed to be `MM-DD-YYYY` (as opposed to the default format `DD-MM-YYYY`). - Type: `bool` - Required: No @@ -69,5 +69,5 @@ A callback function which receives a Date object representing a day as an argume A callback invoked when selecting the previous/next month in the date picker. The callback receives the new month date in the ISO format as an argument. -- Type: `Function` -- Required: No +- Type: `Function` +- Required: No diff --git a/packages/components/src/date-time/test/time.js b/packages/components/src/date-time/test/time.js index 523f2447e6acf2..5d62ff73fcc02e 100644 --- a/packages/components/src/date-time/test/time.js +++ b/packages/components/src/date-time/test/time.js @@ -278,7 +278,7 @@ describe( 'TimePicker', () => { screen.getByLabelText( 'Day' ) ); - expect( monthInputIndex < dayInputIndex ).toBe( true ); + expect( monthInputIndex > dayInputIndex ).toBe( true ); rerender(
@@ -299,7 +299,7 @@ describe( 'TimePicker', () => { screen.getByLabelText( 'Day' ) ); - expect( monthInputIndex > dayInputIndex ).toBe( true ); + expect( monthInputIndex < dayInputIndex ).toBe( true ); } ); it( 'Should set a time when passed a null currentTime', () => { diff --git a/packages/components/src/date-time/time.js b/packages/components/src/date-time/time.js index 098fba0d9cfabc..b3ed133416063a 100644 --- a/packages/components/src/date-time/time.js +++ b/packages/components/src/date-time/time.js @@ -196,13 +196,13 @@ export function TimePicker( { is12Hour, currentTime, onChange } ) { const dayMonthFormat = is12Hour ? ( <> - { dayFormat } { monthFormat } + { dayFormat } ) : ( <> - { monthFormat } { dayFormat } + { monthFormat } ); From 062a8620ec9db5d813f016d6a8738b58f816035c Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Wed, 26 Jan 2022 10:22:05 -0500 Subject: [PATCH 11/14] Update core/archive block schema to reflect no block-level settings support. (#37778) * Update the schema to reflect that the block doesn't support block-level settings. * Update description. --- schemas/json/theme.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/json/theme.json b/schemas/json/theme.json index c5b45ecde9bd75..9fd1241f59fed0 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -365,7 +365,8 @@ "type": "object", "properties": { "core/archives": { - "$ref": "#/definitions/settingsPropertiesComplete" + "description": "Archive block. Display a monthly archive of your posts. This block has no block-level settings", + "additionalProperties": false }, "core/audio": { "$ref": "#/definitions/settingsPropertiesComplete" From 482bc80bfeb8bc260be801811e70a95d9b425da5 Mon Sep 17 00:00:00 2001 From: Gutenberg Repository Automation Date: Wed, 26 Jan 2022 15:26:39 +0000 Subject: [PATCH 12/14] Update Changelog for 12.5.0-rc.1 --- changelog.txt | 226 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) diff --git a/changelog.txt b/changelog.txt index d32490604e6e87..f485e8ef8a3da3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,231 @@ == Changelog == += 12.5.0-rc.1 = + +### Features +- Duotone: Allow users to specify custom filters. ([38055](https://github.com/WordPress/gutenberg/pull/38055)) +- Add: Code editor to edit site. ([37765](https://github.com/WordPress/gutenberg/pull/37765)) +- [Post Featured Image]: Show all the controls when inside a Query Loop. ([37945](https://github.com/WordPress/gutenberg/pull/37945)) + +### Enhancements + +#### Block Library +- Add transform between core/site-logo and core/site-title blocks. ([37920](https://github.com/WordPress/gutenberg/pull/37920)) +- Allow using a text label instead of an icon on overlay menu toggle button. ([36149](https://github.com/WordPress/gutenberg/pull/36149)) +- Post Featured Image: Add size selector. ([38044](https://github.com/WordPress/gutenberg/pull/38044)) +- [Query Loop]: Add multiple authors support. ([38024](https://github.com/WordPress/gutenberg/pull/38024)) +- [Query Loop]: Add support for custom taxonomies filtering. ([38063](https://github.com/WordPress/gutenberg/pull/38063)) +- Comments Query Loop: Add discuss options to the block. ([37297](https://github.com/WordPress/gutenberg/pull/37297)) +- Fetch classic Menus and Pages using view (readonly) context. ([37884](https://github.com/WordPress/gutenberg/pull/37884)) +- Gallery block: Move add/edit media to block toolbar. ([38036](https://github.com/WordPress/gutenberg/pull/38036)) +- Navigation Block : Try not using css variable for block gap support. ([37543](https://github.com/WordPress/gutenberg/pull/37543)) +- Paragraph: Try to avoid a trailing word in the description. ([37483](https://github.com/WordPress/gutenberg/pull/37483)) +- Rename next and previous to newer an older. ([38143](https://github.com/WordPress/gutenberg/pull/38143)) +- Show menus selection in placeholder only if available. ([37980](https://github.com/WordPress/gutenberg/pull/37980)) +- Unset inherited backgrounds on Posts Lists. ([37941](https://github.com/WordPress/gutenberg/pull/37941)) +- Unset inherited backgrounds on social icons. ([37940](https://github.com/WordPress/gutenberg/pull/37940)) + +#### Components +- CustomSelectControl: Add hints example to storybook. ([38056](https://github.com/WordPress/gutenberg/pull/38056)) +- ToolsPanel: Add CSS classes to first and last displayed ToolsPanelItems. ([37546](https://github.com/WordPress/gutenberg/pull/37546)) +- `Navigator`: Add basic location history. ([37416](https://github.com/WordPress/gutenberg/pull/37416)) +- Add: Hover and Selected states to the palette editor. ([37962](https://github.com/WordPress/gutenberg/pull/37962)) +- Update gray color palette to match base styles. ([38109](https://github.com/WordPress/gutenberg/pull/38109)) + +#### Post Editor +- Post Lock Modal: Update avatar size. ([38040](https://github.com/WordPress/gutenberg/pull/38040)) +- Post Lock: Adjust avatar design and update message. ([37979](https://github.com/WordPress/gutenberg/pull/37979)) +- Block styles: Remove box-sizing rule on Post Editor container to achieve editor/frontend parity. ([37902](https://github.com/WordPress/gutenberg/pull/37902)) + +#### Block Editor +- Buttons: Preserve styling from adjacent button blocks when inserting a new button block. ([37905](https://github.com/WordPress/gutenberg/pull/37905)) +- Identify the site frontpage in link UI search results. ([36493](https://github.com/WordPress/gutenberg/pull/36493)) +- Rich text: Use file on internal dependencies. ([38005](https://github.com/WordPress/gutenberg/pull/38005)) +- Transform pasted div tags to p tags. ([38042](https://github.com/WordPress/gutenberg/pull/38042)) + +#### Site Editor +- Update template home, front-page, and search template descriptions. ([38132](https://github.com/WordPress/gutenberg/pull/38132)) +- Add: Copy all content to edit site. ([37781](https://github.com/WordPress/gutenberg/pull/37781)) + +#### Design Tools +- Enable alpha on Block Inspector Color ToolsPanel. ([37731](https://github.com/WordPress/gutenberg/pull/37731)) + +#### Global Styles +- Load the global styles before the theme styles in the editor. ([37885](https://github.com/WordPress/gutenberg/pull/37885)) +- Allow switching global styles variations. ([35619](https://github.com/WordPress/gutenberg/pull/35619)) + +#### Internationalization +- i18n: Create new function `addLocaleData` to merge domain configuration. ([37704](https://github.com/WordPress/gutenberg/pull/37704)) + +#### REST API +- [Global Styles]: Add REST API endpoint to fetch variations. ([38124](https://github.com/WordPress/gutenberg/pull/38124)) + +#### WP ENV +- wp-env: Add install-path command. ([35638](https://github.com/WordPress/gutenberg/pull/35638)) + +### Bug Fixes + +#### Block Library +- Add classic menus to menu switcher. ([38168](https://github.com/WordPress/gutenberg/pull/38168)) +- Always allow accessing edit.php?post_type=wp_navigation page. ([38170](https://github.com/WordPress/gutenberg/pull/38170)) +- Fix Post Date block escaping of date HTML. ([38023](https://github.com/WordPress/gutenberg/pull/38023)) +- Fix duotone render in non-fse themes. ([37954](https://github.com/WordPress/gutenberg/pull/37954)) +- Social Icons: Fix color picker bug when set to Logos Only. ([38006](https://github.com/WordPress/gutenberg/pull/38006)) +- Temporarily remove text decoration from Nav block. ([37963](https://github.com/WordPress/gutenberg/pull/37963)) +- [Query Loop]: Reorganise inspector controls + `order` selection bug. ([37949](https://github.com/WordPress/gutenberg/pull/37949)) +- Revert "Late escape RSS block (#37878)". ([38117](https://github.com/WordPress/gutenberg/pull/38117)) +- Fix missing default `align-items` when items are oriented vertically in `flex` layout. ([38069](https://github.com/WordPress/gutenberg/pull/38069)) +- Update `micromodal` to 0.4.10 to fix navigation close button. ([38032](https://github.com/WordPress/gutenberg/pull/38032)) + +#### Site Editor +- Fix empty gray circle when site has no logo on template list page. ([37474](https://github.com/WordPress/gutenberg/pull/37474)) +- Fix hiding the bottom of tablet/mobile preview in Site Editor. ([38019](https://github.com/WordPress/gutenberg/pull/38019)) +- Fix resizable box scrollbars in blocks. ([38123](https://github.com/WordPress/gutenberg/pull/38123)) +- Override Site Editor URLs to use plugin page. ([38232](https://github.com/WordPress/gutenberg/pull/38232)) +- Restore ?styles=open functionality. ([38093](https://github.com/WordPress/gutenberg/pull/38093)) +- Site Editor: Fix Inserter classes. ([38112](https://github.com/WordPress/gutenberg/pull/38112)) + +#### Block Editor +- Fix pattern preview expanding height and scrollbar issues. ([38175](https://github.com/WordPress/gutenberg/pull/38175)) +- Remove warning for enqueued styles in Editor. ([37937](https://github.com/WordPress/gutenberg/pull/37937)) + +#### Post Editor +- Editor: Fix post lock data inconsistency. ([37914](https://github.com/WordPress/gutenberg/pull/37914)) +- Fix template queries. ([38070](https://github.com/WordPress/gutenberg/pull/38070)) + +#### Block Library +- Latest Posts: Fix featured image alignment label position. ([38125](https://github.com/WordPress/gutenberg/pull/38125)) + +#### Components +- Increase ConfirmDialog overlay's z-index to render above popovers. ([37959](https://github.com/WordPress/gutenberg/pull/37959)) +- Label components: Improve consistency by setting to 8px margin-bottom. ([37844](https://github.com/WordPress/gutenberg/pull/37844)) +- RangeControl: Fix space between icons and rail. ([36935](https://github.com/WordPress/gutenberg/pull/36935)) +- `SelectControl`: Mark the `children` prop as optional. ([37872](https://github.com/WordPress/gutenberg/pull/37872)) +- `ToggleGroupControl`: Remove animated backdrop. ([38008](https://github.com/WordPress/gutenberg/pull/38008)) + +#### Design Tools +- Fix: Double border on palette editor. ([38035](https://github.com/WordPress/gutenberg/pull/38035)) +- Fix: PanelColorSettings renders an empty when a color setting is falsy. ([38029](https://github.com/WordPress/gutenberg/pull/38029)) + +#### Accessibility +- Make sure when on last block focus cannot enter the block. ([37965](https://github.com/WordPress/gutenberg/pull/37965)) +- Tree Grid: Fix keyboard navigation for expand/collapse table rows in Firefox. ([37983](https://github.com/WordPress/gutenberg/pull/37983)) + +#### Data API +- Load the entities list using the view context. ([37685](https://github.com/WordPress/gutenberg/pull/37685)) +- Fix inconsistent response when preloading OPTIONS type requests. ([38051](https://github.com/WordPress/gutenberg/pull/38051)) + +#### Testing +- Fix back button aria name in customizing widgets tests. ([38195](https://github.com/WordPress/gutenberg/pull/38195)) + +#### Widgets Editor +- Fix empty secondary sidebar overlapping widget editor content on mobile viewports. ([38017](https://github.com/WordPress/gutenberg/pull/38017)) + +#### Block settings menu +- Wrap long cell labels on Android. ([37993](https://github.com/WordPress/gutenberg/pull/37993)) + +#### Internationalization +- Add context to font style and font weight related translation strings. ([37939](https://github.com/WordPress/gutenberg/pull/37939)) + +#### Saving +- Fix draft previews. ([37952](https://github.com/WordPress/gutenberg/pull/37952)) + +#### WP Scripts +- Add temporary workaround to fix broken common js import of mini-css-extract-plugin. ([38004](https://github.com/WordPress/gutenberg/pull/38004)) + +#### Developer Tooling +- Docgen/stop crashing on missing return types. ([37929](https://github.com/WordPress/gutenberg/pull/37929)) + +#### Mobile +- Mobile - Highlight text - Force format for some edge cases. ([37915](https://github.com/WordPress/gutenberg/pull/37915)) +- Send non-deprecated language tags from Android in initialProps. ([37565](https://github.com/WordPress/gutenberg/pull/37565)) + +### Performance + +#### Plugin +- Don't use WP_Query::Get_posts directly. ([38104](https://github.com/WordPress/gutenberg/pull/38104)) + +#### Components +- ToolsPanel: Memoize callbacks and context to prevent unnecessary rerenders. ([38037](https://github.com/WordPress/gutenberg/pull/38037)) + +### Documentation +- Add anchors to all terms of the glossary. ([38073](https://github.com/WordPress/gutenberg/pull/38073)) +- Add documentation for useBlockEditContext hook. ([36299](https://github.com/WordPress/gutenberg/pull/36299)) +- Add note about "local styles" in the glossary. ([38083](https://github.com/WordPress/gutenberg/pull/38083)) +- Add some terms related to styles to the glossary. ([38076](https://github.com/WordPress/gutenberg/pull/38076)) +- Add theme.json v1 reference and v1 to v2 migration documentation. ([37886](https://github.com/WordPress/gutenberg/pull/37886)) +- Block API Reference: Fix 'isSelected' property type. ([38161](https://github.com/WordPress/gutenberg/pull/38161)) +- Capitalise the GitHub wordmark correctly in the Wordpress Gutenberg project. ([38092](https://github.com/WordPress/gutenberg/pull/38092)) +- Component: Update color-picker documentation. ([38010](https://github.com/WordPress/gutenberg/pull/38010)) +- Document that `__experimentalSelector` requires server-side block registration. ([37984](https://github.com/WordPress/gutenberg/pull/37984)) +- Document the Global Styles Presets. ([38129](https://github.com/WordPress/gutenberg/pull/38129)) +- Fix documentation regression. ([38235](https://github.com/WordPress/gutenberg/pull/38235)) +- Include partialRight import from lodash in DimensionControl example. ([38088](https://github.com/WordPress/gutenberg/pull/38088)) +- Multiple typos fixed. ([38071](https://github.com/WordPress/gutenberg/pull/38071)) +- Scripts: Corrected "npm start:Hot" in the README file. ([38178](https://github.com/WordPress/gutenberg/pull/38178)) +- Update Block Supports Documentation to better reflect how it works. ([37847](https://github.com/WordPress/gutenberg/pull/37847)) +- Update BlockPreview component readme. ([38209](https://github.com/WordPress/gutenberg/pull/38209)) +- Update versions for 5.8.2 and 5.8.3. ([37924](https://github.com/WordPress/gutenberg/pull/37924)) +- Use consistent punctuation, capitalization in templateParts documentation. ([38193](https://github.com/WordPress/gutenberg/pull/38193)) +- [Type] Documentation Updating Faq.md typo. ([38154](https://github.com/WordPress/gutenberg/pull/38154)) + +### Code Quality +- Compose: Rework types of createHigherOrderComponent for closer match to API. ([37795](https://github.com/WordPress/gutenberg/pull/37795)) +- Docblock typos. ([38067](https://github.com/WordPress/gutenberg/pull/38067)) +- Fix two inline typos. ([38048](https://github.com/WordPress/gutenberg/pull/38048)) +- Testing: Upgrade Jest to v27. ([33287](https://github.com/WordPress/gutenberg/pull/33287)) +- Add a missing `@since` tag. ([38151](https://github.com/WordPress/gutenberg/pull/38151)) +- Ignore local environment .tool-versions configuration file. ([38013](https://github.com/WordPress/gutenberg/pull/38013)) + +#### Block Library +- Allow for HTML in `get_the_title`. ([38145](https://github.com/WordPress/gutenberg/pull/38145)) +- Fix double escaping in blocks. ([37985](https://github.com/WordPress/gutenberg/pull/37985)) +- Late escape Latest Posts block. ([37866](https://github.com/WordPress/gutenberg/pull/37866)) +- Late escape Navigation blocks. ([37870](https://github.com/WordPress/gutenberg/pull/37870)) +- Late escape Post blocks. ([37876](https://github.com/WordPress/gutenberg/pull/37876)) +- Late escape Social block. ([37881](https://github.com/WordPress/gutenberg/pull/37881)) +- Late escape comment blocks. ([37860](https://github.com/WordPress/gutenberg/pull/37860)) +- Late escape comments link block. ([37875](https://github.com/WordPress/gutenberg/pull/37875)) +- Late escape latest comments block. ([37865](https://github.com/WordPress/gutenberg/pull/37865)) +- Late escape post author blocks. ([37874](https://github.com/WordPress/gutenberg/pull/37874)) +- Late escape site blocks. ([37880](https://github.com/WordPress/gutenberg/pull/37880)) +- Spacer: No need to use withDispatch HOC. ([38206](https://github.com/WordPress/gutenberg/pull/38206)) + +#### Plugin +- Add allowed-plugins in composer configuration. ([38085](https://github.com/WordPress/gutenberg/pull/38085)) + +#### Site Editor +- Site editor - try redirecting to homepage before the react render. ([37248](https://github.com/WordPress/gutenberg/pull/37248)) + +### Tools +- Bump dot-prop from 4.2.0 to 4.2.1. ([38101](https://github.com/WordPress/gutenberg/pull/38101)) +- Bump ini from 1.3.5 to 1.3.8. ([38106](https://github.com/WordPress/gutenberg/pull/38106)) +- Bump tar from 4.4.13 to 4.4.19. ([37917](https://github.com/WordPress/gutenberg/pull/37917)) +- Bump tree-kill from 1.2.0 to 1.2.2. ([38102](https://github.com/WordPress/gutenberg/pull/38102)) +- Bump trim-off-newlines from 1.0.1 to 1.0.3. ([38095](https://github.com/WordPress/gutenberg/pull/38095)) +- Update MiniCSSExtractPlugin to version 2.5.1. ([38027](https://github.com/WordPress/gutenberg/pull/38027)) +- Bump follow-redirects from 1.14.1 to 1.14.7. ([37957](https://github.com/WordPress/gutenberg/pull/37957)) +- Bump handlebars from 4.7.6 to 4.7.7. ([38054](https://github.com/WordPress/gutenberg/pull/38054)) +- Bump path-parse from 1.0.5 to 1.0.7. ([37990](https://github.com/WordPress/gutenberg/pull/37990)) +- Bump tmpl from 1.0.4 to 1.0.5. ([37916](https://github.com/WordPress/gutenberg/pull/37916)) +- Add '.git-blame-ignore-revs' to the project. ([37822](https://github.com/WordPress/gutenberg/pull/37822)) + +#### Testing +- Fix flaky Nav block user permissions end-to-end test. ([38025](https://github.com/WordPress/gutenberg/pull/38025)) +- Fix flaky classic block conversion undo test. ([37933](https://github.com/WordPress/gutenberg/pull/37933)) +- Improve flaky draft creation navigation block end-to-end test. ([37931](https://github.com/WordPress/gutenberg/pull/37931)) +- Skip flaky nav permissions test until fixed. ([38099](https://github.com/WordPress/gutenberg/pull/38099)) +- [docgen] Refactor code to use require() instead of JSON.parse(fs.readFileSync()). ([38148](https://github.com/WordPress/gutenberg/pull/38148)) +- end-to-end Tests: Add coverage for reusable blocks save button state regression. ([33151](https://github.com/WordPress/gutenberg/pull/33151)) +- Add new Testing Instructions section to PR template. ([38147](https://github.com/WordPress/gutenberg/pull/38147)) + +#### Build Tooling +- Require stylelint v14 for stylelint configuration and scripts. ([38091](https://github.com/WordPress/gutenberg/pull/38091)) + +#### Plugin +- Tested up to WP 5.9. ([38162](https://github.com/WordPress/gutenberg/pull/38162)) + + = 12.4.1 = ### Bug Fixes From 6a8fc976293e6360280bc6752994fad31329d38a Mon Sep 17 00:00:00 2001 From: Staci Cooper <63313398+stacimc@users.noreply.github.com> Date: Wed, 26 Jan 2022 08:57:59 -0800 Subject: [PATCH 13/14] Override max-width rules set by alignment options (#38189) --- packages/block-library/src/gallery/style.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/gallery/style.scss b/packages/block-library/src/gallery/style.scss index 14c372f062e30b..e2cf42ba2cf569 100644 --- a/packages/block-library/src/gallery/style.scss +++ b/packages/block-library/src/gallery/style.scss @@ -30,6 +30,7 @@ margin-top: auto; margin-bottom: auto; flex-direction: column; + max-width: 100%; > div, > a { @@ -41,7 +42,9 @@ img { display: block; height: auto; - max-width: 100%; + // Ensure max-width is not overridden on the img when the parent gallery has + // wide or full alignment. + max-width: 100% !important; width: auto; } From 4ab1bab5122389d9885aeecddaa6e985e6d1fbb0 Mon Sep 17 00:00:00 2001 From: Oguz Kocer Date: Wed, 26 Jan 2022 12:09:02 -0500 Subject: [PATCH 14/14] Update kotlin version for react-native Android projects to 1.5.32 (#37970) --- packages/react-native-aztec/android/settings.gradle | 2 +- packages/react-native-bridge/android/settings.gradle | 2 +- packages/react-native-editor/android/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-aztec/android/settings.gradle b/packages/react-native-aztec/android/settings.gradle index 2cb73103cc2383..d10db4f3c9a8d0 100644 --- a/packages/react-native-aztec/android/settings.gradle +++ b/packages/react-native-aztec/android/settings.gradle @@ -1,5 +1,5 @@ pluginManagement { - gradle.ext.kotlinVersion = '1.5.20' + gradle.ext.kotlinVersion = '1.5.32' plugins { id "com.android.library" version "4.2.2" diff --git a/packages/react-native-bridge/android/settings.gradle b/packages/react-native-bridge/android/settings.gradle index 0502d4779dbe58..68d80e70106322 100644 --- a/packages/react-native-bridge/android/settings.gradle +++ b/packages/react-native-bridge/android/settings.gradle @@ -1,5 +1,5 @@ pluginManagement { - gradle.ext.kotlinVersion = '1.5.20' + gradle.ext.kotlinVersion = '1.5.32' plugins { id "com.android.library" version "4.2.2" diff --git a/packages/react-native-editor/android/build.gradle b/packages/react-native-editor/android/build.gradle index e832bd9fe60483..74958bd3ef138b 100644 --- a/packages/react-native-editor/android/build.gradle +++ b/packages/react-native-editor/android/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { gradlePluginVersion = '4.2.2' - kotlinVersion = '1.5.20' + kotlinVersion = '1.5.32' buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30