Skip to content

Commit

Permalink
Merge branch 'trunk' into try/playlist2
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Dec 4, 2024
2 parents 45bc81f + d017783 commit 6b37af5
Show file tree
Hide file tree
Showing 801 changed files with 13,052 additions and 6,789 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md -->
<!-- How can you test the changes by using the keyboard only? Please note, this is required for PRs that change the user interface (UI). This ensures the PR can be tested for any possible accessibility regressions. -->

## Screenshots or screencast <!-- if applicable -->

<!-- If you would like to upload screenshots, feel free to use the table below when it is useful to show the difference between before and after the change. -->

|Before|After|
|-|-|
|<!-- Before screenshot here -->|<!-- After screenshot here -->|
6 changes: 4 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ jobs:
name: 'Validation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- uses: gradle/wrapper-validation-action@v3
- name: Validate checksums
uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build
build-module
build-style
build-types
build-wp
node_modules
gutenberg.zip
coverage
Expand Down
1 change: 1 addition & 0 deletions backport-changelog/6.8/7069.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ https://github.com/WordPress/wordpress-develop/pull/7069

* https://github.com/WordPress/gutenberg/pull/63401
* https://github.com/WordPress/gutenberg/pull/66918
* https://github.com/WordPress/gutenberg/pull/67018
1 change: 1 addition & 0 deletions backport-changelog/6.8/7687.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7687

* https://github.com/WordPress/gutenberg/pull/66488
* https://github.com/WordPress/gutenberg/pull/67497
4 changes: 4 additions & 0 deletions backport-changelog/6.8/7695.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
https://github.com/WordPress/wordpress-develop/pull/7695

* https://github.com/WordPress/gutenberg/pull/66631
* https://github.com/WordPress/gutenberg/pull/67465
* https://github.com/WordPress/gutenberg/pull/66579
* https://github.com/WordPress/gutenberg/pull/66654
* https://github.com/WordPress/gutenberg/pull/67518
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7848.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7848

* https://github.com/WordPress/gutenberg/pull/67154
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7895.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7895

* https://github.com/WordPress/gutenberg/pull/66459
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7903.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7903

* https://github.com/WordPress/gutenberg/pull/67199
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7909.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7909

* https://github.com/WordPress/gutenberg/pull/67330
539 changes: 539 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions docs/contributors/repository-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,3 @@ If you meet this criterion of several meaningful contributions having been accep
## Projects

