Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/13.1" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Apr 21, 2022
1 parent 9c15c66 commit 9ad1f9d
Show file tree
Hide file tree
Showing 455 changed files with 8,749 additions and 15,563 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const majorMinorRegExp =
*/
const developmentFiles = [
'**/benchmark/**/*.js',
'**/@(__mocks__|__tests__|test)/**/*.js',
'**/@(__mocks__|__tests__|test)/**/*.{js,ts,tsx}',
'**/@(storybook|stories)/**/*.js',
'packages/babel-preset-default/bin/**/*.js',
];
Expand Down
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@
/packages/html-entities
/packages/i18n @swissspidy
/packages/is-shallow-equal
/packages/keyboard-shortcuts
/packages/keycodes
/packages/preferences @talldan
/packages/priority-queue
/packages/token-list
/packages/url
/packages/wordcount
/packages/warning
/packages/keyboard-shortcuts

# Extensibility
/packages/hooks @adamsilverstein
Expand Down
4 changes: 2 additions & 2 deletions .github/report-flaky-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inputs:
description: 'The flaky-test label name'
required: true
default: 'flaky-test'
artifact-name:
description: 'The name of the uploaded artifact'
artifact-name-prefix:
description: 'The prefix name of the uploaded artifact'
required: true
default: 'flaky-tests-report'
runs:
Expand Down
12 changes: 7 additions & 5 deletions .github/report-flaky-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ const metaData = {
( async function run() {
const token = core.getInput( 'repo-token', { required: true } );
const label = core.getInput( 'label', { required: true } );
const artifactName = core.getInput( 'artifact-name', { required: true } );
const artifactNamePrefix = core.getInput( 'artifact-name-prefix', {
required: true,
} );

const octokit = github.getOctokit( token );

const flakyTests = await downloadReportFromArtifact(
octokit,
artifactName
artifactNamePrefix
);

if ( ! flakyTests ) {
Expand Down Expand Up @@ -191,16 +193,16 @@ async function fetchAllIssuesLabeledFlaky( octokit, label ) {
return issues;
}

async function downloadReportFromArtifact( octokit, artifactName ) {
async function downloadReportFromArtifact( octokit, artifactNamePrefix ) {
const {
data: { artifacts },
} = await octokit.rest.actions.listWorkflowRunArtifacts( {
...github.context.repo,
run_id: github.context.payload.workflow_run.id,
} );

const matchArtifact = artifacts.find(
( artifact ) => artifact.name === artifactName
const matchArtifact = artifacts.find( ( artifact ) =>
artifact.name.startsWith( artifactNamePrefix )
);

if ( ! matchArtifact ) {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
if: always()
with:
name: flaky-tests-report
name: flaky-tests-report-playwright
path: flaky-tests
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
if: always()
with:
name: flaky-tests-report
name: flaky-tests-report-${{ matrix.part }}
path: flaky-tests
if-no-files-found: ignore
6 changes: 2 additions & 4 deletions .github/workflows/flaky-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Report Flaky Tests

on:
workflow_run:
# We should also add 'End-to-End Tests Playwright' here but that
# wil run this workflow whenever either one of them completes.
workflows: ['End-to-End Tests']
workflows: ['End-to-End Tests', 'End-to-End Tests Playwright']
types:
- completed

Expand All @@ -31,4 +29,4 @@ jobs:
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
label: '[Type] Flaky Test'
artifact-name: flaky-tests-report
artifact-name-prefix: flaky-tests-report
4 changes: 2 additions & 2 deletions bin/test-create-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi
expected=6
actual=$( find src -maxdepth 1 -type f | wc -l )
if [ "$expected" -ne "$actual" ]; then
error "Expected $expected files in the `src` directory, but found $actual."
error "Expected $expected files in the \`src\` directory, but found $actual."
exit 1
fi

Expand All @@ -72,7 +72,7 @@ status "Verifying build..."
expected=5
actual=$( find build -maxdepth 1 -type f | wc -l )
if [ "$expected" -ne "$actual" ]; then
error "Expected $expected files in the `build` directory, but found $actual."
error "Expected $expected files in the \`build\` directory, but found $actual."
exit 1
fi

Expand Down
682 changes: 372 additions & 310 deletions changelog.txt

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions docs/explanations/architecture/full-site-editing-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

## Template and template part flows

<div class="callout callout-alert">
This documentation is for block templates and template parts, these features are part of the Full Site Editing project releasing in WordPress 5.9.
</div>

This document will explain the internals of how templates and templates parts are rendered in the frontend and edited in the backend. For an introduction about block themes and Full site editing templates, refer to the [block theme documentation](/docs/how-to-guides/themes/block-theme-overview.md).

## Storage
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/create-block/author-experience.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Update `src/editor.scss` to:

```scss
.wp-block-create-block-gutenpride input[type='text'] {
font-family: Gilbert;
font-family: Gilbert, sans-serif;
font-size: 64px;
color: inherit;
background: inherit;
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/create-block/block-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Note: the block classname is prefixed with `wp-block`. The `create-block/gutenpr

```scss
@font-face {
font-family: Gilbert;
font-family: Gilbert, sans-serif;
src: url( ../assets/gilbert-color.otf );
font-weight: 700;
}
Expand Down
32 changes: 22 additions & 10 deletions docs/how-to-guides/block-tutorial/nested-blocks-inner-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,30 @@ add_action( 'init', function() {
} );
```

## Parent-Child InnerBlocks
## Child InnerBlocks: Parent and Ancestors

A common pattern for using InnerBlocks is to create a custom block that will be included only in the InnerBlocks. An example of this is the Columns block, that creates a single parent block called `columns` and then creates an child block called `column`. The parent block is defined to only allow the child blocks. See [Column code for reference](https://github.com/WordPress/gutenberg/tree/HEAD/packages/block-library/src/column).
A common pattern for using InnerBlocks is to create a custom block that will be included only in the InnerBlocks.

An example of this is the Columns block, that creates a single parent block called `columns` and then creates an child block called `column`. The parent block is defined to only allow the child blocks. See [Column code for reference](https://github.com/WordPress/gutenberg/tree/HEAD/packages/block-library/src/column).

When defining a child block, use the `parent` block setting to define which block is the parent. This prevents the block showing in the inserter outside of the InnerBlock it is defined for.

```js
export const settings = {
title: __( 'Column' ),
parent: [ 'core/columns' ],
icon,
description: __( 'A single column within a columns block.' ),
//...
};
```json
{
"title": "Column",
"name": "core/column",
"parent": [ "core/columns" ],
// ...
}
```

Another example is using the `ancestors` block setting to define a block that must be present as an ancestor, but it doesn't need to be the direct parent (like with `parent`). This prevents the block from showing in the inserter if the ancestor is not in the tree, but other blocks can be added in between, like a Columns or Group block. See [Comment Author Name code for reference](https://github.com/WordPress/gutenberg/tree/HEAD/packages/block-library/src/comment-author-name).

```json
{
"title": "Comment Author Name",
"name": "core/comment-author-name",
"ancestor": [ "core/comment-template" ],
// ...
}
```
Loading

0 comments on commit 9ad1f9d

Please sign in to comment.