Skip to content

Commit

Permalink
Merge trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
derekblank committed Aug 9, 2023
2 parents b8be63f + e57bf0d commit 4333a9c
Show file tree
Hide file tree
Showing 335 changed files with 5,932 additions and 3,577 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ module.exports = {
],
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
disallowTypeAnnotations: false,
},
],
'no-restricted-syntax': [
'error',
// NOTE: We can't include the forward slash in our regex or
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
count: 1
labels: '[Type] Accessibility (a11y), [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core'
add_comment: true
message: "## ⚠️ Type of PR label error\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}.\n\nYou can learn more about the Type labels in Gutenberg [here](https://github.com/WordPress/gutenberg/labels?q=type)"
message: "**Warning: Type of PR label error**\n\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}.\n\nRead more about [Type labels in Gutenberg](https://github.com/WordPress/gutenberg/labels?q=type)."
exit_type: failure
6 changes: 0 additions & 6 deletions .github/workflows/stale-issue-gardening.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
only-labels: '[Type] Flaky Test'
remove-stale-when-updated: true
stale-issue-label: '[Status] Stale'
- name: 'Issues without recent updates that need confirmation'
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 check-in'

steps:
- name: Update issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Note that the commands described here should be run in the top-level directory o
```sh
nvm install
npm ci
npm run native preios
```

## Run
Expand Down
52 changes: 26 additions & 26 deletions docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ Similar requirements apply to releasing WordPress's [npm packages](https://devel

**Table of contents**

- [Gutenberg plugin releases](#gutenberg-plugin-releases)
- - [Release schedule](#release-schedule)
- - [Release management](#release-management)
- - [Preparing a release](#preparing-a-release)
- - - [Organizing and labeling milestone PRs](#organizing-and-labeling-milestone-prs)
- - - [Running the release workflow](#running-the-release-workflow)
- - - [Publishing the @wordpress packages to NPM](#publishing-the-wordpress-packages-to-npm)
- - - [Viewing the release draft](#viewing-the-release-draft)
- - - [Curating the release changelog](#curating-the-release-changelog)
- - - [Creating release candidate patches (cherry-picking)](#creating-release-candidate-patches-cherry-picking)
- - - - [Automated cherry-picking](#automated-cherry-picking)
- - - - [Manual cherry-picking](#manual-cherry-picking)
- - - [Publishing the release](#publishing-the-release)
- - [Documenting the release](#documenting-the-release)
- - - [Selecting the release highlights](#selecting-the-release-highlights)
- - - [Requesting release assets](#requesting-release-assets)
- - - [Drafting the release post](#drafting-the-release-post)
- - - [Publishing the release post](#publishing-the-release-post)
- - [Creating minor releases](#creating-minor-releases)
- - - [Updating the release branch](#updating-the-release-branch)
- - - [Running the minor release](#running-the-minor-release)
- - - [Creating a minor release for previous stable releases](#creating-a-minor-release-for-previous-stable-releases)
- - - [Troubleshooting](#troubleshooting)
- **[Gutenberg plugin releases](#gutenberg-plugin-releases)**
- [Release schedule](#release-schedule)
- [Release management](#release-management)
- [Preparing a release](#preparing-a-release)
- [Organizing and labeling milestone PRs](#organizing-and-labeling-milestone-prs)
- [Running the release workflow](#running-the-release-workflow)
- [Publishing the @wordpress packages to NPM](#publishing-the-wordpress-packages-to-npm)
- [Viewing the release draft](#viewing-the-release-draft)
- [Curating the release changelog](#curating-the-release-changelog)
- [Creating release candidate patches (cherry-picking)](#creating-release-candidate-patches-cherry-picking)
- [Automated cherry-picking](#automated-cherry-picking)
- [Manual cherry-picking](#manual-cherry-picking)
- [Publishing the release](#publishing-the-release)
- [Documenting the release](#documenting-the-release)
- [Selecting the release highlights](#selecting-the-release-highlights)
- [Requesting release assets](#requesting-release-assets)
- [Drafting the release post](#drafting-the-release-post)
- [Publishing the release post](#publishing-the-release-post)
- [Creating minor releases](#creating-minor-releases)
- [Updating the release branch](#updating-the-release-branch)
- [Running the minor release](#running-the-minor-release)
- [Creating a minor release for previous stable releases](#creating-a-minor-release-for-previous-stable-releases)
- [Troubleshooting](#troubleshooting)
- [Packages releases to NPM and WordPress Core updates](#packages-releases-to-npm-and-wordpress-core-updates)
- - [Synchronizing the Gutenberg plugin](#synchronizing-the-gutenberg-plugin)
- - [WordPress releases](#wordpress-releases)
- - [Development releases](#development-releases)
- [Synchronizing the Gutenberg plugin](#synchronizing-the-gutenberg-plugin)
- [WordPress releases](#wordpress-releases)
- [Development releases](#development-releases)

## Gutenberg plugin releases

Expand Down
5 changes: 5 additions & 0 deletions docs/explanations/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ This is the canonical list of keyboard shortcuts:
<td><kbd>Esc</kbd></td>
<td><kbd>Esc</kbd></td>
</tr>
<tr>
<td>Select text across multiple blocks.</td>
<td></td>
<td><kbd>Shift</kbd>+<kbd>Arrow (⇦, ⇧, ⇨, ⇩)</kbd></td>
</tr>
</tbody>
</table>

Expand Down
19 changes: 19 additions & 0 deletions docs/how-to-guides/curating-the-editor-experience.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,25 @@ To opt into this, include `core/post-content` in the Block Types for your patter

Read more about this functionality in the [Page creation patterns in WordPress 6.0 dev note](https://make.wordpress.org/core/2022/05/03/page-creation-patterns-in-wordpress-6-0/) and [note that WordPress 6.1 brought this functionality to all post types](https://make.wordpress.org/core/2022/10/10/miscellaneous-editor-changes-for-wordpress-6-1/#start-content-patterns-for-all-post-types).

**Prioritize starter patterns for template creation**

In the same way patterns can be prioritized for new posts or pages, the same experience can be added to the template creation process. When patterns declare support for the 'templateTypes' property, the patterns will appear anytime a template that matches the designation is created, along with the options to start from a blank state or use the current fallback of the template. By default, WordPress does not include any of these patterns.

To opt into this, a pattern needs to specify a property called `templateTypes`, which is an array containing the templates where the patterns can be used as the full content. Here's an example of a pattern that would appear when creating a 404 template:

```
register_block_pattern(
'wp-my-theme/404-template-pattern',
array(
'title' => __( '404 Only template pattern', 'wp-my-theme' ),
'templateTypes' => array( '404' ),
'content' => '<!-- wp:paragraph {"align":"center","fontSize":"x-large"} --><p class="has-text-align-center has-x-large-font-size">404 pattern</p><!-- /wp:paragraph -->',
)
);
```

Read more about this functionality in the [Patterns on the create a new template modal in the WordPress 6.3 dev note](https://make.wordpress.org/core/2023/07/18/miscellaneous-editor-changes-in-wordpress-6-3/#patterns-on-the-create-a-new-template-modal).

**Lock patterns**

As mentioned in the prior section on Locking APIs, aspects of patterns themselves can be locked so that the important aspects of the design can be preserved. [Here’s an example of a pattern](https://gist.github.com/annezazu/acee30f8b6e8995e1b1a52796e6ef805) with various blocks locked in different ways. You can build these patterns in the editor itself, including adding locking options, before [following the documentation to register them](/docs/reference-guides/block-api/block-patterns.md).
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Hide and show additional content. ([Source](https://github.com/WordPress/gutenbe

- **Name:** core/details
- **Category:** text
- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), color (background, gradients, link, text), layout (~~allowEditing~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** showContent, summary

## Embed
Expand All @@ -275,7 +275,7 @@ Add a link to a downloadable file. ([Source](https://github.com/WordPress/gutenb

- **Name:** core/footnotes
- **Category:** text
- **Supports:** color (background, link, text), ~~html~~, ~~multiple~~, ~~reusable~~
- **Supports:** color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~multiple~~, ~~reusable~~
- **Attributes:**

## Classic
Expand Down
1 change: 1 addition & 0 deletions docs/reference-guides/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [**core/block-directory**: Block directory](/docs/reference-guides/data/data-core-block-directory.md)
- [**core/block-editor**: The Block Editor’s Data](/docs/reference-guides/data/data-core-block-editor.md)
- [**core/blocks**: Block Types Data](/docs/reference-guides/data/data-core-blocks.md)
- [**core/commands**: Command Palette](/docs/reference-guides/data/data-core-commands.md)
- [**core/customize-widgets**: Customize Widgets](/docs/reference-guides/data/data-core-customize-widgets.md)
- [**core/edit-post**: The Editor’s UI Data](/docs/reference-guides/data/data-core-edit-post.md)
- [**core/edit-site**: Edit Site](/docs/reference-guides/data/data-core-edit-site.md)
Expand Down
62 changes: 62 additions & 0 deletions docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,35 @@ _Returns_

- `number`: Number of blocks in the post.

### getBlockEditingMode

Returns the block editing mode for a given block.

The mode can be one of three options:

- `'disabled'`: Prevents editing the block entirely, i.e. it cannot be selected.
- `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the toolbar, the block movers, block settings.
- `'default'`: Allows editing the block as normal.

Blocks can set a mode using the `useBlockEditingMode` hook.

The mode is inherited by all of the block's inner blocks, unless they have their own mode.

A template lock can also set a mode. If the template lock is `'contentOnly'`, the block's mode is overridden to `'contentOnly'` if the block has a content role attribute, or `'disabled'` otherwise.

_Related_

- useBlockEditingMode

_Parameters_

- _state_ `Object`: Global application state.
- _clientId_ `string`: The block client ID, or `''` for the root container.

_Returns_

- `BlockEditingMode`: The block editing mode. One of `'disabled'`, `'contentOnly'`, or `'default'`.

### getBlockHierarchyRootClientId

Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks.
Expand Down Expand Up @@ -1554,6 +1583,23 @@ _Parameters_
- _clientId_ `string`: Block client ID.
- _fallbackToParent_ `boolean`: If true, select the first parent if there is no previous block.

### setBlockEditingMode

Sets the block editing mode for a given block.

_Related_

- useBlockEditingMode

_Parameters_

- _clientId_ `string`: The block client ID, or `''` for the root container.
- _mode_ `BlockEditingMode`: The block editing mode. One of `'disabled'`, `'contentOnly'`, or `'default'`.

_Returns_

- `Object`: Action object.

### setBlockMovingClientId

Action that enables or disables the block moving mode.
Expand Down Expand Up @@ -1711,6 +1757,22 @@ _Returns_

- `Object`: Action object.

### unsetBlockEditingMode

Clears the block editing mode for a given block.

_Related_

- useBlockEditingMode

_Parameters_

- _clientId_ `string`: The block client ID, or `''` for the root container.

_Returns_

- `Object`: Action object.

### updateBlock

Action that updates the block with the specified client ID.
Expand Down
129 changes: 129 additions & 0 deletions docs/reference-guides/data/data-core-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# The Commands Data

Namespace: `core/commands`.

## Selectors

<!-- START TOKEN(Autogenerated selectors|../../../packages/commands/src/store/selectors.js) -->

### getCommandLoaders

Returns the registered command loaders.

_Parameters_

- _state_ `Object`: State tree.
- _contextual_ `boolean`: Whether to return only contextual command loaders.

_Returns_

- `import('./actions').WPCommandLoaderConfig[]`: The list of registered command loaders.

### getCommands

Returns the registered static commands.

_Parameters_

- _state_ `Object`: State tree.
- _contextual_ `boolean`: Whether to return only contextual commands.

_Returns_

- `import('./actions').WPCommandConfig[]`: The list of registered commands.

### getContext

Returns whether the active context.

_Parameters_

- _state_ `Object`: State tree.

_Returns_

- `string`: Context.

### isOpen

Returns whether the command palette is open.

_Parameters_

- _state_ `Object`: State tree.

_Returns_

- `boolean`: Returns whether the command palette is open.

<!-- END TOKEN(Autogenerated selectors|../../../packages/commands/src/store/selectors.js) -->

## Actions

<!-- START TOKEN(Autogenerated actions|../../../packages/commands/src/store/actions.js) -->

### close

Closes the command palette.

_Returns_

- `Object`: action.

### open

Opens the command palette.

_Returns_

- `Object`: action.

### registerCommand

Returns an action object used to register a new command.

_Parameters_

- _config_ `WPCommandConfig`: Command config.

_Returns_

- `Object`: action.

### registerCommandLoader

Register command loader.

_Parameters_

- _config_ `WPCommandLoaderConfig`: Command loader config.

_Returns_

- `Object`: action.

### unregisterCommand

Returns an action object used to unregister a command.

_Parameters_

- _name_ `string`: Command name.

_Returns_

- `Object`: action.

### unregisterCommandLoader

Unregister command loader hook.

_Parameters_

- _name_ `string`: Command loader name.

_Returns_

- `Object`: action.

<!-- END TOKEN(Autogenerated actions|../../../packages/commands/src/store/actions.js) -->
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Settings related to layout.
| --- | --- | --- |--- |
| contentSize | string | | |
| wideSize | string | | |
| allowEditing | boolean | true | |

---

Expand Down
5 changes: 3 additions & 2 deletions lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,9 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
}

// Add combined layout and block classname for global styles to hook onto.
$block_name = explode( '/', $block['blockName'] );
$class_names[] = 'wp-block-' . end( $block_name ) . '-' . $layout_classname;
$split_block_name = explode( '/', $block['blockName'] );
$full_block_name = 'core' === $split_block_name[0] ? end( $split_block_name ) : implode( '-', $split_block_name );
$class_names[] = 'wp-block-' . $full_block_name . '-' . $layout_classname;

$content_with_outer_classnames = '';

Expand Down
Loading

0 comments on commit 4333a9c

Please sign in to comment.