We use [GitHub projects](https://github.com/WordPress/gutenberg/projects) to keep track of details that aren't immediately actionable, but that we want to keep around for future reference.

Some key projects include:

- [Phase 2](https://github.com/WordPress/gutenberg/projects/13) - Development tasks needed for Phase 2 of Gutenberg.
- [Phase 2 design](https://github.com/WordPress/gutenberg/projects/21) - Tasks for design in Phase 2. Note: specific projects may have their own boards.
- [Ideas](https://github.com/WordPress/gutenberg/projects/8) - Project containing tickets that, while closed for the time being, can be revisited in the future.
1 change: 1 addition & 0 deletions docs/contributors/versions-in-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre

| Gutenberg Versions | WordPress Version |
| ------------------ | ----------------- |
| 18.6-19.3 | 6.7.1 |
| 18.6-19.3 | 6.7 |
| 17.8-18.5 | 6.6.2 |
| 17.8-18.5 | 6.6.1 |
Expand Down
16 changes: 9 additions & 7 deletions docs/explanations/architecture/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ The user may change the state of this block by applying different styles: a text
After some user modifications to the block, the initial markup may become something like this:

```html
<p class="has-color has-green-color has-font-size has-small-font-size my-custom-class"
style="line-height: 1em"></p>
<p
class="has-color has-green-color has-font-size has-small-font-size my-custom-class"
style="line-height: 1em"
></p>
```

This is what we refer to as "user-provided block styles", also know as "local styles" or "serialized styles". Essentially, each tool (font size, color, etc) ends up adding some classes and/or inline styles to the block markup. The CSS styling for these classes is part of the block, global, or theme stylesheets.
Expand Down Expand Up @@ -123,7 +125,7 @@ The block supports API only serializes the font size value to the wrapper, resul

This is an active area of work you can follow [in the tracking issue](https://github.com/WordPress/gutenberg/issues/38167). The linked proposal is exploring a different way to serialize the user changes: instead of each block support serializing its own data (for example, classes such as `has-small-font-size`, `has-green-color`) the idea is the block would get a single class instead (for example, `wp-style-UUID`) and the CSS styling for that class will be generated in the server by WordPress.

While work continues in that proposal, there's an escape hatch, an experimental option block authors can use. Any block support can skip the serialization to HTML markup by using `__experimentalSkipSerialization`. For example:
While work continues in that proposal, there's an escape hatch, an experimental option block authors can use. Any block support can skip the serialization to HTML markup by using `skipSerialization`. For example:

```json
{
Expand All @@ -132,15 +134,15 @@ While work continues in that proposal, there's an escape hatch, an experimental
"supports": {
"typography": {
"fontSize": true,
"__experimentalSkipSerialization": true
"skipSerialization": true
}
}
}
```

This means that the typography block support will do all of the things (create a UI control, bind the block attribute to the control, etc) except serializing the user values into the HTML markup. The classes and inline styles will not be automatically applied to the wrapper and it is the block author's responsibility to implement this in the `edit`, `save`, and `render_callback` functions. See [this issue](https://github.com/WordPress/gutenberg/issues/28913) for examples of how it was done for some blocks provided by WordPress.

Note that, if `__experimentalSkipSerialization` is enabled for a group (typography, color, spacing) it affects _all_ block supports within this group. In the example above _all_ the properties within the `typography` group will be affected (e.g. `fontSize`, `lineHeight`, `fontFamily` .etc).
Note that, if `skipSerialization` is enabled for a group (typography, color, spacing) it affects _all_ block supports within this group. In the example above _all_ the properties within the `typography` group will be affected (e.g. `fontSize`, `lineHeight`, `fontFamily` .etc).

To enable for a _single_ property only, you may use an array to declare which properties are to be skipped. In the example below, only `fontSize` will skip serialization, leaving other items within the `typography` group (e.g. `lineHeight`, `fontFamily` .etc) unaffected.

Expand All @@ -152,7 +154,7 @@ To enable for a _single_ property only, you may use an array to declare which pr
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalSkipSerialization": [ "fontSize" ]
"skipSerialization": [ "fontSize" ]
}
}
}
Expand Down Expand Up @@ -473,7 +475,7 @@ If blocks do this, they need to be registered in the server using the `block.jso

Every chunk of styles can only use a single selector.

This is particularly relevant if the block is using `__experimentalSkipSerialization` to serialize the different style properties to different nodes other than the wrapper. See "Current limitations of blocks supports" for more.
This is particularly relevant if the block is using `skipSerialization` to serialize the different style properties to different nodes other than the wrapper. See "Current limitations of blocks supports" for more.

#### 3. **Only a single property per block**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ As of Gutenberg version 14.2, the following controls are available:
- `taxQuery` - Shows available taxonomies filters for the currently selected post type.
- `author` - Shows an input field to filter the query by author.
- `search` - Shows an input field to filter the query by keywords.
- `format` - Shows an input field to filter the query by array/collection of [formats](https://developer.wordpress.org/advanced-administration/wordpress/post-formats/#supported-formats).
- `parents` - Shows an input field to filter the query using parent(s) entity.

In our case, the property would look like this:

Expand Down
12 changes: 6 additions & 6 deletions docs/reference-guides/block-api/block-transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ A transformation of type `block` is an object that takes the following parameter
- **transform** _(function)_: a callback that receives the attributes and inner blocks of the block being processed. It should return a block object or an array of block objects.
- **isMatch** _(function, optional)_: a callback that receives the block attributes as the first argument and the block object as the second argument and should return a boolean. Returning `false` from this function will prevent the transform from being available and displayed as an option to the user.
- **isMultiBlock** _(boolean, optional)_: whether the transformation can be applied when multiple blocks are selected. If true, the `transform` function's first parameter will be an array containing each selected block's attributes, and the second an array of each selected block's inner blocks. False by default.
- **priority** _(number, optional)_: controls the priority with which a transformation is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transformation is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from Paragraph block to Heading block**

Expand Down Expand Up @@ -97,7 +97,7 @@ A transformation of type `enter` is an object that takes the following parameter
- **type** _(string)_: the value `enter`.
- **regExp** _(RegExp)_: the Regular Expression to use as a matcher. If the value matches, the transformation will be applied.
- **transform** _(function)_: a callback that receives an object with a `content` field containing the value that has been entered. It should return a block object or an array of block objects.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from --- to Separator block**

Expand All @@ -124,7 +124,7 @@ A transformation of type `files` is an object that takes the following parameter
- **type** _(string)_: the value `files`.
- **transform** _(function)_: a callback that receives the array of files being processed. It should return a block object or an array of block objects.
- **isMatch** _(function, optional)_: a callback that receives the array of files being processed and should return a boolean. Returning `false` from this function will prevent the transform from being applied.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from file to File block**

Expand Down Expand Up @@ -164,7 +164,7 @@ A transformation of type `prefix` is an object that takes the following paramete
- **type** _(string)_: the value `prefix`.
- **prefix** _(string)_: the character or sequence of characters that match this transform.
- **transform** _(function)_: a callback that receives the content introduced. It should return a block object or an array of block objects.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from text to custom block**

Expand Down Expand Up @@ -197,7 +197,7 @@ A transformation of type `raw` is an object that takes the following parameters:
- **schema** _(object|function, optional)_: defines an [HTML content model](https://html.spec.whatwg.org/multipage/dom.html#content-models) used to detect and process pasted contents. See [below](#schemas-and-content-models).
- **selector** _(string, optional)_: a CSS selector string to determine whether the element matches according to the [element.matches](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches) method. The transform won't be executed if the element doesn't match. This is a shorthand and alternative to using `isMatch`, which, if present, will take precedence.
- **isMatch** _(function, optional)_: a callback that receives the node being processed and should return a boolean. Returning `false` from this function will prevent the transform from being applied.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from URLs to Embed block**

Expand Down Expand Up @@ -273,7 +273,7 @@ A transformation of type `shortcode` is an object that takes the following param
- **transform** _(function, optional)_: a callback that receives the shortcode attributes as the first argument and the [WPShortcodeMatch](/packages/shortcode/README.md#next) as the second. It should return a block object or an array of block objects. When this parameter is defined, it will take precedence over the `attributes` parameter.
- **attributes** _(object, optional)_: object representing where the block attributes should be sourced from, according to the attributes shape defined by the [block configuration object](./block-registration.md). If a particular attribute contains a `shortcode` key, it should be a function that receives the shortcode attributes as the first arguments and the [WPShortcodeMatch](/packages/shortcode/README.md#next) as second, and returns a value for the attribute that will be sourced in the block's comment.
- **isMatch** _(function, optional)_: a callback that receives the shortcode attributes per the [Shortcode API](https://codex.wordpress.org/Shortcode_API) and should return a boolean. Returning `false` from this function will prevent the shortcode to be transformed into this block.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://codex.wordpress.org/Plugin_API#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.
- **priority** _(number, optional)_: controls the priority with which a transform is applied, where a lower value will take precedence over higher values. This behaves much like a [WordPress hook](https://developer.wordpress.org/reference/#Hook_to_WordPress). Like hooks, the default priority is `10` when not otherwise set.

**Example: from shortcode to block using `transform`**

Expand Down
8 changes: 4 additions & 4 deletions docs/reference-guides/data/data-core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ _Parameters_

_Returns_

- `string?`: Default block name.
- `?string`: Default block name.

### getDefaultBlockVariation

Expand Down Expand Up @@ -464,7 +464,7 @@ _Parameters_

_Returns_

- `string?`: Name of the block for handling non-block content.
- `?string`: Name of the block for handling non-block content.

### getGroupingBlockName

Expand Down Expand Up @@ -502,7 +502,7 @@ _Parameters_

_Returns_

- `string?`: Name of the block for handling the grouping of blocks.
- `?string`: Name of the block for handling the grouping of blocks.

### getUnregisteredFallbackBlockName

Expand Down Expand Up @@ -540,7 +540,7 @@ _Parameters_

_Returns_

- `string?`: Name of the block for handling unregistered blocks.
- `?string`: Name of the block for handling unregistered blocks.

### hasBlockSupport

Expand Down
13 changes: 7 additions & 6 deletions docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ _Parameters_

_Returns_

- `string?`: Template ID.
- `?string`: Template ID.

### getDeviceType

Expand Down Expand Up @@ -1148,7 +1148,8 @@ Action that autosaves the current post. This includes server-side autosaving (de
_Parameters_
- _options_ `Object?`: Extra flags to identify the autosave.
- _options_ `[Object]`: Extra flags to identify the autosave.
- _options.local_ `[boolean]`: Whether to perform a local autosave.
### clearSelectedBlock
Expand Down Expand Up @@ -1204,7 +1205,7 @@ const getFeaturedMediaUrl = useSelect( ( select ) => {
_Parameters_
- _edits_ `Object`: Post attributes to edit.
- _options_ `Object`: Options for the edit.
- _options_ `[Object]`: Options for the edit.
_Returns_
Expand Down Expand Up @@ -1417,7 +1418,7 @@ Returns an action object used to signal that the blocks have been updated.
_Parameters_
- _blocks_ `Array`: Block Array.
- _options_ `?Object`: Optional options.
- _options_ `[Object]`: Optional options.
### resetPost
Expand All @@ -1431,7 +1432,7 @@ Action for saving the current post in the editor.
_Parameters_
- _options_ `Object`:
- _options_ `[Object]`:
### selectBlock
Expand Down Expand Up @@ -1519,7 +1520,7 @@ _Parameters_
- _post_ `Object`: Post object.
- _edits_ `Object`: Initial edited attributes object.
- _template_ `Array?`: Block Template.
- _template_ `[Array]`: Block Template.
### setupEditorState
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/data/data-core-keyboard-shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ _Parameters_

_Returns_

- `string?`: Shortcut description.
- `?string`: Shortcut description.

### getShortcutKeyCombination

Expand Down Expand Up @@ -335,7 +335,7 @@ _Parameters_

_Returns_

- `string?`: Shortcut representation.
- `?string`: Shortcut representation.

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

Expand Down
Loading

0 comments on commit 6b37af5

Please sign in to comment.