';
+ }
+ return;
}
$content = $wp_embed->run_shortcode( $_wp_current_template_content );
From 158d03ce1e98a75fecbe1bd009226cc72e73664b Mon Sep 17 00:00:00 2001
From: Ari Stathopoulos
Date: Wed, 31 Mar 2021 17:02:19 +0300
Subject: [PATCH 08/53] Use a WordPress loop for the query block (#30405)
* Use a normal WordPress loop similar to themes
* post-content: Run the_post if not in a loop
* phpcs fix
* Address feedback
* early exit earlier
* Update packages/block-library/src/post-content/index.php
Co-authored-by: Nik Tsekouras
Co-authored-by: Nik Tsekouras
---
.../block-library/src/post-content/index.php | 4 ++++
.../block-library/src/query-loop/index.php | 24 +++++++++++--------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/packages/block-library/src/post-content/index.php b/packages/block-library/src/post-content/index.php
index 7ee8b4dd1b7055..251947582c920a 100644
--- a/packages/block-library/src/post-content/index.php
+++ b/packages/block-library/src/post-content/index.php
@@ -18,6 +18,10 @@ function render_block_core_post_content( $attributes, $content, $block ) {
return '';
}
+ if ( ! in_the_loop() ) {
+ the_post();
+ }
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) );
return (
diff --git a/packages/block-library/src/query-loop/index.php b/packages/block-library/src/query-loop/index.php
index 293ad681ff0f06..30bc6ca75de08d 100644
--- a/packages/block-library/src/query-loop/index.php
+++ b/packages/block-library/src/query-loop/index.php
@@ -18,24 +18,25 @@ function render_block_core_query_loop( $attributes, $content, $block ) {
$page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page';
$page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
- $query = construct_wp_query_args( $block, $page );
+ $query_args = construct_wp_query_args( $block, $page );
// Override the custom query with the global query if needed.
$use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] );
if ( $use_global_query ) {
global $wp_query;
if ( $wp_query && isset( $wp_query->query_vars ) && is_array( $wp_query->query_vars ) ) {
// Unset `offset` because if is set, $wp_query overrides/ignores the paged parameter and breaks pagination.
- unset( $query['offset'] );
- $query = wp_parse_args( $wp_query->query_vars, $query );
+ unset( $query_args['offset'] );
+ $query_args = wp_parse_args( $wp_query->query_vars, $query_args );
- if ( empty( $query['post_type'] ) && is_singular() ) {
- $query['post_type'] = get_post_type( get_the_ID() );
+ if ( empty( $query_args['post_type'] ) && is_singular() ) {
+ $query_args['post_type'] = get_post_type( get_the_ID() );
}
}
}
- $posts = get_posts( $query );
- if ( empty( $posts ) ) {
+ $query = new WP_Query( $query_args );
+
+ if ( ! $query->have_posts() ) {
return '';
}
@@ -49,19 +50,22 @@ function render_block_core_query_loop( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );
$content = '';
- foreach ( $posts as $post ) {
+ while ( $query->have_posts() ) {
+ $query->the_post();
$block_content = (
new WP_Block(
$block->parsed_block,
array(
- 'postType' => $post->post_type,
- 'postId' => $post->ID,
+ 'postType' => get_post_type(),
+ 'postId' => get_the_ID(),
)
)
)->render( array( 'dynamic' => false ) );
$content .= "
{$block_content}
";
}
+ wp_reset_postdata();
+
return sprintf(
'
%2$s
',
$wrapper_attributes,
From ef10b4a334487520fe5256a6366062d3231c041c Mon Sep 17 00:00:00 2001
From: Gutenberg Repository Automation
Date: Wed, 31 Mar 2021 14:59:36 +0000
Subject: [PATCH 09/53] Bump plugin version to 10.3.0
---
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 8d15396ee54465..74dabab72d3a69 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.6
* Requires PHP: 5.6
- * Version: 10.3.0-rc.1
+ * Version: 10.3.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
diff --git a/package-lock.json b/package-lock.json
index 199b089e99bc4a..81b7f2e4bb11da 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.0-rc.1",
+ "version": "10.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 22e027d5313306..cb2e78fcbb1b3a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.0-rc.1",
+ "version": "10.3.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
diff --git a/readme.txt b/readme.txt
index 87cbe04b9e5980..f18e4630ba4458 100644
--- a/readme.txt
+++ b/readme.txt
@@ -55,4 +55,4 @@ View release page.
+To read the changelog for Gutenberg 10.3.0, please navigate to the release page.
From 87db183c6bb3db0e9ac0c72cf5abe05260ce6043 Mon Sep 17 00:00:00 2001
From: Gutenberg Repository Automation
Date: Wed, 31 Mar 2021 15:00:18 +0000
Subject: [PATCH 10/53] Bump plugin version to 10.3.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 74dabab72d3a69..06561f7d0b06b6 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.6
* Requires PHP: 5.6
- * Version: 10.3.0
+ * Version: 10.3.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
diff --git a/package-lock.json b/package-lock.json
index 81b7f2e4bb11da..4746a384a82cbe 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.0",
+ "version": "10.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index cb2e78fcbb1b3a..a65896086d3acc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.0",
+ "version": "10.3.1",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
diff --git a/readme.txt b/readme.txt
index f18e4630ba4458..55143c81c6ddd2 100644
--- a/readme.txt
+++ b/readme.txt
@@ -55,4 +55,4 @@ View release page.
+To read the changelog for Gutenberg 10.3.1, please navigate to the release page.
From 58dc8645a3f4ea337560180896cc15aa2fbd18cd Mon Sep 17 00:00:00 2001
From: Joel Dean
Date: Wed, 31 Mar 2021 10:04:50 -0500
Subject: [PATCH 11/53] [RNMobile] Initial HTML E2E test (#26405)
* added initial-html to test-data.js
* Added a test that loads all the blocks within a post.
* Updated the ci test runners to run gutenberg-editor-blocks
* added a function that scrolls to a specific element and returns it.
* updated the test to utilize the scroll and return functionality
* utilize a shared initialHtml for both test and initial editor content.
* added delay to swipe methods.
* Remove unneeded code after merging master
* Paste instead of typing when setting HTML content
* Paste using keycode on Android
* Select html content view only on android
* Use iOS 14.0 simulator on server
* Print driver data on stop
* Enable remaining paragraph tests on iOS
* Remove dot at the end of jobURL
* Print menuButton
* Print error if environment cannot be initialized
* Revert "Use iOS 14.0 simulator on server"
This reverts commit 85178d15122d09bfb0060af2957ced110e41b41f.
* Revert "Print driver data on stop"
This reverts commit f136234b0d3cef5089162606a46b9191189447d8.
* Revert "Print menuButton"
This reverts commit 9e16a13eee9a52bc56528b31d3118c330a89aeac.
* Update server appium version to 1.18 and iOS to 14.0
* Add teardown to paste test
* On iOS wait for paste notification to disappear
* Double tap instead of long press to paste
* Fix lint error
* On iOS also long press before pasting
* On iOS use click instead of clickBeginningOfElement in paragraph test
* Scroll to bottom by adding a paragraph block to the end
* Use .type on Android instead of pressing paste keycode
* Check last block without scrolling on iOS
* Update package-lock.json
* added endYCoefficient to increase the swipe distance on Android.
* added package-lock.json
* Retry one more time getting the last block after a delay on iOS
* Temporarily delete cancel workflow (and others) to run native jobs multiple times more quickly in consecutive commits
* Run 1
* Run 2
* Run 3
* Run 4
* Run 5
* Run 6
* Run 7
* Run 8
* Revert "Temporarily delete cancel workflow (and others) to run native jobs multiple times more quickly in consecutive commits"
This reverts commit fe5a1b11ed2f337eea40522f1e8620dd595e0aab.
* Temporarily delete cancel workflow
* Run 1
* Run 2
* Run 3
* Run 4
* Run 5
* Run 6
* Run 7
* Run 8
* Temporarily delete non-native workflows
* Bump reactivecircus/android-emulator-runner action to v2.15.0
* Run 1
* Run 2
* Run 3
* Run 4
* Run 5
* Run 6
* Run 7
* Run 8
* Run 9
* Run 10
* Run 11
* Run 12
* Run 13
* Run 14
* Run 15
* Run 16
* Revert "Temporarily delete cancel workflow"
This reverts commit b31695a7bb55efb19b2740ac72cdbc3dd69a1a18.
* Revert "Temporarily delete non-native workflows"
This reverts commit ff5a3c4b8ade129c3057868b2bb47b60522f54fe.
* Rename test file
Co-authored-by: Ceyhun Ozugur
---
.github/workflows/rnmobile-android-runner.yml | 4 +-
.github/workflows/rnmobile-ios-runner.yml | 2 +-
.../gutenberg-editor-initial-html.test.js | 39 ++++++
.../gutenberg-editor-paragraph.test.js | 112 ++++++++----------
.../gutenberg-editor-paste.test.js | 3 +
.../__device-tests__/helpers/caps.js | 6 +-
.../__device-tests__/helpers/utils.js | 43 +++++--
.../__device-tests__/pages/editor-page.js | 46 ++++++-
.../react-native-editor/src/initial-html.js | 4 +
9 files changed, 180 insertions(+), 79 deletions(-)
create mode 100644 packages/react-native-editor/__device-tests__/gutenberg-editor-initial-html.test.js
diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml
index 76128bb84a6742..384cfaf5de5a06 100644
--- a/.github/workflows/rnmobile-android-runner.yml
+++ b/.github/workflows/rnmobile-android-runner.yml
@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
native-test-name: [
- gutenberg-editor-gallery
+ gutenberg-editor-initial-html
]
steps:
@@ -35,7 +35,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- - uses: reactivecircus/android-emulator-runner@08b092e904025fada32a01b711af1e7ff7b7a4a3 # v2.14.3
+ - uses: reactivecircus/android-emulator-runner@d2799957d660add41c61a5103e2fbb9e2889eb73 # v2.15.0
with:
api-level: 28
profile: pixel_xl
diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml
index 33b3a8ab72172e..c05bbb42da10a3 100644
--- a/.github/workflows/rnmobile-ios-runner.yml
+++ b/.github/workflows/rnmobile-ios-runner.yml
@@ -12,7 +12,7 @@ jobs:
matrix:
xcode: [12.2]
native-test-name: [
- gutenberg-editor-gallery
+ gutenberg-editor-initial-html
]
steps:
diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-initial-html.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-initial-html.test.js
new file mode 100644
index 00000000000000..90bcb0f16b0e55
--- /dev/null
+++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-initial-html.test.js
@@ -0,0 +1,39 @@
+/**
+ * Internal dependencies
+ */
+import initialHtml from '../src/initial-html';
+import { isAndroid } from './helpers/utils';
+
+describe( 'Gutenberg Editor Blocks test', () => {
+ it( 'should be able to create a post with all blocks and scroll to the last one', async () => {
+ await editorPage.setHtmlContent( initialHtml );
+
+ const lastBlockAccessibilityLabel =
+ 'This block is used in initial HTML e2e tests and should be kept as the last block.';
+ let lastBlockElement;
+ if ( isAndroid() ) {
+ lastBlockElement = await editorPage.androidScrollAndReturnElement(
+ lastBlockAccessibilityLabel
+ );
+ } else {
+ lastBlockElement = await editorPage.getLastElementByXPath(
+ lastBlockAccessibilityLabel
+ );
+ if ( ! lastBlockElement ) {
+ const retryDelay = 5000;
+ // eslint-disable-next-line no-console
+ console.log(
+ `Warning: "lastBlockElement" was not found in the first attempt. Could be that all the blocks were not loaded yet.
+Will retry one more time after ${ retryDelay / 1000 } seconds.`,
+ lastBlockElement
+ );
+ await editorPage.driver.sleep( retryDelay );
+ lastBlockElement = await editorPage.getLastElementByXPath(
+ lastBlockAccessibilityLabel
+ );
+ }
+ }
+
+ expect( lastBlockElement ).toBeTruthy();
+ } );
+} );
diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-paragraph.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-paragraph.test.js
index f6ab1e191fc541..85345ec9079dfa 100644
--- a/packages/react-native-editor/__device-tests__/gutenberg-editor-paragraph.test.js
+++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-paragraph.test.js
@@ -148,10 +148,8 @@ describe( 'Gutenberg Editor tests for Paragraph Block', () => {
}
} );
- // Restricting these test to Android because I was not able to update the html on iOS
- if ( isAndroid() ) {
- it( 'should be able to merge blocks with unknown html elements', async () => {
- await editorPage.setHtmlContent( `
+ it( 'should be able to merge blocks with unknown html elements', async () => {
+ await editorPage.setHtmlContent( `
+
+
+
+
+` );
+
+ // // Merge paragraphs
+ const secondParagraphBlockElement = await editorPage.getBlockAtPosition(
+ blockNames.paragraph,
+ 2
+ );
+ await secondParagraphBlockElement.click();
+ await editorPage.typeTextToParagraphBlock(
+ secondParagraphBlockElement,
+ backspace
+ );
+
+ // verify the editor has not crashed
+ const text = await editorPage.getTextForParagraphBlockAtPosition( 1 );
+ expect( text.length ).not.toEqual( 0 );
+
+ await editorPage.removeBlockAtPosition( blockNames.paragraph );
+ } );
} );
diff --git a/packages/react-native-editor/__device-tests__/gutenberg-editor-paste.test.js b/packages/react-native-editor/__device-tests__/gutenberg-editor-paste.test.js
index e0799af6f135a7..6498f46ca7c551 100644
--- a/packages/react-native-editor/__device-tests__/gutenberg-editor-paste.test.js
+++ b/packages/react-native-editor/__device-tests__/gutenberg-editor-paste.test.js
@@ -70,6 +70,9 @@ describe( 'Gutenberg Editor paste tests', () => {
const text = await editorPage.getTextForParagraphBlockAtPosition( 2 );
expect( text ).toBe( testData.pastePlainText );
+
+ await editorPage.removeBlockAtPosition( blockNames.paragraph, 2 );
+ await editorPage.removeBlockAtPosition( blockNames.paragraph, 1 );
} );
it( 'copies styled text from one paragraph block and pastes in another', async () => {
diff --git a/packages/react-native-editor/__device-tests__/helpers/caps.js b/packages/react-native-editor/__device-tests__/helpers/caps.js
index 30f23cc2ffa5e6..d614724f1870ae 100644
--- a/packages/react-native-editor/__device-tests__/helpers/caps.js
+++ b/packages/react-native-editor/__device-tests__/helpers/caps.js
@@ -4,7 +4,7 @@ const ios = {
os: 'iOS',
deviceOrientation: 'portrait',
automationName: 'XCUITest',
- appiumVersion: '1.17.1', // Sauce Labs requires appiumVersion to be specified.
+ appiumVersion: '1.18.3', // Sauce Labs requires appiumVersion to be specified.
app: undefined, // will be set later, locally this is relative to root of project
processArguments: {
args: [ 'uitesting' ],
@@ -20,7 +20,7 @@ exports.iosLocal = {
exports.iosServer = {
...ios,
- platformVersion: '13.4', // Supported Sauce Labs platforms can be found here: https://saucelabs.com/rest/v1/info/platforms/appium
+ platformVersion: '14.0', // Supported Sauce Labs platforms can be found here: https://saucelabs.com/rest/v1/info/platforms/appium
deviceName: 'iPhone 11 Simulator',
};
@@ -34,6 +34,6 @@ exports.android = {
appPackage: 'com.gutenberg',
appActivity: 'com.gutenberg.MainActivity',
deviceOrientation: 'portrait',
- appiumVersion: '1.16.0',
+ appiumVersion: '1.18.1',
app: undefined,
};
diff --git a/packages/react-native-editor/__device-tests__/helpers/utils.js b/packages/react-native-editor/__device-tests__/helpers/utils.js
index eec48ba84a26b4..df49d98b600f63 100644
--- a/packages/react-native-editor/__device-tests__/helpers/utils.js
+++ b/packages/react-native-editor/__device-tests__/helpers/utils.js
@@ -172,7 +172,7 @@ const stopDriver = async ( driver ) => {
.createHmac( 'md5', jobID )
.update( serverConfigs.sauce.auth )
.digest( 'hex' );
- const jobURL = `https://saucelabs.com/jobs/${ jobID }?auth=${ hash }.`;
+ const jobURL = `https://saucelabs.com/jobs/${ jobID }?auth=${ hash }`;
// eslint-disable-next-line no-console
console.log( `You can view the video of this test run at ${ jobURL }` );
}
@@ -218,15 +218,19 @@ const clearTextBox = async ( driver, element ) => {
// We are double tapping on the text field and pressing backspace until all content is removed.
do {
originalText = await element.text();
- const action = new wd.TouchAction( driver );
- action.tap( { el: element, count: 2 } );
- await action.perform();
+ await doubleTap( driver, element );
await element.type( '\b' );
text = await element.text();
// We compare with the original content and not empty because text always return any hint set on the element.
} while ( originalText !== text );
};
+const doubleTap = async ( driver, element ) => {
+ const action = new wd.TouchAction( driver );
+ action.tap( { el: element, count: 2 } );
+ await action.perform();
+};
+
const typeStringAndroid = async (
driver,
element,
@@ -351,7 +355,12 @@ const tapPasteAboveElement = async ( driver, element ) => {
// Starts from the middle of the screen or the element(if specified)
// and swipes upwards
-const swipeUp = async ( driver, element = undefined ) => {
+const swipeUp = async (
+ driver,
+ element = undefined,
+ delay = 3000,
+ endYCoefficient = 0.5
+) => {
let size = await driver.getWindowSize();
let y = 0;
if ( element !== undefined ) {
@@ -363,27 +372,33 @@ const swipeUp = async ( driver, element = undefined ) => {
const startX = size.width / 2;
const startY = y + size.height / 3;
const endX = startX;
- const endY = startY + startY * -1 * 0.5;
+ const endY = startY + startY * -1 * endYCoefficient;
- await swipeFromTo( driver, { x: startX, y: startY }, { x: endX, y: endY } );
+ await swipeFromTo(
+ driver,
+ { x: startX, y: startY },
+ { x: endX, y: endY },
+ delay
+ );
};
const defaultCoordinates = { x: 0, y: 0 };
const swipeFromTo = async (
driver,
from = defaultCoordinates,
- to = defaultCoordinates
+ to = defaultCoordinates,
+ delay
) => {
const action = await new wd.TouchAction( driver );
action.press( from );
- action.wait( 3000 );
+ action.wait( delay );
action.moveTo( to );
action.release();
await action.perform();
};
// Starts from the middle of the screen and swipes downwards
-const swipeDown = async ( driver ) => {
+const swipeDown = async ( driver, delay = 3000 ) => {
const size = await driver.getWindowSize();
const y = 0;
@@ -392,7 +407,12 @@ const swipeDown = async ( driver ) => {
const endX = startX;
const endY = startY - startY * -1 * 0.5;
- await swipeFromTo( driver, { x: startX, y: startY }, { x: endX, y: endY } );
+ await swipeFromTo(
+ driver,
+ { x: startX, y: startY },
+ { x: endX, y: endY },
+ delay
+ );
};
const toggleHtmlMode = async ( driver, toggleOn ) => {
@@ -451,4 +471,5 @@ module.exports = {
stopDriver,
toggleHtmlMode,
toggleOrientation,
+ doubleTap,
};
diff --git a/packages/react-native-editor/__device-tests__/pages/editor-page.js b/packages/react-native-editor/__device-tests__/pages/editor-page.js
index 8fd19373bba37b..492d16f62c0287 100644
--- a/packages/react-native-editor/__device-tests__/pages/editor-page.js
+++ b/packages/react-native-editor/__device-tests__/pages/editor-page.js
@@ -11,6 +11,7 @@ const {
toggleHtmlMode,
swipeFromTo,
longPressMiddleOfElement,
+ doubleTap,
} = require( '../helpers/utils' );
const initializeEditorPage = async () => {
@@ -135,6 +136,27 @@ class EditorPage {
return elements[ elements.length - 1 ];
}
+ // iOS loads the block list more eagerly compared to Android.
+ // This makes this function return elements without scrolling on iOS.
+ // So we are keeping this Android only.
+ async androidScrollAndReturnElement( accessibilityLabel ) {
+ const elements = await this.driver.elementsByXPath(
+ `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ accessibilityLabel }")]`
+ );
+ if ( elements.length === 0 ) {
+ await swipeUp( this.driver, undefined, 100, 1 );
+ return this.androidScrollAndReturnElement( accessibilityLabel );
+ }
+ return elements[ elements.length - 1 ];
+ }
+
+ async getLastElementByXPath( accessibilityLabel ) {
+ const elements = await this.driver.elementsByXPath(
+ `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ accessibilityLabel }")]`
+ );
+ return elements[ elements.length - 1 ];
+ }
+
async getTextViewForHtmlViewContent() {
const accessibilityId = 'html-view-content';
let blockLocator = `//*[@${ this.accessibilityIdXPathAttrib }="${ accessibilityId }"]`;
@@ -161,8 +183,30 @@ class EditorPage {
async setHtmlContent( html ) {
await toggleHtmlMode( this.driver, true );
+ const base64String = Buffer.from( html ).toString( 'base64' );
+
+ await this.driver.setClipboard( base64String, 'plaintext' );
+
const htmlContentView = await this.getTextViewForHtmlViewContent();
- await htmlContentView.type( html );
+
+ if ( isAndroid() ) {
+ // Attention! On Android `.type()` replaces the content of htmlContentView instead of appending
+ // contrary to what iOS is doing. On Android tried calling `driver.pressKeycode( 279 ) // KEYCODE_PASTE`
+ // before to paste, but for some reason it didn't work on GitHub Actions but worked only on Sauce Labs
+ await htmlContentView.type( html );
+ } else {
+ await htmlContentView.click();
+ await doubleTap( this.driver, htmlContentView );
+ // Sometimes double tap is not enough for paste menu to appear, so we also long press
+ await longPressMiddleOfElement( this.driver, htmlContentView );
+
+ const pasteButton = this.driver.elementByXPath(
+ '//XCUIElementTypeMenuItem[@name="Paste"]'
+ );
+
+ await pasteButton.click();
+ await this.driver.sleep( 3000 ); // wait for paste notification to disappear
+ }
await toggleHtmlMode( this.driver, false );
}
diff --git a/packages/react-native-editor/src/initial-html.js b/packages/react-native-editor/src/initial-html.js
index 8650bf7d7b54cd..7c1cb67a5cc9bb 100644
--- a/packages/react-native-editor/src/initial-html.js
+++ b/packages/react-native-editor/src/initial-html.js
@@ -248,4 +248,8 @@ else:
Heading with line-height set
+
+
+
This block is used in initial HTML e2e tests and should be kept as the last block.
+
`;
From cf7d5b193cc89d8284d284b1d726ef0325b6567e Mon Sep 17 00:00:00 2001
From: James Koster
Date: Wed, 31 Mar 2021 16:28:25 +0100
Subject: [PATCH 12/53] Clarify that when the Inserter is open clicking the +
button in the top bar will close it again (#29759)
* Rotate the inserter icon and switch the label when pressed
* Use a single label rather than toggling. Include reduce-motion mixin.
* Update tests
* formatting
* Update test snapshots
* Update labels
* Add old selectors
* Add comment
Co-authored-by: David Szabo
---
packages/e2e-test-utils/src/inserter.js | 8 ++++++--
.../specs/editor/plugins/cpt-locking.test.js | 8 ++++++--
.../src/components/header/header-toolbar/index.js | 2 +-
.../src/components/header/header-toolbar/style.scss | 11 +++++++++++
packages/edit-site/src/components/header/index.js | 2 +-
packages/edit-site/src/components/header/style.scss | 11 +++++++++++
6 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/packages/e2e-test-utils/src/inserter.js b/packages/e2e-test-utils/src/inserter.js
index 4c907efab7a18b..b5041992f2bbc4 100644
--- a/packages/e2e-test-utils/src/inserter.js
+++ b/packages/e2e-test-utils/src/inserter.js
@@ -40,8 +40,10 @@ export async function closeGlobalBlockInserter() {
async function isGlobalInserterOpen() {
return await page.evaluate( () => {
+ // "Add block" selector is required to make sure performance comparison
+ // doesn't fail on older branches where we still had "Add block" as label.
return !! document.querySelector(
- '.edit-post-header [aria-label="Add block"].is-pressed, .edit-site-header [aria-label="Add block"].is-pressed'
+ '.edit-post-header [aria-label="Add block"].is-pressed, .edit-site-header [aria-label="Add block"].is-pressed, .edit-post-header [aria-label="Toggle block inserter"].is-pressed, .edit-site-header [aria-label="Toggle block inserter"].is-pressed'
);
} );
}
@@ -49,8 +51,10 @@ async function isGlobalInserterOpen() {
* Toggles the global inserter.
*/
export async function toggleGlobalBlockInserter() {
+ // "Add block" selector is required to make sure performance comparison
+ // doesn't fail on older branches where we still had "Add block" as label.
await page.click(
- '.edit-post-header [aria-label="Add block"], .edit-site-header [aria-label="Add block"]'
+ '.edit-post-header [aria-label="Add block"], .edit-site-header [aria-label="Add block"], .edit-post-header [aria-label="Toggle block inserter"], .edit-site-header [aria-label="Toggle block inserter"]'
);
}
diff --git a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js
index a9b0181d4e47fc..aee6398871a9b1 100644
--- a/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js
+++ b/packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js
@@ -27,7 +27,7 @@ describe( 'cpt locking', () => {
expect(
await page.evaluate( () => {
const inserter = document.querySelector(
- '.edit-post-header [aria-label="Add block"]'
+ '.edit-post-header [aria-label="Add block"], .edit-post-header [aria-label="Toggle block inserter"]'
);
return inserter.getAttribute( 'disabled' );
} )
@@ -159,7 +159,11 @@ describe( 'cpt locking', () => {
it( 'should allow blocks to be inserted', async () => {
expect(
- await page.$( '.edit-post-header [aria-label="Add block"]' )
+ // "Add block" selector is required to make sure performance comparison
+ // doesn't fail on older branches where we still had "Add block" as label.
+ await page.$(
+ '.edit-post-header [aria-label="Add block"], .edit-post-header [aria-label="Toggle block inserter"]'
+ )
).not.toBeNull();
await insertBlock( 'List' );
await page.keyboard.type( 'List content' );
diff --git a/packages/edit-post/src/components/header/header-toolbar/index.js b/packages/edit-post/src/components/header/header-toolbar/index.js
index cc2efea4bf657a..e2d287346bc899 100644
--- a/packages/edit-post/src/components/header/header-toolbar/index.js
+++ b/packages/edit-post/src/components/header/header-toolbar/index.js
@@ -143,7 +143,7 @@ function HeaderToolbar() {
/* translators: button label text should, if possible, be under 16
characters. */
label={ _x(
- 'Add block',
+ 'Toggle block inserter',
'Generic label for block inserter button'
) }
showTooltip={ ! showIconLabels }
diff --git a/packages/edit-post/src/components/header/header-toolbar/style.scss b/packages/edit-post/src/components/header/header-toolbar/style.scss
index c71dfebddfc66f..f1be46ff3c2803 100644
--- a/packages/edit-post/src/components/header/header-toolbar/style.scss
+++ b/packages/edit-post/src/components/header/header-toolbar/style.scss
@@ -15,6 +15,17 @@
.edit-post-header-toolbar__left > .edit-post-header-toolbar__inserter-toggle {
display: inline-flex;
+
+ svg {
+ transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
+ @include reduce-motion("transition");
+ }
+
+ &.is-pressed {
+ svg {
+ transform: rotate(45deg);
+ }
+ }
}
// Hide table of contents and block navigation on mobile.
diff --git a/packages/edit-site/src/components/header/index.js b/packages/edit-site/src/components/header/index.js
index eff62335460e43..9e6a6fbf31a18d 100644
--- a/packages/edit-site/src/components/header/index.js
+++ b/packages/edit-site/src/components/header/index.js
@@ -106,7 +106,7 @@ export default function Header( { openEntitiesSavedStates } ) {
} }
icon={ plus }
label={ _x(
- 'Add block',
+ 'Toggle block inserter',
'Generic label for block inserter button'
) }
/>
diff --git a/packages/edit-site/src/components/header/style.scss b/packages/edit-site/src/components/header/style.scss
index 859c26d8c1e456..1b4d68e1c8f71b 100644
--- a/packages/edit-site/src/components/header/style.scss
+++ b/packages/edit-site/src/components/header/style.scss
@@ -79,6 +79,17 @@ body.is-navigation-sidebar-open {
width: $grid-unit-40;
height: $grid-unit-40;
padding: 0;
+
+ svg {
+ transition: transform cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
+ @include reduce-motion("transition");
+ }
+
+ &.is-pressed {
+ svg {
+ transform: rotate(45deg);
+ }
+ }
}
}
From 836e6db06b0eba2783b02ae09cfebcd2d098a88c Mon Sep 17 00:00:00 2001
From: Bernie Reiter
Date: Wed, 31 Mar 2021 17:36:32 +0200
Subject: [PATCH 13/53] Revert "Bump plugin version to 10.3.1"
This reverts commit 87db183c6bb3db0e9ac0c72cf5abe05260ce6043.
---
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 06561f7d0b06b6..74dabab72d3a69 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.6
* Requires PHP: 5.6
- * Version: 10.3.1
+ * Version: 10.3.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
diff --git a/package-lock.json b/package-lock.json
index 4746a384a82cbe..81b7f2e4bb11da 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.1",
+ "version": "10.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index a65896086d3acc..cb2e78fcbb1b3a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
- "version": "10.3.1",
+ "version": "10.3.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
diff --git a/readme.txt b/readme.txt
index 55143c81c6ddd2..f18e4630ba4458 100644
--- a/readme.txt
+++ b/readme.txt
@@ -55,4 +55,4 @@ View release page.
+To read the changelog for Gutenberg 10.3.0, please navigate to the release page.
From e70720a62afbd01e32b90766783af4c8e54129f9 Mon Sep 17 00:00:00 2001
From: Janw Oostendorp
Date: Wed, 31 Mar 2021 18:31:23 +0200
Subject: [PATCH 14/53] Added a practical example of adding a component to the
sidebar. (#30379)
* Added a practical example of adding a component to the sidebar.
* Apply suggestions from code review
I needed to unresolve the comments so I could commit them. In GitHub, it is possible to accept the suggestions and commit them directly from the Files tab in the PR.
Co-authored-by: Marcus Kazmierczak
---
.../block-controls-toolbar-and-sidebar.md | 111 +++++++++++++++---
.../plugin-sidebar-1-up-and-running.md | 2 +
2 files changed, 94 insertions(+), 19 deletions(-)
diff --git a/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md b/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
index 957104508fdd2a..eecbd3d0977c15 100644
--- a/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
+++ b/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md
@@ -44,26 +44,17 @@ registerBlockType( 'gutenberg-examples/example-04-controls-esnext', {
alignment: 'right',
},
},
- edit: ( props ) => {
- const {
- attributes: {
- content,
- alignment,
- },
- } = props;
-
- const blockProps = useBlockProps();
-
+ edit: ( {attributes, setAttributes} ) => {
const onChangeContent = ( newContent ) => {
- props.setAttributes( { content: newContent } );
+ setAttributes( { content: newContent } );
};
const onChangeAlignment = ( newAlignment ) => {
- props.setAttributes( { alignment: newAlignment === undefined ? 'none' : newAlignment } );
+ setAttributes( { alignment: newAlignment === undefined ? 'none' : newAlignment } );
};
return (
-
+
{
);
@@ -131,7 +122,6 @@ registerBlockType( 'gutenberg-examples/example-04-controls-esnext', {
edit: function( props ) {
var content = props.attributes.content;
var alignment = props.attributes.alignment;
- var blockProps = useBlockProps();
function onChangeContent( newContent ) {
props.setAttributes( { content: newContent } );
@@ -142,8 +132,8 @@ registerBlockType( 'gutenberg-examples/example-04-controls-esnext', {
}
return el(
- 'div',
- blockProps,
+ 'div',
+ useBlockProps(),
el(
BlockControls,
{ key: 'controls' },
@@ -192,7 +182,7 @@ registerBlockType( 'gutenberg-examples/example-04-controls-esnext', {
Note that `BlockControls` is only visible when the block is currently selected and in visual editing mode. `BlockControls` are not shown when editing a block in HTML editing mode.
-## Inspector
+## Settings Sidebar
![Screenshot of the inspector panel focused on the settings for a Paragraph block](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/assets/inspector.png)
@@ -203,6 +193,89 @@ If you have settings that affects only selected content inside a block (example:
The Block Tab is shown in place of the Document Tab when a block is selected.
Similar to rendering a toolbar, if you include an `InspectorControls` element in the return value of your block type's `edit` function, those controls will be shown in the Settings Sidebar region.
+The following example adds 2 color palettes to the sidebar, one for the text color and one for the background color.
+
+```jsx
+import { registerBlockType } from '@wordpress/blocks';
+import { __ } from '@wordpress/i18n';
+import { TextControl } from '@wordpress/components';
+
+import {
+ useBlockProps,
+ ColorPalette,
+ InspectorControls,
+} from '@wordpress/block-editor';
+
+registerBlockType( 'create-block/gutenpride', {
+ apiVersion: 2,
+ attributes: {
+ message: {
+ type: 'string',
+ source: 'text',
+ selector: 'div',
+ default: '', // empty default
+ },
+ bg_color: { type: 'string', default: '#000000' },
+ text_color: { type: 'string', default: '#ffffff' },
+ },
+ edit: ( { attributes, setAttributes } ) => {
+ const onChangeBGColor = ( hexColor ) => {
+ setAttributes( { bg_color: hexColor } );
+ };
+
+ const onChangeTextColor = ( hexColor ) => {
+ setAttributes( { text_color: hexColor } );
+ };
+
+ return (
+
+ );
+ },
+} );
+
+```
Block controls rendered in both the toolbar and sidebar will also be used when
multiple blocks of the same type are selected.
diff --git a/docs/how-to-guides/sidebar-tutorial/plugin-sidebar-1-up-and-running.md b/docs/how-to-guides/sidebar-tutorial/plugin-sidebar-1-up-and-running.md
index 0f7a9410b78596..f908c59e6d194a 100644
--- a/docs/how-to-guides/sidebar-tutorial/plugin-sidebar-1-up-and-running.md
+++ b/docs/how-to-guides/sidebar-tutorial/plugin-sidebar-1-up-and-running.md
@@ -1,5 +1,7 @@
# Get a Sidebar up and Running
+_Note: this tutorial covers a custom sidebar, Adding controls to the sidebar is covered in [Block Toolbar and Settings Sidebar](/docs/how-to-guides/block-tutorial/block-controls-toolbar-and-sidebar.md)_
+
The first step in the journey is to tell the editor that there is a new plugin that will have its own sidebar. You can do so by using the [registerPlugin](/packages/plugins/README.md), [PluginSidebar](/packages/edit-post/README.md#pluginsidebar), and [createElement](/packages/element/README.md) utilities provided by WordPress, to be found in the `@wordpress/plugins`, `@wordpress/edit-post`, and `@wordpress/element` [packages](/docs/reference-guides/packages.md), respectively.
Add the following code to a JavaScript file called `plugin-sidebar.js` and save it within your plugin's directory:
From df8e7307404818446c3ffd0d86ac6584fa15a911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?=
Date: Wed, 31 Mar 2021 19:02:09 +0200
Subject: [PATCH 15/53] Gutenberg Plugin: Remove deprecations planned for 10.3
release (#30417)
* Gutenberg Plugin: Remove deprecations planned for 10.3 release
* Docs: Add changelog entry
---
packages/interface/CHANGELOG.md | 4 ++++
.../interface/src/components/action-item/index.js | 15 +--------------
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md
index b7e838b04ad30b..8fe1eb16ff1a96 100644
--- a/packages/interface/CHANGELOG.md
+++ b/packages/interface/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### Breaking Changes
+
+- Passing a tuple of components with `as` prop to `ActionItem.Slot` component is no longer supported. Please pass a component with `as` prop instead ([#30417](https://github.com/WordPress/gutenberg/pull/30417)).
+
## 1.1.0 (2021-03-17)
### Deprecations
diff --git a/packages/interface/src/components/action-item/index.js b/packages/interface/src/components/action-item/index.js
index 23d3e147eefe3c..b19a573f1016b0 100644
--- a/packages/interface/src/components/action-item/index.js
+++ b/packages/interface/src/components/action-item/index.js
@@ -1,13 +1,12 @@
/**
* External dependencies
*/
-import { isArray, isEmpty, noop } from 'lodash';
+import { isEmpty, noop } from 'lodash';
/**
* WordPress dependencies
*/
import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
-import deprecated from '@wordpress/deprecated';
import { Children } from '@wordpress/element';
function ActionItemSlot( {
@@ -17,18 +16,6 @@ function ActionItemSlot( {
bubblesVirtually,
...props
} ) {
- if ( isArray( Component ) ) {
- deprecated(
- 'Passing a tuple of components with `as` prop to `ActionItem.Slot` component',
- {
- since: '10.2',
- plugin: 'Gutenberg',
- alternative: 'a component with `as` prop',
- version: '10.3',
- }
- );
- Component = Component[ 0 ];
- }
return (
Date: Wed, 31 Mar 2021 19:00:18 +0000
Subject: [PATCH 16/53] Update Changelog for 10.3.0
---
changelog.txt | 393 +++++++++++++++++++++++++-------------------------
1 file changed, 199 insertions(+), 194 deletions(-)
diff --git a/changelog.txt b/changelog.txt
index 603d1a298dee94..50eb6f10d5be23 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,223 +1,228 @@
== Changelog ==
-= 10.3.0-rc.1 =
-
-### Features
-
-- Move theme location settings to navigation editor sidebar. ([29458](https://github.com/WordPress/gutenberg/pull/29458))
+= 10.3.0 =
### Enhancements
-- File block: Make the editor markup match the frontend. ([30148](https://github.com/WordPress/gutenberg/pull/30148))
-- Add 'since' versions to the deprecated features. ([30072](https://github.com/WordPress/gutenberg/pull/30072))
-- Better CSS reset style loader order. ([30034](https://github.com/WordPress/gutenberg/pull/30034))
-- Add 'since' option to deprecated function. ([30017](https://github.com/WordPress/gutenberg/pull/30017))
-- Normalize the block toolbar of the audio, file, media and text, video, site logo and post featured image blocks. ([30012](https://github.com/WordPress/gutenberg/pull/30012))
-- Try: Add post content description. ([29971](https://github.com/WordPress/gutenberg/pull/29971))
-- Media: Use image default size from settings. ([29966](https://github.com/WordPress/gutenberg/pull/29966))
-- Components: Allow multiple words in the autocomplete phrase matcher. ([29939](https://github.com/WordPress/gutenberg/pull/29939))
-- Persistent List View: Add visual support for multiple selected blocks. ([29878](https://github.com/WordPress/gutenberg/pull/29878))
-- Normalize the block toolbar for more blocks: Button, buttons, list, heading, paragraph and quote. ([29863](https://github.com/WordPress/gutenberg/pull/29863))
-- Create block: Require WordPress 5.7 by default and source it from the main plugin file. ([29757](https://github.com/WordPress/gutenberg/pull/29757))
-- List View and Block List: Update hover, focus, highlight, select borders. ([29636](https://github.com/WordPress/gutenberg/pull/29636))
-- Cover Block: Normalize the block toolbar. ([29247](https://github.com/WordPress/gutenberg/pull/29247))
-- Editor Styles: Add a transform for button rules. ([29229](https://github.com/WordPress/gutenberg/pull/29229))
-- Improve block inserter keyboard navigation. ([26938](https://github.com/WordPress/gutenberg/pull/26938))
+- Add `since` versions to the deprecated features. ([30072](https://github.com/WordPress/gutenberg/pull/30072))
+- Blocks: Add "theme" category and better present Template Parts in the inserter. ([30020](https://github.com/WordPress/gutenberg/pull/30020))
+- Block Editor:
+ - Add drag handle to select mode. ([28815](https://github.com/WordPress/gutenberg/pull/28815))
+ - Improve block inserter keyboard navigation. ([26938](https://github.com/WordPress/gutenberg/pull/26938))
+ - Open admin sidebar menu over editor on small screens. ([29955](https://github.com/WordPress/gutenberg/pull/29955))
+- Block Library:
+ - Cover: Allow drag and drop media replacement. ([29813](https://github.com/WordPress/gutenberg/pull/29813))
+ - File: Make the editor markup match the frontend. ([30148](https://github.com/WordPress/gutenberg/pull/30148))
+ - Social Links: Improve selected state of empty block. ([29756](https://github.com/WordPress/gutenberg/pull/29756))
+ - Standardize the groups in the block toolbar. ([30012](https://github.com/WordPress/gutenberg/pull/30012), [29247](https://github.com/WordPress/gutenberg/pull/29247), [29863](https://github.com/WordPress/gutenberg/pull/29863))
+ - Verse block: Add support for the padding to the verse block. ([29820](https://github.com/WordPress/gutenberg/pull/29820))
+- Components: Allow multiple words in the autocomplete phrase matcher. ([29939](https://github.com/WordPress/gutenberg/pull/29939))
+- Gutenberg Plugin: Improved cache bust without `filemtime` for assets. ([29775](https://github.com/WordPress/gutenberg/pull/29775))
+- Icons: Hint the lowercase icon by 0.15px to correct the font weight appearance. ([29754](https://github.com/WordPress/gutenberg/pull/29754))
+- Media: Use image default size from settings. ([29966](https://github.com/WordPress/gutenberg/pull/29966))
### New APIs
-- Copy to clipboard hook: Use ref callback. ([29643](https://github.com/WordPress/gutenberg/pull/29643))
+- Compose: Add new `useCopyToClipboard` hook. ([29643](https://github.com/WordPress/gutenberg/pull/29643))
+- Deprecated: Add `since` option to `deprecated` function. ([30017](https://github.com/WordPress/gutenberg/pull/30017))
### Bug Fixes
-- RichText: Fix inline display warning. ([30193](https://github.com/WordPress/gutenberg/pull/30193))
-- Fix regression with multi select style. ([30128](https://github.com/WordPress/gutenberg/pull/30128))
-- Add check to avoid PHP warnings. ([30127](https://github.com/WordPress/gutenberg/pull/30127))
-- Fix navigation mode focus. ([30126](https://github.com/WordPress/gutenberg/pull/30126))
-- Block Editor: Ensure that uncategorized block types are properly handled. ([30125](https://github.com/WordPress/gutenberg/pull/30125))
-- Blocks: Adding onRemove event to verse block. ([30104](https://github.com/WordPress/gutenberg/pull/30104))
-- Navigation component: Align item text to the left/right. ([30083](https://github.com/WordPress/gutenberg/pull/30083))
-- Restore the default editor font for the non FSE themes. ([30080](https://github.com/WordPress/gutenberg/pull/30080))
-- Fix: Kind attribute missing subtitle value in video text track. ([30040](https://github.com/WordPress/gutenberg/pull/30040))
-- Fix persistence of Preferences in site editor. ([30019](https://github.com/WordPress/gutenberg/pull/30019))
-- Writing flow: Fix tab behaviour. ([30000](https://github.com/WordPress/gutenberg/pull/30000))
-- Fix sibling block inserter displaying at end of block list. ([29920](https://github.com/WordPress/gutenberg/pull/29920))
-- Prevent PanelBody title from being overlapped by arrow. ([29914](https://github.com/WordPress/gutenberg/pull/29914))
-- Block Editor: Fix the issue with block style preview when example missing. ([29894](https://github.com/WordPress/gutenberg/pull/29894))
-- useMergeRefs: Call when dependency changes after ref change. ([29892](https://github.com/WordPress/gutenberg/pull/29892))
-- Fix mover width/size regressions. ([29889](https://github.com/WordPress/gutenberg/pull/29889))
-- Try: Fix gallery item clicking. ([29860](https://github.com/WordPress/gutenberg/pull/29860))
-- Fix broken image link in the documentation main README. ([29857](https://github.com/WordPress/gutenberg/pull/29857))
-- Docs: Fix broken link to developer resources in README.md. (#29795). ([29796](https://github.com/WordPress/gutenberg/pull/29796))
-- Site Editor: Remove header toolbar transition in reduced-motion mode. ([29764](https://github.com/WordPress/gutenberg/pull/29764))
-- Docs: Fix rebase error. ([29753](https://github.com/WordPress/gutenberg/pull/29753))
-- Storybook playground - Fix block editor shortcuts. ([29750](https://github.com/WordPress/gutenberg/pull/29750))
-- Keep post publishing popover open when a date is clicked. ([29738](https://github.com/WordPress/gutenberg/pull/29738))
-- Fix React warning in Text Control. ([29724](https://github.com/WordPress/gutenberg/pull/29724))
-- Try: Fix overzealous aspect ratio scaling for embeds. ([29510](https://github.com/WordPress/gutenberg/pull/29510))
-- Embed: Fix select on focus. ([29431](https://github.com/WordPress/gutenberg/pull/29431))
-- Raw handling: Fix pasting special spaces. ([28077](https://github.com/WordPress/gutenberg/pull/28077))
-- Fix/image block reset sizes on external URL change. ([26879](https://github.com/WordPress/gutenberg/pull/26879))
+- Block Editor:
+ - Ensure that uncategorized block types are properly handled. ([30125](https://github.com/WordPress/gutenberg/pull/30125))
+ - Fix mover width/size regressions. ([29889](https://github.com/WordPress/gutenberg/pull/29889))
+ - Fix navigation mode focus. ([30126](https://github.com/WordPress/gutenberg/pull/30126))
+ - Fix regression with multi select style. ([30128](https://github.com/WordPress/gutenberg/pull/30128))
+ - Fix the issue with block style preview when example missing. ([29894](https://github.com/WordPress/gutenberg/pull/29894))
+ - Fix sibling block inserter displaying at end of block list. ([29920](https://github.com/WordPress/gutenberg/pull/29920))
+ - Revert showing empty paragraphs on fronted. ([29809](https://github.com/WordPress/gutenberg/pull/29809))
+ - Show the active block variation's icon in Select mode. ([30143](https://github.com/WordPress/gutenberg/pull/30143))
+- Blocks: Adding onRemove event to verse block. ([30104](https://github.com/WordPress/gutenberg/pull/30104))
+- Block Library:
+ - Cover: Improve disabled media buttons check for placeholder. ([29858](https://github.com/WordPress/gutenberg/pull/29858))
+ - Embed:
+ - Fix overzealous aspect ratio scaling for embeds. ([29510](https://github.com/WordPress/gutenberg/pull/29510))
+ - Embed: Fix select on focus. ([29431](https://github.com/WordPress/gutenberg/pull/29431))
+ - Gallery: Fix gallery item clicking. ([29860](https://github.com/WordPress/gutenberg/pull/29860))
+ - Image:
+ - Fix block reset sizes on external URL change. ([26879](https://github.com/WordPress/gutenberg/pull/26879))
+ - Fix undo step with temporary URL. ([30114](https://github.com/WordPress/gutenberg/pull/30114))
+ - Social Link: More accessible labels. ([29659](https://github.com/WordPress/gutenberg/pull/29659))
+ - Video: Fix kind attribute missing subtitle value in video text track. ([30040](https://github.com/WordPress/gutenberg/pull/30040))
+- Components:
+ - Don't display Guide's page control if there is only one page. ([29629](https://github.com/WordPress/gutenberg/pull/29629))
+ - Prevent PanelBody title from being overlapped by arrow. ([29914](https://github.com/WordPress/gutenberg/pull/29914))
+- Compose: Call `useMergeRefs` when dependency changes after ref change. ([29892](https://github.com/WordPress/gutenberg/pull/29892))
+- Copy:
+ - Restore dot at the end of a sentence. ([29897](https://github.com/WordPress/gutenberg/pull/29897))
+ - Update the layout alignment description for better clarity. ([29974](https://github.com/WordPress/gutenberg/pull/29974))
+- Gutenberg Plugin: Update "requires at least" value to 5.6. ([29646](https://github.com/WordPress/gutenberg/pull/29646))
+- E2E Tests: Stabilize randomly failing tests in trunk. ([29836](https://github.com/WordPress/gutenberg/pull/29836))
+- Navigation Component: Align item text to the left/right. ([30083](https://github.com/WordPress/gutenberg/pull/30083))
+- Post Editor:
+ - Fix post editor layout regression. ([30093](https://github.com/WordPress/gutenberg/pull/30093))
+ - Keep post publishing popover open when a date is clicked. ([29738](https://github.com/WordPress/gutenberg/pull/29738), [29893](https://github.com/WordPress/gutenberg/pull/29893))
+- RichText: Fix inline display warning. ([30193](https://github.com/WordPress/gutenberg/pull/30193))
+- Themes: Restore the default editor font for the non FSE themes. ([30080](https://github.com/WordPress/gutenberg/pull/30080))
+- Raw Handling: Fix pasting special spaces. ([28077](https://github.com/WordPress/gutenberg/pull/28077))
+- Storybook: Fix block editor shortcuts. ([29750](https://github.com/WordPress/gutenberg/pull/29750))
+- Writing Flow:
+ - Fix `caretRangeFromPoint`. ([30031](https://github.com/WordPress/gutenberg/pull/30031))
+ - Fix tab behavior. ([30000](https://github.com/WordPress/gutenberg/pull/30000))
+ - Remove arrow nav limitations. ([30057](https://github.com/WordPress/gutenberg/pull/30057))
### Performance
-- Button block: Use early return to optimize save.js. ([29781](https://github.com/WordPress/gutenberg/pull/29781))
-- Parsing patterns when idling (performance follow-up for inserting patterns into containers). ([29444](https://github.com/WordPress/gutenberg/pull/29444))
+- Block Editor:
+ - Optimise multi-selection select calls. ([30140](https://github.com/WordPress/gutenberg/pull/30140))
+ - When inserting Block Patterns they get parsed when the browser is idle. ([29444](https://github.com/WordPress/gutenberg/pull/29444))
+- Block Library: Use early return in the Button block to optimize save.js. ([29781](https://github.com/WordPress/gutenberg/pull/29781))
### Experiments
-- Fix padding issues with nav screen. ([30183](https://github.com/WordPress/gutenberg/pull/30183))
-- Global Styles: Skip null when translating settings. ([30171](https://github.com/WordPress/gutenberg/pull/30171))
-- Navigation Block: Increase importance of submenus staying open. ([30169](https://github.com/WordPress/gutenberg/pull/30169))
-- Polish navigation editor menu settings styles. ([30168](https://github.com/WordPress/gutenberg/pull/30168))
-- Fix minor styling issues with nav editor. ([30129](https://github.com/WordPress/gutenberg/pull/30129))
-- Navigation: Consistently provide fallback variations. ([30117](https://github.com/WordPress/gutenberg/pull/30117))
-- Fix Template Part Alignments behavior. ([30099](https://github.com/WordPress/gutenberg/pull/30099))
-- Site Editor (Experiment): Automatically open the sidebar to the appropriate template sub-menu. ([30098](https://github.com/WordPress/gutenberg/pull/30098))
-- Fix post editor layout regression. ([30093](https://github.com/WordPress/gutenberg/pull/30093))
-- Optimistically continue with empty data when user data for global styles is not a JSON. ([30088](https://github.com/WordPress/gutenberg/pull/30088))
-- Fix navigation screen font. ([30085](https://github.com/WordPress/gutenberg/pull/30085))
-- Use a default sans serif font for the widget screen. ([30084](https://github.com/WordPress/gutenberg/pull/30084))
-- Remove alignments from the root level of the site editor. ([30079](https://github.com/WordPress/gutenberg/pull/30079))
-- Fix query loop margin. ([30078](https://github.com/WordPress/gutenberg/pull/30078))
-- Add layout support to the template part block. ([30077](https://github.com/WordPress/gutenberg/pull/30077))
-- Load block editor assets in the navigation and widget editors. ([30076](https://github.com/WordPress/gutenberg/pull/30076))
-- Fix post comment count block attribute. ([30056](https://github.com/WordPress/gutenberg/pull/30056))
-- Fix paragraph margin specificity inside layout containers. ([30038](https://github.com/WordPress/gutenberg/pull/30038))
-- Block Supports: Allow skipping serialization of border. ([30035](https://github.com/WordPress/gutenberg/pull/30035))
-- Expose Template part block variations to the Inserter. ([30032](https://github.com/WordPress/gutenberg/pull/30032))
-- Fix edge case where the default layout could be undefined. ([30024](https://github.com/WordPress/gutenberg/pull/30024))
-- Add "theme" category and better present template parts in the inserter. ([30020](https://github.com/WordPress/gutenberg/pull/30020))
-- Use the interface package for the navigation screen. ([30013](https://github.com/WordPress/gutenberg/pull/30013))
-- Unset font weight and text decoration inheritance in nav block. ([30011](https://github.com/WordPress/gutenberg/pull/30011))
-- Try: Add line-height to Navigation block. ([30010](https://github.com/WordPress/gutenberg/pull/30010))
-- Fix link items in navigation screen. ([30009](https://github.com/WordPress/gutenberg/pull/30009))
-- GlobalStyles: Remove kebab-case camelCase transformations. ([29986](https://github.com/WordPress/gutenberg/pull/29986))
-- Post Content: Add support for experimental layout. ([29982](https://github.com/WordPress/gutenberg/pull/29982))
-- Navigation Block / Page List: Unify menu item styles. ([29975](https://github.com/WordPress/gutenberg/pull/29975))
-- Fix navigation editor block toolbar not visible on small screens. ([29967](https://github.com/WordPress/gutenberg/pull/29967))
-- Editor Layout: Open sidebar menu over editor on small screens. ([29955](https://github.com/WordPress/gutenberg/pull/29955))
-- [Query block] Remove unused QueryProvider. ([29947](https://github.com/WordPress/gutenberg/pull/29947))
-- Allow themes to use any styles in the theme.json whether or not the block supports it. ([29941](https://github.com/WordPress/gutenberg/pull/29941))
-- Page List & Navigation Screen: Fix flyout bg color in page list. ([29932](https://github.com/WordPress/gutenberg/pull/29932))
-- Fix navigation screen inserter horizontal scrollbar. ([29930](https://github.com/WordPress/gutenberg/pull/29930))
-- Polish nav screen slightly. ([29926](https://github.com/WordPress/gutenberg/pull/29926))
-- Navigation Editor: Improve default label of location select. ([29908](https://github.com/WordPress/gutenberg/pull/29908))
-- Navigation Editor: Show all menus in manage locations. ([29906](https://github.com/WordPress/gutenberg/pull/29906))
-- Block Editor: Add client ID trees selectors. ([29902](https://github.com/WordPress/gutenberg/pull/29902))
-- Lighten the post content block. ([29898](https://github.com/WordPress/gutenberg/pull/29898))
-- Navigation Menu: Show submenus only on select in the editor. ([29869](https://github.com/WordPress/gutenberg/pull/29869))
-- Update post content icon, unuse justify. ([29867](https://github.com/WordPress/gutenberg/pull/29867))
-- Fix template saving issue after switching themes. ([29842](https://github.com/WordPress/gutenberg/pull/29842))
-- Add padding to link placeholder. ([29832](https://github.com/WordPress/gutenberg/pull/29832))
-- Update Post Title markup so that editor and front match. ([29824](https://github.com/WordPress/gutenberg/pull/29824))
-- Verse block: Add support for the padding to the verse block. ([29820](https://github.com/WordPress/gutenberg/pull/29820))
-- List View: Visual and design improvements. ([29769](https://github.com/WordPress/gutenberg/pull/29769))
-- Add loginout block. ([29766](https://github.com/WordPress/gutenberg/pull/29766))
-- Fix navigation editor saving. ([29749](https://github.com/WordPress/gutenberg/pull/29749))
-- Fix navigation block styles in the navigation editor. ([29748](https://github.com/WordPress/gutenberg/pull/29748))
-- Keep submenus open onselect in the editor. ([29713](https://github.com/WordPress/gutenberg/pull/29713))
-- Fix navigation editor link search suggestions. ([29707](https://github.com/WordPress/gutenberg/pull/29707))
-- Iterate on widget REST API endpoints. ([29649](https://github.com/WordPress/gutenberg/pull/29649))
-- Query title block - Archive Title. ([29428](https://github.com/WordPress/gutenberg/pull/29428))
-- Add a layout configuration to the group and theme.json and make alignments declarative. ([29335](https://github.com/WordPress/gutenberg/pull/29335))
-- First step towards hybrid themes: Fallback to PHP templates. ([29026](https://github.com/WordPress/gutenberg/pull/29026))
-- Fix Site title: Different markup in the editor and on the frontend. ([29021](https://github.com/WordPress/gutenberg/pull/29021))
-- Try: Allow vertical inserter in the nav block. ([28833](https://github.com/WordPress/gutenberg/pull/28833))
-- Add preload_paths filter for widgets screen and full site editing. ([28701](https://github.com/WordPress/gutenberg/pull/28701))
-- Site Editor (Experiment): Automatically open the sidebar to the appropriate menu. ([26964](https://github.com/WordPress/gutenberg/pull/26964))
+- Components:
+ - Add Heading. ([29592](https://github.com/WordPress/gutenberg/pull/29592))
+ - Button: Add a default type of button. ([29900](https://github.com/WordPress/gutenberg/pull/29900))
+- Customizer: Add widgets customize inspector. ([29755](https://github.com/WordPress/gutenberg/pull/29755))
+- Full-Site Editing:
+ - Add a layout configuration to the Group block and `theme.json` and make alignments declarative. ([29335](https://github.com/WordPress/gutenberg/pull/29335))
+ - Add client ID trees selectors in block navigation. ([29902](https://github.com/WordPress/gutenberg/pull/29902))
+ - Add description field to Post Content block. ([29971](https://github.com/WordPress/gutenberg/pull/29971))
+ - Add Log In/Out block. ([29766](https://github.com/WordPress/gutenberg/pull/29766))
+ - Add Query Title block and Archive Title variation. ([29428](https://github.com/WordPress/gutenberg/pull/29428))
+ - Add Term Description block. ([29613](https://github.com/WordPress/gutenberg/pull/29613))
+ - Add preload_paths filter for widgets screen and full site editing. ([28701](https://github.com/WordPress/gutenberg/pull/28701))
+ - Add support for experimental layout in Post Content block. ([29982](https://github.com/WordPress/gutenberg/pull/29982))
+ - Add layout support to the Template Part block. ([30077](https://github.com/WordPress/gutenberg/pull/30077))
+ - Add link color option in Site Title block. ([29924](https://github.com/WordPress/gutenberg/pull/29924))
+ - Always use full screen mode. ([29489](https://github.com/WordPress/gutenberg/pull/29489))
+ - Automatically open the sidebar to the appropriate menu. ([26964](https://github.com/WordPress/gutenberg/pull/26964), [30098](https://github.com/WordPress/gutenberg/pull/30098))
+ - Close navigation panel after template selection. ([29956](https://github.com/WordPress/gutenberg/pull/29956))
+ - Expose Template Part block variations to the Inserter. ([30032](https://github.com/WordPress/gutenberg/pull/30032))
+ - First step towards hybrid themes – fallback to PHP templates. ([29026](https://github.com/WordPress/gutenberg/pull/29026))
+ - Fix block toolbar from overlapping navigation panel. ([29918](https://github.com/WordPress/gutenberg/pull/29918))
+ - Fix different markup in the editor and on the frontend for the Site Title block. ([29021](https://github.com/WordPress/gutenberg/pull/29021))
+ - Fix edge case where the default layout could be undefined. ([30024](https://github.com/WordPress/gutenberg/pull/30024))
+ - Fix persistence of Preferences in site editor. ([30019](https://github.com/WordPress/gutenberg/pull/30019))
+ - Fix Post Comment Count block attribute. ([30056](https://github.com/WordPress/gutenberg/pull/30056))
+ - Fix Query Loop block margin. ([30078](https://github.com/WordPress/gutenberg/pull/30078))
+ - Fix Template Part alignments behavior. ([30099](https://github.com/WordPress/gutenberg/pull/30099))
+ - Fix template saving issue after switching themes. ([29842](https://github.com/WordPress/gutenberg/pull/29842))
+ - Polish site button focus/hover styles in post and site editor. ([29888](https://github.com/WordPress/gutenberg/pull/29888))
+ - Prevent navigation panel focus when hidden. ([29600](https://github.com/WordPress/gutenberg/pull/29600))
+ - Refactor the Post Content block. ([29898](https://github.com/WordPress/gutenberg/pull/29898))
+ - Remove alignments from the root level of the site editor. ([30079](https://github.com/WordPress/gutenberg/pull/30079))
+ - Remove header toolbar transition in reduced-motion mode. ([29764](https://github.com/WordPress/gutenberg/pull/29764))
+ - Remove unused QueryProvider in Query block. ([29947](https://github.com/WordPress/gutenberg/pull/29947))
+ - Template Part: Identify template parts in error messages. ([28398](https://github.com/WordPress/gutenberg/pull/28398))
+ - Update Post Content icon, unuse justify. ([29867](https://github.com/WordPress/gutenberg/pull/29867))
+ - Update Post Title markup so that editor and front match. ([29824](https://github.com/WordPress/gutenberg/pull/29824))
+ - Update template details popover. ([29439](https://github.com/WordPress/gutenberg/pull/29439))
+- Global Styles:
+ - Allow themes to use any styles in the `theme.json` whether or not the block supports it. ([29941](https://github.com/WordPress/gutenberg/pull/29941))
+ - Better CSS reset style loader order. ([30034](https://github.com/WordPress/gutenberg/pull/30034))
+ - Block Supports: Allow skipping serialization of border. ([30035](https://github.com/WordPress/gutenberg/pull/30035))
+ - Optimistically continue with empty data when user data for global styles is not a JSON. ([30088](https://github.com/WordPress/gutenberg/pull/30088))
+ - Remove kebab-case camelCase transformations. ([29986](https://github.com/WordPress/gutenberg/pull/29986))
+ - Skip `null` when translating settings. ([30171](https://github.com/WordPress/gutenberg/pull/30171))
+ - Translate custom templates in `theme.json`. ([29828](https://github.com/WordPress/gutenberg/pull/29828))
+- Navigation Editor and Block:
+ - Add line-height to Navigation block. ([30010](https://github.com/WordPress/gutenberg/pull/30010))
+ - Add padding to Navigation Link placeholder. ([29832](https://github.com/WordPress/gutenberg/pull/29832))
+ - Allow vertical inserter in the Navigation block. ([28833](https://github.com/WordPress/gutenberg/pull/28833))
+ - Consistently provide fallback variations for the block. ([30117](https://github.com/WordPress/gutenberg/pull/30117))
+ - Enable list view. ([29936](https://github.com/WordPress/gutenberg/pull/29936))
+ - Fix flyout background color in Page List block. ([29932](https://github.com/WordPress/gutenberg/pull/29932))
+ - Fix link items in navigation screen. ([30009](https://github.com/WordPress/gutenberg/pull/30009))
+ - Fix minor styling issues with nav editor. ([30129](https://github.com/WordPress/gutenberg/pull/30129))
+ - Fix Navigation block styles in the navigation editor. ([29748](https://github.com/WordPress/gutenberg/pull/29748))
+ - Fix navigation editor link search suggestions. ([29707](https://github.com/WordPress/gutenberg/pull/29707))
+ - Fix navigation editor saving. ([29749](https://github.com/WordPress/gutenberg/pull/29749))
+ - Fix navigation screen font. ([30085](https://github.com/WordPress/gutenberg/pull/30085))
+ - Fix navigation screen inserter horizontal scrollbar. ([29930](https://github.com/WordPress/gutenberg/pull/29930))
+ - Fix navigation editor block toolbar not visible on small screens. ([29967](https://github.com/WordPress/gutenberg/pull/29967))
+ - Fix padding issues with nav screen. ([30183](https://github.com/WordPress/gutenberg/pull/30183))
+ - Fix paragraph margin specificity inside layout containers. ([30038](https://github.com/WordPress/gutenberg/pull/30038))
+ - Fix popover anchor in Navigation Link block. ([30173](https://github.com/WordPress/gutenberg/pull/30173))
+ - Improve default label of location select. ([29908](https://github.com/WordPress/gutenberg/pull/29908))
+ - Increase importance of submenus staying open. ([30169](https://github.com/WordPress/gutenberg/pull/30169))
+ - Keep submenus open on select in the editor. ([29713](https://github.com/WordPress/gutenberg/pull/29713))
+ - Match editor markup to rendered in Navigation Link block. ([29935](https://github.com/WordPress/gutenberg/pull/29935))
+ - Move theme location settings to navigation editor sidebar. ([29458](https://github.com/WordPress/gutenberg/pull/29458))
+ - Navigation Menu: Show submenus only on select in the editor. ([29869](https://github.com/WordPress/gutenberg/pull/29869))
+ - Polish navigation screen. ([29926](https://github.com/WordPress/gutenberg/pull/29926), [30168](https://github.com/WordPress/gutenberg/pull/30168))
+ - Simplify focus style in Site Icon block. ([29872](https://github.com/WordPress/gutenberg/pull/29872))
+ - Show all menus in manage locations. ([29906](https://github.com/WordPress/gutenberg/pull/29906))
+ - Unset font weight and text decoration inheritance in Navigation block. ([30011](https://github.com/WordPress/gutenberg/pull/30011))
+ - Use the interface package for the navigation screen. ([30013](https://github.com/WordPress/gutenberg/pull/30013))
+ - Visual and design improvements for List View. ([29769](https://github.com/WordPress/gutenberg/pull/29769))
+- Widgets Editor:
+ - Fix warning when widgets block editor is disabled. ([30318](https://github.com/WordPress/gutenberg/pull/30318))
+ - Iterate on widgets REST API endpoints. ([29649](https://github.com/WordPress/gutenberg/pull/29649))
+ - Load block editor assets in the navigation and widget editors. ([30076](https://github.com/WordPress/gutenberg/pull/30076))
+ - Unify menu item styles for Navigation Block and Page List blocks. ([29975](https://github.com/WordPress/gutenberg/pull/29975))
+ - Use a default sans serif font for the widget screen. ([30084](https://github.com/WordPress/gutenberg/pull/30084))
### Documentation
-- Docs: Clarify the purpose of the `@wordpress/editor` package. ([30136](https://github.com/WordPress/gutenberg/pull/30136))
-- Docs: Remove superfluous sentence in create block tutorial. ([30062](https://github.com/WordPress/gutenberg/pull/30062))
-- Fix renderAppender documentation. ([29925](https://github.com/WordPress/gutenberg/pull/29925))
-- Update block design principles with a new section on how to group controls. ([29816](https://github.com/WordPress/gutenberg/pull/29816))
-- Docs: Fix typos in interface package. ([29740](https://github.com/WordPress/gutenberg/pull/29740))
-- i18n: Replace dead link in README.md. ([29699](https://github.com/WordPress/gutenberg/pull/29699))
+- Block Editor: Fix `renderAppender` documentation. ([29925](https://github.com/WordPress/gutenberg/pull/29925))
+- Handbook:
+ - Fix broken image link in the documentation main README. ([29857](https://github.com/WordPress/gutenberg/pull/29857))
+ - Fix broken link to developer resources in README.md. (#29795). ([29796](https://github.com/WordPress/gutenberg/pull/29796))
+ - Fix link to native-mobile.md in pull request template. ([29923](https://github.com/WordPress/gutenberg/pull/29923))
+ - Fix rebase error. ([29753](https://github.com/WordPress/gutenberg/pull/29753))
+ - Remove superfluous sentence in create block tutorial. ([30062](https://github.com/WordPress/gutenberg/pull/30062))
+ - Update block design principles with a new section on how to group controls. ([29816](https://github.com/WordPress/gutenberg/pull/29816))
+ - Update broken link to Getting Started for the React Native based Mobile Gutenberg. ([30162](https://github.com/WordPress/gutenberg/pull/30162))
+ - Update the quick view image on the documentation homepage. ([29808](https://github.com/WordPress/gutenberg/pull/29808))
+- Editor: Clarify the purpose of the `@wordpress/editor` package. ([30136](https://github.com/WordPress/gutenberg/pull/30136))
+- I18n: Replace dead link in README.md. ([29699](https://github.com/WordPress/gutenberg/pull/29699))
+- Interface: Fix typos in interface package. ([29740](https://github.com/WordPress/gutenberg/pull/29740))
### Code Quality
-- Block editor: Avoid isInsideRootBlock (DOM query) in useFocusFirstElement. ([30178](https://github.com/WordPress/gutenberg/pull/30178))
-- Move nav mode exit from writing flow to block props. ([30175](https://github.com/WordPress/gutenberg/pull/30175))
-- Revert "Add check to avoid PHP warnings". ([30174](https://github.com/WordPress/gutenberg/pull/30174))
-- Block editor: focus mode: Fix opacity for inner blocks, move classes. ([30130](https://github.com/WordPress/gutenberg/pull/30130))
-- Block editor: Move is-typing and is-outline-mode classes up the tree. ([30106](https://github.com/WordPress/gutenberg/pull/30106))
-- Remove obsolete editor styles for List block. ([30094](https://github.com/WordPress/gutenberg/pull/30094))
-- Blocks: Ensure theme category is only added when not provided. ([30089](https://github.com/WordPress/gutenberg/pull/30089))
-- Fix PHPCS warnings. ([30022](https://github.com/WordPress/gutenberg/pull/30022))
-- Rename loginOut to logInOut. ([29979](https://github.com/WordPress/gutenberg/pull/29979))
-- Cleanup the blocks.php file. ([29964](https://github.com/WordPress/gutenberg/pull/29964))
-- Rename getBlockContent to getBlockInnerHTML internally. ([29949](https://github.com/WordPress/gutenberg/pull/29949))
-- RichText: Remove dead and deprecated setFocusedElement. ([29877](https://github.com/WordPress/gutenberg/pull/29877))
-- Refactor ServerSideRender to use React hooks. ([28297](https://github.com/WordPress/gutenberg/pull/28297))
+- API Fetch:
+ - Type several of the middlewares. ([29719](https://github.com/WordPress/gutenberg/pull/29719), [30150](https://github.com/WordPress/gutenberg/pull/30150), [29901](https://github.com/WordPress/gutenberg/pull/29901))
+ - Type the rest of the package. ([30161](https://github.com/WordPress/gutenberg/pull/30161))
+- Block Editor:
+ - Avoid `isInsideRootBlock` (DOM query) in `useFocusFirstElement`. ([30178](https://github.com/WordPress/gutenberg/pull/30178))
+ - Focus mode: Fix opacity for inner blocks, move classes. ([30130](https://github.com/WordPress/gutenberg/pull/30130))
+ - Move class for navigation mode. ([30181](https://github.com/WordPress/gutenberg/pull/30181))
+ - Move `is-typing` and `is-outline-mode` classes up the tree. ([30106](https://github.com/WordPress/gutenberg/pull/30106))
+ - Move nav mode exit from writing flow to block props. ([30175](https://github.com/WordPress/gutenberg/pull/30175))
+- Block Library:
+ - Refactor ServerSideRender to use React hooks. ([28297](https://github.com/WordPress/gutenberg/pull/28297))
+ - Remove obsolete editor styles for List block. ([30094](https://github.com/WordPress/gutenberg/pull/30094))
+ - Rename `loginOut` variable to `logInOut`. ([29979](https://github.com/WordPress/gutenberg/pull/29979))
+- Blocks:
+ - Ensure theme category is only added when not provided. ([30089](https://github.com/WordPress/gutenberg/pull/30089))
+ - Rename getBlockContent to getBlockInnerHTML internally. ([29949](https://github.com/WordPress/gutenberg/pull/29949))
+- Components: Fix React warning in Text Control. ([29724](https://github.com/WordPress/gutenberg/pull/29724))
+- Date: Add types. ([29789](https://github.com/WordPress/gutenberg/pull/29789))
+- DOM:
+ - Add types to `focusable`. ([29787](https://github.com/WordPress/gutenberg/pull/29787), [30030](https://github.com/WordPress/gutenberg/pull/30030))
+ - Split into smaller modules to facilitate typing. ([30044](https://github.com/WordPress/gutenberg/pull/30044))
+- Gutenberg Plugin:
+ - Cleanup the blocks.php file. ([29964](https://github.com/WordPress/gutenberg/pull/29964))
+ - Fix PHPCS warnings. ([30022](https://github.com/WordPress/gutenberg/pull/30022))
+- Packages: Add types directive to api-fetch and date packages. ([30252](https://github.com/WordPress/gutenberg/pull/30252))
+- RichText: Remove dead and deprecated `setFocusedElement`. ([29877](https://github.com/WordPress/gutenberg/pull/29877))
### Tools
-- Workflows: Use Gutenberg token for version bump, changelog commits. ([30212](https://github.com/WordPress/gutenberg/pull/30212))
-- Remove path ignore configs from CI. ([30090](https://github.com/WordPress/gutenberg/pull/30090))
-- Babel Preset: Update Babel to v7.13.x. ([30018](https://github.com/WordPress/gutenberg/pull/30018))
-- end-to-end Tests: Cover the case when using multiple words in the inserter. ([29978](https://github.com/WordPress/gutenberg/pull/29978))
-- Eslint Plugin: Add TypeScript as peer dependency and make it optional. ([29942](https://github.com/WordPress/gutenberg/pull/29942))
-- Fix link to native-mobile.md in pull request template. ([29923](https://github.com/WordPress/gutenberg/pull/29923))
-- Testing: Allow TypeScript modules for transpiled packages. ([29873](https://github.com/WordPress/gutenberg/pull/29873))
-- Set delay to zero in the reduce-motion mixin and tests. ([29762](https://github.com/WordPress/gutenberg/pull/29762))
-- Fix another end-to-end test function name. ([29745](https://github.com/WordPress/gutenberg/pull/29745))
-- Fix test plugin clash. ([29744](https://github.com/WordPress/gutenberg/pull/29744))
-- Release Workflow: Allow triggering manually. ([28138](https://github.com/WordPress/gutenberg/pull/28138))
-
-### Various
-
-- Revert "Editor Styles: Add a transform for button rules". ([30184](https://github.com/WordPress/gutenberg/pull/30184))
-- Block editor: nav mode: Move class. ([30181](https://github.com/WordPress/gutenberg/pull/30181))
-- Nav link block: Fix popover anchor. ([30173](https://github.com/WordPress/gutenberg/pull/30173))
-- Docs: Update broken link to Getting Started for the React Native based Mobile Gutenberg. ([30162](https://github.com/WordPress/gutenberg/pull/30162))
-- api-fetch: Add types to http-v1 middleware. ([30150](https://github.com/WordPress/gutenberg/pull/30150))
-- Show the active block variation's icon in Select mode. ([30143](https://github.com/WordPress/gutenberg/pull/30143))
-- Block editor: Optimise multi-selection select calls. ([30140](https://github.com/WordPress/gutenberg/pull/30140))
-- Image block: Fix undo step with temporary URL. ([30114](https://github.com/WordPress/gutenberg/pull/30114))
-- Writing flow: Remove arrow nav limitations. ([30057](https://github.com/WordPress/gutenberg/pull/30057))
-- dom: Split into smaller modules to facilitate typing. ([30044](https://github.com/WordPress/gutenberg/pull/30044))
-- Writing flow: Fix caretRangeFromPoint. ([30031](https://github.com/WordPress/gutenberg/pull/30031))
-- dom: Add types to `focusable`. ([30030](https://github.com/WordPress/gutenberg/pull/30030))
-- Update the layout alignment description for better clarity. ([29974](https://github.com/WordPress/gutenberg/pull/29974))
-- Site Editor: Close navigation panel after template selection. ([29956](https://github.com/WordPress/gutenberg/pull/29956))
-- Enable list view. ([29936](https://github.com/WordPress/gutenberg/pull/29936))
-- Navigation Link: Match Editor Markup to Rendered. ([29935](https://github.com/WordPress/gutenberg/pull/29935))
-- Site Title: Add link color option. ([29924](https://github.com/WordPress/gutenberg/pull/29924))
-- Site Editor: Fix block toolbar from overlapping navigation panel. ([29918](https://github.com/WordPress/gutenberg/pull/29918))
-- Improve focal point settings filename clarity. ([29910](https://github.com/WordPress/gutenberg/pull/29910))
-- Packages: Enforce version bump for production packages after WP major. ([29903](https://github.com/WordPress/gutenberg/pull/29903))
-- api-fetch: Add types to media-upload middleware. ([29901](https://github.com/WordPress/gutenberg/pull/29901))
-- Component System: Button - Add a default type of button. ([29900](https://github.com/WordPress/gutenberg/pull/29900))
-- Restore dot at the end of a sentence. ([29897](https://github.com/WordPress/gutenberg/pull/29897))
-- Keep post publishing popover open when a date is clicked, by default. ([29893](https://github.com/WordPress/gutenberg/pull/29893))
-- Polish site button focus/hover styles in post and site editor. ([29888](https://github.com/WordPress/gutenberg/pull/29888))
-- Site icon: Simplify focus style. ([29872](https://github.com/WordPress/gutenberg/pull/29872))
-- Cover: Improve disabled media buttons check for placeholder. ([29858](https://github.com/WordPress/gutenberg/pull/29858))
-- E2E: Stabilize failing tests in trunk. ([29836](https://github.com/WordPress/gutenberg/pull/29836))
-- Themes: Translate custom templates in theme.json. ([29828](https://github.com/WordPress/gutenberg/pull/29828))
-- Cover: Allow drag n drop media replacement. ([29813](https://github.com/WordPress/gutenberg/pull/29813))
-- Revert: Show empty paragraphs on fronted. ([29809](https://github.com/WordPress/gutenberg/pull/29809))
-- Update the quick view image on the documentation homepage. ([29808](https://github.com/WordPress/gutenberg/pull/29808))
-- date: Add types. ([29789](https://github.com/WordPress/gutenberg/pull/29789))
-- dom: Add types to focusable. ([29787](https://github.com/WordPress/gutenberg/pull/29787))
-- Register Assets: Cache bust without filemtime. ([29775](https://github.com/WordPress/gutenberg/pull/29775))
-- Social Links: Improve selected state of empty block. ([29756](https://github.com/WordPress/gutenberg/pull/29756))
-- Add widgets customize inspector. ([29755](https://github.com/WordPress/gutenberg/pull/29755))
-- Hint the lowercase icon by 0.15px to correct the font weight appearance. ([29754](https://github.com/WordPress/gutenberg/pull/29754))
-- api-fetch: Type several of the middlewares. ([29719](https://github.com/WordPress/gutenberg/pull/29719))
-- Try: More accessible labels. ([29659](https://github.com/WordPress/gutenberg/pull/29659))
-- Update "requires at least" value to 5.6. ([29646](https://github.com/WordPress/gutenberg/pull/29646))
-- Don't display Guide's page control if there is only one page. ([29629](https://github.com/WordPress/gutenberg/pull/29629))
-- Add term-description block. ([29613](https://github.com/WordPress/gutenberg/pull/29613))
-- Site Editor: Prevent navigation panel focus when hidden. ([29600](https://github.com/WordPress/gutenberg/pull/29600))
-- Components: Add Heading. ([29592](https://github.com/WordPress/gutenberg/pull/29592))
-- Site Editor: Always use full screen mode. ([29489](https://github.com/WordPress/gutenberg/pull/29489))
-- Update template details popover. ([29439](https://github.com/WordPress/gutenberg/pull/29439))
-- RN: Button Block set the width to fixed when width is set. ([29360](https://github.com/WordPress/gutenberg/pull/29360))
-- Try/add drag handle to select mode. ([28815](https://github.com/WordPress/gutenberg/pull/28815))
-- Identify template parts in error messages. ([28398](https://github.com/WordPress/gutenberg/pull/28398))
+- Babel Preset: Update Babel to v7.13.x. ([30018](https://github.com/WordPress/gutenberg/pull/30018))
+- Create block: Require WordPress 5.7 by default and source it from the main plugin file. ([29757](https://github.com/WordPress/gutenberg/pull/29757))
+- E2E Tests:
+ - Cover the case when using multiple words in the inserter. ([29978](https://github.com/WordPress/gutenberg/pull/29978))
+ - Fix test plugin clash. ([29744](https://github.com/WordPress/gutenberg/pull/29744), [29745](https://github.com/WordPress/gutenberg/pull/29745))
+ - Set delay to zero in the reduce-motion mixin and tests. ([29762](https://github.com/WordPress/gutenberg/pull/29762))
+- Eslint Plugin: Add TypeScript as peer dependency and make it optional. ([29942](https://github.com/WordPress/gutenberg/pull/29942))
+- GitHub Workflows:
+ - Release: Allow triggering manually. ([28138](https://github.com/WordPress/gutenberg/pull/28138))
+ - Remove path ignore configs from CI. ([30090](https://github.com/WordPress/gutenberg/pull/30090))
+ - Use Gutenberg token for version bump, changelog commits. ([30212](https://github.com/WordPress/gutenberg/pull/30212))
+- Packages: Enforce version bump for production packages after WP major. ([29903](https://github.com/WordPress/gutenberg/pull/29903))
+- Unit Testing: Allow TypeScript modules for transpiled packages. ([29873](https://github.com/WordPress/gutenberg/pull/29873))
= 10.2.1 =
From e7369c09f468158e42851ba2a5b1b58efbd4ca88 Mon Sep 17 00:00:00 2001
From: Bernie Reiter
Date: Wed, 31 Mar 2021 21:00:32 +0200
Subject: [PATCH 17/53] Prettify YAML scripts (#30409)
---
.github/ISSUE_TEMPLATE/config.yml | 18 +-
.github/workflows/build-plugin-zip.yml | 403 +++++++++---------
.github/workflows/bundle-size.yml | 22 +-
.github/workflows/cancel.yml | 22 +-
.github/workflows/create-block.yml | 64 +--
.github/workflows/end2end-test.yml | 115 +++--
.github/workflows/performance.yml | 104 +++--
.github/workflows/pull-request-automation.yml | 34 +-
.github/workflows/rnmobile-android-runner.yml | 96 ++---
.github/workflows/rnmobile-ios-runner.yml | 158 ++++---
.../stale-issue-add-needs-testing.yml | 28 +-
.github/workflows/stale-issue-mark-stale.yml | 28 +-
.github/workflows/stale-issue-needs-info.yml | 28 +-
.github/workflows/static-checks.yml | 108 ++---
.github/workflows/storybook-pages.yml | 70 +--
.github/workflows/unit-test.yml | 263 ++++++------
.../upload-release-to-plugin-repo.yml | 294 ++++++-------
.../project-management-automation/action.yml | 12 +-
18 files changed, 929 insertions(+), 938 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index d30612c4f194ff..51bfb0d1bb7c13 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,11 +1,11 @@
blank_issues_enabled: true
contact_links:
- - name: General help request
- url: https://wordpress.org/support/forum/how-to-and-troubleshooting/
- about: For general help requests, create a new topic in the Fixing WordPress support forum
- - name: Technical help request
- url: https://wordpress.org/support/forum/wp-advanced/
- about: For more technical help requests, create a new topic in the Developing with WordPress Forum
- - name: Development help request
- url: https://wordpress.stackexchange.com/
- about: For questions about WordPress development, ask a question in the WordPress Development Stack Exchange
+ - name: General help request
+ url: https://wordpress.org/support/forum/how-to-and-troubleshooting/
+ about: For general help requests, create a new topic in the Fixing WordPress support forum
+ - name: Technical help request
+ url: https://wordpress.org/support/forum/wp-advanced/
+ about: For more technical help requests, create a new topic in the Developing with WordPress Forum
+ - name: Development help request
+ url: https://wordpress.stackexchange.com/
+ about: For questions about WordPress development, ask a question in the WordPress Development Stack Exchange
diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml
index 9d5eadacb40153..bc2e68bbff513e 100644
--- a/.github/workflows/build-plugin-zip.yml
+++ b/.github/workflows/build-plugin-zip.yml
@@ -1,208 +1,207 @@
name: Build Gutenberg Plugin Zip
on:
- pull_request:
- push:
- branches: [trunk]
- workflow_dispatch:
- inputs:
- version:
- description: 'rc or stable?'
- required: true
+ pull_request:
+ push:
+ branches: [trunk]
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'rc or stable?'
+ required: true
jobs:
- bump-version:
- name: Bump version
- runs-on: ubuntu-latest
- if: |
- github.event_name == 'workflow_dispatch' &&
- github.ref == 'refs/heads/trunk' && (
- github.event.inputs.version == 'rc' ||
- github.event.inputs.version == 'stable'
- )
- outputs:
- old_version: ${{ steps.get_version.outputs.old_version }}
- new_version: ${{ steps.get_version.outputs.new_version }}
- release_branch: ${{ steps.get_version.outputs.release_branch }}
- steps:
- - name: Checkout code
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- token: ${{ secrets.GUTENBERG_TOKEN }}
-
- - name: Compute old and new version
- id: get_version
- run: |
- OLD_VERSION=$(jq --raw-output '.version' package.json)
- echo "::set-output name=old_version::$(echo $OLD_VERSION)"
- if [[ ${{ github.event.inputs.version }} == 'stable' ]]; then
- NEW_VERSION=$(npx semver $OLD_VERSION -i patch)
- else
- if [[ $OLD_VERSION == *"rc"* ]]; then
- NEW_VERSION=$(npx semver $OLD_VERSION -i prerelease)
- else
- # WordPress version guidelines: If minor is 9, bump major instead.
- IFS='.' read -r -a OLD_VERSION_ARRAY <<< "$OLD_VERSION"
- if [[ ${OLD_VERSION_ARRAY[1]} == "9" ]]; then
- NEW_VERSION="$(npx semver $OLD_VERSION -i major)-rc.1"
- else
- NEW_VERSION="$(npx semver $OLD_VERSION -i minor)-rc.1"
- fi
- fi
- fi
- echo "::set-output name=new_version::$(echo $NEW_VERSION)"
- IFS='.' read -r -a NEW_VERSION_ARRAY <<< "$NEW_VERSION"
- RELEASE_BRANCH="release/${NEW_VERSION_ARRAY[0]}.${NEW_VERSION_ARRAY[1]}"
- echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)"
-
- - name: Configure git user name and email
- run: |
- git config user.name "Gutenberg Repository Automation"
- git config user.email gutenberg@wordpress.org
-
- - name: Create and switch to release branch
+ bump-version:
+ name: Bump version
+ runs-on: ubuntu-latest
if: |
- github.event.inputs.version == 'rc' &&
- ! contains( steps.get_version.outputs.old_version, 'rc' )
- run: git checkout -b "${{ steps.get_version.outputs.release_branch }}"
-
- - name: Switch to release branch
- if: |
- github.event.inputs.version == 'stable' ||
- contains( steps.get_version.outputs.old_version, 'rc' )
- run: |
- git fetch --depth=1 origin "${{ steps.get_version.outputs.release_branch }}"
- git checkout "${{ steps.get_version.outputs.release_branch }}"
-
- - name: Update plugin version
- env:
- VERSION: ${{ steps.get_version.outputs.new_version }}
- run: |
- cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package.json) > package.json
- cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package-lock.json) > package-lock.json
- sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" gutenberg.php
- sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" readme.txt
-
- - name: Commit the version bump
- run: |
- git add gutenberg.php package.json package-lock.json readme.txt
- git commit -m "Bump plugin version to ${{ steps.get_version.outputs.new_version }}"
- git push --set-upstream origin "${{ steps.get_version.outputs.release_branch }}"
-
- - name: Cherry-pick to trunk
- run: |
- git checkout trunk
- TRUNK_VERSION=$(jq --raw-output '.version' package.json)
- if [[ ${{ steps.get_version.outputs.old_version }} == "$TRUNK_VERSION" ]]; then
- git cherry-pick "${{ steps.get_version.outputs.release_branch }}"
- git push
- fi
-
-
- build:
- name: Build Release Artifact
- runs-on: ubuntu-latest
- needs: bump-version
- if: always()
- steps:
- - name: Checkout code
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Build Gutenberg plugin ZIP file
- run: ./bin/build-plugin-zip.sh
- env:
- NO_CHECKS: 'true'
-
- - name: Upload artifact
- uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- with:
- name: gutenberg-plugin
- path: ./gutenberg.zip
-
- - name: Build release notes draft
- if: ${{ needs.bump-version.outputs.new_version }}
- env:
- VERSION: ${{ needs.bump-version.outputs.new_version }}
- run: |
- IFS='.' read -r -a VERSION_ARRAY <<< "${VERSION}"
- MILESTONE="Gutenberg ${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}"
- npm run changelog -- --milestone="$MILESTONE" --unreleased > release-notes.txt
- sed -ie '1,6d' release-notes.txt
- if [[ ${{ needs.bump-version.outputs.new_version }} != *"rc"* ]]; then
- # Include previous RCs' release notes, if any
- CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s="
- RC_REGEX="=\s${VERSION}(-rc\.[0-9]+)?\s="
- awk "/${RC_REGEX}/ {found=1;print;next} /${CHANGELOG_REGEX}/ {found=0} found" changelog.txt >> release-notes.txt
- fi
-
- - name: Upload release notes artifact
- if: ${{ needs.bump-version.outputs.new_version }}
- uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- with:
- name: release-notes
- path: ./release-notes.txt
-
- create-release:
- name: Create Release Draft and Attach Asset
- needs: [bump-version, build]
- runs-on: ubuntu-latest
- steps:
- - name: Set Release Version
- id: get_release_version
- env:
- VERSION: ${{ needs.bump-version.outputs.new_version }}
- run: echo ::set-output name=version::$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )
-
- - name: Download Plugin Zip Artifact
- uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
- with:
- name: gutenberg-plugin
-
- - name: Download Release Notes Artifact
- uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
- with:
- name: release-notes
-
- - name: Create Release Draft
- id: create_release
- uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: "v${{ needs.bump-version.outputs.new_version }}"
- release_name: ${{ steps.get_release_version.outputs.version }}
- commitish: ${{ needs.bump-version.outputs.release_branch || github.ref }}
- draft: true
- prerelease: ${{ contains(needs.bump-version.outputs.new_version, 'rc') }}
- body_path: release-notes.txt
-
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: ./gutenberg.zip
- asset_name: gutenberg.zip
- asset_content_type: application/zip
+ github.event_name == 'workflow_dispatch' &&
+ github.ref == 'refs/heads/trunk' && (
+ github.event.inputs.version == 'rc' ||
+ github.event.inputs.version == 'stable'
+ )
+ outputs:
+ old_version: ${{ steps.get_version.outputs.old_version }}
+ new_version: ${{ steps.get_version.outputs.new_version }}
+ release_branch: ${{ steps.get_version.outputs.release_branch }}
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ token: ${{ secrets.GUTENBERG_TOKEN }}
+
+ - name: Compute old and new version
+ id: get_version
+ run: |
+ OLD_VERSION=$(jq --raw-output '.version' package.json)
+ echo "::set-output name=old_version::$(echo $OLD_VERSION)"
+ if [[ ${{ github.event.inputs.version }} == 'stable' ]]; then
+ NEW_VERSION=$(npx semver $OLD_VERSION -i patch)
+ else
+ if [[ $OLD_VERSION == *"rc"* ]]; then
+ NEW_VERSION=$(npx semver $OLD_VERSION -i prerelease)
+ else
+ # WordPress version guidelines: If minor is 9, bump major instead.
+ IFS='.' read -r -a OLD_VERSION_ARRAY <<< "$OLD_VERSION"
+ if [[ ${OLD_VERSION_ARRAY[1]} == "9" ]]; then
+ NEW_VERSION="$(npx semver $OLD_VERSION -i major)-rc.1"
+ else
+ NEW_VERSION="$(npx semver $OLD_VERSION -i minor)-rc.1"
+ fi
+ fi
+ fi
+ echo "::set-output name=new_version::$(echo $NEW_VERSION)"
+ IFS='.' read -r -a NEW_VERSION_ARRAY <<< "$NEW_VERSION"
+ RELEASE_BRANCH="release/${NEW_VERSION_ARRAY[0]}.${NEW_VERSION_ARRAY[1]}"
+ echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)"
+
+ - name: Configure git user name and email
+ run: |
+ git config user.name "Gutenberg Repository Automation"
+ git config user.email gutenberg@wordpress.org
+
+ - name: Create and switch to release branch
+ if: |
+ github.event.inputs.version == 'rc' &&
+ ! contains( steps.get_version.outputs.old_version, 'rc' )
+ run: git checkout -b "${{ steps.get_version.outputs.release_branch }}"
+
+ - name: Switch to release branch
+ if: |
+ github.event.inputs.version == 'stable' ||
+ contains( steps.get_version.outputs.old_version, 'rc' )
+ run: |
+ git fetch --depth=1 origin "${{ steps.get_version.outputs.release_branch }}"
+ git checkout "${{ steps.get_version.outputs.release_branch }}"
+
+ - name: Update plugin version
+ env:
+ VERSION: ${{ steps.get_version.outputs.new_version }}
+ run: |
+ cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package.json) > package.json
+ cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package-lock.json) > package-lock.json
+ sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" gutenberg.php
+ sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" readme.txt
+
+ - name: Commit the version bump
+ run: |
+ git add gutenberg.php package.json package-lock.json readme.txt
+ git commit -m "Bump plugin version to ${{ steps.get_version.outputs.new_version }}"
+ git push --set-upstream origin "${{ steps.get_version.outputs.release_branch }}"
+
+ - name: Cherry-pick to trunk
+ run: |
+ git checkout trunk
+ TRUNK_VERSION=$(jq --raw-output '.version' package.json)
+ if [[ ${{ steps.get_version.outputs.old_version }} == "$TRUNK_VERSION" ]]; then
+ git cherry-pick "${{ steps.get_version.outputs.release_branch }}"
+ git push
+ fi
+
+ build:
+ name: Build Release Artifact
+ runs-on: ubuntu-latest
+ needs: bump-version
+ if: always()
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Build Gutenberg plugin ZIP file
+ run: ./bin/build-plugin-zip.sh
+ env:
+ NO_CHECKS: 'true'
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ with:
+ name: gutenberg-plugin
+ path: ./gutenberg.zip
+
+ - name: Build release notes draft
+ if: ${{ needs.bump-version.outputs.new_version }}
+ env:
+ VERSION: ${{ needs.bump-version.outputs.new_version }}
+ run: |
+ IFS='.' read -r -a VERSION_ARRAY <<< "${VERSION}"
+ MILESTONE="Gutenberg ${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}"
+ npm run changelog -- --milestone="$MILESTONE" --unreleased > release-notes.txt
+ sed -ie '1,6d' release-notes.txt
+ if [[ ${{ needs.bump-version.outputs.new_version }} != *"rc"* ]]; then
+ # Include previous RCs' release notes, if any
+ CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s="
+ RC_REGEX="=\s${VERSION}(-rc\.[0-9]+)?\s="
+ awk "/${RC_REGEX}/ {found=1;print;next} /${CHANGELOG_REGEX}/ {found=0} found" changelog.txt >> release-notes.txt
+ fi
+
+ - name: Upload release notes artifact
+ if: ${{ needs.bump-version.outputs.new_version }}
+ uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ with:
+ name: release-notes
+ path: ./release-notes.txt
+
+ create-release:
+ name: Create Release Draft and Attach Asset
+ needs: [bump-version, build]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set Release Version
+ id: get_release_version
+ env:
+ VERSION: ${{ needs.bump-version.outputs.new_version }}
+ run: echo ::set-output name=version::$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )
+
+ - name: Download Plugin Zip Artifact
+ uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
+ with:
+ name: gutenberg-plugin
+
+ - name: Download Release Notes Artifact
+ uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
+ with:
+ name: release-notes
+
+ - name: Create Release Draft
+ id: create_release
+ uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: 'v${{ needs.bump-version.outputs.new_version }}'
+ release_name: ${{ steps.get_release_version.outputs.version }}
+ commitish: ${{ needs.bump-version.outputs.release_branch || github.ref }}
+ draft: true
+ prerelease: ${{ contains(needs.bump-version.outputs.new_version, 'rc') }}
+ body_path: release-notes.txt
+
+ - name: Upload Release Asset
+ id: upload-release-asset
+ uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: ./gutenberg.zip
+ asset_name: gutenberg.zip
+ asset_content_type: application/zip
diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml
index 1b85fa623e23fe..2253ff9941d23e 100644
--- a/.github/workflows/bundle-size.yml
+++ b/.github/workflows/bundle-size.yml
@@ -3,16 +3,16 @@ name: Compressed Size
on: [pull_request]
jobs:
- build:
- name: Check
- runs-on: ubuntu-latest
+ build:
+ name: Check
+ runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- fetch-depth: 1
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ fetch-depth: 1
- - uses: preactjs/compressed-size-action@7d87f60a6b0c7d193b8183ce859ed00b356ea92f # v2.1.0
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
- pattern: "{build/**/*.js,build/**/*.css}"
+ - uses: preactjs/compressed-size-action@7d87f60a6b0c7d193b8183ce859ed00b356ea92f # v2.1.0
+ with:
+ repo-token: '${{ secrets.GITHUB_TOKEN }}'
+ pattern: '{build/**/*.js,build/**/*.css}'
diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml
index 6c8cc20fe1135f..919a8a4691db8c 100644
--- a/.github/workflows/cancel.yml
+++ b/.github/workflows/cancel.yml
@@ -1,15 +1,15 @@
name: Cancel
on: pull_request
jobs:
- cancel:
- name: 'Cancel Previous Runs'
- runs-on: ubuntu-latest
- timeout-minutes: 3
- steps:
- - name: Get all workflow ids and set to env variable
- run: echo "WORKFLOW_IDS_TO_CANCEL=$(curl https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows -s | jq -r '.workflows | map(.id|tostring) | join(",")')" >> $GITHUB_ENV
+ cancel:
+ name: 'Cancel Previous Runs'
+ runs-on: ubuntu-latest
+ timeout-minutes: 3
+ steps:
+ - name: Get all workflow ids and set to env variable
+ run: echo "WORKFLOW_IDS_TO_CANCEL=$(curl https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows -s | jq -r '.workflows | map(.id|tostring) | join(",")')" >> $GITHUB_ENV
- - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
- with:
- workflow_id: ${{ env.WORKFLOW_IDS_TO_CANCEL }}
- access_token: ${{ secrets.GITHUB_TOKEN }}
+ - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
+ with:
+ workflow_id: ${{ env.WORKFLOW_IDS_TO_CANCEL }}
+ access_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml
index e27b9a83686769..e2d76e14788da6 100644
--- a/.github/workflows/create-block.yml
+++ b/.github/workflows/create-block.yml
@@ -1,41 +1,41 @@
name: Create Block
on:
- pull_request:
- push:
- branches: [trunk, wp/trunk]
+ pull_request:
+ push:
+ branches: [trunk, wp/trunk]
jobs:
- checks:
- name: Checks
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- node: [12, 14]
+ checks:
+ name: Checks
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node: [12, 14]
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
- - name: Use Node.js ${{ matrix.node }}.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: ${{ matrix.node }}
+ - name: Use Node.js ${{ matrix.node }}.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: ${{ matrix.node }}
- - name: npm install, build, format and lint
- run: |
- npm ci
- npm run test:create-block
+ - name: npm install, build, format and lint
+ run: |
+ npm ci
+ npm run test:create-block
diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml
index 4d0bbe41c5b27f..6f4576b6cd37c5 100644
--- a/.github/workflows/end2end-test.yml
+++ b/.github/workflows/end2end-test.yml
@@ -1,63 +1,62 @@
name: End-to-End Tests
on:
- pull_request:
- push:
- branches:
- - trunk
- - 'wp/**'
+ pull_request:
+ push:
+ branches:
+ - trunk
+ - 'wp/**'
jobs:
- admin:
- name: Admin - ${{ matrix.part }}
-
- runs-on: ubuntu-latest
-
- strategy:
- fail-fast: false
- matrix:
- part: [1, 2, 3, 4]
-
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Npm install and build
- run: |
- npm ci
- FORCE_REDUCED_MOTION=true npm run build
-
- - name: Install WordPress
- run: |
- chmod -R 767 ./ # TODO: Possibly integrate in wp-env
- npm run wp-env start
-
- - name: Running the tests
- run: |
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
-
- - name: Archive debug artifacts (screenshots, HTML snapshots)
- uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- if: always()
- with:
- name: failures-artifacts
- path: artifacts
+ admin:
+ name: Admin - ${{ matrix.part }}
+
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ matrix:
+ part: [1, 2, 3, 4]
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Npm install and build
+ run: |
+ npm ci
+ FORCE_REDUCED_MOTION=true npm run build
+
+ - name: Install WordPress
+ run: |
+ chmod -R 767 ./ # TODO: Possibly integrate in wp-env
+ npm run wp-env start
+
+ - name: Running the tests
+ run: |
+ $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
+ $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
+
+ - name: Archive debug artifacts (screenshots, HTML snapshots)
+ uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ if: always()
+ with:
+ name: failures-artifacts
+ path: artifacts
diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml
index e3adb12f173846..bf9fb39e4b065a 100644
--- a/.github/workflows/performance.yml
+++ b/.github/workflows/performance.yml
@@ -1,58 +1,56 @@
name: Performances Tests
on:
- pull_request:
- release:
- types: [created]
+ pull_request:
+ release:
+ types: [created]
jobs:
- performance:
- name: Run performance tests
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Npm install
- run: |
- npm ci
-
- - name: Compare performance with trunk
- if: github.event_name == 'pull_request'
- run: ./bin/plugin/cli.js perf --ci $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
-
- - name: Compare performance with current WordPress Core and previous Gutenberg versions
- if: github.event_name == 'release'
- env:
- PLUGIN_VERSION: ${{ github.event.release.name }}
- run: |
- IFS='.' read -r -a PLUGIN_VERSION_ARRAY <<< "$PLUGIN_VERSION"
- CURRENT_RELEASE_BRANCH="release/${PLUGIN_VERSION_ARRAY[0]}.${PLUGIN_VERSION_ARRAY[1]}"
- PREVIOUS_VERSION_BASE_10=$(expr ${PLUGIN_VERSION_ARRAY[0]} \* 10 + ${PLUGIN_VERSION_ARRAY[1]} - 1)
- PREVIOUS_RELEASE_BRANCH="release/$(expr $PREVIOUS_VERSION_BASE_10 / 10).$(expr $PREVIOUS_VERSION_BASE_10 % 10)"
- TESTED_UP_TO_REGEX="Tested up to: \K([0-9]+)\.([0-9]+)\.?([0-9]?)"
- WP_VERSION=$(grep -oP "$TESTED_UP_TO_REGEX" ./readme.txt)
- IFS='.' read -r -a WP_VERSION_ARRAY <<< "$WP_VERSION"
- WP_BRANCH="wp/${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
- ./bin/plugin/cli.js perf --ci $WP_BRANCH $PREVIOUS_RELEASE_BRANCH $CURRENT_RELEASE_BRANCH
-
-
+ performance:
+ name: Run performance tests
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Npm install
+ run: |
+ npm ci
+
+ - name: Compare performance with trunk
+ if: github.event_name == 'pull_request'
+ run: ./bin/plugin/cli.js perf --ci $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
+
+ - name: Compare performance with current WordPress Core and previous Gutenberg versions
+ if: github.event_name == 'release'
+ env:
+ PLUGIN_VERSION: ${{ github.event.release.name }}
+ run: |
+ IFS='.' read -r -a PLUGIN_VERSION_ARRAY <<< "$PLUGIN_VERSION"
+ CURRENT_RELEASE_BRANCH="release/${PLUGIN_VERSION_ARRAY[0]}.${PLUGIN_VERSION_ARRAY[1]}"
+ PREVIOUS_VERSION_BASE_10=$(expr ${PLUGIN_VERSION_ARRAY[0]} \* 10 + ${PLUGIN_VERSION_ARRAY[1]} - 1)
+ PREVIOUS_RELEASE_BRANCH="release/$(expr $PREVIOUS_VERSION_BASE_10 / 10).$(expr $PREVIOUS_VERSION_BASE_10 % 10)"
+ TESTED_UP_TO_REGEX="Tested up to: \K([0-9]+)\.([0-9]+)\.?([0-9]?)"
+ WP_VERSION=$(grep -oP "$TESTED_UP_TO_REGEX" ./readme.txt)
+ IFS='.' read -r -a WP_VERSION_ARRAY <<< "$WP_VERSION"
+ WP_BRANCH="wp/${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
+ ./bin/plugin/cli.js perf --ci $WP_BRANCH $PREVIOUS_RELEASE_BRANCH $CURRENT_RELEASE_BRANCH
diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml
index b3fe89023d2bf3..f97e9c28ec7e90 100644
--- a/.github/workflows/pull-request-automation.yml
+++ b/.github/workflows/pull-request-automation.yml
@@ -1,23 +1,23 @@
on:
- pull_request_target:
- types: [opened]
- push:
+ pull_request_target:
+ types: [opened]
+ push:
name: Pull request automation
jobs:
- pull-request-automation:
- runs-on: ubuntu-latest
- steps:
- # Checkout defaults to using the branch which triggered the event, which
- # isn't necessarily `trunk` (e.g. in the case of a merge).
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- ref: trunk
+ pull-request-automation:
+ runs-on: ubuntu-latest
+ steps:
+ # Checkout defaults to using the branch which triggered the event, which
+ # isn't necessarily `trunk` (e.g. in the case of a merge).
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ ref: trunk
- # Changing into the action's directory and running `npm install` is much
- # faster than a full project-wide `npm ci`.
- - run: cd packages/project-management-automation && npm install
+ # Changing into the action's directory and running `npm install` is much
+ # faster than a full project-wide `npm ci`.
+ - run: cd packages/project-management-automation && npm install
- - uses: ./packages/project-management-automation
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
+ - uses: ./packages/project-management-automation
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml
index 384cfaf5de5a06..74b722c70fcbb4 100644
--- a/.github/workflows/rnmobile-android-runner.yml
+++ b/.github/workflows/rnmobile-android-runner.yml
@@ -1,54 +1,52 @@
name: React Native E2E Tests (Android)
on:
- pull_request:
- push:
- branches: [trunk]
+ pull_request:
+ push:
+ branches: [trunk]
jobs:
- test:
- runs-on: macos-latest
- strategy:
- matrix:
- native-test-name: [
- gutenberg-editor-initial-html
- ]
-
- steps:
- - name: checkout
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Restore npm cache
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- with:
- path: ~/.npm
- key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-npm-
-
- - run: npm ci
-
- - name: Restore Gradle cache
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- with:
- path: ~/.gradle/caches
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
- restore-keys: ${{ runner.os }}-gradle
-
- - uses: reactivecircus/android-emulator-runner@d2799957d660add41c61a5103e2fbb9e2889eb73 # v2.15.0
- with:
- api-level: 28
- profile: pixel_xl
- script: npm run native test:e2e:android:local ${{ matrix.native-test-name }}
-
- - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- if: always()
- with:
- name: android-screen-recordings
- path: packages/react-native-editor/android-screen-recordings
-
- - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- if: always()
- with:
- name: appium-logs
- path: packages/react-native-editor/appium-out.log
+ test:
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ native-test-name: [gutenberg-editor-initial-html]
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Restore npm cache
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-npm-
+
+ - run: npm ci
+
+ - name: Restore Gradle cache
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ with:
+ path: ~/.gradle/caches
+ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
+ restore-keys: ${{ runner.os }}-gradle
+
+ - uses: reactivecircus/android-emulator-runner@d2799957d660add41c61a5103e2fbb9e2889eb73 # v2.15.0
+ with:
+ api-level: 28
+ profile: pixel_xl
+ script: npm run native test:e2e:android:local ${{ matrix.native-test-name }}
+
+ - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ if: always()
+ with:
+ name: android-screen-recordings
+ path: packages/react-native-editor/android-screen-recordings
+
+ - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ if: always()
+ with:
+ name: appium-logs
+ path: packages/react-native-editor/appium-out.log
diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml
index c05bbb42da10a3..1f178df8a6b21b 100644
--- a/.github/workflows/rnmobile-ios-runner.yml
+++ b/.github/workflows/rnmobile-ios-runner.yml
@@ -1,85 +1,83 @@
name: React Native E2E Tests (iOS)
on:
- pull_request:
- push:
- branches: [trunk]
+ pull_request:
+ push:
+ branches: [trunk]
jobs:
- test:
- runs-on: macos-latest
- strategy:
- matrix:
- xcode: [12.2]
- native-test-name: [
- gutenberg-editor-initial-html
- ]
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Restore npm cache
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- with:
- path: ~/.npm
- key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-npm-
-
- - run: npm ci
-
- - name: Prepare build cache key
- run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
-
- - name: Restore build cache
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- with:
- path: |
- packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
- packages/react-native-editor/ios/build/WDA
- key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ hashFiles('ios-checksums.txt') }}
-
- - name: Restore pods cache
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- with:
- path: |
- packages/react-native-editor/ios/Pods
- ~/Library/Caches/CocoaPods
- ~/.cocoapods/repos/trunk
- packages/react-native-editor/ios/vendor
- key: ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }}
- ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-
- ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-
- ${{ runner.os }}-pods-
-
- - name: Bundle iOS
- run: npm run native test:e2e:bundle:ios
-
- - name: Switch Xcode version to ${{ matrix.xcode }}
- run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
-
- - name: Build (if needed)
- run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios
-
- - name: Build Web Driver Agent (if needed)
- run: test -d packages/react-native-editor/ios/build/WDA || npm run native test:e2e:build-wda
-
- - name: Run iOS Device Tests
- run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }}
-
- - name: Prepare build cache
- run: rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle
-
- - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- if: always()
- with:
- name: ios-screen-recordings
- path: packages/react-native-editor/ios-screen-recordings
-
- - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- if: always()
- with:
- name: appium-logs
- path: packages/react-native-editor/appium-out.log
+ test:
+ runs-on: macos-latest
+ strategy:
+ matrix:
+ xcode: [12.2]
+ native-test-name: [gutenberg-editor-initial-html]
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Restore npm cache
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-npm-
+
+ - run: npm ci
+
+ - name: Prepare build cache key
+ run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
+
+ - name: Restore build cache
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ with:
+ path: |
+ packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
+ packages/react-native-editor/ios/build/WDA
+ key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ hashFiles('ios-checksums.txt') }}
+
+ - name: Restore pods cache
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ with:
+ path: |
+ packages/react-native-editor/ios/Pods
+ ~/Library/Caches/CocoaPods
+ ~/.cocoapods/repos/trunk
+ packages/react-native-editor/ios/vendor
+ key: ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }}
+ ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-
+ ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-
+ ${{ runner.os }}-pods-
+
+ - name: Bundle iOS
+ run: npm run native test:e2e:bundle:ios
+
+ - name: Switch Xcode version to ${{ matrix.xcode }}
+ run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
+
+ - name: Build (if needed)
+ run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios
+
+ - name: Build Web Driver Agent (if needed)
+ run: test -d packages/react-native-editor/ios/build/WDA || npm run native test:e2e:build-wda
+
+ - name: Run iOS Device Tests
+ run: TEST_RN_PLATFORM=ios npm run native device-tests:local ${{ matrix.native-test-name }}
+
+ - name: Prepare build cache
+ run: rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle
+
+ - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ if: always()
+ with:
+ name: ios-screen-recordings
+ path: packages/react-native-editor/ios-screen-recordings
+
+ - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ if: always()
+ with:
+ name: appium-logs
+ path: packages/react-native-editor/appium-out.log
diff --git a/.github/workflows/stale-issue-add-needs-testing.yml b/.github/workflows/stale-issue-add-needs-testing.yml
index a963f97287939e..e17bfa7b295670 100644
--- a/.github/workflows/stale-issue-add-needs-testing.yml
+++ b/.github/workflows/stale-issue-add-needs-testing.yml
@@ -1,17 +1,17 @@
-name: "Mark old issues as needs confirmation"
+name: 'Mark old issues as needs confirmation'
on:
- schedule:
- - cron: "45 1 * * *"
+ schedule:
+ - cron: '45 1 * * *'
jobs:
- stale:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- stale-issue-message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out."
- days-before-stale: 180
- days-before-close: -1
- remove-stale-when-updated: false
- stale-issue-label: 'Needs Testing'
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ stale-issue-message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out."
+ days-before-stale: 180
+ days-before-close: -1
+ remove-stale-when-updated: false
+ stale-issue-label: 'Needs Testing'
diff --git a/.github/workflows/stale-issue-mark-stale.yml b/.github/workflows/stale-issue-mark-stale.yml
index 91d29cccedbe8f..983b62c1e07005 100644
--- a/.github/workflows/stale-issue-mark-stale.yml
+++ b/.github/workflows/stale-issue-mark-stale.yml
@@ -1,17 +1,17 @@
-name: "Mark issues stale after needs testing for 30 days"
+name: 'Mark issues stale after needs testing for 30 days'
on:
- schedule:
- - cron: "55 1 * * *"
+ schedule:
+ - cron: '55 1 * * *'
jobs:
- stale:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- days-before-stale: 30
- days-before-close: -1
- only-labels: 'Needs Testing'
- skip-stale-issue-message: true
- stale-issue-label: '[Status] Stale'
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ days-before-stale: 30
+ days-before-close: -1
+ only-labels: 'Needs Testing'
+ skip-stale-issue-message: true
+ stale-issue-label: '[Status] Stale'
diff --git a/.github/workflows/stale-issue-needs-info.yml b/.github/workflows/stale-issue-needs-info.yml
index 7dede45c224ed4..c0f3e4ed6bec62 100644
--- a/.github/workflows/stale-issue-needs-info.yml
+++ b/.github/workflows/stale-issue-needs-info.yml
@@ -1,17 +1,17 @@
-name: "Mark issues stale that require info"
+name: 'Mark issues stale that require info'
on:
- schedule:
- - cron: "30 1 * * *"
+ schedule:
+ - cron: '30 1 * * *'
jobs:
- stale:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- stale-issue-message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.'
- days-before-stale: 15
- days-before-close: -1
- only-labels: '[Status] Needs More Info'
- stale-issue-label: '[Status] Stale'
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ stale-issue-message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.'
+ days-before-stale: 15
+ days-before-close: -1
+ only-labels: '[Status] Needs More Info'
+ stale-issue-label: '[Status] Stale'
diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml
index ad10daa5a167fb..4264af972e028d 100644
--- a/.github/workflows/static-checks.yml
+++ b/.github/workflows/static-checks.yml
@@ -1,59 +1,59 @@
name: Static Analysis (Linting, License, Type checks...)
on:
- pull_request:
- push:
- branches:
- - trunk
- - 'wp/**'
+ pull_request:
+ push:
+ branches:
+ - trunk
+ - 'wp/**'
jobs:
- check:
- name: All
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Npm install and build
- # A "full" install is executed, since `npm ci` does not always exit
- # with an error status code if the lock file is inaccurate.
- #
- # See: https://github.com/WordPress/gutenberg/issues/16157
- run: |
- npm install
- npm run build
-
- - name: Lint JavaScript and Styles
- run: npm run lint
-
- - name: Lint ES5 built files (IE11)
- run: npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js
-
- - name: Type checking
- run: npm run build:package-types
-
- - name: Build artifacts
- run: npm run check-local-changes
-
- - name: License compatibility
- run: npm run check-licenses
+ check:
+ name: All
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Npm install and build
+ # A "full" install is executed, since `npm ci` does not always exit
+ # with an error status code if the lock file is inaccurate.
+ #
+ # See: https://github.com/WordPress/gutenberg/issues/16157
+ run: |
+ npm install
+ npm run build
+
+ - name: Lint JavaScript and Styles
+ run: npm run lint
+
+ - name: Lint ES5 built files (IE11)
+ run: npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js
+
+ - name: Type checking
+ run: npm run build:package-types
+
+ - name: Build artifacts
+ run: npm run check-local-changes
+
+ - name: License compatibility
+ run: npm run check-licenses
diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml
index 5ea64c67899344..d717c1cf58c3a6 100644
--- a/.github/workflows/storybook-pages.yml
+++ b/.github/workflows/storybook-pages.yml
@@ -1,45 +1,45 @@
name: Storybook GitHub Pages
on:
- push:
- branches:
- - trunk
+ push:
+ branches:
+ - trunk
jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- ref: trunk
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ ref: trunk
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
- - name: Setup Node
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: '14.x'
+ - name: Setup Node
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: '14.x'
- - name: Install Dependencies
- run: npm ci
+ - name: Install Dependencies
+ run: npm ci
- - name: Build Storybook
- run: npm run storybook:build
+ - name: Build Storybook
+ run: npm run storybook:build
- - name: Deploy
- uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: ./storybook/build
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./storybook/build
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index a5ccf320fbef50..a14504275a7809 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -3,137 +3,136 @@ name: Unit Tests
# Since Unit Tests are required to pass for each PR,
# we cannot disable them for documentation-only changes.
on:
- pull_request:
- push:
- branches:
- - trunk
- - 'wp/**'
+ pull_request:
+ push:
+ branches:
+ - trunk
+ - 'wp/**'
jobs:
- unit-js:
- name: JavaScript
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- node: [12, 14]
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js ${{ matrix.node }}.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: ${{ matrix.node }}
-
- - name: Npm install and build
- # It's not necessary to run the full build, since Jest can interpret
- # source files with `babel-jest`. Some packages have their own custom
- # build tasks, however. These must be run.
- run: |
- npm ci
- npx lerna run build
-
- - name: Running the tests
- run: npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
-
- - name: Running the date tests
- run: npm run test-unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
-
- unit-php:
- name: PHP
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Npm install and build
- run: |
- npm ci
- npm run build
-
- - name: Install WordPress
- run: |
- chmod -R 767 ./ # TODO: Possibly integrate in wp-env
- npm run wp-env start
-
- - name: Running lint check
- run: npm run lint-php
-
- - name: Running single site unit tests
- run: npm run test-unit-php
- if: ${{ success() || failure() }}
-
- - name: Running multisite unit tests
- run: npm run test-unit-php-multisite
- if: ${{ success() || failure() }}
-
-
- mobile-unit-js:
- name: Mobile
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
-
- - name: Cache node modules
- uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
- env:
- cache-name: cache-node-modules
- with:
- # npm cache files are stored in `~/.npm` on Linux/macOS
- path: ~/.npm
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- restore-keys: |
- ${{ runner.os }}-build-${{ env.cache-name }}-
- ${{ runner.os }}-build-
- ${{ runner.os }}-
-
- - name: Use Node.js 14.x
- uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
- with:
- node-version: 14.x
-
- - name: Npm install and build
- # It's not necessary to run the full build, since Jest can interpret
- # source files with `babel-jest`. Some packages have their own custom
- # build tasks, however. These must be run.
- run: |
- npm ci
- npx lerna run build
-
- - name: Running the tests
- run: npm run test-unit:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
+ unit-js:
+ name: JavaScript
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node: [12, 14]
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js ${{ matrix.node }}.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: ${{ matrix.node }}
+
+ - name: Npm install and build
+ # It's not necessary to run the full build, since Jest can interpret
+ # source files with `babel-jest`. Some packages have their own custom
+ # build tasks, however. These must be run.
+ run: |
+ npm ci
+ npx lerna run build
+
+ - name: Running the tests
+ run: npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
+
+ - name: Running the date tests
+ run: npm run test-unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
+
+ unit-php:
+ name: PHP
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Npm install and build
+ run: |
+ npm ci
+ npm run build
+
+ - name: Install WordPress
+ run: |
+ chmod -R 767 ./ # TODO: Possibly integrate in wp-env
+ npm run wp-env start
+
+ - name: Running lint check
+ run: npm run lint-php
+
+ - name: Running single site unit tests
+ run: npm run test-unit-php
+ if: ${{ success() || failure() }}
+
+ - name: Running multisite unit tests
+ run: npm run test-unit-php-multisite
+ if: ${{ success() || failure() }}
+
+ mobile-unit-js:
+ name: Mobile
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+
+ - name: Cache node modules
+ uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Use Node.js 14.x
+ uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
+ with:
+ node-version: 14.x
+
+ - name: Npm install and build
+ # It's not necessary to run the full build, since Jest can interpret
+ # source files with `babel-jest`. Some packages have their own custom
+ # build tasks, however. These must be run.
+ run: |
+ npm ci
+ npx lerna run build
+
+ - name: Running the tests
+ run: npm run test-unit:native -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"
diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml
index 0f77e22b1844eb..e0997cd45ee58a 100644
--- a/.github/workflows/upload-release-to-plugin-repo.yml
+++ b/.github/workflows/upload-release-to-plugin-repo.yml
@@ -1,154 +1,154 @@
name: Update Changelog and upload Gutenberg plugin to WordPress.org plugin repo
on:
- release:
- types: [published]
+ release:
+ types: [published]
jobs:
- get-release-branch:
- name: Get release branch name
- runs-on: ubuntu-latest
- if: github.event.release.assets[0]
- outputs:
- release_branch: ${{ steps.get_release_branch.outputs.release_branch }}
- steps:
- - name: Compute release branch name
- id: get_release_branch
- env:
- TAG: ${{ github.event.release.tag_name }}
- run: |
- IFS='.' read -r -a VERSION_ARRAY <<< "${TAG#v}"
- RELEASE_BRANCH="release/${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}"
- echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)"
-
- update-changelog:
- name: Update Changelog on ${{ matrix.branch }} branch
- runs-on: ubuntu-latest
- if: github.event.release.assets[0]
- needs: get-release-branch
- env:
- TAG: ${{ github.event.release.tag_name }}
- strategy:
- matrix:
- include:
- - branch: trunk
- label: trunk
- - branch: ${{ needs.get-release-branch.outputs.release_branch }}
- label: release
- steps:
- - name: Checkout code
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- with:
- ref: ${{ matrix.branch }}
- token: ${{ secrets.GUTENBERG_TOKEN }}
-
- - name: Update the Changelog to include the release notes
- run: |
- # First, determine where to insert the new Changelog entry.
- SERIES="${RELEASE_BRANCH#release/}"
- SERIES_REGEX="=\s${SERIES}\.[0-9]+\s="
- CUT_MARKS=$( grep -nP -m 1 "${SERIES_REGEX}" changelog.txt | cut -d: -f1 )
- if [[ -z "${CUT_MARKS}" ]]; then
- CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s="
- RC_REGEX="=\s${TAG#v}(-rc\.[0-9]+)?\s="
- CUT_MARKS=$( awk "/${RC_REGEX}/ {print NR; next}; /${CHANGELOG_REGEX}/ {print NR; exit}" changelog.txt )
- fi
- BEFORE=$( echo "$CUT_MARKS" | head -n 1 )
- AFTER=$( echo "$CUT_MARKS" | tail -n 1 )
- # Okay, we have all we need to build the new Changelog.
- head -n $(( "${BEFORE}" - 1 )) changelog.txt > new_changelog.txt
- printf '= %s =\n\n' "${TAG#v}" >> new_changelog.txt
- # Need to use a heredoc in order to preserve special characters.
- cat <<- "EOF" > release_notes.txt
- ${{ github.event.release.body }}
- EOF
- # Normalize empty lines: Trim them from beginning and end of file...
- awk 'NF {p=1} p' <<< "$(< release_notes.txt)" >> new_changelog.txt
- # ...then add two empty lines at the end.
- printf '\n\n' >> new_changelog.txt
- tail -n +"${AFTER}" changelog.txt >> new_changelog.txt
- mv new_changelog.txt changelog.txt
-
- - name: Configure git user name and email
- run: |
- git config user.name "Gutenberg Repository Automation"
- git config user.email gutenberg@wordpress.org
-
- - name: Commit the Changelog update
- run: |
- git add changelog.txt
- git commit -m "Update Changelog for ${TAG#v}"
- git push --set-upstream origin "${{ matrix.branch }}"
-
- - name: Upload Changelog artifact
- uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
- with:
- name: changelog ${{ matrix.label }}
- path: ./changelog.txt
-
- upload:
- name: Upload Gutenberg Plugin
- runs-on: ubuntu-latest
- environment: wp.org plugin
- needs: update-changelog
- if: ${{ !github.event.release.prerelease && github.event.release.assets[0] }}
- env:
- PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
- STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
- SVN_USERNAME: ${{ secrets.svn_username }}
- SVN_PASSWORD: ${{ secrets.svn_password }}
- VERSION: ${{ github.event.release.name }}
- steps:
- - name: Check out Gutenberg trunk from WP.org plugin repo
- run: svn checkout "$PLUGIN_REPO_URL/trunk"
-
- - name: Get previous stable version
- id: get_previous_stable_version
+ get-release-branch:
+ name: Get release branch name
+ runs-on: ubuntu-latest
+ if: github.event.release.assets[0]
+ outputs:
+ release_branch: ${{ steps.get_release_branch.outputs.release_branch }}
+ steps:
+ - name: Compute release branch name
+ id: get_release_branch
+ env:
+ TAG: ${{ github.event.release.tag_name }}
+ run: |
+ IFS='.' read -r -a VERSION_ARRAY <<< "${TAG#v}"
+ RELEASE_BRANCH="release/${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}"
+ echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)"
+
+ update-changelog:
+ name: Update Changelog on ${{ matrix.branch }} branch
+ runs-on: ubuntu-latest
+ if: github.event.release.assets[0]
+ needs: get-release-branch
env:
- STABLE_TAG_REGEX: 'Stable tag: \K${{ env.STABLE_VERSION_REGEX }}'
- run: echo ::set-output name=stable_version::$(grep -oP "${STABLE_TAG_REGEX}" ./trunk/readme.txt)
-
- - name: Delete everything
- working-directory: ./trunk
- run: find . -maxdepth 1 -not -name ".svn" -not -name "." -not -name ".." -exec rm -rf {} +
-
- - name: Download and unzip Gutenberg plugin asset into trunk folder
- env:
- PLUGIN_URL: ${{ github.event.release.assets[0].browser_download_url }}
- run: |
- curl -L -o gutenberg.zip $PLUGIN_URL
- unzip gutenberg.zip -d trunk
- rm gutenberg.zip
-
- - name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
+ TAG: ${{ github.event.release.tag_name }}
+ strategy:
+ matrix:
+ include:
+ - branch: trunk
+ label: trunk
+ - branch: ${{ needs.get-release-branch.outputs.release_branch }}
+ label: release
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
+ with:
+ ref: ${{ matrix.branch }}
+ token: ${{ secrets.GUTENBERG_TOKEN }}
+
+ - name: Update the Changelog to include the release notes
+ run: |
+ # First, determine where to insert the new Changelog entry.
+ SERIES="${RELEASE_BRANCH#release/}"
+ SERIES_REGEX="=\s${SERIES}\.[0-9]+\s="
+ CUT_MARKS=$( grep -nP -m 1 "${SERIES_REGEX}" changelog.txt | cut -d: -f1 )
+ if [[ -z "${CUT_MARKS}" ]]; then
+ CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s="
+ RC_REGEX="=\s${TAG#v}(-rc\.[0-9]+)?\s="
+ CUT_MARKS=$( awk "/${RC_REGEX}/ {print NR; next}; /${CHANGELOG_REGEX}/ {print NR; exit}" changelog.txt )
+ fi
+ BEFORE=$( echo "$CUT_MARKS" | head -n 1 )
+ AFTER=$( echo "$CUT_MARKS" | tail -n 1 )
+ # Okay, we have all we need to build the new Changelog.
+ head -n $(( "${BEFORE}" - 1 )) changelog.txt > new_changelog.txt
+ printf '= %s =\n\n' "${TAG#v}" >> new_changelog.txt
+ # Need to use a heredoc in order to preserve special characters.
+ cat <<- "EOF" > release_notes.txt
+ ${{ github.event.release.body }}
+ EOF
+ # Normalize empty lines: Trim them from beginning and end of file...
+ awk 'NF {p=1} p' <<< "$(< release_notes.txt)" >> new_changelog.txt
+ # ...then add two empty lines at the end.
+ printf '\n\n' >> new_changelog.txt
+ tail -n +"${AFTER}" changelog.txt >> new_changelog.txt
+ mv new_changelog.txt changelog.txt
+
+ - name: Configure git user name and email
+ run: |
+ git config user.name "Gutenberg Repository Automation"
+ git config user.email gutenberg@wordpress.org
+
+ - name: Commit the Changelog update
+ run: |
+ git add changelog.txt
+ git commit -m "Update Changelog for ${TAG#v}"
+ git push --set-upstream origin "${{ matrix.branch }}"
+
+ - name: Upload Changelog artifact
+ uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
+ with:
+ name: changelog ${{ matrix.label }}
+ path: ./changelog.txt
+
+ upload:
+ name: Upload Gutenberg Plugin
+ runs-on: ubuntu-latest
+ environment: wp.org plugin
+ needs: update-changelog
+ if: ${{ !github.event.release.prerelease && github.event.release.assets[0] }}
env:
- STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V'
- STABLE_TAG: 'Stable tag: ${{ steps.get_previous_stable_version.outputs.stable_version }}'
- run: sed -i "s/${STABLE_TAG_PLACEHOLDER}/${STABLE_TAG}/g" ./trunk/readme.txt
-
- - name: Download Changelog Artifact
- uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
- with:
- name: changelog trunk
- path: trunk
-
- - name: Commit the content changes
- working-directory: ./trunk
- run: |
- svn st | grep '^?' | awk '{print $2}' | xargs -r svn add
- svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm
- svn commit -m "Committing version $VERSION" \
- --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
-
- - name: Create the SVN tag
- working-directory: ./trunk
- run: |
- svn copy "$PLUGIN_REPO_URL/trunk" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Tagging version $VERSION" \
- --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
-
- - name: Update the plugin's stable version
- working-directory: ./trunk
- run: |
- sed -i "s/Stable tag: ${STABLE_VERSION_REGEX}/Stable tag: ${VERSION}/g" ./readme.txt
- svn commit -m "Releasing version $VERSION" \
- --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+ PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
+ STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*'
+ SVN_USERNAME: ${{ secrets.svn_username }}
+ SVN_PASSWORD: ${{ secrets.svn_password }}
+ VERSION: ${{ github.event.release.name }}
+ steps:
+ - name: Check out Gutenberg trunk from WP.org plugin repo
+ run: svn checkout "$PLUGIN_REPO_URL/trunk"
+
+ - name: Get previous stable version
+ id: get_previous_stable_version
+ env:
+ STABLE_TAG_REGEX: 'Stable tag: \K${{ env.STABLE_VERSION_REGEX }}'
+ run: echo ::set-output name=stable_version::$(grep -oP "${STABLE_TAG_REGEX}" ./trunk/readme.txt)
+
+ - name: Delete everything
+ working-directory: ./trunk
+ run: find . -maxdepth 1 -not -name ".svn" -not -name "." -not -name ".." -exec rm -rf {} +
+
+ - name: Download and unzip Gutenberg plugin asset into trunk folder
+ env:
+ PLUGIN_URL: ${{ github.event.release.assets[0].browser_download_url }}
+ run: |
+ curl -L -o gutenberg.zip $PLUGIN_URL
+ unzip gutenberg.zip -d trunk
+ rm gutenberg.zip
+
+ - name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
+ env:
+ STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V'
+ STABLE_TAG: 'Stable tag: ${{ steps.get_previous_stable_version.outputs.stable_version }}'
+ run: sed -i "s/${STABLE_TAG_PLACEHOLDER}/${STABLE_TAG}/g" ./trunk/readme.txt
+
+ - name: Download Changelog Artifact
+ uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
+ with:
+ name: changelog trunk
+ path: trunk
+
+ - name: Commit the content changes
+ working-directory: ./trunk
+ run: |
+ svn st | grep '^?' | awk '{print $2}' | xargs -r svn add
+ svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm
+ svn commit -m "Committing version $VERSION" \
+ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+
+ - name: Create the SVN tag
+ working-directory: ./trunk
+ run: |
+ svn copy "$PLUGIN_REPO_URL/trunk" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Tagging version $VERSION" \
+ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+
+ - name: Update the plugin's stable version
+ working-directory: ./trunk
+ run: |
+ sed -i "s/Stable tag: ${STABLE_VERSION_REGEX}/Stable tag: ${VERSION}/g" ./readme.txt
+ svn commit -m "Releasing version $VERSION" \
+ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
diff --git a/packages/project-management-automation/action.yml b/packages/project-management-automation/action.yml
index c5cd00678edd4d..34490f539875cc 100644
--- a/packages/project-management-automation/action.yml
+++ b/packages/project-management-automation/action.yml
@@ -1,10 +1,10 @@
name: Gutenberg project management automation
description: >
- Various automation to assist with managing the Gutenberg GitHub repository.
+ Various automation to assist with managing the Gutenberg GitHub repository.
inputs:
- github_token:
- description: Secret GitHub API token to use for making API requests.
- required: true
+ github_token:
+ description: Secret GitHub API token to use for making API requests.
+ required: true
runs:
- using: node12
- main: lib/index.js
+ using: node12
+ main: lib/index.js
From 0ae0aea0902340bd68b82a0c878676ba7bc3a5f8 Mon Sep 17 00:00:00 2001
From: Robert Anderson
Date: Thu, 1 Apr 2021 09:03:42 +1100
Subject: [PATCH 18/53] Widgets Customizer: Add Legacy Widget block (#30321)
* Widgets Customizer: Enable Legacy Widget block
Wires up the Legacy Widget block to the Widgets Customizer.
* Widgets Customizer: Remove __unstable_instance in lieu of raw_instance.
Removes __unstable_instance from the instance object returned by the
Customizer and instead add raw_instance. This property is only added if
the widget has declared that it supports raw instances via the
show_instance_in_rest flag.
* Use themes.php in Legacy Widget iframe
* Use destructuring in widgetToBlock
---
lib/widgets-customize.php | 77 ++++++++-----------
.../src/legacy-widget/edit/preview.js | 3 +-
.../use-sidebar-block-editor.js | 68 ++++++++--------
packages/customize-widgets/src/index.js | 33 +-------
4 files changed, 76 insertions(+), 105 deletions(-)
diff --git a/lib/widgets-customize.php b/lib/widgets-customize.php
index 20b79c262a8e6d..e0793ff383bf10 100644
--- a/lib/widgets-customize.php
+++ b/lib/widgets-customize.php
@@ -59,59 +59,48 @@ function gutenberg_widgets_customize_register( $manager ) {
}
/**
- * Our own implementation of WP_Customize_Widgets::sanitize_widget_instance
- * which uses __unstable_instance if it exists.
+ * Swaps the customizer setting's sanitize_callback and sanitize_js_callback
+ * arguments with our own implementation that adds raw_instance to the sanitized
+ * value. This is only done if the widget has declared that it supports raw
+ * instances via the show_instance_in_rest flag. This lets the block editor use
+ * raw_instance to create blocks.
+ *
+ * When merged to Core, these changes should be made to
+ * WP_Customize_Widgets::sanitize_widget_instance and
+ * WP_Customize_Widgets::sanitize_widget_js_instance.
*
- * @param array $value Widget instance to sanitize.
- * @return array|void Sanitized widget instance.
+ * @param array $args Array of Customizer setting arguments.
+ * @param string $id Widget setting ID.
*/
-function gutenberg_widgets_customize_sanitize_widget_instance( $value ) {
- global $wp_customize;
+function gutenberg_widgets_customize_add_unstable_instance( $args, $id ) {
+ if ( preg_match( '/^widget_(?P.+?)(?:\[(?P\d+)\])?$/', $id, $matches ) ) {
+ $id_base = $matches['id_base'];
- if ( isset( $value['__unstable_instance'] ) ) {
- return $value['__unstable_instance'];
- }
+ $args['sanitize_callback'] = function( $value ) use ( $id_base ) {
+ global $wp_customize;
- return $wp_customize->widgets->sanitize_widget_instance( $value );
-}
+ if ( isset( $value['raw_instance'] ) ) {
+ $widget_object = gutenberg_get_widget_object( $id_base );
+ if ( ! empty( $widget_object->show_instance_in_rest ) ) {
+ return $value['raw_instance'];
+ }
+ }
-/**
- * Our own implementation of WP_Customize_Widgets::sanitize_widget_js_instance
- * which adds __unstable_instance.
- *
- * @param array $value Widget instance to convert to JSON.
- * @return array JSON-converted widget instance.
- */
-function gutenberg_widgets_customize_sanitize_widget_js_instance( $value ) {
- global $wp_customize;
+ return $wp_customize->widgets->sanitize_widget_instance( $value );
+ };
- $sanitized_value = $wp_customize->widgets->sanitize_widget_js_instance( $value );
+ $args['sanitize_js_callback'] = function( $value ) use ( $id_base ) {
+ global $wp_customize;
- $sanitized_value['__unstable_instance'] = $value;
+ $sanitized_value = $wp_customize->widgets->sanitize_widget_js_instance( $value );
- return $sanitized_value;
-}
+ $widget_object = gutenberg_get_widget_object( $id_base );
+ if ( ! empty( $widget_object->show_instance_in_rest ) ) {
+ $sanitized_value['raw_instance'] = (object) $value;
+ }
-/**
- * TEMPORARY HACK! \o/
- *
- * Swaps the customizer setting's sanitize_callback and sanitize_js_callback
- * arguments with our own implementation that adds __unstable_instance to the
- * sanitized value.
- *
- * This lets the block editor use __unstable_instance to create blocks.
- *
- * A proper fix would be to only add the raw instance when the widget is a block
- * widget and to update the Legacy Widget block to work with encoded instance
- * values. See https://github.com/WordPress/gutenberg/issues/28902.
- *
- * @param array $args Array of Customizer setting arguments.
- * @param string $id Widget setting ID.
- */
-function gutenberg_widgets_customize_add_unstable_instance( $args, $id ) {
- if ( 0 === strpos( $id, 'widget_' ) ) {
- $args['sanitize_callback'] = 'gutenberg_widgets_customize_sanitize_widget_instance';
- $args['sanitize_js_callback'] = 'gutenberg_widgets_customize_sanitize_widget_js_instance';
+ return $sanitized_value;
+ };
}
return $args;
diff --git a/packages/block-library/src/legacy-widget/edit/preview.js b/packages/block-library/src/legacy-widget/edit/preview.js
index ebdc0a5707e8e4..212905aed71001 100644
--- a/packages/block-library/src/legacy-widget/edit/preview.js
+++ b/packages/block-library/src/legacy-widget/edit/preview.js
@@ -34,7 +34,8 @@ export default function PreviewIframe( { idBase, instance, isVisible } ) {
;
- },
- } );
-
wp.customize.sectionConstructor.sidebar = SidebarSection;
wp.customize.controlConstructor.sidebar_block_editor = SidebarControl;
}
From 336748b39cc1e079806c87c2b8f30ed32d0ebb26 Mon Sep 17 00:00:00 2001
From: Mohammed Faragallah
Date: Thu, 1 Apr 2021 03:54:30 +0200
Subject: [PATCH 19/53] docs: update broken links (#30188)
---
docs/contributors/code/coding-guidelines.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/contributors/code/coding-guidelines.md b/docs/contributors/code/coding-guidelines.md
index ada1952f38e02a..c2a53eb5caff47 100644
--- a/docs/contributors/code/coding-guidelines.md
+++ b/docs/contributors/code/coding-guidelines.md
@@ -225,7 +225,7 @@ Gutenberg follows the [WordPress JavaScript Documentation Standards](https://mak
For additional guidance, consult the following resources:
- [JSDoc Official Documentation](https://jsdoc.app/index.html)
-- [TypeScript Supported JSDoc](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc)
+- [TypeScript Supported JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html)
### Custom Types
@@ -264,7 +264,7 @@ Note the use of quotes when defining a set of string literals. As in the [JavaSc
### Importing and Exporting Types
-Use the [TypeScript `import` function](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#import-types) to import type declarations from other files or third-party dependencies.
+Use the [TypeScript `import` function](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types) to import type declarations from other files or third-party dependencies.
Since an imported type declaration can occupy an excess of the available line length and become verbose when referenced multiple times, you are encouraged to create an alias of the external type using a `@typedef` declaration at the top of the file, immediately following [the `import` groupings](/docs/contributors/code/coding-guidelines.md#imports).
@@ -314,9 +314,9 @@ When documenting a generic type such as `Object`, `Function`, `Promise`, etc., a
When an object is used as a dictionary, you can define its type in 2 ways: indexable interface (`{[setting:string]:any}`) or `Record`. When the name of the key for an object provides hints for developers what to do like `setting`, use indexable interface. If not, use `Record`.
-The function expression here uses TypeScript's syntax for function types, which can be useful in providing more detailed information about the names and types of the expected parameters. For more information, consult the [TypeScript `@type` tag function recommendations](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#type).
+The function expression here uses TypeScript's syntax for function types, which can be useful in providing more detailed information about the names and types of the expected parameters. For more information, consult the [TypeScript `@type` tag function recommendations](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#type).
-In more advanced cases, you may define your own custom types as a generic type using the [TypeScript `@template` tag](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#template).
+In more advanced cases, you may define your own custom types as a generic type using the [TypeScript `@template` tag](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#template).
Similar to the "Custom Types" advice concerning type unions and with literal values, you can consider to create a custom type `@typedef` to better describe expected key values for object records, or to extract a complex function signature.
From 2332b58a476e77eab9f00df8dc35d9ba2fb54198 Mon Sep 17 00:00:00 2001
From: JoshuaDoshua <1930699+JoshuaDoshua@users.noreply.github.com>
Date: Wed, 31 Mar 2021 21:58:23 -0400
Subject: [PATCH 20/53] Documentation: Fix code snippet for disabling the block
directory (#30365)
The `plugins_loaded` filter doesn't work to successfully remove these actions.
Relevant comment:
https://github.com/WordPress/gutenberg/issues/23961#issuecomment-688957626
---
docs/reference-guides/filters/editor-filters.md | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/docs/reference-guides/filters/editor-filters.md b/docs/reference-guides/filters/editor-filters.md
index 6166b356c22f2d..b9701a30b2e24d 100644
--- a/docs/reference-guides/filters/editor-filters.md
+++ b/docs/reference-guides/filters/editor-filters.md
@@ -57,11 +57,6 @@ If set to false the user will not be able to switch between visual and code edit
The Block Directory enables installing new block plugins from [WordPress.org.](https://wordpress.org/plugins/browse/block/) It can be disabled by removing the actions that enqueue it. In WordPress core, the function is `wp_enqueue_editor_block_directory_assets`, and Gutenberg uses `gutenberg_enqueue_block_editor_assets_block_directory`. To remove the feature, use [`remove_action`,](https://developer.wordpress.org/reference/functions/remove_action/) like this:
```php
-add_action(
- 'plugins_loaded',
- function() {
- remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
- remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
- }
-);
+remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
+remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
```
From 787717644b18183904bf34e1b79e94ed66d84420 Mon Sep 17 00:00:00 2001
From: Cory Hughart
Date: Wed, 31 Mar 2021 22:18:58 -0400
Subject: [PATCH 21/53] Remove references to __experimental* in the docs
(#29322)
Remove documented code using `__experimentalGetSettings` as per https://developer.wordpress.org/block-editor/contributors/develop/coding-guidelines/#experimental-and-unstable-apis
---
packages/components/src/date-time/README.md | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/packages/components/src/date-time/README.md b/packages/components/src/date-time/README.md
index 1a796674d87259..23bc4269170868 100644
--- a/packages/components/src/date-time/README.md
+++ b/packages/components/src/date-time/README.md
@@ -16,28 +16,16 @@ Render a DateTimePicker.
```jsx
import { DateTimePicker } from '@wordpress/components';
-import { __experimentalGetSettings } from '@wordpress/date';
import { withState } from '@wordpress/compose';
const MyDateTimePicker = withState( {
date: new Date(),
} )( ( { date, setState } ) => {
- const settings = __experimentalGetSettings();
-
- // To know if the current timezone is a 12 hour time with look for an "a" in the time format.
- // We also make sure this a is not escaped by a "/".
- const is12HourTime = /a(?!\\)/i.test(
- settings.formats.time
- .toLowerCase() // Test only the lower case a
- .replace( /\\\\/g, '' ) // Replace "//" with empty strings
- .split( '' ).reverse().join( '' ) // Reverse the string and test for "a" not followed by a slash
- );
-
return (
setState( { date } ) }
- is12Hour={ is12HourTime }
+ is12Hour={ true }
/>
);
} );
@@ -68,6 +56,7 @@ Whether we use a 12-hour clock. With a 12-hour clock, an AM/PM widget is display
- Type: `bool`
- Required: No
+- Default: false
### isInvalidDate
From e7e165346bde9e0582c6464ce991487927bcaa36 Mon Sep 17 00:00:00 2001
From: James Koster
Date: Thu, 1 Apr 2021 08:54:57 +0100
Subject: [PATCH 22/53] Update "close small" icon so that its shape matches the
"add" icon dimensionally (#30014)
* Update "close small" icon so that its shape matches the "add" icon dimensionally.
* Update test snapshots
* Update e2e test snapshots
Co-authored-by: David Szabo
---
.../editor/plugins/__snapshots__/plugins-api.test.js.snap | 4 ++--
.../post-publish-panel/test/__snapshots__/index.js.snap | 4 ++--
packages/icons/src/library/close-small.js | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap b/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap
index 6a21f349febadd..0bc642cc5bbac8 100644
--- a/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap
+++ b/packages/e2e-tests/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap
@@ -2,6 +2,6 @@
exports[`Using Plugins API Document Setting Custom Panel Should render a custom panel inside Document Setting sidebar 1`] = `"My Custom Panel"`;
-exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Plugin sidebar title
"`;
+exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Plugin sidebar title
"`;
-exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"
(no title)
Plugin sidebar title
"`;
+exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"