Skip to content

Commit 4aba2d3

Browse files
Merge changes published in the Gutenberg plugin "release/21.1" branch
1 parent d1acd76 commit 4aba2d3

File tree

196 files changed

+7451
-847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+7451
-847
lines changed

.github/workflows/unit-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
# dependency versions are installed and cached.
212212
##
213213
- name: Set up PHP
214-
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
214+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
215215
with:
216216
php-version: '${{ matrix.php }}'
217217
ini-file: development
@@ -226,7 +226,7 @@ jobs:
226226
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
227227
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
228228
- name: Install Composer dependencies
229-
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
229+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
230230
with:
231231
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
232232

@@ -311,7 +311,7 @@ jobs:
311311
persist-credentials: false
312312

313313
- name: Set up PHP
314-
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
314+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
315315
with:
316316
php-version: '7.4'
317317
coverage: none
@@ -332,7 +332,7 @@ jobs:
332332
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
333333
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
334334
- name: Install Composer dependencies
335-
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
335+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3.1.1
336336
with:
337337
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
338338

changelog.txt

Lines changed: 291 additions & 0 deletions
Large diffs are not rendered by default.

docs/contributors/code/coding-guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ privateValidateBlocks( blocks, true );
355355
#### Private React component properties
356356

357357
To add a private argument to a stable component you'll need
358-
to prepare a stable and an private version of that component.
358+
to prepare a stable and a private version of that component.
359359
Then, export the stable function and `lock()` the unstable function
360360
inside it:
361361

docs/contributors/folder-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The following snippet explains how the Gutenberg repository is structured omitti
8585
│ PHP Source code of the Gutenberg plugin.
8686
8787
├── lib/compact/wordpress-x.x
88-
│ PHP code that was include in WordPress ont the WordPrexx X.X version.
88+
│ PHP code that was include in WordPress ont the WordPress X.X version.
8989
│ It is kept to ensure plugin compatibility with older WordPress versions.
9090
9191
├── packages

docs/reference-guides/block-api/block-attributes.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,36 @@ _Example_: Example `default` values.
461461
}
462462
}
463463
```
464+
465+
## Role
466+
467+
The `role` property designates an attribute as being of a particular conceptual type. This property can be applied to any attribute to provide semantic meaning about how the attribute should be handled.
468+
469+
Use `content` to designate the attribute as user-editable content. Blocks with attributes marked as `content` may be enabled for privileged editing in special circumstances such as content only locking.
470+
Use `local` to mark the attribute as temporary and non-persistable. Attributes marked as `local` are ignored by the Block Serializer and never saved to post content.
471+
472+
_Example_: `content` role used by the paragraph block
473+
474+
```js
475+
{
476+
content: {
477+
type: 'string',
478+
source: 'html',
479+
selector: 'p',
480+
role: 'content',
481+
}
482+
}
483+
```
484+
485+
_Example_: `local` role used for temporary data.
486+
487+
```js
488+
{
489+
blob: {
490+
type: 'string',
491+
role: 'local',
492+
}
493+
}
494+
```
495+
496+
Learn more in the [WordPress 6.7 dev note](https://make.wordpress.org/core/2024/10/20/miscellaneous-block-editor-changes-in-wordpress-6-7/#stabilized-role-property-for-block-attributes).

docs/reference-guides/block-api/block-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ $template = array(
176176
) ),
177177
array( 'core/column', array(), array(
178178
array( 'core/paragraph', array(
179-
'placeholder' => 'Add a inner paragraph'
179+
'placeholder' => 'Add an inner paragraph'
180180
) ),
181181
) ),
182182
) )

docs/reference-guides/block-api/block-transforms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ A transformation of type `shortcode` is an object that takes the following param
271271
- **type** _(string)_: the value `shortcode`.
272272
- **tag** _(string|array)_: the shortcode tag or list of shortcode aliases this transform can work with.
273273
- **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.
274-
- **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.
274+
- **attributes** _(object, optional)_: object representing where the block attributes should be sourced from, according to the attributes shape defined by the [block configuration object](/docs/reference-guides/block-api/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.
275275
- **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.
276276
- **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.
277277

docs/reference-guides/data/data-core-editor.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,27 @@ _Returns_
10421042
10431043
Returns whether post saving is locked.
10441044
1045+
_Usage_
1046+
1047+
```jsx
1048+
import { __ } from '@wordpress/i18n';
1049+
import { store as editorStore } from '@wordpress/editor';
1050+
import { useSelect } from '@wordpress/data';
1051+
1052+
const ExampleComponent = () => {
1053+
const isSavingLocked = useSelect(
1054+
( select ) => select( editorStore ).isPostSavingLocked(),
1055+
[]
1056+
);
1057+
1058+
return isSavingLocked ? (
1059+
<p>{ __( 'Post saving is locked' ) }</p>
1060+
) : (
1061+
<p>{ __( 'Post saving is not locked' ) }</p>
1062+
);
1063+
};
1064+
```
1065+
10451066
_Parameters_
10461067
10471068
- _state_ `Object`: Global application state.

docs/reference-guides/data/data-core-notices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const ExampleComponent = () => {
7373
}
7474
>
7575
{ __(
76-
'Generate an snackbar error notice with explicit dismiss button.'
76+
'Generate a snackbar error notice with explicit dismiss button.'
7777
) }
7878
</Button>
7979
);

docs/reference-guides/interactivity-api/core-concepts/server-side-rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ store( 'myFruitPlugin', {
175175

176176
The derived state, regardless of whether it derives from the global state, local context, or both, can also be processed on the server by the Server Directive Processing.
177177

178-
_Please, visit the [Understanding global state, local context and derived state](./undestanding-global-state-local-context-and-derived-state.md) guide to learn more about how derived state works in the Interactivity API._
178+
_Please, visit the [Understanding global state, local context and derived state](/docs/reference-guides/interactivity-api/core-concepts/undestanding-global-state-local-context-and-derived-state.md) guide to learn more about how derived state works in the Interactivity API._
179179

180180
### Derived state that can be defined statically
181181

0 commit comments

Comments
 (0)