diff --git a/.eslintrc.js b/.eslintrc.js
index 9240b96c033b48..177f3cf35b8ccf 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -83,6 +83,72 @@ const restrictedImports = [
},
];
+const restrictedSyntax = [
+ // NOTE: We can't include the forward slash in our regex or
+ // we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
+ // here. That's why we use \\u002F in the regexes below.
+ {
+ selector:
+ 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
+ message: 'Path access on WordPress dependencies is not allowed.',
+ },
+ {
+ selector:
+ 'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' +
+ majorMinorRegExp +
+ '/]',
+ message:
+ 'Deprecated functions must be removed before releasing this version.',
+ },
+ {
+ selector:
+ 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
+ message:
+ 'This method is deprecated. You should use the more explicit API methods available.',
+ },
+ {
+ selector:
+ 'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]',
+ message: 'Prefer page.waitForSelector instead.',
+ },
+ {
+ selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
+ message:
+ 'Do not use string literals for IDs; use withInstanceId instead.',
+ },
+ {
+ // Discourage the usage of `Math.random()` as it's a code smell
+ // for UUID generation, for which we already have a higher-order
+ // component: `withInstanceId`.
+ selector:
+ 'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
+ message:
+ 'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
+ },
+ {
+ selector:
+ 'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
+ message:
+ 'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
+ },
+ {
+ selector:
+ 'LogicalExpression[operator="&&"][left.property.name="length"][right.type="JSXElement"]',
+ message:
+ 'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
+ },
+];
+
+/** `no-restricted-syntax` rules for components. */
+const restrictedSyntaxComponents = [
+ {
+ selector:
+ 'JSXOpeningElement[name.name="Button"]:not(:has(JSXAttribute[name.name="__experimentalIsFocusable"])) JSXAttribute[name.name="disabled"]',
+ message:
+ '`disabled` used without the `__experimentalIsFocusable` prop. Disabling a control without maintaining focusability can cause accessibility issues, by hiding their presence from screen reader users, or preventing focus from returning to a trigger element. (Ignore this error if you truly mean to disable.)',
+ },
+];
+
module.exports = {
root: true,
extends: [
@@ -147,63 +213,7 @@ module.exports = {
disallowTypeAnnotations: false,
},
],
- 'no-restricted-syntax': [
- 'error',
- // NOTE: We can't include the forward slash in our regex or
- // we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
- // here. That's why we use \\u002F in the regexes below.
- {
- selector:
- 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
- message:
- 'Path access on WordPress dependencies is not allowed.',
- },
- {
- selector:
- 'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' +
- majorMinorRegExp +
- '/]',
- message:
- 'Deprecated functions must be removed before releasing this version.',
- },
- {
- selector:
- 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
- message:
- 'This method is deprecated. You should use the more explicit API methods available.',
- },
- {
- selector:
- 'CallExpression[callee.object.name="page"][callee.property.name="waitForTimeout"]',
- message: 'Prefer page.waitForSelector instead.',
- },
- {
- selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
- message:
- 'Do not use string literals for IDs; use withInstanceId instead.',
- },
- {
- // Discourage the usage of `Math.random()` as it's a code smell
- // for UUID generation, for which we already have a higher-order
- // component: `withInstanceId`.
- selector:
- 'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
- message:
- 'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
- },
- {
- selector:
- 'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
- message:
- 'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
- },
- {
- selector:
- 'LogicalExpression[operator="&&"][left.property.name="length"][right.type="JSXElement"]',
- message:
- 'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
- },
- ],
+ 'no-restricted-syntax': [ 'error', ...restrictedSyntax ],
},
overrides: [
{
@@ -253,6 +263,20 @@ module.exports = {
],
},
},
+ {
+ files: [
+ 'packages/*/src/**/*.[tj]s?(x)',
+ 'storybook/stories/**/*.[tj]s?(x)',
+ ],
+ excludedFiles: [ '**/*.native.js' ],
+ rules: {
+ 'no-restricted-syntax': [
+ 'error',
+ ...restrictedSyntax,
+ ...restrictedSyntaxComponents,
+ ],
+ },
+ },
{
files: [
// Components package.
@@ -372,6 +396,7 @@ module.exports = {
rules: {
'no-restricted-syntax': [
'error',
+ ...restrictedSyntax,
{
selector:
':matches(Literal[value=/--wp-admin-theme-/],TemplateElement[value.cooked=/--wp-admin-theme-/])',
diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml
index ff1f1eb980347b..2a7ea040f8b493 100644
--- a/.github/workflows/create-block.yml
+++ b/.github/workflows/create-block.yml
@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- node: ['20', '21']
+ node: ['20', '22']
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
steps:
diff --git a/.github/workflows/php-changes-detection.yml b/.github/workflows/php-changes-detection.yml
index 2642485bce1ce2..2eeaea561eb7ed 100644
--- a/.github/workflows/php-changes-detection.yml
+++ b/.github/workflows/php-changes-detection.yml
@@ -17,7 +17,7 @@ jobs:
- name: Get changed PHP files
id: changed-files-php
- uses: tj-actions/changed-files@03334d095e2739fa9ac4034ec16f66d5d01e9eba # v44.5.1
+ uses: tj-actions/changed-files@d6babd6899969df1a11d14c368283ea4436bca78 # v44.5.2
with:
files: |
lib/**
diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml
index 9640243e86629c..83228bd87b85ca 100644
--- a/.github/workflows/rnmobile-ios-runner.yml
+++ b/.github/workflows/rnmobile-ios-runner.yml
@@ -27,7 +27,7 @@ jobs:
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- - uses: ruby/setup-ruby@943103cae7d3f1bb1e4951d5fcc7928b40e4b742 # v1.177.1
+ - uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 # v1.179.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index dd50ea68e0e5d5..a813e4d2d8f5ba 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- node: ['20', '21']
+ node: ['20', '22']
shard: ['1/4', '2/4', '3/4', '4/4']
steps:
@@ -66,7 +66,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- node: ['20', '21']
+ node: ['20', '22']
steps:
- name: Checkout repository
@@ -185,7 +185,7 @@ jobs:
# dependency versions are installed and cached.
##
- name: Set up PHP
- uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2.30.4
+ uses: shivammathur/setup-php@fc14643b0a99ee9db10a3c025a33d76544fa3761 # v2.30.5
with:
php-version: '${{ matrix.php }}'
ini-file: development
@@ -286,7 +286,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Set up PHP
- uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2.30.4
+ uses: shivammathur/setup-php@fc14643b0a99ee9db10a3c025a33d76544fa3761 # v2.30.5
with:
php-version: '7.4'
coverage: none
diff --git a/backport-changelog/6.6/6590.md b/backport-changelog/6.6/6590.md
new file mode 100644
index 00000000000000..47ef89e0db40cb
--- /dev/null
+++ b/backport-changelog/6.6/6590.md
@@ -0,0 +1,5 @@
+https://github.com/WordPress/wordpress-develop/pull/6590
+
+* https://github.com/WordPress/gutenberg/pull/59531
+* https://github.com/WordPress/gutenberg/pull/61182
+* https://github.com/WordPress/gutenberg/pull/61717
diff --git a/backport-changelog/6.6/6616.md b/backport-changelog/6.6/6616.md
index 91261f78fb5c7a..bb35d6c74493cf 100644
--- a/backport-changelog/6.6/6616.md
+++ b/backport-changelog/6.6/6616.md
@@ -2,4 +2,6 @@ https://github.com/WordPress/wordpress-develop/pull/6616
* https://github.com/WordPress/gutenberg/pull/58409
* https://github.com/WordPress/gutenberg/pull/61328
-* https://github.com/WordPress/gutenberg/pull/61842
\ No newline at end of file
+* https://github.com/WordPress/gutenberg/pull/61842
+* https://github.com/WordPress/gutenberg/pull/62199
+* https://github.com/WordPress/gutenberg/pull/62252
diff --git a/backport-changelog/6.6/6694.md b/backport-changelog/6.6/6694.md
new file mode 100644
index 00000000000000..a9eb5a7f37ef5b
--- /dev/null
+++ b/backport-changelog/6.6/6694.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6694
+
+* https://github.com/WordPress/gutenberg/pull/60694
diff --git a/backport-changelog/6.6/6731.md b/backport-changelog/6.6/6731.md
new file mode 100644
index 00000000000000..b8671873251659
--- /dev/null
+++ b/backport-changelog/6.6/6731.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6731
+
+* https://github.com/WordPress/gutenberg/pull/62299
diff --git a/backport-changelog/6.6/6737.md b/backport-changelog/6.6/6737.md
new file mode 100644
index 00000000000000..84e2234ca4e79a
--- /dev/null
+++ b/backport-changelog/6.6/6737.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6737
+
+* https://github.com/WordPress/gutenberg/pull/62305
diff --git a/backport-changelog/6.6/6744.md b/backport-changelog/6.6/6744.md
new file mode 100644
index 00000000000000..032f5420cb7184
--- /dev/null
+++ b/backport-changelog/6.6/6744.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6744
+
+* https://github.com/WordPress/gutenberg/pull/62355
\ No newline at end of file
diff --git a/changelog.txt b/changelog.txt
index 5791fb711c2c43..decdb88ea9a7a4 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,477 @@
== Changelog ==
+= 18.5.0 =
+
+## Changelog
+
+### Features
+
+#### Global Styles
+- Add defaultSpacingSizes option (theme.json v3). ([61842](https://github.com/WordPress/gutenberg/pull/61842))
+- Edit/create shadows in global styles. ([60706](https://github.com/WordPress/gutenberg/pull/60706))
+- Relocate Background Image controls to sit under Layout. ([61886](https://github.com/WordPress/gutenberg/pull/61886))
+
+#### Block Library
+- Enable shadow support for cover block. ([61883](https://github.com/WordPress/gutenberg/pull/61883))
+
+#### Block bindings
+- Allow editing in post meta source. ([61753](https://github.com/WordPress/gutenberg/pull/61753))
+
+#### Script Modules API
+- Add script module data implementation. ([61658](https://github.com/WordPress/gutenberg/pull/61658))
+
+#### Synced Patterns
+- Add `__default` binding for pattern overrides. ([60694](https://github.com/WordPress/gutenberg/pull/60694))
+
+#### Block Styles
+- Extend block style variations as mechanism for achieving section styling. ([57908](https://github.com/WordPress/gutenberg/pull/57908))
+
+
+### Enhancements
+
+- Block card: Fix typographic widow. ([61438](https://github.com/WordPress/gutenberg/pull/61438))
+- Block settings: Update variant of "Apply globally" Button component to secondary. ([61850](https://github.com/WordPress/gutenberg/pull/61850))
+- Editor: Align the Post Format control design with the rest of the post sidebar controls. ([62066](https://github.com/WordPress/gutenberg/pull/62066))
+- Editor: Polish the style of some of the post summary rows. ([61645](https://github.com/WordPress/gutenberg/pull/61645))
+- Format Library: Refactor 'Inline Image' edit component. ([62135](https://github.com/WordPress/gutenberg/pull/62135))
+- Playwright end-to-end Utils: Add fullscreenMode option to createNewPost. ([61766](https://github.com/WordPress/gutenberg/pull/61766))
+- Post Sticky Toggle: Improve the design. ([62012](https://github.com/WordPress/gutenberg/pull/62012))
+- Post Summary: Move PostTemplatePanel below URL and Author. ([62137](https://github.com/WordPress/gutenberg/pull/62137))
+- Remove trash button in post/page inspector. ([61792](https://github.com/WordPress/gutenberg/pull/61792))
+- Shadows instead of borders on interface skeleton. ([61835](https://github.com/WordPress/gutenberg/pull/61835))
+- Tweak contextual block toolbar position. ([61836](https://github.com/WordPress/gutenberg/pull/61836))
+- Update: For synced entities the icon should be purple. ([62024](https://github.com/WordPress/gutenberg/pull/62024))
+- Update: Implement new author panel design. ([61362](https://github.com/WordPress/gutenberg/pull/61362))
+- Update: Implement new parent and order design. ([61918](https://github.com/WordPress/gutenberg/pull/61918))
+- Update: Move duplicate pattern and template part actions to the editor package. ([61879](https://github.com/WordPress/gutenberg/pull/61879))
+
+#### Site Editor
+- Block Editor: Check for multiple block usage in the block-editor package. ([62086](https://github.com/WordPress/gutenberg/pull/62086))
+- Copy custom CSS between variations when switching. ([61752](https://github.com/WordPress/gutenberg/pull/61752))
+- Data views: Align page headers. ([62115](https://github.com/WordPress/gutenberg/pull/62115))
+- Inspector summary rows: Make tooltips appear middle-left. ([61815](https://github.com/WordPress/gutenberg/pull/61815))
+- Inspector: Add '/' prefix to Link button. ([62073](https://github.com/WordPress/gutenberg/pull/62073))
+- Inspector: Display home / posts page badge. ([62071](https://github.com/WordPress/gutenberg/pull/62071))
+- Inspector: Remove revisions panel. ([61867](https://github.com/WordPress/gutenberg/pull/61867))
+- Make post meta row button treatment consistent. ([61954](https://github.com/WordPress/gutenberg/pull/61954))
+- Remove 'Manage...' prefix in Pages / Templates data views. ([62107](https://github.com/WordPress/gutenberg/pull/62107))
+- Remove the details pages. ([61741](https://github.com/WordPress/gutenberg/pull/61741))
+- Update actions order in site editor for template and template parts. ([61803](https://github.com/WordPress/gutenberg/pull/61803))
+- Use site title as a link. ([61258](https://github.com/WordPress/gutenberg/pull/61258))
+- [Site Editor]: Add create pattern button in patterns page. ([60302](https://github.com/WordPress/gutenberg/pull/60302))
+- withRegistryProvider: Prevent intermediate state with no children. ([61859](https://github.com/WordPress/gutenberg/pull/61859))
+
+#### Data Views
+- Add badge to title for posts & front pages. ([61718](https://github.com/WordPress/gutenberg/pull/61718))
+- Clarify `date` value in Pages. ([61709](https://github.com/WordPress/gutenberg/pull/61709))
+- DataViews: `label` prop in Actions API can be either a `string` or a `function`. ([61942](https://github.com/WordPress/gutenberg/pull/61942))
+- Fix pagination position on pages with short lists. ([61712](https://github.com/WordPress/gutenberg/pull/61712))
+- Pages data view: Add Pending and Private views. ([62138](https://github.com/WordPress/gutenberg/pull/62138))
+- Pages sidebar: Adds published & scheduled items. ([62021](https://github.com/WordPress/gutenberg/pull/62021))
+- Stop Patterns data view header shrinking. ([61801](https://github.com/WordPress/gutenberg/pull/61801))
+- Update grid layout on small screens. ([61820](https://github.com/WordPress/gutenberg/pull/61820))
+- Update list layout action styling. ([61797](https://github.com/WordPress/gutenberg/pull/61797))
+- Update page component (and some data view elements) spacing metrics. ([61333](https://github.com/WordPress/gutenberg/pull/61333))
+- Visually hide 'Actions' column header. ([61710](https://github.com/WordPress/gutenberg/pull/61710))
+
+#### Global Styles
+- Add block-level Text Alignment UI. ([61717](https://github.com/WordPress/gutenberg/pull/61717))
+- Add option to remove site-wide theme background image. ([61998](https://github.com/WordPress/gutenberg/pull/61998))
+- Background image: Add support for relative theme path URLs in top-level theme.json styles. ([61271](https://github.com/WordPress/gutenberg/pull/61271))
+- Background image: Update controls defaults and layout. ([62000](https://github.com/WordPress/gutenberg/pull/62000))
+- Background images: Add defaults for background size. ([62046](https://github.com/WordPress/gutenberg/pull/62046))
+- Don't filter out typography variations where the heading and body fonts are the same. ([61327](https://github.com/WordPress/gutenberg/pull/61327))
+- Make color variations fit in a bit better visually. ([61617](https://github.com/WordPress/gutenberg/pull/61617))
+- Make it clearer how to edit a site's palette. ([61364](https://github.com/WordPress/gutenberg/pull/61364))
+- Move type presets below elements. ([61863](https://github.com/WordPress/gutenberg/pull/61863))
+- Restore the default variation to the color and typography style tiles. ([61901](https://github.com/WordPress/gutenberg/pull/61901))
+- Show shadow tool by default under global styles. ([61981](https://github.com/WordPress/gutenberg/pull/61981))
+
+#### Components
+- Add vw and vh units to the custom font size picker. ([60607](https://github.com/WordPress/gutenberg/pull/60607))
+- CustomSelectControlV2: Use `InputBase` for styling. ([60261](https://github.com/WordPress/gutenberg/pull/60261))
+- Tabs: Indicator animation. ([60560](https://github.com/WordPress/gutenberg/pull/60560))
+- Try: Add CSS Custom Properties to CSS types. ([61872](https://github.com/WordPress/gutenberg/pull/61872))
+
+#### Zoom Out
+- Hide inserters behind the experiment flag. ([61866](https://github.com/WordPress/gutenberg/pull/61866))
+- Inserter: Auto-close the inserter unless the zoom out experiment is on. ([61856](https://github.com/WordPress/gutenberg/pull/61856))
+- Show the inserters only when a section is selected. ([61559](https://github.com/WordPress/gutenberg/pull/61559))
+- The patterns tab behind a new experiment. ([61601](https://github.com/WordPress/gutenberg/pull/61601))
+
+#### Block Editor
+- Adjust pattern list items resting, hover, focus styles. ([61831](https://github.com/WordPress/gutenberg/pull/61831))
+- Tweak pattern categories sidebar. ([62113](https://github.com/WordPress/gutenberg/pull/62113))
+- Writing flow: Remove first empty paragraph on Backspace. ([61889](https://github.com/WordPress/gutenberg/pull/61889))
+
+#### Block bindings
+- Add Block Bindings Panel to Block Inspector. ([61527](https://github.com/WordPress/gutenberg/pull/61527))
+- Add indicator for metadata changes to Save Panel when reviewing modified entities. ([61811](https://github.com/WordPress/gutenberg/pull/61811))
+- Lock binding editing with functions. ([61734](https://github.com/WordPress/gutenberg/pull/61734))
+
+#### Block Variations
+- Detect active variation correctly based on RichText attribute. ([62325](https://github.com/WordPress/gutenberg/pull/62325))
+- Have `getActiveBlockVariation` return variation with highest specificity. ([62031](https://github.com/WordPress/gutenberg/pull/62031))
+- Support dot notation in `isActive` string array. ([62088](https://github.com/WordPress/gutenberg/pull/62088))
+
+#### Layout
+- More consistent root padding. ([60715](https://github.com/WordPress/gutenberg/pull/60715))
+- Try using coloured overlay instead of border for grid visualiser. ([61390](https://github.com/WordPress/gutenberg/pull/61390))
+
+#### Block Library
+- Added Bluesky icon to the Social Icon Block. ([61372](https://github.com/WordPress/gutenberg/pull/61372))
+- Media & Text: Replace the deprecated __experimentalImageSizeControl with ResolutionTool. ([57540](https://github.com/WordPress/gutenberg/pull/57540))
+
+#### Inspector Controls
+- Align both "Design" pattern list panels. ([62161](https://github.com/WordPress/gutenberg/pull/62161))
+
+#### Post Editor
+- Add home template details to inspector controls. ([61762](https://github.com/WordPress/gutenberg/pull/61762))
+
+#### Interactivity API
+- Clarify some warning messages. ([61720](https://github.com/WordPress/gutenberg/pull/61720))
+
+#### Patterns
+- Adjust the icons and text of the binding connected blocks. ([61560](https://github.com/WordPress/gutenberg/pull/61560))
+
+
+### Bug Fixes
+
+- Editor: Only render the site logo once if there's a fill. ([62320](https://github.com/WordPress/gutenberg/pull/62320))
+- Interactivity API: Increase directive `wp-each-child` priority. ([62293](https://github.com/WordPress/gutenberg/pull/62293))w
+- Compose: Fix 'useFocusOnMount' cleanup callback. ([62053](https://github.com/WordPress/gutenberg/pull/62053))
+- Do not auto save post status changes. ([62171](https://github.com/WordPress/gutenberg/pull/62171))
+- Editor: Fix canvas padding in post editor. ([61893](https://github.com/WordPress/gutenberg/pull/61893))
+- EntityProvider: Avoid remounts and simplify. ([61882](https://github.com/WordPress/gutenberg/pull/61882))
+- Fix shadow and border for pattern categories panel. ([62158](https://github.com/WordPress/gutenberg/pull/62158))
+- Image Block: Conditionally Render Block Control Based on Component Presence. ([62132](https://github.com/WordPress/gutenberg/pull/62132))
+- Interactivity API: Fix null and number strings as namespaces runtime error. ([61960](https://github.com/WordPress/gutenberg/pull/61960))
+- PostCardPanel: Fix ESLint error. ([62109](https://github.com/WordPress/gutenberg/pull/62109))
+- Remove build-types/ clean from clean:Packages. ([62008](https://github.com/WordPress/gutenberg/pull/62008))
+- Script Modules: Fix private method reflection access. ([62154](https://github.com/WordPress/gutenberg/pull/62154))
+- ServerSideRender: Fix data loading in development mode. ([62140](https://github.com/WordPress/gutenberg/pull/62140))
+- Shadow Panel: Make subtitle translatable. ([62022](https://github.com/WordPress/gutenberg/pull/62022))
+- Site Editor: Fix the Root Padding styles. ([61906](https://github.com/WordPress/gutenberg/pull/61906))
+- Writing flow: Fix heading crash on split (via paste). ([61900](https://github.com/WordPress/gutenberg/pull/61900))
+- e2e: Fix Site Editor Styles test. ([62111](https://github.com/WordPress/gutenberg/pull/62111))
+
+#### Post Editor
+- Consolidate and fix `delete` and `edit` post actions. ([61912](https://github.com/WordPress/gutenberg/pull/61912))
+- Consolidate and fix `rename` post action. ([61857](https://github.com/WordPress/gutenberg/pull/61857))
+- Document Bar: Decode HTML entities and take into account cases where there is no title. ([62087](https://github.com/WordPress/gutenberg/pull/62087))
+- Editor: Don't apply purple accent to the unsynced pattern title. ([61704](https://github.com/WordPress/gutenberg/pull/61704))
+- Editor: Ensure Copy button in sidebar copies whole permalink, *with* URL protocol. ([61876](https://github.com/WordPress/gutenberg/pull/61876))
+- Editor: Fix the 'DocumentBar' position for long titles. ([61691](https://github.com/WordPress/gutenberg/pull/61691))
+- Editor: Render publish date control when the status is `future`(scheduled). ([62070](https://github.com/WordPress/gutenberg/pull/62070))
+- Editor: Unify button size in pre-publish panel. ([62123](https://github.com/WordPress/gutenberg/pull/62123))
+- Editor: Use edited entity for post actions. ([61892](https://github.com/WordPress/gutenberg/pull/61892))
+- Fix read only post status styles. ([61722](https://github.com/WordPress/gutenberg/pull/61722))
+- Post Actions: Hide the trash action for auto-drafts. ([61865](https://github.com/WordPress/gutenberg/pull/61865))
+
+#### Block Editor
+- Inserter: Update Openverse API URLs. ([62241](https://github.com/WordPress/gutenberg/pull/62241))
+- Fix being unable to switch modes while inserter is open. ([61563](https://github.com/WordPress/gutenberg/pull/61563))
+- Fix editor inserter tabs indicator. ([61973](https://github.com/WordPress/gutenberg/pull/61973))
+- Fix positioning of close icons in panels to be consistent. ([61832](https://github.com/WordPress/gutenberg/pull/61832))
+- Fix syncing of publish date between publish and post status panel. ([62165](https://github.com/WordPress/gutenberg/pull/62165))
+- Improve link conrol preview when show button text label is enabled. ([61726](https://github.com/WordPress/gutenberg/pull/61726))
+- Inserter: Show all blocks (alternative). ([62169](https://github.com/WordPress/gutenberg/pull/62169))
+- InspectorControls: Text not displayed when "Show button text labels" is enabled. ([61949](https://github.com/WordPress/gutenberg/pull/61949))
+- Link Control: Fix focus handlers in development mode. ([62141](https://github.com/WordPress/gutenberg/pull/62141))
+- Media & Text block: Remove the link option when the featured image is used. ([60510](https://github.com/WordPress/gutenberg/pull/60510))
+- Writing flow: Fix paste for input fields. ([61389](https://github.com/WordPress/gutenberg/pull/61389))
+
+#### Block Library
+- Classic block: Fix content syncing effect for React StrictMode. ([62051](https://github.com/WordPress/gutenberg/pull/62051))
+- Don't steal focus when opening browse all blocks. ([61975](https://github.com/WordPress/gutenberg/pull/61975))
+- Fix: The latest post block - post titles overlapping. ([61356](https://github.com/WordPress/gutenberg/pull/61356))
+- Fixed : Update `alt text decision tree` links to be translatable. ([62076](https://github.com/WordPress/gutenberg/pull/62076))
+- Fixed: Custom HTML Block should display content in LTR layout for all languages. ([62083](https://github.com/WordPress/gutenberg/pull/62083))
+- More block: Fix React warning when adding custom text. ([61936](https://github.com/WordPress/gutenberg/pull/61936))
+- useUploadMediaFromBlobURL: Prevent duplicate uploads in StrictMode. ([62059](https://github.com/WordPress/gutenberg/pull/62059))
+
+#### Global Styles
+- Fix make dimensions.aspectRatios key of theme.json files translatable. ([61774](https://github.com/WordPress/gutenberg/pull/61774))
+- Hide the presets panel for when there are less or exactly one presets available. ([62074](https://github.com/WordPress/gutenberg/pull/62074))
+- Prevent Typography panel title from wrapping. ([62124](https://github.com/WordPress/gutenberg/pull/62124))
+- Shadow Panel: Generates unique shadow slugs by finding max suffix and incrementing it. ([61997](https://github.com/WordPress/gutenberg/pull/61997))
+- Styles: try wrapping with :Root to fix reset styles. ([61638](https://github.com/WordPress/gutenberg/pull/61638))
+- Transform Styles: Update selector so that styles work when custom fields panel is active. ([62121](https://github.com/WordPress/gutenberg/pull/62121))
+
+#### Site Editor
+- Align the template title to the center in the 'Add template' screen. ([62175](https://github.com/WordPress/gutenberg/pull/62175))
+- Close publish sidebar if not in `edit` mode. ([61707](https://github.com/WordPress/gutenberg/pull/61707))
+- Fix the site editor Admin Bar menu item. ([61851](https://github.com/WordPress/gutenberg/pull/61851))
+- Use a consistent snackbar position. ([61756](https://github.com/WordPress/gutenberg/pull/61756))
+
+#### Components
+- Fix: The focus styles for tabPanel. ([61317](https://github.com/WordPress/gutenberg/pull/61317))
+- InputControl: Fix z-index issue causing slider dots to appear in front of the Appearance dropdown. ([61937](https://github.com/WordPress/gutenberg/pull/61937))
+- getAutocompleterUI: Don't redefine ListBox component on every render. ([61877](https://github.com/WordPress/gutenberg/pull/61877))
+
+#### Synced Patterns
+- Block Bindings: Filter pattern overrides source in bindings panel. ([62015](https://github.com/WordPress/gutenberg/pull/62015))
+- Fix detaching patterns when a pattern has overrides, but there are no override values. ([62014](https://github.com/WordPress/gutenberg/pull/62014))
+
+#### Block bindings
+- Don't show non-existing and not supported attributes in block bindings panel. ([62183](https://github.com/WordPress/gutenberg/pull/62183))
+
+#### Layout
+- Remove extra bracket in the site editor root padding styles. ([62159](https://github.com/WordPress/gutenberg/pull/62159))
+
+#### Block Styles
+- Fix block style variation styles for blocks with complex selectors. ([62125](https://github.com/WordPress/gutenberg/pull/62125))
+
+#### Code Editor
+- Editor: Unify text/code editor between post and site editors. ([61934](https://github.com/WordPress/gutenberg/pull/61934))
+
+#### Page Content Focus
+- Remove lock icons from Content blocks inner blocks when editing a page in the site editor. ([61922](https://github.com/WordPress/gutenberg/pull/61922))
+
+#### Patterns
+- Templates: Only resolve patterns for REST API endpoints. ([61757](https://github.com/WordPress/gutenberg/pull/61757))
+
+#### Interactivity API
+- Turn named capturing groups back into numbered ones inside `toVdom`. ([61728](https://github.com/WordPress/gutenberg/pull/61728))
+
+#### Block API
+- Fix: Enable Text Align UI to be controlled correctly with theme.json. ([61182](https://github.com/WordPress/gutenberg/pull/61182))
+
+#### REST API
+- Return an empty object when no fallback templates are found (wp/v2/templates/lookup). ([60925](https://github.com/WordPress/gutenberg/pull/60925))
+
+
+### Accessibility
+
+#### Global Styles
+- Shadow Panel: Improve a11y and fix browser console error. ([61980](https://github.com/WordPress/gutenberg/pull/61980))
+
+#### Data Views
+- Always show Actions table header. ([61847](https://github.com/WordPress/gutenberg/pull/61847))
+
+#### Block Library
+- Fix: Adds help props for description of Play Inline toggle. ([61310](https://github.com/WordPress/gutenberg/pull/61310))
+
+
+### Performance
+
+- Perf: Batch block list settings in single action. ([61329](https://github.com/WordPress/gutenberg/pull/61329))
+- Remove additional call to `WP_Theme_JSON_Gutenberg::__construct`. ([61262](https://github.com/WordPress/gutenberg/pull/61262))
+
+#### Interactivity API
+- Introduce `wp-on-async` directive as performant alternative over synchronous `wp-on` directive. ([61885](https://github.com/WordPress/gutenberg/pull/61885))
+
+#### Post Editor
+- DocumentBar: Only selected data needed for rendering. ([61706](https://github.com/WordPress/gutenberg/pull/61706))
+
+
+### Experiments
+
+#### Interactivity API
+- Use output buffer and HTML tag processor to inject directives on BODY tag for full-page client-side navigation. ([61212](https://github.com/WordPress/gutenberg/pull/61212))
+
+
+### Documentation
+
+- Add JSDoc to PostVisibility, PostVisibilityCheck, and PostVisibilityLabel. ([61735](https://github.com/WordPress/gutenberg/pull/61735))
+- Add PostURL component documentation. ([61737](https://github.com/WordPress/gutenberg/pull/61737))
+- Add a section about block filters to the Filters and Hooks doc. ([61771](https://github.com/WordPress/gutenberg/pull/61771))
+- Add an example and improve readability of the Block Filters doc. ([61770](https://github.com/WordPress/gutenberg/pull/61770))
+- Add docblock to PostTitle and PostTitleRaw component. ([61740](https://github.com/WordPress/gutenberg/pull/61740))
+- Add documentation for DocumentBar. ([61733](https://github.com/WordPress/gutenberg/pull/61733))
+- Add documentation for PostFeaturedImage, PostFeaturedImageCheck, PostFeaturedImagePanel. ([61165](https://github.com/WordPress/gutenberg/pull/61165))
+- Add documentation for PostLastRevision, PostLastRevisionCheck, PostLastRevisionPanel components. ([61166](https://github.com/WordPress/gutenberg/pull/61166))
+- Add documentation for PostSchedule, PostScheduleCheck, PostSchedulePanel, PostScheduleLabel, usePostScheduleLabel components. ([61345](https://github.com/WordPress/gutenberg/pull/61345))
+- Add documentation for the EditorNotices component. ([61736](https://github.com/WordPress/gutenberg/pull/61736))
+- Add documentation for the EditorProvider and ExperimentalEditorProvider components. ([61739](https://github.com/WordPress/gutenberg/pull/61739))
+- Added missing @global documentation. ([61537](https://github.com/WordPress/gutenberg/pull/61537))
+- Changelog: Add note about removing legacy operators. ([62013](https://github.com/WordPress/gutenberg/pull/62013))
+- Docs: Fix spacing in PHP doc block in comments block. ([61911](https://github.com/WordPress/gutenberg/pull/61911))
+- EditorBoundary editor component. ([61950](https://github.com/WordPress/gutenberg/pull/61950))
+- Fix typo. ([61830](https://github.com/WordPress/gutenberg/pull/61830))
+- Fix: Block library README.md link. ([62081](https://github.com/WordPress/gutenberg/pull/62081))
+- Fix: Custom block editor link. ([61962](https://github.com/WordPress/gutenberg/pull/61962))
+- For `PostTextEditor` component. ([62099](https://github.com/WordPress/gutenberg/pull/62099))
+- LocalAutosaveMonitor editor component. ([61951](https://github.com/WordPress/gutenberg/pull/61951))
+- PageTemplate + PostTemplatePanel editor components. ([61961](https://github.com/WordPress/gutenberg/pull/61961))
+- PostComments editor component. ([61964](https://github.com/WordPress/gutenberg/pull/61964))
+- PostDiscussionPanel editor component. ([61966](https://github.com/WordPress/gutenberg/pull/61966))
+- PostExcerptPanel editor component. ([61967](https://github.com/WordPress/gutenberg/pull/61967))
+- PostLockedModal editor component. ([61968](https://github.com/WordPress/gutenberg/pull/61968))
+- PostPendingStatus + PostPendingStatusCheck editor components. ([61970](https://github.com/WordPress/gutenberg/pull/61970))
+- PostPingbacks editor component. ([62035](https://github.com/WordPress/gutenberg/pull/62035))
+- PostPreviewButton editor component. ([62036](https://github.com/WordPress/gutenberg/pull/62036))
+- Storybook: Add badges based on `tags`. ([61111](https://github.com/WordPress/gutenberg/pull/61111))
+- Update PostFormat, PostFormatCheck editor component documentation. ([61732](https://github.com/WordPress/gutenberg/pull/61732))
+- Update block.json file with correct links. ([61880](https://github.com/WordPress/gutenberg/pull/61880))
+- Update link to architecture key concepts. ([61965](https://github.com/WordPress/gutenberg/pull/61965))
+- Update links to correct lodash website. ([62188](https://github.com/WordPress/gutenberg/pull/62188))
+- Update plugin-document-setting-panel.md. ([61782](https://github.com/WordPress/gutenberg/pull/61782))
+- Update tutorial.md. ([62054](https://github.com/WordPress/gutenberg/pull/62054))
+
+
+### Code Quality
+
+- Add curly brace autofix commit to `.git-blame-ignore-revs`. ([62144](https://github.com/WordPress/gutenberg/pull/62144))
+- Add eslint rule for curly brace presence in JSX. ([62026](https://github.com/WordPress/gutenberg/pull/62026))
+- Blocks: Remove pipe usage and dependency on compose. ([62127](https://github.com/WordPress/gutenberg/pull/62127))
+- Clean up packages build-types when cleaning types. ([61939](https://github.com/WordPress/gutenberg/pull/61939))
+- Command Palette: Remove unused URL parameter. ([61783](https://github.com/WordPress/gutenberg/pull/61783))
+- Commands: Unify the editor context between post and site editors. ([61862](https://github.com/WordPress/gutenberg/pull/61862))
+- Dataviews: Remove unused dependencies. ([62010](https://github.com/WordPress/gutenberg/pull/62010))
+- Distraction Free: Unify the header animation. ([62167](https://github.com/WordPress/gutenberg/pull/62167))
+- Editor: Move editor toggle commands to the editor package. ([62093](https://github.com/WordPress/gutenberg/pull/62093))
+- Editor: Move the InterfaceSkeleton to the editor package. ([62118](https://github.com/WordPress/gutenberg/pull/62118))
+- Editor: Move the resizing of the editor to the EditorCanvas component. ([61896](https://github.com/WordPress/gutenberg/pull/61896))
+- Editor: Remove extra div container and unify the container between post and site editors. ([62016](https://github.com/WordPress/gutenberg/pull/62016))
+- Editor: Remove obsolete `listViewLabel` prop from DocumentTools. ([62032](https://github.com/WordPress/gutenberg/pull/62032))
+- Editor: Remove useless props from InserterSidebar component. ([62103](https://github.com/WordPress/gutenberg/pull/62103))
+- Editor: Unify the MediaUpload hook between post and site editors. ([62085](https://github.com/WordPress/gutenberg/pull/62085))
+- Editor: Unify the content area of the post and site editors. ([61860](https://github.com/WordPress/gutenberg/pull/61860))
+- Fix: React compiler error on button. ([61958](https://github.com/WordPress/gutenberg/pull/61958))
+- Fix: Remove unused css block on patterns page. ([62058](https://github.com/WordPress/gutenberg/pull/62058))
+- Fix: Remove unused css code from the navigation screen. ([62060](https://github.com/WordPress/gutenberg/pull/62060))
+- Fix: Some jsdoc return types on edit site selector. ([62061](https://github.com/WordPress/gutenberg/pull/62061))
+- Improve distclean script. ([62019](https://github.com/WordPress/gutenberg/pull/62019))
+- Interactivity API: Move all utils inside `utils.ts`. ([61721](https://github.com/WordPress/gutenberg/pull/61721))
+- Interactivity API: Move init.js to TypeScript. ([61723](https://github.com/WordPress/gutenberg/pull/61723))
+- Make onPatternCategorySelection private. ([62130](https://github.com/WordPress/gutenberg/pull/62130))
+- Remove useless clsx calls. ([61969](https://github.com/WordPress/gutenberg/pull/61969))
+- Rename backport-changelog/6279.md to backport-changelog/6.6/6279.md. ([61894](https://github.com/WordPress/gutenberg/pull/61894))
+- Update: Remove unused components. ([61955](https://github.com/WordPress/gutenberg/pull/61955))
+- end-to-end Tests: Fix React warnings triggered by test plugins. ([61935](https://github.com/WordPress/gutenberg/pull/61935))
+
+#### Components
+- CustomSelectControl: Fix `menuProps` mutation. ([62149](https://github.com/WordPress/gutenberg/pull/62149))
+- Fix remaining warning in ColorPanelDropdown. ([61933](https://github.com/WordPress/gutenberg/pull/61933))
+- Make the `ProgressBar` public. ([61062](https://github.com/WordPress/gutenberg/pull/61062))
+- Remove reduceMotion utility. ([61963](https://github.com/WordPress/gutenberg/pull/61963))
+- SlotFills: Use state for registry initialization. ([61802](https://github.com/WordPress/gutenberg/pull/61802))
+- Style Book: Use state to initialize examples. ([61848](https://github.com/WordPress/gutenberg/pull/61848))
+- Tooltip: Fix Ariakit tooltip store usage. ([61858](https://github.com/WordPress/gutenberg/pull/61858))
+- `ProgressBar`: Simplify default `width` implementation and make it more easily overridable. ([61976](https://github.com/WordPress/gutenberg/pull/61976))
+
+#### Block Editor
+- Fix `ZoomOutModeInserters` dependencies. ([61908](https://github.com/WordPress/gutenberg/pull/61908))
+- Fix wrapper props mutation in BlockListBlock. ([61789](https://github.com/WordPress/gutenberg/pull/61789))
+- Remove some utility functions. ([61784](https://github.com/WordPress/gutenberg/pull/61784))
+- Shadows: Unlock private components and hooks at the file level. ([61790](https://github.com/WordPress/gutenberg/pull/61790))
+- Unlock private setting keys at the file level. ([61813](https://github.com/WordPress/gutenberg/pull/61813))
+- Unlock the private 'kebabCase' function at a file level. ([60755](https://github.com/WordPress/gutenberg/pull/60755))
+- useBlockInspectorAnimationSettings: Remove unnecessary deps. ([61822](https://github.com/WordPress/gutenberg/pull/61822))
+
+#### Data Views
+- DataViews: Full type the dataviews package. ([61854](https://github.com/WordPress/gutenberg/pull/61854))
+- DataViews: Remove non-used file. ([61853](https://github.com/WordPress/gutenberg/pull/61853))
+- DataViews: Remove unnecessary dependency for pattern fields memo. ([61870](https://github.com/WordPress/gutenberg/pull/61870))
+- DataViews: Type all the filters components. ([61795](https://github.com/WordPress/gutenberg/pull/61795))
+- DataViews: Type the BulkActionsToolbar component. ([61673](https://github.com/WordPress/gutenberg/pull/61673))
+- DataViews: Type the ViewActions component. ([61729](https://github.com/WordPress/gutenberg/pull/61729))
+- DataViews: Type the ViewTable component. ([61682](https://github.com/WordPress/gutenberg/pull/61682))
+
+#### Block Library
+- Added unit test for post excerpt block render function. ([43451](https://github.com/WordPress/gutenberg/pull/43451))
+- Avoid using component naming conventions for non-component code. ([61793](https://github.com/WordPress/gutenberg/pull/61793))
+- Button: Fix ESLint warning. ([62126](https://github.com/WordPress/gutenberg/pull/62126))
+- Remove CSS hack for Internet Explorer 11. ([62043](https://github.com/WordPress/gutenberg/pull/62043))
+- Remove useless styles. ([62017](https://github.com/WordPress/gutenberg/pull/62017))
+- Search Block: Fix `borderRadius` mutation. ([61794](https://github.com/WordPress/gutenberg/pull/61794))
+
+#### Site Editor
+- History: Add getLocationWithParams method. ([61823](https://github.com/WordPress/gutenberg/pull/61823))
+- Navigation Focus Mode: Remove leftover code. ([61897](https://github.com/WordPress/gutenberg/pull/61897))
+- Remove useless onClick handler. ([61902](https://github.com/WordPress/gutenberg/pull/61902))
+- Update to use the EditorInterface component from the editor package. ([62146](https://github.com/WordPress/gutenberg/pull/62146))
+
+#### Block hooks
+- Navigation block: Check for insert_hooked_blocks_into_rest_response i…. ([62134](https://github.com/WordPress/gutenberg/pull/62134))
+- Navigation block: Check for update_ignored_hooked_blocks_postmeta in core. ([61903](https://github.com/WordPress/gutenberg/pull/61903))
+
+#### Font Library
+- Font Library Modal: Remove some contexts. ([62042](https://github.com/WordPress/gutenberg/pull/62042))
+
+#### Post Editor
+- Template Actions: Fix console error when resetting template. ([61921](https://github.com/WordPress/gutenberg/pull/61921))
+
+#### Global Styles
+- Components: Fix React Warning triggers by the new JSX transform. ([61917](https://github.com/WordPress/gutenberg/pull/61917))
+
+#### Interactivity API
+- Interactivity API : Refactor interactivity-router to TS. ([61730](https://github.com/WordPress/gutenberg/pull/61730))
+
+#### CSS & Styling
+- Fix editor view mode canvas shadow. ([61688](https://github.com/WordPress/gutenberg/pull/61688))
+
+
+### Tools
+
+- Build: Use globalThis over process.env and enable TS lib checking. ([61486](https://github.com/WordPress/gutenberg/pull/61486))
+
+#### Testing
+- E2E: Fix canvas waiter in visitSiteEditor. ([61816](https://github.com/WordPress/gutenberg/pull/61816))
+- PaletteEdit: Fix another flaky test. ([61818](https://github.com/WordPress/gutenberg/pull/61818))
+- PaletteEdit: Fix flaky test. ([61791](https://github.com/WordPress/gutenberg/pull/61791))
+- Shadow: Add unit tests for shadow support. ([60063](https://github.com/WordPress/gutenberg/pull/60063))
+- Skip flaky 'Zoom out' end-to-end test. ([61925](https://github.com/WordPress/gutenberg/pull/61925))
+- Synced Pattern: Wait for pattern creation in end-to-end tests. ([62174](https://github.com/WordPress/gutenberg/pull/62174))
+- Tests: Change how directives processing gets disabled. ([62095](https://github.com/WordPress/gutenberg/pull/62095))
+- Workflows: Try a backport changelog. ([61785](https://github.com/WordPress/gutenberg/pull/61785))
+
+#### Build Tooling
+- Add 60 minute timeout to performance job. ([61957](https://github.com/WordPress/gutenberg/pull/61957))
+- Enable parallel processing for PHPCS sniffs. ([61700](https://github.com/WordPress/gutenberg/pull/61700))
+- Fix an issue causing wp-scripts commands to fail if the file path contained a space character. ([61748](https://github.com/WordPress/gutenberg/pull/61748))
+- React: Upgrade to the new JSX transform. ([61692](https://github.com/WordPress/gutenberg/pull/61692))
+- Workflows: Test to check for label and skip backport changelog. ([61808](https://github.com/WordPress/gutenberg/pull/61808))
+
+
+### Various
+
+- Inserter: Encapsulate styles for tablist and close button. ([61760](https://github.com/WordPress/gutenberg/pull/61760))
+- Update 'Add template' screen to prefer template_name label instead of singular_name. ([60367](https://github.com/WordPress/gutenberg/pull/60367))
+- Update: Move pattern actions to the editor package. [take 2]. ([61612](https://github.com/WordPress/gutenberg/pull/61612))
+
+#### Global Styles
+- Update copy for color variations from "Presets" to "Palettes". ([62147](https://github.com/WordPress/gutenberg/pull/62147))
+
+#### Synced Patterns
+- Remove `IS_GUTENBERG_PLUGIN` check to ensure pattern overrides ship in 6.6. ([62011](https://github.com/WordPress/gutenberg/pull/62011))
+
+#### npm Packages
+- Packages: Increase the minimum required Node.js version to v18.12.0. ([61930](https://github.com/WordPress/gutenberg/pull/61930))
+
+#### Layout
+- Update child layout selector to match core. ([61777](https://github.com/WordPress/gutenberg/pull/61777))
+
+#### Components
+- Introduce Combobox `expandOnFocus` property. ([61705](https://github.com/WordPress/gutenberg/pull/61705))
+
+
+## First time contributors
+
+The following PRs were merged by first time contributors:
+
+- @akashdhawade2005: Fix: Block library README.md link. ([62081](https://github.com/WordPress/gutenberg/pull/62081))
+- @amitraj2203: Added Bluesky icon to the Social Icon Block. ([61372](https://github.com/WordPress/gutenberg/pull/61372))
+- @dbrian: Add JSDoc to PostVisibility, PostVisibilityCheck, and PostVisibilityLabel. ([61735](https://github.com/WordPress/gutenberg/pull/61735))
+- @gemkev: Update tutorial.md. ([62054](https://github.com/WordPress/gutenberg/pull/62054))
+- @kellenmace: Fix an issue causing wp-scripts commands to fail if the file path contained a space character. ([61748](https://github.com/WordPress/gutenberg/pull/61748))
+- @narenin: Fixed: Custom HTML Block should display content in LTR layout for all languages. ([62083](https://github.com/WordPress/gutenberg/pull/62083))
+- @nateinaction: Add documentation for the EditorProvider and ExperimentalEditorProvider components. ([61739](https://github.com/WordPress/gutenberg/pull/61739))
+- @paolopiaggio: Playwright end-to-end Utils: Add fullscreenMode option to createNewPost. ([61766](https://github.com/WordPress/gutenberg/pull/61766))
+- @sanjucta: Add docblock to PostTitle and PostTitleRaw component. ([61740](https://github.com/WordPress/gutenberg/pull/61740))
+- @vipul0425: Fix: The latest post block - post titles overlapping. ([61356](https://github.com/WordPress/gutenberg/pull/61356))
+
+
+## Contributors
+
+The following contributors merged PRs in this release:
+
+@aaronrobertshaw @abhi3315 @afercia @ajlende @akashdhawade2005 @akasunil @Aljullu @amitraj2203 @andrewserong @anton-vlasenko @anver @artemiomorales @carolinan @cbravobernal @colorful-tones @creativecoder @DaniGuardiola @DAreRodz @dbrian @draganescu @ellatrix @fabiankaegy @fullofcaffeine @gemkev @geriux @glendaviesnz @gziolo @jameskoster @jasmussen @jeryj @jorgefilipecosta @jsnajdr @kellenmace @kevin940726 @kt-12 @madhusudhand @Mamaduka @mattsherman @mcsf @michalczaplinski @mirka @narenin @nateinaction @ndiego @ntsekouras @oandregal @ockham @paolopiaggio @ramonjd @retrofox @richtabor @sanjucta @SantosGuillamot @scruffian @senadir @shail-mehta @sirreal @stokesman @t-hamano @talldan @taylorgorman @tellthemachines @tjcafferkey @twstokes @tyxla @vcanales @vipul0425 @westonruter @WunderBart @youknowriad
+
+
+
+
= 18.4.1 =
## Changelog
diff --git a/docs/how-to-guides/themes/global-settings-and-styles.md b/docs/how-to-guides/themes/global-settings-and-styles.md
index a5c3e828a2d661..f71bd67bfaf2ec 100644
--- a/docs/how-to-guides/themes/global-settings-and-styles.md
+++ b/docs/how-to-guides/themes/global-settings-and-styles.md
@@ -310,20 +310,21 @@ There's one special setting property, `appearanceTools`, which is a boolean and
To retain backward compatibility, the existing `add_theme_support` declarations that configure the block editor are retrofit in the proper categories for the top-level section. For example, if a theme uses `add_theme_support('disable-custom-colors')`, it'll be the same as setting `settings.color.custom` to `false`. If the `theme.json` contains any settings, these will take precedence over the values declared via `add_theme_support`. This is the complete list of equivalences:
-| add_theme_support | theme.json setting |
-| --------------------------- | --------------------------------------------------------- |
-| `custom-line-height` | Set `typography.lineHeight` to `true`. |
-| `custom-spacing` | Set `spacing.padding` to `true`. |
-| `custom-units` | Provide the list of units via `spacing.units`. |
-| `disable-custom-colors` | Set `color.custom` to `false`. |
-| `disable-custom-font-sizes` | Set `typography.customFontSize` to `false`. |
-| `disable-custom-gradients` | Set `color.customGradient` to `false`. |
-| `editor-color-palette` | Provide the list of colors via `color.palette`. |
-| `editor-font-sizes` | Provide the list of font size via `typography.fontSizes`. |
-| `editor-gradient-presets` | Provide the list of gradients via `color.gradients`. |
-| `appearance-tools` | Set `appearanceTools` to `true`. |
-| `border` | Set `border: color, radius, style, width` to `true`. |
-| `link-color ` | Set `color.link` to `true`. |
+| add_theme_support | theme.json setting |
+| --------------------------- | ------------------------------------------------------------- |
+| `custom-line-height` | Set `typography.lineHeight` to `true`. |
+| `custom-spacing` | Set `spacing.padding` to `true`. |
+| `custom-units` | Provide the list of units via `spacing.units`. |
+| `disable-custom-colors` | Set `color.custom` to `false`. |
+| `disable-custom-font-sizes` | Set `typography.customFontSize` to `false`. |
+| `disable-custom-gradients` | Set `color.customGradient` to `false`. |
+| `editor-color-palette` | Provide the list of colors via `color.palette`. |
+| `editor-font-sizes` | Provide the list of font size via `typography.fontSizes`. |
+| `editor-gradient-presets` | Provide the list of gradients via `color.gradients`. |
+| `editor-spacing-sizes` | Provide the list of spacing sizes via `spacing.spacingSizes`. |
+| `appearance-tools` | Set `appearanceTools` to `true`. |
+| `border` | Set `border: color, radius, style, width` to `true`. |
+| `link-color ` | Set `color.link` to `true`. |
#### Presets
diff --git a/docs/reference-guides/block-api/block-styles.md b/docs/reference-guides/block-api/block-styles.md
index 90b6c06d18f59d..b47b1a76a71f68 100644
--- a/docs/reference-guides/block-api/block-styles.md
+++ b/docs/reference-guides/block-api/block-styles.md
@@ -1,6 +1,6 @@
# Styles
-Block Styles allow alternative styles to be applied to existing blocks. They work by adding a className to the block's wrapper. This className can be used to provide an alternative styling for the block if the block style is selected. See the [Getting Started with JavaScript tutorial](/docs/how-to-guides/javascript/) for a full example.
+Block Styles allow alternative styles to be applied to existing blocks. They work by adding a className to the block's wrapper. This className can be used to provide an alternative styling for the block if the block style is selected. See the [Use styles and stylesheets](/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md) for a full example on how to apply styles to a block.
_Example:_
diff --git a/docs/reference-guides/block-api/block-variations.md b/docs/reference-guides/block-api/block-variations.md
index 0790b7f02641e8..ffd3cc49adda80 100644
--- a/docs/reference-guides/block-api/block-variations.md
+++ b/docs/reference-guides/block-api/block-variations.md
@@ -129,9 +129,9 @@ While the `isActive` property is optional, it's recommended. This API is used by
If `isActive` is not set, the Editor cannot distinguish between an instance of the original block and your variation, so the original block information will be displayed.
-The property can be set to either a function or an array of strings (`string[]`).
+The property can be set to either an array of strings (`string[]`), or a function. It is recommended to use the string array version whenever possible.
-The function version of this property accepts a block instance's `blockAttributes` as the first argument, and the `variationAttributes` declared for a variation as the second argument. These arguments can be used to determine if a variation is active by comparing them and returning a `true` or `false` (indicating whether this variation is inactive for this block instance).
+The `string[]` version is used to declare which of the block instance's attributes should be compared to the given variation's. Each attribute will be checked and the variation will be active if all of them match.
As an example, in the core Embed block, the `providerNameSlug` attribute is used to determine the embed provider (e.g. 'youtube' or 'twitter'). The variations may be declared like this:
@@ -162,28 +162,32 @@ const variations = [
]
```
- The `isActive` function can compare the block instance value for `providerNameSlug` to the value declared in the variation's declaration (the values in the code snippet above) to determine which embed variation is active:
+The `isActive` property would then look like this:
```js
-isActive: ( blockAttributes, variationAttributes ) =>
- blockAttributes.providerNameSlug === variationAttributes.providerNameSlug,
+isActive: [ 'providerNameSlug' ]
```
-The `string[]` version is used to declare which attributes should be compared as a shorthand. Each attribute will be checked and the variation will be active if all of them match. Using the same example for the embed block, the string version would look like this:
+This will cause the block instance value for `providerNameSlug` to be compared to the value declared in the variation's declaration (the values in the code snippet above) to determine which embed variation is active.
+
+Nested object paths are also supported. For example, consider a block variation that has a `query` object as an attribute. It is possible to determine if the variation is active solely based on that object's `postType` property (while ignoring all its other properties):
```js
-isActive: [ 'providerNameSlug' ]
+isActive: [ 'query.postType' ]
```
-Nested object paths are also supported. For example, consider a block variation that has a `query` object as an attribute. It is possible to determine if the variation is active solely based on that object's `postType` property (while ignoring all its other properties):
+The function version of this property accepts a block instance's `blockAttributes` as the first argument, and the `variationAttributes` declared for a variation as the second argument. These arguments can be used to determine if a variation is active by comparing them and returning a `true` or `false` (indicating whether this variation is inactive for this block instance).
+
+Using the same example for the embed block, the function version would look like this:
```js
-isActive: [ 'query.postType' ]
+isActive: ( blockAttributes, variationAttributes ) =>
+ blockAttributes.providerNameSlug === variationAttributes.providerNameSlug,
```
-### Caveats to using `isActive`
+### Specificity of `isActive` matches
-The `isActive` property can return false positives if multiple variations exist for a specific block and the `isActive` checks are not specific enough. To demonstrate this, consider the following example:
+If there are multiple variations whose `isActive` check matches a given block instance, and all of them are string arrays, then the variation with the highest _specificity_ will be chosen. Consider the following example:
```js
wp.blocks.registerBlockVariation(
@@ -212,6 +216,6 @@ wp.blocks.registerBlockVariation(
);
```
-The `isActive` check on both variations tests the `textColor`, but each variations uses `vivid-red`. Since the `paragraph-red` variation is registered first, once the `paragraph-red-grey` variation is inserted into the Editor, it will have the title `Red Paragraph` instead of `Red/Grey Paragraph`. As soon as the Editor finds a match, it stops checking.
+If a block instance has attributes `textColor: vivid-red` and `backgroundColor: cyan-bluish-gray`, both variations' `isActive` criterion will match that block instance. In this case, the more _specific_ match will be determined to be the active variation, where specificity is calculated as the length of each `isActive` array. This means that the `Red/Grey Paragraph` will be shown as the active variation.
-There have been [discussions](https://github.com/WordPress/gutenberg/issues/41303#issuecomment-1526193087) around how the API can be improved, but as of WordPress 6.3, this remains an issue to watch out for.
+Note that specificity cannot be determined for a matching variation if its `isActive` property is a function rather than a `string[]`. In this case, the first matching variation will be determined to be the active variation. For this reason, it is generally recommended to use a `string[]` rather than a `function` for the `isActive` property.
diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md
index 862a8b2d8a06aa..f687eb79732b5a 100644
--- a/docs/reference-guides/data/data-core-block-editor.md
+++ b/docs/reference-guides/data/data-core-block-editor.md
@@ -1439,7 +1439,7 @@ wp.data.dispatch( 'core/block-editor' ).registerInserterMediaCategory( {
per_page: 'page_size',
search: 'q',
};
- const url = new URL( 'https://api.openverse.engineering/v1/images/' );
+ const url = new URL( 'https://api.openverse.org/v1/images/' );
Object.entries( finalQuery ).forEach( ( [ key, value ] ) => {
const queryKey = mapFromInserterMediaRequest[ key ] || key;
url.searchParams.set( queryKey, value );
diff --git a/docs/reference-guides/slotfills/README.md b/docs/reference-guides/slotfills/README.md
index 043a50cb5186e6..ea324f71b25e83 100644
--- a/docs/reference-guides/slotfills/README.md
+++ b/docs/reference-guides/slotfills/README.md
@@ -33,7 +33,7 @@ registerPlugin( 'post-status-info-test', { render: PluginPostStatusInfoTest } );
SlotFills are created using `createSlotFill`. This creates two components, `Slot` and `Fill` which are then used to create a new component that is exported on the `wp.plugins` global.
-**Definition of the `PluginPostStatusInfo` SlotFill** ([see core code](https://github.com/WordPress/gutenberg/blob/HEAD/packages/edit-post/src/components/sidebar/plugin-post-status-info/index.js#L54))
+**Definition of the `PluginPostStatusInfo` SlotFill** ([see core code](https://github.com/WordPress/gutenberg/blob/HEAD/packages/editor/src/components/plugin-post-status-info/index.js#L55))
```js
/**
@@ -61,34 +61,70 @@ export default PluginPostStatusInfo;
This new Slot is then exposed in the editor. The example below is from core and represents the Summary panel.
As we can see, the `` is wrapping all of the items that will appear in the panel.
-Any items that have been added via the SlotFill ( see the example above ), will be included in the `fills` parameter and be displayed between the `` and `` components.
+Any items that have been added via the SlotFill ( see the example above ), will be included in the `fills` parameter and be displayed in the end of the component.
-See [core code](https://github.com/WordPress/gutenberg/tree/HEAD/packages/edit-post/src/components/sidebar/post-status/index.js#L26).
+See [core code](https://github.com/WordPress/gutenberg/tree/HEAD/packages/editor/src/components/sidebar/post-summary.js#L39).
```js
-const PostStatus = ( { isOpened, onTogglePanel } ) => (
-
-
- { ( fills ) => (
- <>
-
-
-
-
-
-
- { fills }
-
- >
- ) }
-
-
-);
+export default function PostSummary( { onActionPerformed } ) {
+ const { isRemovedPostStatusPanel } = useSelect( ( select ) => {
+ // We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
+ // not use isEditorPanelEnabled since this panel should not be disabled through the UI.
+ const { isEditorPanelRemoved, getCurrentPostType } =
+ select( editorStore );
+ return {
+ isRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),
+ postType: getCurrentPostType(),
+ };
+ }, [] );
+
+ return (
+
+
+ { ( fills ) => (
+ <>
+
+
+ }
+ />
+
+
+
+
+
+
+ { ! isRemovedPostStatusPanel && (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { fills }
+
+ ) }
+
+ >
+ ) }
+
+
+ );
+}
```
## Currently available SlotFills and examples
diff --git a/gutenberg.php b/gutenberg.php
index becad26a3e9f3a..a8d9ebe7e981f0 100644
--- a/gutenberg.php
+++ b/gutenberg.php
@@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.4
* Requires PHP: 7.2
- * Version: 18.4.1
+ * Version: 18.5.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
diff --git a/lib/block-template-utils.php b/lib/block-template-utils.php
new file mode 100644
index 00000000000000..a644047d3cfdc1
--- /dev/null
+++ b/lib/block-template-utils.php
@@ -0,0 +1,114 @@
+open( $filename, ZipArchive::CREATE | ZipArchive::OVERWRITE ) ) {
+ return new WP_Error( 'unable_to_create_zip', __( 'Unable to open export file (archive) for writing.', 'gutenberg' ) );
+ }
+
+ $zip->addEmptyDir( 'templates' );
+ $zip->addEmptyDir( 'parts' );
+
+ // Get path of the theme.
+ $theme_path = wp_normalize_path( get_stylesheet_directory() );
+
+ // Create recursive directory iterator.
+ $theme_files = new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator( $theme_path ),
+ RecursiveIteratorIterator::LEAVES_ONLY
+ );
+
+ // Make a copy of the current theme.
+ foreach ( $theme_files as $file ) {
+ // Skip directories as they are added automatically.
+ if ( ! $file->isDir() ) {
+ // Get real and relative path for current file.
+ $file_path = wp_normalize_path( $file );
+ $relative_path = substr( $file_path, strlen( $theme_path ) + 1 );
+
+ if ( ! wp_is_theme_directory_ignored( $relative_path ) ) {
+ $zip->addFile( $file_path, $relative_path );
+ }
+ }
+ }
+
+ // Load templates into the zip file.
+ $templates = gutenberg_get_block_templates();
+ foreach ( $templates as $template ) {
+ $template->content = traverse_and_serialize_blocks(
+ parse_blocks( $template->content ),
+ '_remove_theme_attribute_from_template_part_block'
+ );
+
+ $zip->addFromString(
+ 'templates/' . $template->slug . '.html',
+ $template->content
+ );
+ }
+
+ // Load template parts into the zip file.
+ $template_parts = gutenberg_get_block_templates( array(), 'wp_template_part' );
+ foreach ( $template_parts as $template_part ) {
+ $zip->addFromString(
+ 'parts/' . $template_part->slug . '.html',
+ $template_part->content
+ );
+ }
+
+ // Load theme.json into the zip file.
+ $tree = WP_Theme_JSON_Resolver_Gutenberg::get_theme_data( array(), array( 'with_supports' => false ) );
+ // Merge with user data.
+ $tree->merge( WP_Theme_JSON_Resolver_Gutenberg::get_user_data() );
+
+ $theme_json_raw = $tree->get_data();
+ // If a version is defined, add a schema.
+ if ( $theme_json_raw['version'] ) {
+ $theme_json_version = 'wp/' . substr( $wp_version, 0, 3 );
+ $schema = array( '$schema' => 'https://schemas.wp.org/' . $theme_json_version . '/theme.json' );
+ $theme_json_raw = array_merge( $schema, $theme_json_raw );
+ }
+
+ // Convert to a string.
+ $theme_json_encoded = wp_json_encode( $theme_json_raw, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
+
+ // Replace 4 spaces with a tab.
+ $theme_json_tabbed = preg_replace( '~(?:^|\G)\h{4}~m', "\t", $theme_json_encoded );
+
+ // Add the theme.json file to the zip.
+ $zip->addFromString(
+ 'theme.json',
+ $theme_json_tabbed
+ );
+
+ // Save changes to the zip file.
+ $zip->close();
+
+ return $filename;
+}
diff --git a/lib/class-wp-rest-edit-site-export-controller-gutenberg.php b/lib/class-wp-rest-edit-site-export-controller-gutenberg.php
new file mode 100644
index 00000000000000..b05de230dd0ccd
--- /dev/null
+++ b/lib/class-wp-rest-edit-site-export-controller-gutenberg.php
@@ -0,0 +1,46 @@
+add_data( array( 'status' => 500 ) );
+
+ return $filename;
+ }
+
+ $theme_name = basename( get_stylesheet() );
+ header( 'Content-Type: application/zip' );
+ header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' );
+ header( 'Content-Length: ' . filesize( $filename ) );
+ flush();
+ readfile( $filename );
+ unlink( $filename );
+ exit;
+ }
+}
diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php
index ad4e2fe105b0c3..a1e79a56a683bf 100644
--- a/lib/class-wp-theme-json-gutenberg.php
+++ b/lib/class-wp-theme-json-gutenberg.php
@@ -734,14 +734,14 @@ public static function get_element_class_name( $element ) {
*
* @param array $theme_json A structure that follows the theme.json schema.
* @param string $origin Optional. What source of data this object represents.
- * One of 'default', 'theme', or 'custom'. Default 'theme'.
+ * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.
*/
public function __construct( $theme_json = array( 'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA ), $origin = 'theme' ) {
if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) {
$origin = 'theme';
}
- $this->theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json );
+ $this->theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json, $origin );
$registry = WP_Block_Type_Registry::get_instance();
$valid_block_names = array_keys( $registry->get_all_registered() );
$valid_element_names = array_keys( static::ELEMENTS );
@@ -3278,15 +3278,21 @@ protected static function filter_slugs( $node, $slugs ) {
* Removes insecure data from theme.json.
*
* @since 5.9.0
- * @since 6.6.0 Added support for block style variation element styles.
+ * @since 6.6.0 Added support for block style variation element styles and $origin parameter.
*
* @param array $theme_json Structure to sanitize.
+ * @param string $origin Optional. What source of data this object represents.
+ * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.
* @return array Sanitized structure.
*/
- public static function remove_insecure_properties( $theme_json ) {
+ public static function remove_insecure_properties( $theme_json, $origin = 'theme' ) {
+ if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) {
+ $origin = 'theme';
+ }
+
$sanitized = array();
- $theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json );
+ $theme_json = WP_Theme_JSON_Schema_Gutenberg::migrate( $theme_json, $origin );
$valid_block_names = array_keys( static::get_blocks_metadata() );
$valid_element_names = array_keys( static::ELEMENTS );
@@ -3559,53 +3565,32 @@ public static function get_from_editor_settings( $settings ) {
// Deprecated theme supports.
if ( isset( $settings['disableCustomColors'] ) ) {
- if ( ! isset( $theme_settings['settings']['color'] ) ) {
- $theme_settings['settings']['color'] = array();
- }
$theme_settings['settings']['color']['custom'] = ! $settings['disableCustomColors'];
}
if ( isset( $settings['disableCustomGradients'] ) ) {
- if ( ! isset( $theme_settings['settings']['color'] ) ) {
- $theme_settings['settings']['color'] = array();
- }
$theme_settings['settings']['color']['customGradient'] = ! $settings['disableCustomGradients'];
}
if ( isset( $settings['disableCustomFontSizes'] ) ) {
- if ( ! isset( $theme_settings['settings']['typography'] ) ) {
- $theme_settings['settings']['typography'] = array();
- }
$theme_settings['settings']['typography']['customFontSize'] = ! $settings['disableCustomFontSizes'];
}
if ( isset( $settings['enableCustomLineHeight'] ) ) {
- if ( ! isset( $theme_settings['settings']['typography'] ) ) {
- $theme_settings['settings']['typography'] = array();
- }
$theme_settings['settings']['typography']['lineHeight'] = $settings['enableCustomLineHeight'];
}
if ( isset( $settings['enableCustomUnits'] ) ) {
- if ( ! isset( $theme_settings['settings']['spacing'] ) ) {
- $theme_settings['settings']['spacing'] = array();
- }
$theme_settings['settings']['spacing']['units'] = ( true === $settings['enableCustomUnits'] ) ?
array( 'px', 'em', 'rem', 'vh', 'vw', '%' ) :
$settings['enableCustomUnits'];
}
if ( isset( $settings['colors'] ) ) {
- if ( ! isset( $theme_settings['settings']['color'] ) ) {
- $theme_settings['settings']['color'] = array();
- }
$theme_settings['settings']['color']['palette'] = $settings['colors'];
}
if ( isset( $settings['gradients'] ) ) {
- if ( ! isset( $theme_settings['settings']['color'] ) ) {
- $theme_settings['settings']['color'] = array();
- }
$theme_settings['settings']['color']['gradients'] = $settings['gradients'];
}
@@ -3617,19 +3602,17 @@ public static function get_from_editor_settings( $settings ) {
$font_sizes[ $key ]['size'] = $font_size['size'] . 'px';
}
}
- if ( ! isset( $theme_settings['settings']['typography'] ) ) {
- $theme_settings['settings']['typography'] = array();
- }
$theme_settings['settings']['typography']['fontSizes'] = $font_sizes;
}
if ( isset( $settings['enableCustomSpacing'] ) ) {
- if ( ! isset( $theme_settings['settings']['spacing'] ) ) {
- $theme_settings['settings']['spacing'] = array();
- }
$theme_settings['settings']['spacing']['padding'] = $settings['enableCustomSpacing'];
}
+ if ( isset( $settings['spacingSizes'] ) ) {
+ $theme_settings['settings']['spacing']['spacingSizes'] = $settings['spacingSizes'];
+ }
+
return $theme_settings;
}
@@ -3794,12 +3777,10 @@ public function get_data() {
/**
* Sets the spacingSizes array based on the spacingScale values from theme.json.
*
- * No longer used since theme.json version 3 as the spacingSizes are now
- * automatically generated during construction and merge instead of manually
- * set in the resolver.
- *
* @since 6.1.0
- * @deprecated 6.6.0
+ * @deprecated 6.6.0 No longer used as the spacingSizes are automatically
+ * generated in the constructor and merge methods instead
+ * of manually after instantiation.
*
* @return null|void
*/
@@ -3852,6 +3833,10 @@ public function set_spacing_sizes() {
* @return array The merged set of spacing sizes.
*/
private static function merge_spacing_sizes( $base, $incoming ) {
+ // Preserve the order if there are no base (spacingScale) values.
+ if ( empty( $base ) ) {
+ return $incoming;
+ }
$merged = array();
foreach ( $base as $item ) {
$merged[ $item['slug'] ] = $item;
@@ -3859,6 +3844,7 @@ private static function merge_spacing_sizes( $base, $incoming ) {
foreach ( $incoming as $item ) {
$merged[ $item['slug'] ] = $item;
}
+ ksort( $merged, SORT_NUMERIC );
return array_values( $merged );
}
diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php
index 84f999e4e9d020..507876af4952a8 100644
--- a/lib/class-wp-theme-json-resolver-gutenberg.php
+++ b/lib/class-wp-theme-json-resolver-gutenberg.php
@@ -220,6 +220,7 @@ protected static function has_same_registered_blocks( $origin ) {
* @since 5.8.0
* @since 5.9.0 Theme supports have been inlined and the `$theme_support_data` argument removed.
* @since 6.0.0 Added an `$options` parameter to allow the theme data to be returned without theme supports.
+ * @since 6.6.0 Add support for 'default-font-sizes' and 'default-spacing-sizes' theme supports.
*
* @param array $deprecated Deprecated. Not used.
* @param array $options {
@@ -291,35 +292,27 @@ public static function get_theme_data( $deprecated = array(), $options = array()
* So we take theme supports, transform it to theme.json shape
* and merge the static::$theme upon that.
*/
- $theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
+ $theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_classic_theme_supports_block_editor_settings() );
if ( ! wp_theme_has_theme_json() ) {
- if ( ! isset( $theme_support_data['settings']['color'] ) ) {
- $theme_support_data['settings']['color'] = array();
- }
-
- $default_palette = false;
- if ( current_theme_supports( 'default-color-palette' ) ) {
- $default_palette = true;
- }
- if ( ! isset( $theme_support_data['settings']['color']['palette'] ) ) {
- // If the theme does not have any palette, we still want to show the core one.
- $default_palette = true;
- }
- $theme_support_data['settings']['color']['defaultPalette'] = $default_palette;
-
- $default_gradients = false;
- if ( current_theme_supports( 'default-gradient-presets' ) ) {
- $default_gradients = true;
- }
- if ( ! isset( $theme_support_data['settings']['color']['gradients'] ) ) {
- // If the theme does not have any gradients, we still want to show the core ones.
- $default_gradients = true;
- }
- $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;
+ /*
+ * Unlike block themes, classic themes without a theme.json disable
+ * default presets when custom preset theme support is added. This
+ * behavior can be overridden by using the corresponding default
+ * preset theme support.
+ */
+ $theme_support_data['settings']['color']['defaultPalette'] =
+ ! isset( $theme_support_data['settings']['color']['palette'] ) ||
+ current_theme_supports( 'default-color-palette' );
+ $theme_support_data['settings']['color']['defaultGradients'] =
+ ! isset( $theme_support_data['settings']['color']['gradients'] ) ||
+ current_theme_supports( 'default-gradient-presets' );
+ $theme_support_data['settings']['typography']['defaultFontSizes'] =
+ ! isset( $theme_support_data['settings']['typography']['fontSizes'] ) ||
+ current_theme_supports( 'default-font-sizes' );
+ $theme_support_data['settings']['spacing']['defaultSpacingSizes'] =
+ ! isset( $theme_support_data['settings']['spacing']['spacingSizes'] ) ||
+ current_theme_supports( 'default-spacing-sizes' );
- if ( ! isset( $theme_support_data['settings']['shadow'] ) ) {
- $theme_support_data['settings']['shadow'] = array();
- }
/*
* Shadow presets are explicitly disabled for classic themes until a
* decision is made for whether the default presets should match the
@@ -541,18 +534,14 @@ public static function get_user_data() {
isset( $decoded_data['isGlobalStylesUserThemeJSON'] ) &&
$decoded_data['isGlobalStylesUserThemeJSON']
) {
+ unset( $decoded_data['isGlobalStylesUserThemeJSON'] );
$config = $decoded_data;
}
}
/** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */
- $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data_Gutenberg( $config, 'custom' ) );
- $config = $theme_json->get_data();
-
- // Needs to be set for schema migrations of user data.
- $config['isGlobalStylesUserThemeJSON'] = true;
-
- static::$user = new WP_Theme_JSON_Gutenberg( $config, 'custom' );
+ $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data_Gutenberg( $config, 'custom' ) );
+ static::$user = $theme_json->get_theme_json();
return static::$user;
}
diff --git a/lib/class-wp-theme-json-schema-gutenberg.php b/lib/class-wp-theme-json-schema-gutenberg.php
index 0def88f86a23a7..af0977ada1b307 100644
--- a/lib/class-wp-theme-json-schema-gutenberg.php
+++ b/lib/class-wp-theme-json-schema-gutenberg.php
@@ -40,11 +40,13 @@ class WP_Theme_JSON_Schema_Gutenberg {
* @since 5.9.0
* @since 6.6.0 Migrate up to v3.
*
- * @param array $theme_json The structure to migrate.
+ * @param array $theme_json The structure to migrate.
+ * @param string $origin Optional. What source of data this object represents.
+ * One of 'blocks', 'default', 'theme', or 'custom'. Default 'theme'.
*
* @return array The structure in the last version.
*/
- public static function migrate( $theme_json ) {
+ public static function migrate( $theme_json, $origin = 'theme' ) {
if ( ! isset( $theme_json['version'] ) ) {
$theme_json = array(
'version' => WP_Theme_JSON::LATEST_SCHEMA,
@@ -55,10 +57,9 @@ public static function migrate( $theme_json ) {
switch ( $theme_json['version'] ) {
case 1:
$theme_json = self::migrate_v1_to_v2( $theme_json );
- // no break
+ // Deliberate fall through. Once migrated to v2, also migrate to v3.
case 2:
- $theme_json = self::migrate_v2_to_v3( $theme_json );
- // no break
+ $theme_json = self::migrate_v2_to_v3( $theme_json, $origin );
}
return $theme_json;
@@ -97,15 +98,19 @@ private static function migrate_v1_to_v2( $old ) {
/**
* Migrates from v2 to v3.
*
- * - Sets settings.typography.defaultFontSizes to false.
+ * - Sets settings.typography.defaultFontSizes to false if settings.typography.fontSizes are defined.
+ * - Sets settings.spacing.defaultSpacingSizes to false if settings.spacing.spacingSizes are defined.
+ * - Prevents settings.spacing.spacingSizes from merging with settings.spacing.spacingScale by
+ * unsetting spacingScale when spacingSizes are defined.
*
* @since 6.6.0
*
- * @param array $old Data to migrate.
- *
+ * @param array $old Data to migrate.
+ * @param string $origin What source of data this object represents.
+ * One of 'blocks', 'default', 'theme', or 'custom'.
* @return array Data with defaultFontSizes set to false.
*/
- private static function migrate_v2_to_v3( $old ) {
+ private static function migrate_v2_to_v3( $old, $origin ) {
// Copy everything.
$new = $old;
@@ -116,10 +121,7 @@ private static function migrate_v2_to_v3( $old ) {
* Remaining changes do not need to be applied to the custom origin,
* as they should take on the value of the theme origin.
*/
- if (
- isset( $new['isGlobalStylesUserThemeJSON'] ) &&
- true === $new['isGlobalStylesUserThemeJSON']
- ) {
+ if ( 'custom' === $origin ) {
return $new;
}
@@ -132,12 +134,6 @@ private static function migrate_v2_to_v3( $old ) {
* when the theme did not provide any.
*/
if ( isset( $old['settings']['typography']['fontSizes'] ) ) {
- if ( ! isset( $new['settings'] ) ) {
- $new['settings'] = array();
- }
- if ( ! isset( $new['settings']['typography'] ) ) {
- $new['settings']['typography'] = array();
- }
$new['settings']['typography']['defaultFontSizes'] = false;
}
@@ -151,12 +147,6 @@ private static function migrate_v2_to_v3( $old ) {
isset( $old['settings']['spacing']['spacingSizes'] ) ||
isset( $old['settings']['spacing']['spacingScale'] )
) {
- if ( ! isset( $new['settings'] ) ) {
- $new['settings'] = array();
- }
- if ( ! isset( $new['settings']['spacing'] ) ) {
- $new['settings']['spacing'] = array();
- }
$new['settings']['spacing']['defaultSpacingSizes'] = false;
}
diff --git a/lib/compat/wordpress-6.5/blocks.php b/lib/compat/wordpress-6.5/blocks.php
index d3a8b3f5571813..5c5688e7cdf43e 100644
--- a/lib/compat/wordpress-6.5/blocks.php
+++ b/lib/compat/wordpress-6.5/blocks.php
@@ -65,27 +65,68 @@ function gutenberg_block_bindings_replace_html( $block_content, $block_name, str
switch ( $block_type->attributes[ $attribute_name ]['source'] ) {
case 'html':
case 'rich-text':
- // Hardcode the selectors and processing until the HTML API is able to read CSS selectors and replace inner HTML.
- // TODO: Use the HTML API instead.
- if ( 'core/paragraph' === $block_name && 'content' === $attribute_name ) {
- $selector = 'p';
- }
- if ( 'core/heading' === $block_name && 'content' === $attribute_name ) {
- $selector = 'h[1-6]';
+ $block_reader = new WP_HTML_Tag_Processor( $block_content );
+
+ // TODO: Support for CSS selectors whenever they are ready in the HTML API.
+ // In the meantime, support comma-separated selectors by exploding them into an array.
+ $selectors = explode( ',', $block_type->attributes[ $attribute_name ]['selector'] );
+ // Add a bookmark to the first tag to be able to iterate over the selectors.
+ $block_reader->next_tag();
+ $block_reader->set_bookmark( 'iterate-selectors' );
+
+ // TODO: This shouldn't be needed when the `set_inner_html` function is ready.
+ // Store the parent tag and its attributes to be able to restore them later in the button.
+ // The button block has a wrapper while the paragraph and heading blocks don't.
+ if ( 'core/button' === $block_name ) {
+ $button_wrapper = $block_reader->get_tag();
+ $button_wrapper_attribute_names = $block_reader->get_attribute_names_with_prefix( '' );
+ $button_wrapper_attrs = array();
+ foreach ( $button_wrapper_attribute_names as $name ) {
+ $button_wrapper_attrs[ $name ] = $block_reader->get_attribute( $name );
+ }
}
- if ( 'core/button' === $block_name && 'text' === $attribute_name ) {
- // Check if it is a
) : (
- Shadows
+ { __( 'Shadows' ) } {
- return {
- editorCanvasView: unlock(
- select( editSiteStore )
- ).getEditorCanvasContainerView(),
- };
- }, [] );
-
- return (
- <>
-
- }
- forceDisableBlockTools={ ! hasDefaultEditorCanvasView }
- title={
- ! hasDefaultEditorCanvasView
- ? getEditorCanvasContainerTitle( editorCanvasView )
- : undefined
- }
- />
-
- >
- );
-}
-
-export default Header;
diff --git a/packages/edit-site/src/components/header-edit-mode/style.scss b/packages/edit-site/src/components/header-edit-mode/style.scss
deleted file mode 100644
index 69b1e9dff38492..00000000000000
--- a/packages/edit-site/src/components/header-edit-mode/style.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.editor-header {
- padding-left: $header-height;
-}
diff --git a/packages/edit-site/src/components/layout/index.js b/packages/edit-site/src/components/layout/index.js
index 6c9668c28d0cc1..4bbf29cced39ea 100644
--- a/packages/edit-site/src/components/layout/index.js
+++ b/packages/edit-site/src/components/layout/index.js
@@ -80,7 +80,6 @@ export default function Layout() {
canvasMode,
previousShortcut,
nextShortcut,
- hasBlockBreadcrumbs,
} = useSelect( ( select ) => {
const { getAllShortcutKeyCombinations } = select(
keyboardShortcutsStore
@@ -102,10 +101,6 @@ export default function Layout() {
'core',
'distractionFree'
),
- hasBlockBreadcrumbs: select( preferencesStore ).get(
- 'core',
- 'showBlockBreadcrumbs'
- ),
hasBlockSelected:
select( blockEditorStore ).getBlockSelectionStart(),
};
@@ -185,10 +180,6 @@ export default function Layout() {
'is-full-canvas': canvasMode === 'edit',
'has-fixed-toolbar': hasFixedToolbar,
'is-block-toolbar-visible': hasBlockSelected,
- 'has-block-breadcrumbs':
- hasBlockBreadcrumbs &&
- ! isDistractionFree &&
- canvasMode === 'edit',
}
) }
>
diff --git a/packages/edit-site/src/components/layout/style.scss b/packages/edit-site/src/components/layout/style.scss
index 8c15cdae338818..0c5412b6d765bb 100644
--- a/packages/edit-site/src/components/layout/style.scss
+++ b/packages/edit-site/src/components/layout/style.scss
@@ -4,6 +4,11 @@
color: $gray-400;
display: flex;
flex-direction: column;
+
+ // Show a dark background in "frame" mode to avoid edge artifacts.
+ &:not(.is-full-canvas) .editor-visual-editor {
+ background: $gray-900;
+ }
}
.edit-site-layout__hub {
diff --git a/packages/edit-site/src/components/header-edit-mode/more-menu/index.js b/packages/edit-site/src/components/more-menu/index.js
similarity index 94%
rename from packages/edit-site/src/components/header-edit-mode/more-menu/index.js
rename to packages/edit-site/src/components/more-menu/index.js
index f0df5cf57fe6f0..4c4e9bb45c093e 100644
--- a/packages/edit-site/src/components/header-edit-mode/more-menu/index.js
+++ b/packages/edit-site/src/components/more-menu/index.js
@@ -10,7 +10,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
*/
import SiteExport from './site-export';
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
-import { unlock } from '../../../lock-unlock';
+import { unlock } from '../../lock-unlock';
const { ToolsMoreMenuGroup, PreferencesModal } = unlock( editorPrivateApis );
diff --git a/packages/edit-site/src/components/header-edit-mode/more-menu/site-export.js b/packages/edit-site/src/components/more-menu/site-export.js
similarity index 100%
rename from packages/edit-site/src/components/header-edit-mode/more-menu/site-export.js
rename to packages/edit-site/src/components/more-menu/site-export.js
diff --git a/packages/edit-site/src/components/header-edit-mode/more-menu/welcome-guide-menu-item.js b/packages/edit-site/src/components/more-menu/welcome-guide-menu-item.js
similarity index 100%
rename from packages/edit-site/src/components/header-edit-mode/more-menu/welcome-guide-menu-item.js
rename to packages/edit-site/src/components/more-menu/welcome-guide-menu-item.js
diff --git a/packages/edit-site/src/components/pagination/index.js b/packages/edit-site/src/components/pagination/index.js
index 5a56e6560a2e11..450ff2a17d5b5e 100644
--- a/packages/edit-site/src/components/pagination/index.js
+++ b/packages/edit-site/src/components/pagination/index.js
@@ -46,6 +46,7 @@ export default function Pagination( {
changePage( 1 ) }
+ __experimentalIsFocusable
disabled={ disabled || currentPage === 1 }
aria-label={ __( 'First page' ) }
>
@@ -54,6 +55,7 @@ export default function Pagination( {
changePage( currentPage - 1 ) }
+ __experimentalIsFocusable
disabled={ disabled || currentPage === 1 }
aria-label={ __( 'Previous page' ) }
>
@@ -72,6 +74,7 @@ export default function Pagination( {
changePage( currentPage + 1 ) }
+ __experimentalIsFocusable
disabled={ disabled || currentPage === numPages }
aria-label={ __( 'Next page' ) }
>
@@ -80,6 +83,7 @@ export default function Pagination( {
changePage( numPages ) }
+ __experimentalIsFocusable
disabled={ disabled || currentPage === numPages }
aria-label={ __( 'Last page' ) }
>
diff --git a/packages/edit-site/src/components/sidebar-dataviews/default-views.js b/packages/edit-site/src/components/sidebar-dataviews/default-views.js
index 6a10e0cd95d7b3..e75faa60b92e90 100644
--- a/packages/edit-site/src/components/sidebar-dataviews/default-views.js
+++ b/packages/edit-site/src/components/sidebar-dataviews/default-views.js
@@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { trash, pages, drafts } from '@wordpress/icons';
+import { trash, pages, drafts, unseen, inbox } from '@wordpress/icons';
/**
* Internal dependencies
@@ -99,6 +99,36 @@ export const DEFAULT_VIEWS = {
],
},
},
+ {
+ title: __( 'Pending' ),
+ slug: 'pending',
+ icon: inbox,
+ view: {
+ ...DEFAULT_PAGE_BASE,
+ filters: [
+ {
+ field: 'status',
+ operator: OPERATOR_IS_ANY,
+ value: 'pending',
+ },
+ ],
+ },
+ },
+ {
+ title: __( 'Private' ),
+ slug: 'private',
+ icon: unseen,
+ view: {
+ ...DEFAULT_PAGE_BASE,
+ filters: [
+ {
+ field: 'status',
+ operator: OPERATOR_IS_ANY,
+ value: 'private',
+ },
+ ],
+ },
+ },
{
title: __( 'Trash' ),
slug: 'trash',
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js
index a2281804bcb728..d290a40516bf0b 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js
+++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js
@@ -43,6 +43,7 @@ export default function RenameModal( { menuTitle, onClose, onSave } ) {
diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/style.scss b/packages/edit-site/src/components/sidebar-navigation-screen/style.scss
index bf6b79d151d595..7691f9ba2cdb0b 100644
--- a/packages/edit-site/src/components/sidebar-navigation-screen/style.scss
+++ b/packages/edit-site/src/components/sidebar-navigation-screen/style.scss
@@ -67,8 +67,8 @@
.edit-site-sidebar-navigation-screen__title {
flex-grow: 1;
- padding: $grid-unit-15 * 0.5 0 0 0;
overflow-wrap: break-word;
+ padding: $grid-unit-05 * 0.5 0 0 0;
}
.edit-site-sidebar-navigation-screen__actions {
diff --git a/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js b/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js
index a3ccc3e7c3234e..9e876d39d73407 100644
--- a/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js
+++ b/packages/edit-site/src/hooks/push-changes-to-global-styles/index.js
@@ -339,6 +339,7 @@ function PushChangesToGlobalStylesControl( {
diff --git a/packages/edit-site/src/index.js b/packages/edit-site/src/index.js
index 41fc0a1985fded..f7ef09f81ce7e7 100644
--- a/packages/edit-site/src/index.js
+++ b/packages/edit-site/src/index.js
@@ -9,7 +9,7 @@ import {
} from '@wordpress/block-library';
import { dispatch } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
-import { createRoot } from '@wordpress/element';
+import { createRoot, StrictMode } from '@wordpress/element';
import { store as editorStore } from '@wordpress/editor';
import { store as preferencesStore } from '@wordpress/preferences';
import {
@@ -85,7 +85,11 @@ export function initializeEditor( id, settings ) {
window.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );
window.addEventListener( 'drop', ( e ) => e.preventDefault(), false );
- root.render( );
+ root.render(
+
+
+
+ );
return root;
}
diff --git a/packages/edit-site/src/style.scss b/packages/edit-site/src/style.scss
index 20eb3397b00ed9..6203c24196592b 100644
--- a/packages/edit-site/src/style.scss
+++ b/packages/edit-site/src/style.scss
@@ -6,7 +6,6 @@
@import "./components/global-styles/style.scss";
@import "./components/global-styles/screen-revisions/style.scss";
@import "./components/global-styles-sidebar/style.scss";
-@import "./components/header-edit-mode/style.scss";
@import "./components/page/style.scss";
@import "./components/page-pages/style.scss";
@import "./components/page-patterns/style.scss";
diff --git a/packages/edit-widgets/CHANGELOG.md b/packages/edit-widgets/CHANGELOG.md
index df05e7281b7f21..c2551dfbe9df96 100644
--- a/packages/edit-widgets/CHANGELOG.md
+++ b/packages/edit-widgets/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json
index 1d48948f81f77d..a11cfbf56273df 100644
--- a/packages/edit-widgets/package.json
+++ b/packages/edit-widgets/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/edit-widgets",
- "version": "5.35.0",
+ "version": "6.0.0",
"description": "Widgets Page module for WordPress..",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/edit-widgets/src/index.js b/packages/edit-widgets/src/index.js
index 2374ec19dabd7b..f8247d733f1a15 100644
--- a/packages/edit-widgets/src/index.js
+++ b/packages/edit-widgets/src/index.js
@@ -9,7 +9,7 @@ import {
} from '@wordpress/blocks';
import { dispatch } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
-import { createRoot } from '@wordpress/element';
+import { StrictMode, createRoot } from '@wordpress/element';
import {
registerCoreBlocks,
__experimentalGetCoreBlocks,
@@ -91,7 +91,11 @@ export function initializeEditor( id, settings ) {
// see: https://github.com/WordPress/gutenberg/issues/33097
setFreeformContentHandlerName( 'core/html' );
- root.render( );
+ root.render(
+
+
+
+ );
return root;
}
diff --git a/packages/editor/CHANGELOG.md b/packages/editor/CHANGELOG.md
index 7fb4b4ecf3196f..41ab4c4b5ca26c 100644
--- a/packages/editor/CHANGELOG.md
+++ b/packages/editor/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 14.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/editor/README.md b/packages/editor/README.md
index 30e18afd671e4f..d4161f9bac6266 100644
--- a/packages/editor/README.md
+++ b/packages/editor/README.md
@@ -350,7 +350,35 @@ _Returns_
### EditorProvider
-Undocumented declaration.
+This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).
+
+It supports a large number of post types, including post, page, templates, custom post types, patterns, template parts.
+
+All modification and changes are performed to the `@wordpress/core-data` store.
+
+_Usage_
+
+```jsx
+
+ { children }
+
+```
+
+_Parameters_
+
+- _props_ `Object`: The component props.
+- _props.post_ `[Object]`: The post object to edit. This is required.
+- _props.\_\_unstableTemplate_ `[Object]`: The template object wrapper the edited post. This is optional and can only be used when the post type supports templates (like posts and pages).
+- _props.settings_ `[Object]`: The settings object to use for the editor. This is optional and can be used to override the default settings.
+- _props.children_ `[Element]`: Children elements for which the BlockEditorProvider context should apply. This is optional.
+
+_Returns_
+
+- `JSX.Element`: The rendered EditorProvider component.
### EditorSnackbars
@@ -1564,7 +1592,11 @@ Undocumented declaration.
### WordCount
-Undocumented declaration.
+Renders the word count of the post content.
+
+_Returns_
+
+- `JSX.Element|null`: The rendered WordCount component.
### WritingFlow
diff --git a/packages/editor/package.json b/packages/editor/package.json
index d6d5731ebbc1fd..24461df0369318 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/editor",
- "version": "13.35.0",
+ "version": "14.0.0",
"description": "Enhanced block editor for WordPress posts.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
@@ -70,6 +70,7 @@
"clsx": "^2.1.1",
"date-fns": "^3.6.0",
"deepmerge": "^4.3.0",
+ "fast-deep-equal": "^3.1.3",
"is-plain-object": "^5.0.0",
"memize": "^2.1.0",
"react-autosize-textarea": "^7.1.0",
diff --git a/packages/editor/src/bindings/pattern-overrides.js b/packages/editor/src/bindings/pattern-overrides.js
index 4065cefe362808..107ed72e722ba5 100644
--- a/packages/editor/src/bindings/pattern-overrides.js
+++ b/packages/editor/src/bindings/pattern-overrides.js
@@ -89,7 +89,5 @@ export default {
},
} );
},
- lockAttributesEditing() {
- return false;
- },
+ canUserEditValue: () => true,
};
diff --git a/packages/editor/src/bindings/post-meta.js b/packages/editor/src/bindings/post-meta.js
index f5b3b526dbfd4a..aec890c5ceff87 100644
--- a/packages/editor/src/bindings/post-meta.js
+++ b/packages/editor/src/bindings/post-meta.js
@@ -16,13 +16,53 @@ export default {
return args.key;
},
getValue( { registry, context, args } ) {
- const postType = context.postType
- ? context.postType
- : registry.select( editorStore ).getCurrentPostType();
-
return registry
.select( coreDataStore )
- .getEditedEntityRecord( 'postType', postType, context.postId )
- .meta?.[ args.key ];
+ .getEditedEntityRecord(
+ 'postType',
+ context?.postType,
+ context?.postId
+ ).meta?.[ args.key ];
+ },
+ setValue( { registry, context, args, value } ) {
+ registry
+ .dispatch( coreDataStore )
+ .editEntityRecord( 'postType', context?.postType, context?.postId, {
+ meta: {
+ [ args.key ]: value,
+ },
+ } );
+ },
+ canUserEditValue( { select, context, args } ) {
+ const postType =
+ context?.postType || select( editorStore ).getCurrentPostType();
+
+ // Check that editing is happening in the post editor and not a template.
+ if ( postType === 'wp_template' ) {
+ return false;
+ }
+
+ // Check that the custom field is not protected and available in the REST API.
+ const isFieldExposed = !! select( coreDataStore ).getEntityRecord(
+ 'postType',
+ postType,
+ context?.postId
+ )?.meta?.[ args.key ];
+
+ if ( ! isFieldExposed ) {
+ return false;
+ }
+
+ // Check that the user has the capability to edit post meta.
+ const canUserEdit = select( coreDataStore ).canUserEditEntityRecord(
+ 'postType',
+ context?.postType,
+ context?.postId
+ );
+ if ( ! canUserEdit ) {
+ return false;
+ }
+
+ return true;
},
};
diff --git a/packages/editor/src/components/collapsible-block-toolbar/style.scss b/packages/editor/src/components/collapsible-block-toolbar/style.scss
index 701d6fa7c5ecc2..18fdc556681449 100644
--- a/packages/editor/src/components/collapsible-block-toolbar/style.scss
+++ b/packages/editor/src/components/collapsible-block-toolbar/style.scss
@@ -7,6 +7,7 @@
.block-editor-block-contextual-toolbar {
border-bottom: 0;
height: 100%;
+ background: transparent;
}
// These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
@@ -64,8 +65,9 @@
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
@include break-small() {
&:not(.is-horizontal) .block-editor-block-mover__move-button-container {
+ height: $grid-unit-50;
position: relative;
- top: -10px;
+ top: -5px; // Should be -4px, but that causes scrolling when focus lands on the movers, in a 60px header.
}
}
}
diff --git a/packages/editor/src/components/editor-interface/content-slot-fill.js b/packages/editor/src/components/editor-interface/content-slot-fill.js
new file mode 100644
index 00000000000000..1aab394e87230f
--- /dev/null
+++ b/packages/editor/src/components/editor-interface/content-slot-fill.js
@@ -0,0 +1,15 @@
+/**
+ * WordPress dependencies
+ */
+import { privateApis as componentsPrivateApis } from '@wordpress/components';
+
+/**
+ * Internal dependencies
+ */
+import { unlock } from '../../lock-unlock';
+
+const { createPrivateSlotFill } = unlock( componentsPrivateApis );
+const SLOT_FILL_NAME = 'EditCanvasContainerSlot';
+const EditorContentSlotFill = createPrivateSlotFill( SLOT_FILL_NAME );
+
+export default EditorContentSlotFill;
diff --git a/packages/editor/src/components/editor-interface/index.js b/packages/editor/src/components/editor-interface/index.js
index 60ee3043e073bb..8d4bdfc00344af 100644
--- a/packages/editor/src/components/editor-interface/index.js
+++ b/packages/editor/src/components/editor-interface/index.js
@@ -24,13 +24,13 @@ import { useState, useCallback } from '@wordpress/element';
*/
import { store as editorStore } from '../../store';
import EditorNotices from '../editor-notices';
-import EditorSnackbars from '../editor-snackbars';
import Header from '../header';
import InserterSidebar from '../inserter-sidebar';
import ListViewSidebar from '../list-view-sidebar';
import SavePublishPanels from '../save-publish-panels';
import TextEditor from '../text-editor';
import VisualEditor from '../visual-editor';
+import EditorContentSlotFill from './content-slot-fill';
const interfaceLabels = {
/* translators: accessibility text for the editor top bar landmark region. */
@@ -47,12 +47,17 @@ const interfaceLabels = {
export default function EditorInterface( {
className,
+ enableRegionNavigation,
styles,
children,
forceIsDirty,
contentRef,
disableIframe,
autoFocus,
+ customSaveButton,
+ forceDisableBlockTools,
+ title,
+ iframeProps,
} ) {
const {
mode,
@@ -60,6 +65,7 @@ export default function EditorInterface( {
isInserterOpened,
isListViewOpened,
isDistractionFree,
+ isPreviewMode,
previousShortcut,
nextShortcut,
showBlockBreadcrumbs,
@@ -77,6 +83,7 @@ export default function EditorInterface( {
isInserterOpened: select( editorStore ).isInserterOpened(),
isListViewOpened: select( editorStore ).isListViewOpened(),
isDistractionFree: get( 'core', 'distractionFree' ),
+ isPreviewMode: editorSettings.__unstableIsPreviewMode,
previousShortcut: select(
keyboardShortcutsStore
).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),
@@ -112,68 +119,96 @@ export default function EditorInterface( {
return (
+ ! isPreviewMode && (
+
+ )
}
editorNotices={ }
secondarySidebar={
+ ! isPreviewMode &&
mode === 'visual' &&
( ( isInserterOpened && ) ||
( isListViewOpened && ) )
}
sidebar={
+ ! isPreviewMode &&
! isDistractionFree &&
}
- notices={ }
content={
<>
- { ! isDistractionFree && }
- { ( mode === 'text' || ! isRichEditingEnabled ) && (
-
- ) }
- { ! isLargeViewport && mode === 'visual' && (
-
+ { ! isDistractionFree && ! isPreviewMode && (
+
) }
- { isRichEditingEnabled && mode === 'visual' && (
-
- ) }
- { children }
+
+
+ { ( [ editorCanvasView ] ) =>
+ editorCanvasView ? (
+ editorCanvasView
+ ) : (
+ <>
+ { ! isPreviewMode &&
+ ( mode === 'text' ||
+ ! isRichEditingEnabled ) && (
+
+ ) }
+ { ! isPreviewMode &&
+ ! isLargeViewport &&
+ mode === 'visual' && (
+
+ ) }
+ { ( isPreviewMode ||
+ ( isRichEditingEnabled &&
+ mode === 'visual' ) ) && (
+
+ ) }
+ { children }
+ >
+ )
+ }
+
>
}
footer={
+ ! isPreviewMode &&
! isDistractionFree &&
isLargeViewport &&
showBlockBreadcrumbs &&
isRichEditingEnabled &&
blockEditorMode !== 'zoom-out' &&
mode === 'visual' && (
-
-
-
+
)
}
actions={
diff --git a/packages/editor/src/components/editor-interface/style.scss b/packages/editor/src/components/editor-interface/style.scss
new file mode 100644
index 00000000000000..e7e0a93af20906
--- /dev/null
+++ b/packages/editor/src/components/editor-interface/style.scss
@@ -0,0 +1,3 @@
+.editor-editor-interface .entities-saved-states__panel-header {
+ height: $header-height + $border-width;
+}
diff --git a/packages/editor/src/components/editor/index.js b/packages/editor/src/components/editor/index.js
new file mode 100644
index 00000000000000..b094c3ceb44376
--- /dev/null
+++ b/packages/editor/src/components/editor/index.js
@@ -0,0 +1,88 @@
+/**
+ * WordPress dependencies
+ */
+import { useSelect } from '@wordpress/data';
+import { store as coreStore } from '@wordpress/core-data';
+import { Notice } from '@wordpress/components';
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import { TEMPLATE_POST_TYPE } from '../../store/constants';
+import EditorInterface from '../editor-interface';
+import { ExperimentalEditorProvider } from '../provider';
+import Sidebar from '../sidebar';
+
+function Editor( {
+ postType,
+ postId,
+ templateId,
+ settings,
+ children,
+ initialEdits,
+
+ // This could be part of the settings.
+ onActionPerformed,
+
+ // The following abstractions are not ideal but necessary
+ // to account for site editor and post editor differences for now.
+ extraContent,
+ extraSidebarPanels,
+ ...props
+} ) {
+ const { post, template, hasLoadedPost } = useSelect(
+ ( select ) => {
+ const { getEntityRecord, hasFinishedResolution } =
+ select( coreStore );
+ return {
+ post: getEntityRecord( 'postType', postType, postId ),
+ template: templateId
+ ? getEntityRecord(
+ 'postType',
+ TEMPLATE_POST_TYPE,
+ templateId
+ )
+ : undefined,
+ hasLoadedPost: hasFinishedResolution( 'getEntityRecord', [
+ 'postType',
+ postType,
+ postId,
+ ] ),
+ };
+ },
+ [ postType, postId, templateId ]
+ );
+
+ return (
+ <>
+ { hasLoadedPost && ! post && (
+
+ { __(
+ "You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
+ ) }
+
+ ) }
+ { !! post && (
+
+
+ { extraContent }
+
+
+ { children }
+
+ ) }
+ >
+ );
+}
+
+export default Editor;
diff --git a/packages/editor/src/components/entities-saved-states/entity-record-item.js b/packages/editor/src/components/entities-saved-states/entity-record-item.js
index 15bdc8c2f22842..49733489b0a117 100644
--- a/packages/editor/src/components/entities-saved-states/entity-record-item.js
+++ b/packages/editor/src/components/entities-saved-states/entity-record-item.js
@@ -1,25 +1,32 @@
/**
* WordPress dependencies
*/
-import { CheckboxControl, PanelRow } from '@wordpress/components';
+import { Icon, CheckboxControl, Flex, PanelRow } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';
+import { connection } from '@wordpress/icons';
/**
* Internal dependencies
*/
import { store as editorStore } from '../../store';
+import { unlock } from '../../lock-unlock';
export default function EntityRecordItem( { record, checked, onChange } ) {
const { name, kind, title, key } = record;
// Handle templates that might use default descriptive titles.
- const entityRecordTitle = useSelect(
+ const { entityRecordTitle, hasPostMetaChanges } = useSelect(
( select ) => {
if ( 'postType' !== kind || 'wp_template' !== name ) {
- return title;
+ return {
+ entityRecordTitle: title,
+ hasPostMetaChanges: unlock(
+ select( editorStore )
+ ).hasPostMetaChanges( name, key ),
+ };
}
const template = select( coreStore ).getEditedEntityRecord(
@@ -27,23 +34,45 @@ export default function EntityRecordItem( { record, checked, onChange } ) {
name,
key
);
- return select( editorStore ).__experimentalGetTemplateInfo(
- template
- ).title;
+ return {
+ entityRecordTitle:
+ select( editorStore ).__experimentalGetTemplateInfo(
+ template
+ ).title,
+ hasPostMetaChanges: unlock(
+ select( editorStore )
+ ).hasPostMetaChanges( name, key ),
+ };
},
[ name, kind, title, key ]
);
return (
-
-
-
+ <>
+
+
+
+ { hasPostMetaChanges && (
+
+
+
+
+ { __( 'Post Meta.' ) }
+
+
+
+ ) }
+ >
);
}
diff --git a/packages/editor/src/components/entities-saved-states/style.scss b/packages/editor/src/components/entities-saved-states/style.scss
index f4e0c9f814c24f..8f0d8f53ca9cbb 100644
--- a/packages/editor/src/components/entities-saved-states/style.scss
+++ b/packages/editor/src/components/entities-saved-states/style.scss
@@ -31,9 +31,15 @@
}
}
-.edit-post-layout,
-.edit-site-editor__interface-skeleton {
- .entities-saved-states__panel-header {
- height: $header-height + $border-width;
- }
+.entities-saved-states__post-meta {
+ margin-left: $grid-unit-30;
+ align-items: center;
+}
+
+.entities-saved-states__connections-icon {
+ flex-grow: 0;
+}
+
+.entities-saved-states__bindings-text {
+ flex-grow: 1;
}
diff --git a/packages/editor/src/components/header/back-button.js b/packages/editor/src/components/header/back-button.js
index 7b775d11cd7a83..3ac689c8415264 100644
--- a/packages/editor/src/components/header/back-button.js
+++ b/packages/editor/src/components/header/back-button.js
@@ -20,7 +20,12 @@ const BackButtonSlot = ( { children } ) => {
return children;
}
- return ;
+ return (
+
+ );
};
BackButton.Slot = BackButtonSlot;
diff --git a/packages/editor/src/components/header/index.js b/packages/editor/src/components/header/index.js
index 4f1df093176a7d..14b62def0cfa74 100644
--- a/packages/editor/src/components/header/index.js
+++ b/packages/editor/src/components/header/index.js
@@ -25,7 +25,6 @@ import MoreMenu from '../more-menu';
import PostPreviewButton from '../post-preview-button';
import PostPublishButtonOrToggle from '../post-publish-button/post-publish-button-or-toggle';
import PostSavedState from '../post-saved-state';
-import PostTypeSupportCheck from '../post-type-support-check';
import PostViewLink from '../post-view-link';
import PreviewDropdown from '../preview-dropdown';
import { store as editorStore } from '../../store';
@@ -117,13 +116,7 @@ function Header( {
! isBlockToolsCollapsed && hasTopToolbar,
} ) }
>
- { ! title ? (
-
-
-
- ) : (
- title
- ) }
+ { ! title ? : title }
{
const queryKey = mapFromInserterMediaRequest[ key ] || key;
url.searchParams.set( queryKey, value );
diff --git a/packages/editor/src/components/post-actions/actions.js b/packages/editor/src/components/post-actions/actions.js
index e12195e63c0df3..69337e181f5e55 100644
--- a/packages/editor/src/components/post-actions/actions.js
+++ b/packages/editor/src/components/post-actions/actions.js
@@ -1049,6 +1049,7 @@ export function usePostActions( postType, onActionPerformed ) {
const isPattern = postType === PATTERN_POST_TYPE;
const isLoaded = !! postTypeObject;
const supportsRevisions = !! postTypeObject?.supports?.revisions;
+ const supportsTitle = !! postTypeObject?.supports?.title;
return useMemo( () => {
if ( ! isLoaded ) {
return [];
@@ -1064,7 +1065,7 @@ export function usePostActions( postType, onActionPerformed ) {
: false,
isTemplateOrTemplatePart && duplicateTemplatePartAction,
isPattern && duplicatePatternAction,
- renamePostAction,
+ supportsTitle && renamePostAction,
isPattern && exportPatternAsJSONAction,
isTemplateOrTemplatePart ? resetTemplateAction : restorePostAction,
isTemplateOrTemplatePart || isPattern
@@ -1124,5 +1125,6 @@ export function usePostActions( postType, onActionPerformed ) {
onActionPerformed,
isLoaded,
supportsRevisions,
+ supportsTitle,
] );
}
diff --git a/packages/editor/src/components/post-discussion/panel.js b/packages/editor/src/components/post-discussion/panel.js
index 4812b021a6e6b3..718754d56857aa 100644
--- a/packages/editor/src/components/post-discussion/panel.js
+++ b/packages/editor/src/components/post-discussion/panel.js
@@ -6,7 +6,6 @@ import {
Dropdown,
Button,
__experimentalVStack as VStack,
- __experimentalText as Text,
} from '@wordpress/components';
import { useSelect } from '@wordpress/data';
import { useState, useMemo } from '@wordpress/element';
@@ -81,7 +80,7 @@ function PostDiscussionToggle( { isOpen, onClick } ) {
aria-expanded={ isOpen }
onClick={ onClick }
>
- { label }
+ { label }
);
}
diff --git a/packages/editor/src/components/post-discussion/style.scss b/packages/editor/src/components/post-discussion/style.scss
index b1eae851402859..b2d65c9aa7cf3f 100644
--- a/packages/editor/src/components/post-discussion/style.scss
+++ b/packages/editor/src/components/post-discussion/style.scss
@@ -13,9 +13,7 @@
}
}
.editor-post-discussion__panel-toggle {
- &.components-button {
- height: auto;
- }
+
.components-text {
color: inherit;
}
diff --git a/packages/editor/src/components/post-panel-row/style.scss b/packages/editor/src/components/post-panel-row/style.scss
index 22d0cbbb644d8a..024394c3aaf331 100644
--- a/packages/editor/src/components/post-panel-row/style.scss
+++ b/packages/editor/src/components/post-panel-row/style.scss
@@ -11,6 +11,9 @@
min-height: $grid-unit-40;
display: flex;
align-items: center;
+ padding: 6px 0; // Matches button to ensure alignment
+ line-height: $grid-unit-05 * 5;
+ hyphens: auto;
}
.editor-post-panel__row-control {
@@ -18,4 +21,17 @@
min-height: $grid-unit-40;
display: flex;
align-items: center;
+
+ .components-button {
+ max-width: 100%;
+ text-align: left;
+ text-wrap: balance; // Fallback for Safari.
+ text-wrap: pretty;
+ height: auto;
+ min-height: $button-size-compact;
+ }
+
+ .components-dropdown {
+ max-width: 100%;
+ }
}
diff --git a/packages/editor/src/components/post-preview-button/index.js b/packages/editor/src/components/post-preview-button/index.js
index 110de5858af382..e517ac0e8a0fbc 100644
--- a/packages/editor/src/components/post-preview-button/index.js
+++ b/packages/editor/src/components/post-preview-button/index.js
@@ -183,6 +183,7 @@ export default function PostPreviewButton( {
className={ className || 'editor-post-preview' }
href={ href }
target={ targetId }
+ __experimentalIsFocusable
disabled={ ! isSaveable }
onClick={ openPreviewWindow }
role={ role }
diff --git a/packages/editor/src/components/post-preview-button/test/index.js b/packages/editor/src/components/post-preview-button/test/index.js
index e34c05caa178bd..bb51f302edf50e 100644
--- a/packages/editor/src/components/post-preview-button/test/index.js
+++ b/packages/editor/src/components/post-preview-button/test/index.js
@@ -139,12 +139,16 @@ describe( 'PostPreviewButton', () => {
).toBeInTheDocument();
} );
- it( 'should be disabled if post is not saveable.', () => {
+ it( 'should be accessibly disabled if post is not saveable.', () => {
mockUseSelect( { isEditedPostSaveable: () => false } );
render( );
- expect( screen.getByRole( 'button' ) ).toBeDisabled();
+ expect( screen.getByRole( 'button' ) ).toBeEnabled();
+ expect( screen.getByRole( 'button' ) ).toHaveAttribute(
+ 'aria-disabled',
+ 'true'
+ );
} );
it( 'should not be disabled if post is saveable.', () => {
@@ -153,6 +157,10 @@ describe( 'PostPreviewButton', () => {
render( );
expect( screen.getByRole( 'button' ) ).toBeEnabled();
+ expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
+ 'aria-disabled',
+ 'true'
+ );
} );
it( 'should set `href` to edited post preview link if specified.', () => {
diff --git a/packages/editor/src/components/post-publish-button/index.js b/packages/editor/src/components/post-publish-button/index.js
index 355986fdf509dd..8797c9d1428251 100644
--- a/packages/editor/src/components/post-publish-button/index.js
+++ b/packages/editor/src/components/post-publish-button/index.js
@@ -11,6 +11,7 @@ import { compose } from '@wordpress/compose';
*/
import PublishButtonLabel from './label';
import { store as editorStore } from '../../store';
+import { unlock } from '../../lock-unlock';
const noop = () => {};
@@ -45,14 +46,24 @@ export class PostPublishButton extends Component {
createOnClick( callback ) {
return ( ...args ) => {
- const { hasNonPostEntityChanges, setEntitiesSavedStatesCallback } =
- this.props;
+ const {
+ hasNonPostEntityChanges,
+ hasPostMetaChanges,
+ setEntitiesSavedStatesCallback,
+ isPublished,
+ } = this.props;
// If a post with non-post entities is published, but the user
// elects to not save changes to the non-post entities, those
// entities will still be dirty when the Publish button is clicked.
// We also need to check that the `setEntitiesSavedStatesCallback`
// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
- if ( hasNonPostEntityChanges && setEntitiesSavedStatesCallback ) {
+ //
+ // TODO: Explore how to manage `hasPostMetaChanges` and pre-publish workflow properly.
+ if (
+ ( hasNonPostEntityChanges ||
+ ( hasPostMetaChanges && isPublished ) ) &&
+ setEntitiesSavedStatesCallback
+ ) {
// The modal for multiple entity saving will open,
// hold the callback for saving/publishing the post
// so that we can call it if the post entity is checked.
@@ -212,7 +223,8 @@ export default compose( [
isSavingNonPostEntityChanges,
getEditedPostAttribute,
getPostEdits,
- } = select( editorStore );
+ hasPostMetaChanges,
+ } = unlock( select( editorStore ) );
return {
isSaving: isSavingPost(),
isAutoSaving: isAutosavingPost(),
@@ -229,6 +241,7 @@ export default compose( [
postStatus: getEditedPostAttribute( 'status' ),
postStatusHasChanged: getPostEdits()?.status,
hasNonPostEntityChanges: hasNonPostEntityChanges(),
+ hasPostMetaChanges: hasPostMetaChanges(),
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
};
} ),
diff --git a/packages/editor/src/components/post-publish-panel/index.js b/packages/editor/src/components/post-publish-panel/index.js
index 4d59133966759a..31e838575c0871 100644
--- a/packages/editor/src/components/post-publish-panel/index.js
+++ b/packages/editor/src/components/post-publish-panel/index.js
@@ -93,6 +93,7 @@ export class PostPublishPanel extends Component {
-
-
- { __(
- 'Choose a predefined pattern to switch up the look of your template.' // TODO - make this dynamic?
- ) }
-
-
-
select( editorStore ).getEditedPostSlug(),
- []
- );
+ const { slug, isFrontPage, postLink } = useSelect( ( select ) => {
+ const { getCurrentPostId, getCurrentPost } = select( editorStore );
+ const { getEditedEntityRecord } = select( coreStore );
+ const siteSettings = getEditedEntityRecord( 'root', 'site' );
+ const _id = getCurrentPostId();
+ return {
+ slug: select( editorStore ).getEditedPostSlug(),
+ isFrontPage: siteSettings?.page_on_front === _id,
+ postLink: getCurrentPost()?.link,
+ };
+ }, [] );
const decodedSlug = safeDecodeURIComponent( slug );
return (
- /{ decodedSlug }
+ { isFrontPage ? postLink : <>/{ decodedSlug }> }
);
}
diff --git a/packages/editor/src/components/post-url/style.scss b/packages/editor/src/components/post-url/style.scss
index c622cfce33f90e..a711402f1a82eb 100644
--- a/packages/editor/src/components/post-url/style.scss
+++ b/packages/editor/src/components/post-url/style.scss
@@ -2,15 +2,6 @@
width: 100%;
}
-.components-button.editor-post-url__panel-toggle {
- display: block;
- max-width: 100%;
- overflow: hidden;
- text-align: left;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
.editor-post-url__panel-dialog .editor-post-url {
// sidebar width - popover padding - form margin
min-width: $sidebar-width - $grid-unit-20 - $grid-unit-20;
diff --git a/packages/editor/src/components/provider/README.md b/packages/editor/src/components/provider/README.md
deleted file mode 100644
index deaa9375bba746..00000000000000
--- a/packages/editor/src/components/provider/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# EditorProvider
-
-EditorProvider is a component which establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).
-
-It supports a big number of post types, including post, page, templates, custom post types, patterns, template parts.
-
-All modification and changes are performed to the `@wordpress/core-data` store.
-
-## Props
-
-### `post`
-
-- **Type:** `Object`
-- **Required** `yes`
-
-The post object to edit
-
-### `__unstableTemplate`
-
-- **Type:** `Object`
-- **Required** `no`
-
-The template object wrapper the edited post. This is optional and can only be used when the post type supports templates (like posts and pages).
-
-### `settings`
-
-- **Type:** `Object`
-- **Required** `no`
-
-The settings object to use for the editor. This is optional and can be used to override the default settings.
-
-### `children`
-
-- **Type:** `Element`
-- **Required** `no`
-
-Children elements for which the BlockEditorProvider context should apply.
diff --git a/packages/editor/src/components/provider/index.js b/packages/editor/src/components/provider/index.js
index 56c86968f0274f..081b1cdfa0f1b2 100644
--- a/packages/editor/src/components/provider/index.js
+++ b/packages/editor/src/components/provider/index.js
@@ -59,6 +59,12 @@ const NON_CONTEXTUAL_POST_TYPES = [
* @param {Array} post Block list.
* @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.
* @param {string} mode Rendering mode.
+ *
+ * @example
+ * ```jsx
+ * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );
+ * ```
+ *
* @return {Array} Block editor props.
*/
function useBlockEditorProps( post, template, mode ) {
@@ -118,6 +124,32 @@ function useBlockEditorProps( post, template, mode ) {
];
}
+/**
+ * This component provides the editor context and manages the state of the block editor.
+ *
+ * @param {Object} props The component props.
+ * @param {Object} props.post The post object.
+ * @param {Object} props.settings The editor settings.
+ * @param {boolean} props.recovery Indicates if the editor is in recovery mode.
+ * @param {Array} props.initialEdits The initial edits for the editor.
+ * @param {Object} props.children The child components.
+ * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.
+ * @param {Object} [props.__unstableTemplate] The template object.
+ *
+ * @example
+ * ```jsx
+ *
+ * { children }
+ *
+ *
+ * @return {Object} The rendered ExperimentalEditorProvider component.
+ */
export const ExperimentalEditorProvider = withRegistryProvider(
( {
post,
@@ -293,6 +325,36 @@ export const ExperimentalEditorProvider = withRegistryProvider(
}
);
+/**
+ * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).
+ *
+ * It supports a large number of post types, including post, page, templates,
+ * custom post types, patterns, template parts.
+ *
+ * All modification and changes are performed to the `@wordpress/core-data` store.
+ *
+ * @param {Object} props The component props.
+ * @param {Object} [props.post] The post object to edit. This is required.
+ * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.
+ * This is optional and can only be used when the post type supports templates (like posts and pages).
+ * @param {Object} [props.settings] The settings object to use for the editor.
+ * This is optional and can be used to override the default settings.
+ * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.
+ * This is optional.
+ *
+ * @example
+ * ```jsx
+ *
+ * { children }
+ *
+ * ```
+ *
+ * @return {JSX.Element} The rendered EditorProvider component.
+ */
export function EditorProvider( props ) {
return (
( {
publishSidebarOpened:
select( editorStore ).isPublishSidebarOpened(),
hasNonPostEntityChanges:
select( editorStore ).hasNonPostEntityChanges(),
+ hasPostMetaChanges: unlock(
+ select( editorStore )
+ ).hasPostMetaChanges(),
} ),
[]
);
@@ -54,7 +62,7 @@ export default function SavePublishPanels( {
PostPublishExtension={ PluginPostPublishPanel.Slot }
/>
);
- } else if ( hasNonPostEntityChanges ) {
+ } else if ( hasNonPostEntityChanges || hasPostMetaChanges ) {
unmountableContent = (
{
return [
- ...styles,
+ ...( styles ?? [] ),
{
css: `.is-root-container{display:flow-root;${
// Some themes will have `min-height: 100vh` for the root container,
diff --git a/packages/editor/src/components/visual-editor/style.scss b/packages/editor/src/components/visual-editor/style.scss
index 59f98450257f6c..597769ff7fb784 100644
--- a/packages/editor/src/components/visual-editor/style.scss
+++ b/packages/editor/src/components/visual-editor/style.scss
@@ -29,6 +29,7 @@
font-size: $default-font-size;
padding: 6px 12px;
+ &.is-tertiary,
&.has-icon {
padding: 6px;
}
diff --git a/packages/editor/src/components/word-count/index.js b/packages/editor/src/components/word-count/index.js
index 1aad38d62132d0..aab562b46b89ff 100644
--- a/packages/editor/src/components/word-count/index.js
+++ b/packages/editor/src/components/word-count/index.js
@@ -10,6 +10,11 @@ import { count as wordCount } from '@wordpress/wordcount';
*/
import { store as editorStore } from '../../store';
+/**
+ * Renders the word count of the post content.
+ *
+ * @return {JSX.Element|null} The rendered WordCount component.
+ */
export default function WordCount() {
const content = useSelect(
( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
diff --git a/packages/editor/src/private-apis.js b/packages/editor/src/private-apis.js
index 3f4c24b4b1e071..48e43e7737fec8 100644
--- a/packages/editor/src/private-apis.js
+++ b/packages/editor/src/private-apis.js
@@ -6,35 +6,19 @@ import * as interfaceApis from '@wordpress/interface';
/**
* Internal dependencies
*/
-import { ExperimentalEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
-import useAutoSwitchEditorSidebars from './components/provider/use-auto-switch-editor-sidebars';
+import EditorContentSlotFill from './components/editor-interface/content-slot-fill';
import useBlockEditorSettings from './components/provider/use-block-editor-settings';
import BackButton from './components/header/back-button';
-import EditorInterface from './components/editor-interface';
-import Header from './components/header';
import CreateTemplatePartModal from './components/create-template-part-modal';
-import InserterSidebar from './components/inserter-sidebar';
-import ListViewSidebar from './components/list-view-sidebar';
-import PatternOverridesPanel from './components/pattern-overrides-panel';
+import Editor from './components/editor';
import PluginPostExcerpt from './components/post-excerpt/plugin';
-import PostPanelRow from './components/post-panel-row';
import PreferencesModal from './components/preferences-modal';
-import PostActions from './components/post-actions';
import { usePostActions } from './components/post-actions/actions';
-import PostCardPanel from './components/post-card-panel';
-import PostStatus from './components/post-status';
import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
-import { PrivatePostExcerptPanel } from './components/post-excerpt/panel';
-import SavePublishPanels from './components/save-publish-panels';
-import PostContentInformation from './components/post-content-information';
-import PostLastEditedPanel from './components/post-last-edited-panel';
import ResizableEditor from './components/resizable-editor';
-import Sidebar from './components/sidebar';
-import TextEditor from './components/text-editor';
-import VisualEditor from './components/visual-editor';
import {
mergeBaseAndUserConfigs,
GlobalStylesProvider,
@@ -46,35 +30,19 @@ export const privateApis = {};
lock( privateApis, {
CreateTemplatePartModal,
BackButton,
- ExperimentalEditorProvider,
EntitiesSavedStatesExtensible,
+ Editor,
+ EditorContentSlotFill,
GlobalStylesProvider,
- EditorInterface,
- Header,
- InserterSidebar,
- ListViewSidebar,
mergeBaseAndUserConfigs,
- PatternOverridesPanel,
PluginPostExcerpt,
- PostActions,
- PostPanelRow,
PreferencesModal,
usePostActions,
- PostCardPanel,
- PostStatus,
ToolsMoreMenuGroup,
ViewMoreMenuGroup,
- PrivatePostExcerptPanel,
- SavePublishPanels,
- PostContentInformation,
- PostLastEditedPanel,
ResizableEditor,
- Sidebar,
- TextEditor,
- VisualEditor,
// This is a temporary private API while we're updating the site editor to use EditorProvider.
- useAutoSwitchEditorSidebars,
useBlockEditorSettings,
interfaceStore,
...remainingInterfaceApis,
diff --git a/packages/editor/src/private-apis.native.js b/packages/editor/src/private-apis.native.js
index d6fb0894d04d64..5ba2d8e4406739 100644
--- a/packages/editor/src/private-apis.native.js
+++ b/packages/editor/src/private-apis.native.js
@@ -7,54 +7,28 @@ import * as interfaceApis from '@wordpress/interface';
* Internal dependencies
*/
import VisualEditor from './components/visual-editor';
-import { ExperimentalEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
-import useAutoSwitchEditorSidebars from './components/provider/use-auto-switch-editor-sidebars';
import useBlockEditorSettings from './components/provider/use-block-editor-settings';
-import InserterSidebar from './components/inserter-sidebar';
-import ListViewSidebar from './components/list-view-sidebar';
-import PatternOverridesPanel from './components/pattern-overrides-panel';
import PluginPostExcerpt from './components/post-excerpt/plugin';
-import PostPanelRow from './components/post-panel-row';
import PreferencesModal from './components/preferences-modal';
-import PostActions from './components/post-actions';
import { usePostActions } from './components/post-actions/actions';
-import PostCardPanel from './components/post-card-panel';
-import PostStatus from './components/post-status';
import ToolsMoreMenuGroup from './components/more-menu/tools-more-menu-group';
import ViewMoreMenuGroup from './components/more-menu/view-more-menu-group';
-import { PrivatePostExcerptPanel } from './components/post-excerpt/panel';
-import SavePublishPanels from './components/save-publish-panels';
-import PostContentInformation from './components/post-content-information';
-import PostLastEditedPanel from './components/post-last-edited-panel';
const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
export const privateApis = {};
lock( privateApis, {
VisualEditor,
- ExperimentalEditorProvider,
EntitiesSavedStatesExtensible,
- InserterSidebar,
- ListViewSidebar,
- PatternOverridesPanel,
PluginPostExcerpt,
- PostActions,
- PostPanelRow,
PreferencesModal,
usePostActions,
- PostCardPanel,
- PostStatus,
ToolsMoreMenuGroup,
ViewMoreMenuGroup,
- PrivatePostExcerptPanel,
- SavePublishPanels,
- PostContentInformation,
- PostLastEditedPanel,
// This is a temporary private API while we're updating the site editor to use EditorProvider.
- useAutoSwitchEditorSidebars,
useBlockEditorSettings,
interfaceStore,
...remainingInterfaceApis,
diff --git a/packages/editor/src/store/private-selectors.js b/packages/editor/src/store/private-selectors.js
index aa2af9172ff18f..8a866b46a6cdd7 100644
--- a/packages/editor/src/store/private-selectors.js
+++ b/packages/editor/src/store/private-selectors.js
@@ -1,3 +1,8 @@
+/**
+ * External dependencies
+ */
+import fastDeepEqual from 'fast-deep-equal';
+
/**
* WordPress dependencies
*/
@@ -17,6 +22,7 @@ import { store as coreStore } from '@wordpress/core-data';
*/
import {
getRenderingMode,
+ getCurrentPost,
__experimentalGetDefaultTemplatePartAreas,
} from './selectors';
import { TEMPLATE_PART_POST_TYPE } from './constants';
@@ -135,3 +141,42 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(
return getFilteredTemplatePartBlocks( blocks, templateParts );
}
);
+
+/**
+ * Returns true if there are unsaved changes to the
+ * post's meta fields, and false otherwise.
+ *
+ * @param {Object} state Global application state.
+ * @param {string} postType The post type of the post.
+ * @param {number} postId The ID of the post.
+ *
+ * @return {boolean} Whether there are edits or not in the meta fields of the relevant post.
+ */
+export const hasPostMetaChanges = createRegistrySelector(
+ ( select ) => ( state, postType, postId ) => {
+ const { type: currentPostType, id: currentPostId } =
+ getCurrentPost( state );
+ // If no postType or postId is passed, use the current post.
+ const edits = select( coreStore ).getEntityRecordNonTransientEdits(
+ 'postType',
+ postType || currentPostType,
+ postId || currentPostId
+ );
+
+ if ( ! edits?.meta ) {
+ return false;
+ }
+
+ // Compare if anything apart from `footnotes` has changed.
+ const originalPostMeta = select( coreStore ).getEntityRecord(
+ 'postType',
+ postType || currentPostType,
+ postId || currentPostId
+ )?.meta;
+
+ return ! fastDeepEqual(
+ { ...originalPostMeta, footnotes: undefined },
+ { ...edits.meta, footnotes: undefined }
+ );
+ }
+);
diff --git a/packages/editor/src/style.scss b/packages/editor/src/style.scss
index bd8d03568e9d47..a4034a8a51c733 100644
--- a/packages/editor/src/style.scss
+++ b/packages/editor/src/style.scss
@@ -9,6 +9,7 @@
@import "./components/document-bar/style.scss";
@import "./components/document-outline/style.scss";
@import "./components/document-tools/style.scss";
+@import "./components/editor-interface/style.scss";
@import "./components/editor-notices/style.scss";
@import "./components/entities-saved-states/style.scss";
@import "./components/error-boundary/style.scss";
diff --git a/packages/element/CHANGELOG.md b/packages/element/CHANGELOG.md
index 9be466cfa8a13b..2d0c67c22c2847 100644
--- a/packages/element/CHANGELOG.md
+++ b/packages/element/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/element/package.json b/packages/element/package.json
index 2a66b1201f5d2f..fe9a68695b159c 100644
--- a/packages/element/package.json
+++ b/packages/element/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/element",
- "version": "5.35.0",
+ "version": "6.0.0",
"description": "Element React module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/env/CHANGELOG.md b/packages/env/CHANGELOG.md
index 4da081b51eb713..7669cf755943ea 100644
--- a/packages/env/CHANGELOG.md
+++ b/packages/env/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 10.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/env/README.md b/packages/env/README.md
index fb9e9751d9c666..b82f59f734840c 100644
--- a/packages/env/README.md
+++ b/packages/env/README.md
@@ -480,7 +480,7 @@ You can customize the WordPress installation, plugins and themes that the develo
`.wp-env.json` supports fields for options applicable to both the tests and development instances.
| Field | Type | Default | Description |
-| -------------- | -------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
+|----------------|----------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| `"core"` | `string\|null` | `null` | The WordPress installation to use. If `null` is specified, `wp-env` will use the latest production release of WordPress. |
| `"phpVersion"` | `string\|null` | `null` | The PHP version to use. If `null` is specified, `wp-env` will use the default version used with production release of WordPress. |
| `"plugins"` | `string[]` | `[]` | A list of plugins to install and activate in the environment. |
@@ -489,6 +489,7 @@ You can customize the WordPress installation, plugins and themes that the develo
| `"testsPort"` | `integer` | `8889` | The port number for the test site. You'll access the instance through the port: 'http://localhost:8889'. |
| `"config"` | `Object` | See below. | Mapping of wp-config.php constants to their desired values. |
| `"mappings"` | `Object` | `"{}"` | Mapping of WordPress directories to local directories to be mounted in the WordPress instance. |
+| `"mysqlPort"` | `integer` | `null` (randomly assigned) | The MySQL port number to expose. The setting is only available in the `env.development` and `env.tests` objects. |
_Note: the port number environment variables (`WP_ENV_PORT` and `WP_ENV_TESTS_PORT`) take precedent over the .wp-env.json values._
@@ -521,7 +522,8 @@ Additionally, the key `env` is available to override any of the above options on
"config": {
"KEY_1": false
},
- "port": 3000
+ "port": 3000,
+ "mysqlPort": 13306
}
}
}
@@ -686,6 +688,8 @@ You can tell `wp-env` to use a custom port number so that your instance does not
}
```
+These can also be set via the environment variables `WP_ENV_PORT`, `WP_ENV_TESTS_PORT`, `WP_ENV_MYSQL_PORT` and `WP_ENV_TESTS_MYSQL_PORT`.
+
### Specific PHP Version
You can tell `wp-env` to use a specific PHP version for compatibility and testing. This can also be set via the environment variable `WP_ENV_PHP_VERSION`.
diff --git a/packages/env/lib/build-docker-compose-config.js b/packages/env/lib/build-docker-compose-config.js
index 1794f7217ff946..d7a813e1afafb0 100644
--- a/packages/env/lib/build-docker-compose-config.js
+++ b/packages/env/lib/build-docker-compose-config.js
@@ -166,14 +166,20 @@ module.exports = function buildDockerComposeConfig( config ) {
// Set the default ports based on the config values.
const developmentPorts = `\${WP_ENV_PORT:-${ config.env.development.port }}:80`;
+ const developmentMysqlPorts = `\${WP_ENV_MYSQL_PORT:-${
+ config.env.development.mysqlPort ?? ''
+ }}:3306`;
const testsPorts = `\${WP_ENV_TESTS_PORT:-${ config.env.tests.port }}:80`;
+ const testsMysqlPorts = `\${WP_ENV_TESTS_MYSQL_PORT:-${
+ config.env.tests.mysqlPort ?? ''
+ }}:3306`;
return {
version: '3.7',
services: {
mysql: {
image: 'mariadb:lts',
- ports: [ '3306' ],
+ ports: [ developmentMysqlPorts ],
environment: {
MYSQL_ROOT_HOST: '%',
MYSQL_ROOT_PASSWORD:
@@ -184,7 +190,7 @@ module.exports = function buildDockerComposeConfig( config ) {
},
'tests-mysql': {
image: 'mariadb:lts',
- ports: [ '3306' ],
+ ports: [ testsMysqlPorts ],
environment: {
MYSQL_ROOT_HOST: '%',
MYSQL_ROOT_PASSWORD:
diff --git a/packages/env/lib/config/get-config-from-environment-vars.js b/packages/env/lib/config/get-config-from-environment-vars.js
index 8a4608b859b7f7..beaf721ea1c0c1 100644
--- a/packages/env/lib/config/get-config-from-environment-vars.js
+++ b/packages/env/lib/config/get-config-from-environment-vars.js
@@ -17,7 +17,9 @@ const { checkPort, checkVersion, checkString } = require( './validate-config' );
*
* @typedef WPEnvironmentVariableConfig
* @property {?number} port An override for the development environment's port.
+ * @property {?number} mysqlPort An override for the development environment's MySQL port.
* @property {?number} testsPort An override for the testing environment's port.
+ * @property {?number} testsMysqlPort An override for the testing environment's MySQL port.
* @property {?WPSource} coreSource An override for all environment's coreSource.
* @property {?string} phpVersion An override for all environment's PHP version.
* @property {?Object.} lifecycleScripts An override for various lifecycle scripts.
@@ -33,7 +35,11 @@ const { checkPort, checkVersion, checkString } = require( './validate-config' );
module.exports = function getConfigFromEnvironmentVars( cacheDirectoryPath ) {
const environmentConfig = {
port: getPortFromEnvironmentVariable( 'WP_ENV_PORT' ),
+ mysqlPort: getPortFromEnvironmentVariable( 'WP_ENV_MYSQL_PORT' ),
testsPort: getPortFromEnvironmentVariable( 'WP_ENV_TESTS_PORT' ),
+ testsMysqlPort: getPortFromEnvironmentVariable(
+ 'WP_ENV_TESTS_MYSQL_PORT'
+ ),
lifecycleScripts: getLifecycleScriptOverrides(),
};
diff --git a/packages/env/lib/config/parse-config.js b/packages/env/lib/config/parse-config.js
index 5da05396ec468c..30125951b1ac89 100644
--- a/packages/env/lib/config/parse-config.js
+++ b/packages/env/lib/config/parse-config.js
@@ -50,6 +50,7 @@ const mergeConfigs = require( './merge-configs' );
* @property {WPSource[]} pluginSources Plugins to load in the environment.
* @property {WPSource[]} themeSources Themes to load in the environment.
* @property {number} port The port to use.
+ * @property {number} mysqlPort The port to use for MySQL. Random if empty.
* @property {Object} config Mapping of wp-config.php constants to their desired values.
* @property {Object.} mappings Mapping of WordPress directories to local directories which should be mounted.
* @property {string|null} phpVersion Version of PHP to use in the environments, of the format 0.0.
@@ -85,6 +86,7 @@ const DEFAULT_ENVIRONMENT_CONFIG = {
themes: [],
port: 8888,
testsPort: 8889,
+ mysqlPort: null,
mappings: {},
config: {
FS_METHOD: 'direct',
@@ -276,11 +278,19 @@ function getEnvironmentVarOverrides( cacheDirectoryPath ) {
overrideConfig.env.development.port = overrides.port;
}
+ if ( overrides.mysqlPort ) {
+ overrideConfig.env.development.mysqlPort = overrides.mysqlPort;
+ }
+
if ( overrides.testsPort ) {
overrideConfig.testsPort = overrides.testsPort;
overrideConfig.env.tests.port = overrides.testsPort;
}
+ if ( overrides.testsMysqlPort ) {
+ overrideConfig.env.tests.mysqlPort = overrides.testsMysqlPort;
+ }
+
if ( overrides.coreSource ) {
overrideConfig.coreSource = overrides.coreSource;
overrideConfig.env.development.coreSource = overrides.coreSource;
@@ -436,6 +446,10 @@ async function parseEnvironmentConfig(
parsedConfig.port = config.port;
}
+ if ( config.mysqlPort !== undefined ) {
+ parsedConfig.mysqlPort = config.mysqlPort;
+ }
+
if ( config.phpVersion !== undefined ) {
// Support null as a valid input.
if ( config.phpVersion !== null ) {
diff --git a/packages/env/lib/config/test/__snapshots__/config-integration.js.snap b/packages/env/lib/config/test/__snapshots__/config-integration.js.snap
index 53a2d652c740fd..6c3618f4724cb0 100644
--- a/packages/env/lib/config/test/__snapshots__/config-integration.js.snap
+++ b/packages/env/lib/config/test/__snapshots__/config-integration.js.snap
@@ -29,6 +29,7 @@ exports[`Config Integration should load local and override configuration files 1
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 23306,
"phpVersion": null,
"pluginSources": [],
"port": 999,
@@ -57,6 +58,7 @@ exports[`Config Integration should load local and override configuration files 1
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 23307,
"phpVersion": null,
"pluginSources": [],
"port": 456,
@@ -102,6 +104,7 @@ exports[`Config Integration should load local configuration file 1`] = `
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 13306,
"phpVersion": null,
"pluginSources": [],
"port": 123,
@@ -130,6 +133,7 @@ exports[`Config Integration should load local configuration file 1`] = `
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 23307,
"phpVersion": null,
"pluginSources": [],
"port": 8889,
@@ -175,6 +179,7 @@ exports[`Config Integration should use default configuration 1`] = `
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": null,
"phpVersion": null,
"pluginSources": [],
"port": 8888,
@@ -203,6 +208,7 @@ exports[`Config Integration should use default configuration 1`] = `
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": null,
"phpVersion": null,
"pluginSources": [],
"port": 8889,
@@ -248,6 +254,7 @@ exports[`Config Integration should use environment variables over local and over
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 23306,
"phpVersion": null,
"pluginSources": [],
"port": 12345,
@@ -277,6 +284,7 @@ exports[`Config Integration should use environment variables over local and over
"url": "https://github.com/WordPress/WordPress.git",
},
"mappings": {},
+ "mysqlPort": 23307,
"phpVersion": null,
"pluginSources": [],
"port": 61234,
diff --git a/packages/env/lib/config/test/config-integration.js b/packages/env/lib/config/test/config-integration.js
index a6728f91200f11..8ab2897da7ff4f 100644
--- a/packages/env/lib/config/test/config-integration.js
+++ b/packages/env/lib/config/test/config-integration.js
@@ -48,7 +48,9 @@ describe( 'Config Integration', () => {
afterEach( () => {
delete process.env.WP_ENV_HOME;
delete process.env.WP_ENV_PORT;
+ delete process.env.WP_ENV_MYSQL_PORT;
delete process.env.WP_ENV_TESTS_PORT;
+ delete process.env.WP_ENV_TESTS_MYSQL_PORT;
delete process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START;
} );
@@ -61,6 +63,8 @@ describe( 'Config Integration', () => {
expect( config.env.development.port ).toEqual( 8888 );
expect( config.env.tests.port ).toEqual( 8889 );
+ expect( config.env.development.mysqlPort ).toEqual( null );
+ expect( config.env.tests.mysqlPort ).toEqual( null );
expect( config ).toMatchSnapshot();
} );
@@ -75,6 +79,14 @@ describe( 'Config Integration', () => {
afterClean: null,
afterDestroy: null,
},
+ env: {
+ development: {
+ mysqlPort: 13306,
+ },
+ tests: {
+ mysqlPort: 23307,
+ },
+ },
} );
}
@@ -85,6 +97,8 @@ describe( 'Config Integration', () => {
expect( config.env.development.port ).toEqual( 123 );
expect( config.env.tests.port ).toEqual( 8889 );
+ expect( config.env.development.mysqlPort ).toEqual( 13306 );
+ expect( config.env.tests.mysqlPort ).toEqual( 23307 );
expect( config ).toMatchSnapshot();
} );
@@ -100,6 +114,11 @@ describe( 'Config Integration', () => {
afterClean: null,
afterDestroy: null,
},
+ env: {
+ tests: {
+ mysqlPort: 13306,
+ },
+ },
} );
}
@@ -111,6 +130,14 @@ describe( 'Config Integration', () => {
afterClean: null,
afterDestroy: 'test',
},
+ env: {
+ development: {
+ mysqlPort: 23306,
+ },
+ tests: {
+ mysqlPort: 23307,
+ },
+ },
} );
}
@@ -121,12 +148,16 @@ describe( 'Config Integration', () => {
expect( config.env.development.port ).toEqual( 999 );
expect( config.env.tests.port ).toEqual( 456 );
+ expect( config.env.development.mysqlPort ).toEqual( 23306 );
+ expect( config.env.tests.mysqlPort ).toEqual( 23307 );
expect( config ).toMatchSnapshot();
} );
it( 'should use environment variables over local and override configuration files', async () => {
process.env.WP_ENV_PORT = 12345;
+ process.env.WP_ENV_MYSQL_PORT = 23306;
process.env.WP_ENV_TESTS_PORT = 61234;
+ process.env.WP_ENV_TESTS_MYSQL_PORT = 23307;
process.env.WP_ENV_LIFECYCLE_SCRIPT_AFTER_START = 'test';
readFile.mockImplementation( async ( fileName ) => {
@@ -140,6 +171,11 @@ describe( 'Config Integration', () => {
afterClean: null,
afterDestroy: null,
},
+ env: {
+ tests: {
+ mysqlPort: 13306,
+ },
+ },
} );
}
@@ -156,6 +192,8 @@ describe( 'Config Integration', () => {
expect( config.env.development.port ).toEqual( 12345 );
expect( config.env.tests.port ).toEqual( 61234 );
+ expect( config.env.development.mysqlPort ).toEqual( 23306 );
+ expect( config.env.tests.mysqlPort ).toEqual( 23307 );
expect( config.lifecycleScripts ).toHaveProperty(
'afterStart',
'test'
diff --git a/packages/env/lib/config/test/parse-config.js b/packages/env/lib/config/test/parse-config.js
index f2e9b923d7fdcd..c1b01df9d8d884 100644
--- a/packages/env/lib/config/test/parse-config.js
+++ b/packages/env/lib/config/test/parse-config.js
@@ -21,6 +21,7 @@ jest.mock( '../../wordpress', () => ( {
const DEFAULT_CONFIG = {
port: 8888,
testsPort: 8889,
+ mysqlPort: null,
phpVersion: null,
coreSource: {
type: 'git',
diff --git a/packages/env/package.json b/packages/env/package.json
index 9604ededadca45..165ff57790fba2 100644
--- a/packages/env/package.json
+++ b/packages/env/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/env",
- "version": "9.10.0",
+ "version": "10.0.0",
"description": "A zero-config, self contained local WordPress environment for development and testing.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/escape-html/CHANGELOG.md b/packages/escape-html/CHANGELOG.md
index 9917b2eeadff4b..2562662aa2ce91 100644
--- a/packages/escape-html/CHANGELOG.md
+++ b/packages/escape-html/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/escape-html/package.json b/packages/escape-html/package.json
index 318bf847b8d292..35cf1e8c286957 100644
--- a/packages/escape-html/package.json
+++ b/packages/escape-html/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/escape-html",
- "version": "2.58.0",
+ "version": "3.0.0",
"description": "Escape HTML utils.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index 6d3791ba7c7a6a..816140ed76900b 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 19.0.0 (2024-05-31)
+
### Breaking Changes
- `@wordpress/is-gutenberg-plugin` rule has been replaced by `@wordpress/wp-global-usage` ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 0709fdee582c99..8cf48275fbe884 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/eslint-plugin",
- "version": "18.1.0",
+ "version": "19.0.0",
"description": "ESLint plugin for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/format-library/CHANGELOG.md b/packages/format-library/CHANGELOG.md
index 4156282600a4b4..8f73bad3fcad36 100644
--- a/packages/format-library/CHANGELOG.md
+++ b/packages/format-library/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/format-library/package.json b/packages/format-library/package.json
index 46d38ee6441128..5582be09668464 100644
--- a/packages/format-library/package.json
+++ b/packages/format-library/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/format-library",
- "version": "4.35.0",
+ "version": "5.0.0",
"description": "Format library for the WordPress editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md
index 2d918d78d571c4..c92c344893f368 100644
--- a/packages/hooks/CHANGELOG.md
+++ b/packages/hooks/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/hooks/package.json b/packages/hooks/package.json
index 7c654b1356a0de..06779db3d042de 100644
--- a/packages/hooks/package.json
+++ b/packages/hooks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/hooks",
- "version": "3.58.0",
+ "version": "4.0.0",
"description": "WordPress hooks library.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/html-entities/CHANGELOG.md b/packages/html-entities/CHANGELOG.md
index 205d3f03a8ca7c..b970e05f95faa7 100644
--- a/packages/html-entities/CHANGELOG.md
+++ b/packages/html-entities/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/html-entities/package.json b/packages/html-entities/package.json
index 5ef035763394ce..2cb96e17a6270c 100644
--- a/packages/html-entities/package.json
+++ b/packages/html-entities/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/html-entities",
- "version": "3.58.0",
+ "version": "4.0.0",
"description": "HTML entity utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/i18n/CHANGELOG.md b/packages/i18n/CHANGELOG.md
index 993d8758c8d27d..55a6a848950dfc 100644
--- a/packages/i18n/CHANGELOG.md
+++ b/packages/i18n/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/i18n/package.json b/packages/i18n/package.json
index da0c793d4f6092..b6ec0f47c1f9b0 100644
--- a/packages/i18n/package.json
+++ b/packages/i18n/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/i18n",
- "version": "4.58.0",
+ "version": "5.0.0",
"description": "WordPress internationalization (i18n) library.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/icons/CHANGELOG.md b/packages/icons/CHANGELOG.md
index ff3eece680666b..485fdaed579965 100644
--- a/packages/icons/CHANGELOG.md
+++ b/packages/icons/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 10.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/icons/package.json b/packages/icons/package.json
index 0d3024b83557a7..f3912559bb7101 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/icons",
- "version": "9.49.0",
+ "version": "10.0.0",
"description": "WordPress Icons package, based on dashicon.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interactivity-router/CHANGELOG.md b/packages/interactivity-router/CHANGELOG.md
index d17d6f834b6460..a7e6f5060b6023 100644
--- a/packages/interactivity-router/CHANGELOG.md
+++ b/packages/interactivity-router/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/interactivity-router/package.json b/packages/interactivity-router/package.json
index a109c3031d2446..a2ed315c7d1856 100644
--- a/packages/interactivity-router/package.json
+++ b/packages/interactivity-router/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/interactivity-router",
- "version": "1.8.0",
+ "version": "2.0.0",
"description": "Package that exposes state and actions from the `core/router` store, part of the Interactivity API.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interactivity/CHANGELOG.md b/packages/interactivity/CHANGELOG.md
index cf80324d09d35e..6154841c1db2c4 100644
--- a/packages/interactivity/CHANGELOG.md
+++ b/packages/interactivity/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### New Features
- Introduce `wp-on-async` directive as performant alternative over synchronous `wp-on` directive. ([#61885](https://github.com/WordPress/gutenberg/pull/61885))
diff --git a/packages/interactivity/package.json b/packages/interactivity/package.json
index 6a5413108768e3..0b18d2ced29197 100644
--- a/packages/interactivity/package.json
+++ b/packages/interactivity/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/interactivity",
- "version": "5.7.0",
+ "version": "6.0.0",
"description": "Package that provides a standard and simple way to handle the frontend interactivity of Gutenberg blocks.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interactivity/src/directives.tsx b/packages/interactivity/src/directives.tsx
index a4a320eda57f02..a013d442166897 100644
--- a/packages/interactivity/src/directives.tsx
+++ b/packages/interactivity/src/directives.tsx
@@ -632,5 +632,5 @@ export default () => {
{ priority: 20 }
);
- directive( 'each-child', () => null );
+ directive( 'each-child', () => null, { priority: 1 } );
};
diff --git a/packages/interactivity/src/store.ts b/packages/interactivity/src/store.ts
index f6366283d2d6a9..281a6c266021e1 100644
--- a/packages/interactivity/src/store.ts
+++ b/packages/interactivity/src/store.ts
@@ -321,7 +321,9 @@ export function store(
export const parseInitialData = ( dom = document ) => {
const jsonDataScriptTag =
// Preferred Script Module data passing form
- dom.getElementById( 'wp-scriptmodule-data_@wordpress/interactivity' ) ??
+ dom.getElementById(
+ 'wp-script-module-data-@wordpress/interactivity'
+ ) ??
// Legacy form
dom.getElementById( 'wp-interactivity-data' );
if ( jsonDataScriptTag?.textContent ) {
diff --git a/packages/interface/CHANGELOG.md b/packages/interface/CHANGELOG.md
index c423c206747b83..108bac3e369670 100644
--- a/packages/interface/CHANGELOG.md
+++ b/packages/interface/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/interface/package.json b/packages/interface/package.json
index 7fe5f3b2686493..a8ad016a5dc21f 100644
--- a/packages/interface/package.json
+++ b/packages/interface/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/interface",
- "version": "5.35.0",
+ "version": "6.0.0",
"description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/interface/src/components/interface-skeleton/index.js b/packages/interface/src/components/interface-skeleton/index.js
index 81d95a97602737..ed4d98cdf7637f 100644
--- a/packages/interface/src/components/interface-skeleton/index.js
+++ b/packages/interface/src/components/interface-skeleton/index.js
@@ -81,7 +81,6 @@ function InterfaceSkeleton(
editorNotices,
sidebar,
secondarySidebar,
- notices,
content,
actions,
labels,
@@ -210,11 +209,6 @@ function InterfaceSkeleton(
) }
- { !! notices && (
-
- { notices }
-
- ) }
{
container.className = 'list-reusable-blocks__container';
button.parentNode.insertBefore( container, button );
createRoot( container ).render(
-
+
+
+
);
} );
diff --git a/packages/media-utils/CHANGELOG.md b/packages/media-utils/CHANGELOG.md
index 8f65e32becda16..f9ad3a6b77b42a 100644
--- a/packages/media-utils/CHANGELOG.md
+++ b/packages/media-utils/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json
index 1d200320c4b65f..1ca36aa6fd1a82 100644
--- a/packages/media-utils/package.json
+++ b/packages/media-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/media-utils",
- "version": "4.49.0",
+ "version": "5.0.0",
"description": "WordPress Media Upload Utils.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/media-utils/src/components/media-upload/index.js b/packages/media-utils/src/components/media-upload/index.js
index 732a9bcabd79fc..91de011869ad38 100644
--- a/packages/media-utils/src/components/media-upload/index.js
+++ b/packages/media-utils/src/components/media-upload/index.js
@@ -400,6 +400,8 @@ class MediaUpload extends Component {
if ( onClose ) {
onClose();
}
+
+ this.frame.detach();
}
updateCollection() {
diff --git a/packages/notices/CHANGELOG.md b/packages/notices/CHANGELOG.md
index 5d7ea51ecb3391..3a847355bd0a82 100644
--- a/packages/notices/CHANGELOG.md
+++ b/packages/notices/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/notices/package.json b/packages/notices/package.json
index 664077d36e5390..abcbb6ecfba2d5 100644
--- a/packages/notices/package.json
+++ b/packages/notices/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/notices",
- "version": "4.26.0",
+ "version": "5.0.0",
"description": "State management for notices.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/npm-package-json-lint-config/CHANGELOG.md b/packages/npm-package-json-lint-config/CHANGELOG.md
index 7c4ebdb06735d3..09ee8912592a09 100644
--- a/packages/npm-package-json-lint-config/CHANGELOG.md
+++ b/packages/npm-package-json-lint-config/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/npm-package-json-lint-config/package.json b/packages/npm-package-json-lint-config/package.json
index be03f5633db857..71e584477d5cb2 100644
--- a/packages/npm-package-json-lint-config/package.json
+++ b/packages/npm-package-json-lint-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/npm-package-json-lint-config",
- "version": "4.43.0",
+ "version": "5.0.0",
"description": "WordPress npm-package-json-lint shareable configuration.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/nux/CHANGELOG.md b/packages/nux/CHANGELOG.md
index d1be7f5513b903..9141ca8ee3b278 100644
--- a/packages/nux/CHANGELOG.md
+++ b/packages/nux/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 9.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/nux/package.json b/packages/nux/package.json
index e06ecb5c0ad675..d2c760a6cf1aae 100644
--- a/packages/nux/package.json
+++ b/packages/nux/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/nux",
- "version": "8.20.0",
+ "version": "9.0.0",
"description": "NUX (New User eXperience) module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/patterns/CHANGELOG.md b/packages/patterns/CHANGELOG.md
index eb2cdc1661c97d..1519a8164fe29a 100644
--- a/packages/patterns/CHANGELOG.md
+++ b/packages/patterns/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/patterns/package.json b/packages/patterns/package.json
index cf214377d61b0e..b14c3739e31751 100644
--- a/packages/patterns/package.json
+++ b/packages/patterns/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/patterns",
- "version": "1.19.0",
+ "version": "2.0.0",
"description": "Management of user pattern editing.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/patterns/src/api/index.js b/packages/patterns/src/api/index.js
index 448001f891fbae..4321dc4262145a 100644
--- a/packages/patterns/src/api/index.js
+++ b/packages/patterns/src/api/index.js
@@ -22,3 +22,19 @@ export function isOverridableBlock( block ) {
)
);
}
+
+/**
+ * Determines whether the blocks list has overridable blocks.
+ *
+ * @param {WPBlock[]} blocks The blocks list.
+ *
+ * @return {boolean} `true` if the list has overridable blocks, `false` otherwise.
+ */
+export function hasOverridableBlocks( blocks ) {
+ return blocks.some( ( block ) => {
+ if ( isOverridableBlock( block ) ) {
+ return true;
+ }
+ return hasOverridableBlocks( block.innerBlocks );
+ } );
+}
diff --git a/packages/patterns/src/components/pattern-overrides-controls.js b/packages/patterns/src/components/pattern-overrides-controls.js
index 3ece910a0df47c..9869c5b072c856 100644
--- a/packages/patterns/src/components/pattern-overrides-controls.js
+++ b/packages/patterns/src/components/pattern-overrides-controls.js
@@ -9,66 +9,48 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
-import {
- PARTIAL_SYNCING_SUPPORTED_BLOCKS,
- PATTERN_OVERRIDES_BINDING_SOURCE,
-} from '../constants';
+import { PATTERN_OVERRIDES_BINDING_SOURCE } from '../constants';
import {
AllowOverridesModal,
DisallowOverridesModal,
} from './allow-overrides-modal';
-function removeBindings( bindings, syncedAttributes ) {
- let updatedBindings = {};
- for ( const attributeName of syncedAttributes ) {
- // Omit any bindings that's not the same source from the `updatedBindings` object.
- if (
- bindings?.[ attributeName ]?.source !==
- PATTERN_OVERRIDES_BINDING_SOURCE &&
- bindings?.[ attributeName ]?.source !== undefined
- ) {
- updatedBindings[ attributeName ] = bindings[ attributeName ];
- }
- }
+function removeBindings( bindings ) {
+ let updatedBindings = { ...bindings };
+ delete updatedBindings.__default;
if ( ! Object.keys( updatedBindings ).length ) {
updatedBindings = undefined;
}
return updatedBindings;
}
-function addBindings( bindings, syncedAttributes ) {
- const updatedBindings = { ...bindings };
- for ( const attributeName of syncedAttributes ) {
- if ( ! bindings?.[ attributeName ] ) {
- updatedBindings[ attributeName ] = {
- source: PATTERN_OVERRIDES_BINDING_SOURCE,
- };
- }
- }
- return updatedBindings;
+function addBindings( bindings ) {
+ return {
+ ...bindings,
+ __default: { source: PATTERN_OVERRIDES_BINDING_SOURCE },
+ };
}
-function PatternOverridesControls( { attributes, name, setAttributes } ) {
+function PatternOverridesControls( { attributes, setAttributes } ) {
const controlId = useId();
const [ showAllowOverridesModal, setShowAllowOverridesModal ] =
useState( false );
const [ showDisallowOverridesModal, setShowDisallowOverridesModal ] =
useState( false );
- const syncedAttributes = PARTIAL_SYNCING_SUPPORTED_BLOCKS[ name ];
- const attributeSources = syncedAttributes.map(
- ( attributeName ) =>
- attributes.metadata?.bindings?.[ attributeName ]?.source
- );
- const isConnectedToOtherSources = attributeSources.every(
- ( source ) => source && source !== 'core/pattern-overrides'
- );
+ const hasName = !! attributes.metadata?.name;
+ const defaultBindings = attributes.metadata?.bindings?.__default;
+ const allowOverrides =
+ hasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;
+ const isConnectedToOtherSources =
+ defaultBindings?.source &&
+ defaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;
function updateBindings( isChecked, customName ) {
const prevBindings = attributes?.metadata?.bindings;
const updatedBindings = isChecked
- ? addBindings( prevBindings, syncedAttributes )
- : removeBindings( prevBindings, syncedAttributes );
+ ? addBindings( prevBindings )
+ : removeBindings( prevBindings );
const updatedMetadata = {
...attributes.metadata,
@@ -89,13 +71,6 @@ function PatternOverridesControls( { attributes, name, setAttributes } ) {
return null;
}
- const hasName = !! attributes.metadata?.name;
- const allowOverrides =
- hasName &&
- attributeSources.some(
- ( source ) => source === PATTERN_OVERRIDES_BINDING_SOURCE
- );
-
return (
<>
diff --git a/packages/patterns/src/private-apis.js b/packages/patterns/src/private-apis.js
index 05417de2b2c669..0553378cb56043 100644
--- a/packages/patterns/src/private-apis.js
+++ b/packages/patterns/src/private-apis.js
@@ -11,7 +11,7 @@ import {
default as DuplicatePatternModal,
useDuplicatePatternProps,
} from './components/duplicate-pattern-modal';
-import { isOverridableBlock } from './api';
+import { isOverridableBlock, hasOverridableBlocks } from './api';
import RenamePatternModal from './components/rename-pattern-modal';
import PatternsMenuItems from './components';
import RenamePatternCategoryModal from './components/rename-pattern-category-modal';
@@ -34,6 +34,7 @@ lock( privateApis, {
CreatePatternModalContents,
DuplicatePatternModal,
isOverridableBlock,
+ hasOverridableBlocks,
useDuplicatePatternProps,
RenamePatternModal,
PatternsMenuItems,
diff --git a/packages/plugins/CHANGELOG.md b/packages/plugins/CHANGELOG.md
index ae572061e64bcc..5ba4ad33c6a745 100644
--- a/packages/plugins/CHANGELOG.md
+++ b/packages/plugins/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 7.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/plugins/package.json b/packages/plugins/package.json
index 43b5877c4448e3..5747c0d6d889cf 100644
--- a/packages/plugins/package.json
+++ b/packages/plugins/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/plugins",
- "version": "6.26.0",
+ "version": "7.0.0",
"description": "Plugins module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/postcss-plugins-preset/CHANGELOG.md b/packages/postcss-plugins-preset/CHANGELOG.md
index 49fc5ca3da5322..35fa13f05ab1df 100644
--- a/packages/postcss-plugins-preset/CHANGELOG.md
+++ b/packages/postcss-plugins-preset/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/postcss-plugins-preset/package.json b/packages/postcss-plugins-preset/package.json
index d3891d679e04a1..a8954e0ec9cbc1 100644
--- a/packages/postcss-plugins-preset/package.json
+++ b/packages/postcss-plugins-preset/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/postcss-plugins-preset",
- "version": "4.42.0",
+ "version": "5.0.0",
"description": "PostCSS sharable plugins preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/postcss-themes/CHANGELOG.md b/packages/postcss-themes/CHANGELOG.md
index d6b1cfadd0ca28..cf32c7f744931c 100644
--- a/packages/postcss-themes/CHANGELOG.md
+++ b/packages/postcss-themes/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/postcss-themes/package.json b/packages/postcss-themes/package.json
index 028a1967bbcfb1..eddfdecb3d0522 100644
--- a/packages/postcss-themes/package.json
+++ b/packages/postcss-themes/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/postcss-themes",
- "version": "5.41.0",
+ "version": "6.0.0",
"description": "PostCSS plugin to generate theme colors.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/preferences-persistence/CHANGELOG.md b/packages/preferences-persistence/CHANGELOG.md
index 78035788442653..6c7af3085d8378 100644
--- a/packages/preferences-persistence/CHANGELOG.md
+++ b/packages/preferences-persistence/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/preferences-persistence/package.json b/packages/preferences-persistence/package.json
index a7d73fbc0df100..a250930699aec4 100644
--- a/packages/preferences-persistence/package.json
+++ b/packages/preferences-persistence/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/preferences-persistence",
- "version": "1.50.0",
+ "version": "2.0.0",
"description": "Persistence utilities for `wordpress/preferences`.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/preferences/CHANGELOG.md b/packages/preferences/CHANGELOG.md
index 70095e3a329f5c..54778a68a2ce1b 100644
--- a/packages/preferences/CHANGELOG.md
+++ b/packages/preferences/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/preferences/package.json b/packages/preferences/package.json
index c6d2347ba9723f..5b3e520ea96e8c 100644
--- a/packages/preferences/package.json
+++ b/packages/preferences/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/preferences",
- "version": "3.35.0",
+ "version": "4.0.0",
"description": "Utilities for managing WordPress preferences.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/prettier-config/CHANGELOG.md b/packages/prettier-config/CHANGELOG.md
index 86e0a52d5e518f..a3e735502062d2 100644
--- a/packages/prettier-config/CHANGELOG.md
+++ b/packages/prettier-config/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/prettier-config/package.json b/packages/prettier-config/package.json
index dd7604f0c3d61a..56e4a530ec2767 100644
--- a/packages/prettier-config/package.json
+++ b/packages/prettier-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/prettier-config",
- "version": "3.15.0",
+ "version": "4.0.0",
"description": "WordPress Prettier shared configuration.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/primitives/CHANGELOG.md b/packages/primitives/CHANGELOG.md
index 8f5c66d8e810c3..95093af2921921 100644
--- a/packages/primitives/CHANGELOG.md
+++ b/packages/primitives/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/primitives/package.json b/packages/primitives/package.json
index 96a450e99ecc00..f47b368097470d 100644
--- a/packages/primitives/package.json
+++ b/packages/primitives/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/primitives",
- "version": "3.56.0",
+ "version": "4.0.0",
"description": "WordPress cross-platform primitives.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/priority-queue/CHANGELOG.md b/packages/priority-queue/CHANGELOG.md
index 3a4df3e85ee90a..ebc0c6501bcdb8 100644
--- a/packages/priority-queue/CHANGELOG.md
+++ b/packages/priority-queue/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/priority-queue/package.json b/packages/priority-queue/package.json
index 236a48c796dc37..a544c61f217d6b 100644
--- a/packages/priority-queue/package.json
+++ b/packages/priority-queue/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/priority-queue",
- "version": "2.58.0",
+ "version": "3.0.0",
"description": "Generic browser priority queue.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/private-apis/CHANGELOG.md b/packages/private-apis/CHANGELOG.md
index c70924a8a33be5..d10d7d73cd78f9 100644
--- a/packages/private-apis/CHANGELOG.md
+++ b/packages/private-apis/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 1.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/private-apis/package.json b/packages/private-apis/package.json
index ea2e33468cd35a..307c4f021e7612 100644
--- a/packages/private-apis/package.json
+++ b/packages/private-apis/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/private-apis",
- "version": "0.40.0",
+ "version": "1.0.0",
"description": "Internal experimental APIs for WordPress core.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/project-management-automation/CHANGELOG.md b/packages/project-management-automation/CHANGELOG.md
index b1d801f3f93ae3..6794a20720a5cb 100644
--- a/packages/project-management-automation/CHANGELOG.md
+++ b/packages/project-management-automation/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/project-management-automation/package.json b/packages/project-management-automation/package.json
index 118acb3faadc49..d0741b4c4e094d 100644
--- a/packages/project-management-automation/package.json
+++ b/packages/project-management-automation/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/project-management-automation",
- "version": "1.57.0",
+ "version": "2.0.0",
"description": "GitHub Action that implements various automation to assist with managing the Gutenberg GitHub repository.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/react-i18n/CHANGELOG.md b/packages/react-i18n/CHANGELOG.md
index 7b62c13efebfda..2d547d0335f644 100644
--- a/packages/react-i18n/CHANGELOG.md
+++ b/packages/react-i18n/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json
index 51346a5af7c9f5..89f7a763b4b8df 100644
--- a/packages/react-i18n/package.json
+++ b/packages/react-i18n/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/react-i18n",
- "version": "3.56.0",
+ "version": "4.0.0",
"description": "React bindings for @wordpress/i18n.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md
index 7e7e9afba41858..44f5b63bd1f4d0 100644
--- a/packages/react-native-editor/CHANGELOG.md
+++ b/packages/react-native-editor/CHANGELOG.md
@@ -15,6 +15,10 @@ For each user feature we should also add a importance categorization label to i
- [*] Prevent deleting content when backspacing in the first Paragraph block [#62069]
- [internal] Adds new bridge functionality for updating content [#61796]
+## 1.119.1
+- [*] Image corrector - Check the path extension is a valid one [#62190]
+- [*] Unsupported block - UI improvements [#62240]
+
## 1.119.0
- [internal] Remove circular dependencies within the components package [#61102]
- [internal] Upgrade target sdk version to Android API 34 [#61727]
diff --git a/packages/readable-js-assets-webpack-plugin/CHANGELOG.md b/packages/readable-js-assets-webpack-plugin/CHANGELOG.md
index e9be2ae8ae3d4a..121831aa851bf6 100644
--- a/packages/readable-js-assets-webpack-plugin/CHANGELOG.md
+++ b/packages/readable-js-assets-webpack-plugin/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/readable-js-assets-webpack-plugin/package.json b/packages/readable-js-assets-webpack-plugin/package.json
index 05d962b3708767..29e3ce5562847d 100644
--- a/packages/readable-js-assets-webpack-plugin/package.json
+++ b/packages/readable-js-assets-webpack-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/readable-js-assets-webpack-plugin",
- "version": "2.41.0",
+ "version": "3.0.0",
"description": "Generate a readable JS file for each JS asset.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/redux-routine/CHANGELOG.md b/packages/redux-routine/CHANGELOG.md
index af1d1e080c214d..2fc48dbef19025 100644
--- a/packages/redux-routine/CHANGELOG.md
+++ b/packages/redux-routine/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json
index 8d13c9dfc18b44..b423accef8f0a8 100644
--- a/packages/redux-routine/package.json
+++ b/packages/redux-routine/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/redux-routine",
- "version": "4.58.0",
+ "version": "5.0.0",
"description": "Redux middleware for generator coroutines.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/reusable-blocks/CHANGELOG.md b/packages/reusable-blocks/CHANGELOG.md
index 6297ea5d7a1b15..5a89e64ba8c46e 100644
--- a/packages/reusable-blocks/CHANGELOG.md
+++ b/packages/reusable-blocks/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/reusable-blocks/package.json b/packages/reusable-blocks/package.json
index ae584e75ed184a..d496eded1a7537 100644
--- a/packages/reusable-blocks/package.json
+++ b/packages/reusable-blocks/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/reusable-blocks",
- "version": "4.35.0",
+ "version": "5.0.0",
"description": "Reusable blocks utilities.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/rich-text/CHANGELOG.md b/packages/rich-text/CHANGELOG.md
index 81d23a43f25a36..1fae202db5fc0d 100644
--- a/packages/rich-text/CHANGELOG.md
+++ b/packages/rich-text/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 7.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/rich-text/package.json b/packages/rich-text/package.json
index 546b5926c65f85..c823d1018009fd 100644
--- a/packages/rich-text/package.json
+++ b/packages/rich-text/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/rich-text",
- "version": "6.35.0",
+ "version": "7.0.0",
"description": "Rich text value and manipulation API.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md
index 528201ee2c5664..b05dda0cca2b23 100644
--- a/packages/router/CHANGELOG.md
+++ b/packages/router/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 1.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/router/package.json b/packages/router/package.json
index bcdb1fb3d79043..2b0f84aac06cc1 100644
--- a/packages/router/package.json
+++ b/packages/router/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/router",
- "version": "0.27.0",
+ "version": "1.0.0",
"description": "Router API for WordPress pages.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md
index 3e1bfb09f679c9..470929fd0628a2 100644
--- a/packages/scripts/CHANGELOG.md
+++ b/packages/scripts/CHANGELOG.md
@@ -2,9 +2,13 @@
## Unreleased
+## 28.0.0 (2024-05-31)
+
### Breaking Changes
-- Use React's automatic runtime to transform JSX ([#61692](https://github.com/WordPress/gutenberg/pull/61692)).
+**Note** If you're using @wordpress/scripts for building JS scripts to target WordPress 6.5 or earlier, you should not upgrade to this version and continue using @wordpress/scripts@27.
+
+- Use React's automatic runtime to transform JSX ([#61692](https://github.com/WordPress/gutenberg/pull/61692)).
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/scripts/package.json b/packages/scripts/package.json
index e8b03804e8662d..6fe707ec9571c9 100644
--- a/packages/scripts/package.json
+++ b/packages/scripts/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/scripts",
- "version": "27.9.0",
+ "version": "28.0.0",
"description": "Collection of reusable scripts for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/server-side-render/CHANGELOG.md b/packages/server-side-render/CHANGELOG.md
index 8a2867beb33071..23d8b8aa75353b 100644
--- a/packages/server-side-render/CHANGELOG.md
+++ b/packages/server-side-render/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 5.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/server-side-render/package.json b/packages/server-side-render/package.json
index d042cb4329efa3..e1d3d95e39a23a 100644
--- a/packages/server-side-render/package.json
+++ b/packages/server-side-render/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/server-side-render",
- "version": "4.35.0",
+ "version": "5.0.0",
"description": "The component used with WordPress to server-side render a preview of dynamic blocks to display in the editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/shortcode/CHANGELOG.md b/packages/shortcode/CHANGELOG.md
index 4cd5c9c886736e..bcb92c69a7ef4a 100644
--- a/packages/shortcode/CHANGELOG.md
+++ b/packages/shortcode/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/shortcode/package.json b/packages/shortcode/package.json
index 2c227eb976bf1b..baeb4000c0420c 100644
--- a/packages/shortcode/package.json
+++ b/packages/shortcode/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/shortcode",
- "version": "3.58.0",
+ "version": "4.0.0",
"description": "Shortcode module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/style-engine/CHANGELOG.md b/packages/style-engine/CHANGELOG.md
index 8e9bcaebfb4509..006fc960398b6a 100644
--- a/packages/style-engine/CHANGELOG.md
+++ b/packages/style-engine/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 2.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/style-engine/package.json b/packages/style-engine/package.json
index 008f58cf729e85..9ebe2800e1b411 100644
--- a/packages/style-engine/package.json
+++ b/packages/style-engine/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/style-engine",
- "version": "1.41.0",
+ "version": "2.0.0",
"description": "A suite of parsers and compilers for WordPress styles.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/stylelint-config/CHANGELOG.md b/packages/stylelint-config/CHANGELOG.md
index ee2aae030222e2..9c26f9efa6e03e 100644
--- a/packages/stylelint-config/CHANGELOG.md
+++ b/packages/stylelint-config/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 22.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json
index cae248d0d7164a..dbb0a0899b726b 100644
--- a/packages/stylelint-config/package.json
+++ b/packages/stylelint-config/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/stylelint-config",
- "version": "21.41.0",
+ "version": "22.0.0",
"description": "stylelint config for WordPress development.",
"author": "The WordPress Contributors",
"license": "MIT",
diff --git a/packages/sync/CHANGELOG.md b/packages/sync/CHANGELOG.md
index 16abed443cf820..b4c3d770142183 100644
--- a/packages/sync/CHANGELOG.md
+++ b/packages/sync/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 1.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/sync/package.json b/packages/sync/package.json
index f02019326e6649..3bda7acb0e1187 100644
--- a/packages/sync/package.json
+++ b/packages/sync/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/sync",
- "version": "0.20.0",
+ "version": "1.0.0",
"description": "Sync Data.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/token-list/CHANGELOG.md b/packages/token-list/CHANGELOG.md
index df5526e5d14495..3cd9c7e7aa5925 100644
--- a/packages/token-list/CHANGELOG.md
+++ b/packages/token-list/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/token-list/package.json b/packages/token-list/package.json
index f70b9cba52ae52..ee46c9f269c47e 100644
--- a/packages/token-list/package.json
+++ b/packages/token-list/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/token-list",
- "version": "2.58.0",
+ "version": "3.0.0",
"description": "Constructable, plain JavaScript DOMTokenList implementation, supporting non-browser runtimes.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/undo-manager/CHANGELOG.md b/packages/undo-manager/CHANGELOG.md
index 7882af9711a1a9..36e815bbe8e2ba 100644
--- a/packages/undo-manager/CHANGELOG.md
+++ b/packages/undo-manager/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 1.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/undo-manager/package.json b/packages/undo-manager/package.json
index 1fd6dfcd1a785d..ed4f4a8e6b9204 100644
--- a/packages/undo-manager/package.json
+++ b/packages/undo-manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/undo-manager",
- "version": "0.18.0",
+ "version": "1.0.0",
"description": "A small package to manage undo/redo.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/url/CHANGELOG.md b/packages/url/CHANGELOG.md
index 838566e7837ba9..172f881f369223 100644
--- a/packages/url/CHANGELOG.md
+++ b/packages/url/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/url/package.json b/packages/url/package.json
index cd747ae652239e..89d3e673254894 100644
--- a/packages/url/package.json
+++ b/packages/url/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/url",
- "version": "3.59.0",
+ "version": "4.0.0",
"description": "WordPress URL utilities.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/viewport/CHANGELOG.md b/packages/viewport/CHANGELOG.md
index 7763a587ea082b..7f3e15b09fc542 100644
--- a/packages/viewport/CHANGELOG.md
+++ b/packages/viewport/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 6.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/viewport/package.json b/packages/viewport/package.json
index 3c6dc5efd540c5..fe54fccb2ca496 100644
--- a/packages/viewport/package.json
+++ b/packages/viewport/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/viewport",
- "version": "5.35.0",
+ "version": "6.0.0",
"description": "Viewport module for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/warning/CHANGELOG.md b/packages/warning/CHANGELOG.md
index a10a7073d0a5a7..cfc8338f86c597 100644
--- a/packages/warning/CHANGELOG.md
+++ b/packages/warning/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 3.0.0 (2024-05-31)
+
### Breaking Changes
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
diff --git a/packages/warning/package.json b/packages/warning/package.json
index 5b4b7234e1f699..6052f207b0d3f9 100644
--- a/packages/warning/package.json
+++ b/packages/warning/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/warning",
- "version": "2.58.0",
+ "version": "3.0.0",
"description": "Warning utility for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/widgets/CHANGELOG.md b/packages/widgets/CHANGELOG.md
index c4833fefe258cf..3b318660859eb4 100644
--- a/packages/widgets/CHANGELOG.md
+++ b/packages/widgets/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/widgets/package.json b/packages/widgets/package.json
index d15ccd484e966f..cbbc3a928b9b4e 100644
--- a/packages/widgets/package.json
+++ b/packages/widgets/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/widgets",
- "version": "3.35.0",
+ "version": "4.0.0",
"description": "Functionality used by the widgets block editor in the Widgets screen and the Customizer.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/packages/wordcount/CHANGELOG.md b/packages/wordcount/CHANGELOG.md
index dd7f233b7cc9bb..73042aef093a31 100644
--- a/packages/wordcount/CHANGELOG.md
+++ b/packages/wordcount/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+## 4.0.0 (2024-05-31)
+
### Breaking Changes
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json
index b450c0ef55ff27..4bbda336f2eb75 100644
--- a/packages/wordcount/package.json
+++ b/packages/wordcount/package.json
@@ -1,6 +1,6 @@
{
"name": "@wordpress/wordcount",
- "version": "3.58.0",
+ "version": "4.0.0",
"description": "WordPress word count utility.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php
index f9e919e68f5a0d..bcf0d238400a08 100644
--- a/phpunit/class-wp-theme-json-test.php
+++ b/phpunit/class-wp-theme-json-test.php
@@ -503,6 +503,11 @@ public function test_get_stylesheet() {
),
),
),
+ 'core/media-text' => array(
+ 'typography' => array(
+ 'textAlign' => 'center',
+ ),
+ ),
'core/post-date' => array(
'color' => array(
'text' => '#123456',
@@ -547,7 +552,7 @@ public function test_get_stylesheet() {
);
$variables = ':root{--wp--preset--color--grey: grey;--wp--preset--gradient--custom-gradient: linear-gradient(135deg,rgba(0,0,0) 0%,rgb(0,0,0) 100%);--wp--preset--font-size--small: 14px;--wp--preset--font-size--big: 41px;--wp--preset--font-family--arial: Arial, serif;}.wp-block-group{--wp--custom--base-font: 16;--wp--custom--line-height--small: 1.2;--wp--custom--line-height--medium: 1.4;--wp--custom--line-height--large: 1.8;}';
- $styles = static::$base_styles . ':root :where(body){color: var(--wp--preset--color--grey);}:root :where(a:where(:not(.wp-element-button))){background-color: #333;color: #111;}:root :where(.wp-element-button, .wp-block-button__link){box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}:root :where(.wp-block-cover){min-height: unset;aspect-ratio: 16/9;}:root :where(.wp-block-group){background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;min-height: 50vh;padding: 24px;}:root :where(.wp-block-group a:where(:not(.wp-element-button))){color: #111;}:root :where(.wp-block-heading){color: #123456;}:root :where(.wp-block-heading a:where(:not(.wp-element-button))){background-color: #333;color: #111;font-size: 60px;}:root :where(.wp-block-post-date){color: #123456;}:root :where(.wp-block-post-date a:where(:not(.wp-element-button))){background-color: #777;color: #555;}:root :where(.wp-block-post-excerpt){column-count: 2;}:root :where(.wp-block-image){margin-bottom: 30px;}:root :where(.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder){border-top-left-radius: 10px;border-bottom-right-radius: 1em;}:root :where(.wp-block-image img, .wp-block-image .components-placeholder){filter: var(--wp--preset--duotone--custom-duotone);}';
+ $styles = static::$base_styles . ':root :where(body){color: var(--wp--preset--color--grey);}:root :where(a:where(:not(.wp-element-button))){background-color: #333;color: #111;}:root :where(.wp-element-button, .wp-block-button__link){box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.66);}:root :where(.wp-block-cover){min-height: unset;aspect-ratio: 16/9;}:root :where(.wp-block-group){background: var(--wp--preset--gradient--custom-gradient);border-radius: 10px;min-height: 50vh;padding: 24px;}:root :where(.wp-block-group a:where(:not(.wp-element-button))){color: #111;}:root :where(.wp-block-heading){color: #123456;}:root :where(.wp-block-heading a:where(:not(.wp-element-button))){background-color: #333;color: #111;font-size: 60px;}:root :where(.wp-block-media-text){text-align: center;}:root :where(.wp-block-post-date){color: #123456;}:root :where(.wp-block-post-date a:where(:not(.wp-element-button))){background-color: #777;color: #555;}:root :where(.wp-block-post-excerpt){column-count: 2;}:root :where(.wp-block-image){margin-bottom: 30px;}:root :where(.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder){border-top-left-radius: 10px;border-bottom-right-radius: 1em;}:root :where(.wp-block-image img, .wp-block-image .components-placeholder){filter: var(--wp--preset--duotone--custom-duotone);}';
$presets = '.has-grey-color{color: var(--wp--preset--color--grey) !important;}.has-grey-background-color{background-color: var(--wp--preset--color--grey) !important;}.has-grey-border-color{border-color: var(--wp--preset--color--grey) !important;}.has-custom-gradient-gradient-background{background: var(--wp--preset--gradient--custom-gradient) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-big-font-size{font-size: var(--wp--preset--font-size--big) !important;}.has-arial-font-family{font-family: var(--wp--preset--font-family--arial) !important;}';
$all = $variables . $styles . $presets;
@@ -3156,7 +3161,7 @@ public function test_get_editor_settings_blank() {
public function test_get_editor_settings_custom_units_can_be_disabled() {
add_theme_support( 'custom-units', array() );
- $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
+ $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_classic_theme_supports_block_editor_settings() );
remove_theme_support( 'custom-units' );
$expected = array(
@@ -3169,7 +3174,7 @@ public function test_get_editor_settings_custom_units_can_be_disabled() {
public function test_get_editor_settings_custom_units_can_be_enabled() {
add_theme_support( 'custom-units' );
- $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
+ $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_classic_theme_supports_block_editor_settings() );
remove_theme_support( 'custom-units' );
$expected = array(
@@ -3182,7 +3187,7 @@ public function test_get_editor_settings_custom_units_can_be_enabled() {
public function test_get_editor_settings_custom_units_can_be_filtered() {
add_theme_support( 'custom-units', 'rem', 'em' );
- $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
+ $actual = WP_Theme_JSON_Gutenberg::get_from_editor_settings( gutenberg_get_classic_theme_supports_block_editor_settings() );
remove_theme_support( 'custom-units' );
$expected = array(
diff --git a/schemas/json/block.json b/schemas/json/block.json
index 92bcecf90b9b60..0c036a6e05ffe6 100644
--- a/schemas/json/block.json
+++ b/schemas/json/block.json
@@ -640,6 +640,11 @@
}
}
]
+ },
+ "splitting": {
+ "type": "boolean",
+ "description": "This property indicates whether the block can split when the Enter key is pressed or when blocks are pasted.",
+ "default": false
}
},
"additionalProperties": true
diff --git a/storybook/stories/playground/with-undo-redo/index.js b/storybook/stories/playground/with-undo-redo/index.js
index 8bef2d184f8c59..c2b2781cd31e4f 100644
--- a/storybook/stories/playground/with-undo-redo/index.js
+++ b/storybook/stories/playground/with-undo-redo/index.js
@@ -49,12 +49,14 @@ export default function EditorWithUndoRedo() {
diff --git a/test/e2e/specs/editor/blocks/columns.spec.js b/test/e2e/specs/editor/blocks/columns.spec.js
index 8ddf7e9377ff20..e322a52eeba10b 100644
--- a/test/e2e/specs/editor/blocks/columns.spec.js
+++ b/test/e2e/specs/editor/blocks/columns.spec.js
@@ -40,7 +40,7 @@ test.describe( 'Columns', () => {
// Verify Column
const inserterOptions = page.locator(
- 'role=region[name="Block Library"i] >> role=option'
+ 'role=region[name="Block Library"i] >> .block-editor-inserter__insertable-blocks-at-selection >> role=option'
);
await expect( inserterOptions ).toHaveCount( 1 );
await expect( inserterOptions ).toHaveText( 'Column' );
diff --git a/test/e2e/specs/editor/blocks/links.spec.js b/test/e2e/specs/editor/blocks/links.spec.js
index 5686eaed0c83e5..02400fe9c9dd8a 100644
--- a/test/e2e/specs/editor/blocks/links.spec.js
+++ b/test/e2e/specs/editor/blocks/links.spec.js
@@ -235,7 +235,7 @@ test.describe( 'Links', () => {
// Change the URL.
// getByPlaceholder required in order to handle Link Control component
// managing focus onto other inputs within the control.
- await page.getByPlaceholder( 'Search or type url' ).fill( '' );
+ await page.getByPlaceholder( 'Search or type URL' ).fill( '' );
await page.keyboard.type( '/handbook' );
// Submit the link.
@@ -349,7 +349,7 @@ test.describe( 'Links', () => {
// Change the URL.
// getByPlaceholder required in order to handle Link Control component
// managing focus onto other inputs within the control.
- await page.getByPlaceholder( 'Search or type url' ).fill( '' );
+ await page.getByPlaceholder( 'Search or type URL' ).fill( '' );
await page.keyboard.type( '/handbook' );
// Submit the link.
@@ -679,7 +679,7 @@ test.describe( 'Links', () => {
// Change the URL.
// Note: getByPlaceholder required in order to handle Link Control component
// managing focus onto other inputs within the control.
- await linkPopover.getByPlaceholder( 'Search or type url' ).fill( '' );
+ await linkPopover.getByPlaceholder( 'Search or type URL' ).fill( '' );
await page.keyboard.type( 'wordpress.org' );
// Save the link.
diff --git a/test/e2e/specs/editor/plugins/child-blocks.spec.js b/test/e2e/specs/editor/plugins/child-blocks.spec.js
index b3073b70a5409a..0cd043c6a46105 100644
--- a/test/e2e/specs/editor/plugins/child-blocks.spec.js
+++ b/test/e2e/specs/editor/plugins/child-blocks.spec.js
@@ -48,9 +48,13 @@ test.describe( 'Child Blocks', () => {
const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
- const blockLibrary = page.getByRole( 'region', {
- name: 'Block Library',
- } );
+ const blockLibrary = page
+ .getByRole( 'region', {
+ name: 'Block Library',
+ } )
+ .locator(
+ '.block-editor-inserter__insertable-blocks-at-selection'
+ );
await blockInserter.click();
await expect( blockLibrary ).toBeVisible();
@@ -82,9 +86,13 @@ test.describe( 'Child Blocks', () => {
const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
- const blockLibrary = page.getByRole( 'region', {
- name: 'Block Library',
- } );
+ const blockLibrary = page
+ .getByRole( 'region', {
+ name: 'Block Library',
+ } )
+ .locator(
+ '.block-editor-inserter__insertable-blocks-at-selection'
+ );
await blockInserter.click();
await expect( blockLibrary ).toBeVisible();
diff --git a/test/e2e/specs/editor/plugins/custom-post-types.spec.js b/test/e2e/specs/editor/plugins/custom-post-types.spec.js
index 36050415925c19..67372d46c61a70 100644
--- a/test/e2e/specs/editor/plugins/custom-post-types.spec.js
+++ b/test/e2e/specs/editor/plugins/custom-post-types.spec.js
@@ -59,6 +59,19 @@ test.describe( 'Test Custom Post Types', () => {
await expect( parentPageLocator ).toHaveValue( parentPage );
} );
+ test( 'should not be able to rename a post that lacks title support', async ( {
+ admin,
+ editor,
+ page,
+ } ) => {
+ await admin.createNewPost( { postType: 'hierar-no-title' } );
+ await editor.openDocumentSettingsSidebar();
+ await page.getByRole( 'button', { name: 'Actions' } ).click();
+ await expect(
+ page.getByRole( 'menuitem', { name: 'Rename' } )
+ ).toHaveCount( 0 );
+ } );
+
test( 'should create a cpt with a legacy block in its template without WSOD', async ( {
admin,
editor,
diff --git a/test/e2e/specs/editor/plugins/inner-blocks-allowed-blocks.spec.js b/test/e2e/specs/editor/plugins/inner-blocks-allowed-blocks.spec.js
index eaf171adf9313c..d2dc521f0196bd 100644
--- a/test/e2e/specs/editor/plugins/inner-blocks-allowed-blocks.spec.js
+++ b/test/e2e/specs/editor/plugins/inner-blocks-allowed-blocks.spec.js
@@ -46,9 +46,13 @@ test.describe( 'Allowed Blocks Setting on InnerBlocks', () => {
const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
- const blockLibrary = page.getByRole( 'region', {
- name: 'Block Library',
- } );
+ const blockLibrary = page
+ .getByRole( 'region', {
+ name: 'Block Library',
+ } )
+ .locator(
+ '.block-editor-inserter__insertable-blocks-at-selection'
+ );
await blockInserter.click();
await expect( blockLibrary ).toBeVisible();
@@ -89,9 +93,13 @@ test.describe( 'Allowed Blocks Setting on InnerBlocks', () => {
const blockInserter = page
.getByRole( 'toolbar', { name: 'Document tools' } )
.getByRole( 'button', { name: 'Toggle block inserter' } );
- const blockLibrary = page.getByRole( 'region', {
- name: 'Block Library',
- } );
+ const blockLibrary = page
+ .getByRole( 'region', {
+ name: 'Block Library',
+ } )
+ .locator(
+ '.block-editor-inserter__insertable-blocks-at-selection'
+ );
await blockInserter.click();
await expect( blockLibrary ).toBeVisible();
diff --git a/test/e2e/specs/editor/various/block-bindings.spec.js b/test/e2e/specs/editor/various/block-bindings.spec.js
index 97b8579bb07ba6..be5c7594b46dad 100644
--- a/test/e2e/specs/editor/various/block-bindings.spec.js
+++ b/test/e2e/specs/editor/various/block-bindings.spec.js
@@ -1193,11 +1193,6 @@ test.describe( 'Block bindings', () => {
await expect( paragraphBlock ).toHaveText(
'Value of the text_custom_field'
);
- // Paragraph is not editable.
- await expect( paragraphBlock ).toHaveAttribute(
- 'contenteditable',
- 'false'
- );
// Check the frontend shows the value of the custom field.
const postId = await editor.publishPost();
@@ -1331,6 +1326,12 @@ test.describe( 'Block bindings', () => {
},
},
} );
+ // Select the paragraph and press Enter at the end of it.
+ const paragraph = editor.canvas.getByRole( 'document', {
+ name: 'Block: Paragraph',
+ } );
+ await editor.selectBlocks( paragraph );
+ await page.keyboard.press( 'End' );
await page.keyboard.press( 'Enter' );
const [ initialParagraph, newEmptyParagraph ] =
await editor.canvas
@@ -1342,6 +1343,70 @@ test.describe( 'Block bindings', () => {
await expect( newEmptyParagraph ).toHaveText( '' );
await expect( newEmptyParagraph ).toBeEditable();
} );
+
+ test( 'should NOT be possible to edit the value of the custom field when it is protected', async ( {
+ editor,
+ } ) => {
+ await editor.insertBlock( {
+ name: 'core/paragraph',
+ attributes: {
+ anchor: 'protected-field-binding',
+ content: 'fallback value',
+ metadata: {
+ bindings: {
+ content: {
+ source: 'core/post-meta',
+ args: { key: '_protected_field' },
+ },
+ },
+ },
+ },
+ } );
+
+ const protectedFieldBlock = editor.canvas.getByRole(
+ 'document',
+ {
+ name: 'Block: Paragraph',
+ }
+ );
+
+ await expect( protectedFieldBlock ).toHaveAttribute(
+ 'contenteditable',
+ 'false'
+ );
+ } );
+
+ test( 'should NOT be possible to edit the value of the custom field when it is not shown in the REST API', async ( {
+ editor,
+ } ) => {
+ await editor.insertBlock( {
+ name: 'core/paragraph',
+ attributes: {
+ anchor: 'show-in-rest-false-binding',
+ content: 'fallback value',
+ metadata: {
+ bindings: {
+ content: {
+ source: 'core/post-meta',
+ args: { key: 'show_in_rest_false_field' },
+ },
+ },
+ },
+ },
+ } );
+
+ const showInRestFalseBlock = editor.canvas.getByRole(
+ 'document',
+ {
+ name: 'Block: Paragraph',
+ }
+ );
+
+ await expect( showInRestFalseBlock ).toHaveAttribute(
+ 'contenteditable',
+ 'false'
+ );
+ } );
} );
test.describe( 'Heading', () => {
@@ -1370,11 +1435,6 @@ test.describe( 'Block bindings', () => {
await expect( headingBlock ).toHaveText(
'Value of the text_custom_field'
);
- // Heading is not editable.
- await expect( headingBlock ).toHaveAttribute(
- 'contenteditable',
- 'false'
- );
// Check the frontend shows the value of the custom field.
const postId = await editor.publishPost();
@@ -1406,6 +1466,13 @@ test.describe( 'Block bindings', () => {
},
},
} );
+
+ // Select the heading and press Enter at the end of it.
+ const heading = editor.canvas.getByRole( 'document', {
+ name: 'Block: Heading',
+ } );
+ await editor.selectBlocks( heading );
+ await page.keyboard.press( 'End' );
await page.keyboard.press( 'Enter' );
// Can't use `editor.getBlocks` because it doesn't return the meta value shown in the editor.
const [ initialHeading, newEmptyParagraph ] =
@@ -1465,12 +1532,6 @@ test.describe( 'Block bindings', () => {
'Value of the text_custom_field'
);
- // Button is not editable.
- await expect( buttonBlock ).toHaveAttribute(
- 'contenteditable',
- 'false'
- );
-
// Check the frontend shows the value of the custom field.
const postId = await editor.publishPost();
await page.goto( `/?p=${ postId }` );
@@ -1599,6 +1660,7 @@ test.describe( 'Block bindings', () => {
} )
.getByRole( 'textbox' )
.click();
+ await page.keyboard.press( 'End' );
await page.keyboard.press( 'Enter' );
const [ initialButton, newEmptyButton ] = await editor.canvas
.locator( '[data-type="core/button"]' )
@@ -1723,12 +1785,7 @@ test.describe( 'Block bindings', () => {
imagePlaceholderSrc
);
- // Alt textarea is disabled and with the custom field value.
- await expect(
- page
- .getByRole( 'tabpanel', { name: 'Settings' } )
- .getByLabel( 'Alternative text' )
- ).toHaveAttribute( 'readonly' );
+ // Alt textarea should have the custom field value.
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
@@ -1789,7 +1846,7 @@ test.describe( 'Block bindings', () => {
imagePlaceholderSrc
);
- // Title input is disabled and with the custom field value.
+ // Title input should have the custom field value.
const advancedButton = page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByRole( 'button', {
@@ -1800,11 +1857,6 @@ test.describe( 'Block bindings', () => {
if ( isAdvancedPanelOpen === 'false' ) {
await advancedButton.click();
}
- await expect(
- page
- .getByRole( 'tabpanel', { name: 'Settings' } )
- .getByLabel( 'Title attribute' )
- ).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
@@ -1869,19 +1921,14 @@ test.describe( 'Block bindings', () => {
imageCustomFieldSrc
);
- // Alt textarea is disabled and with the custom field value.
- await expect(
- page
- .getByRole( 'tabpanel', { name: 'Settings' } )
- .getByLabel( 'Alternative text' )
- ).toHaveAttribute( 'readonly' );
+ // Alt textarea should have the custom field value.
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
.inputValue();
expect( altValue ).toBe( 'Value of the text_custom_field' );
- // Title input is enabled and with the original value.
+ // Title input should have the original value.
const advancedButton = page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByRole( 'button', {
@@ -1892,11 +1939,6 @@ test.describe( 'Block bindings', () => {
if ( isAdvancedPanelOpen === 'false' ) {
await advancedButton.click();
}
- await expect(
- page
- .getByRole( 'tabpanel', { name: 'Settings' } )
- .getByLabel( 'Title attribute' )
- ).toBeEnabled();
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
@@ -1922,6 +1964,208 @@ test.describe( 'Block bindings', () => {
);
} );
} );
+
+ test.describe( 'Edit custom fields', () => {
+ test( 'should be possible to edit the value of the custom field from the paragraph', async ( {
+ editor,
+ } ) => {
+ await editor.insertBlock( {
+ name: 'core/paragraph',
+ attributes: {
+ anchor: 'paragraph-binding',
+ content: 'paragraph default content',
+ metadata: {
+ bindings: {
+ content: {
+ source: 'core/post-meta',
+ args: { key: 'text_custom_field' },
+ },
+ },
+ },
+ },
+ } );
+ const paragraphBlock = editor.canvas.getByRole( 'document', {
+ name: 'Block: Paragraph',
+ } );
+
+ await expect( paragraphBlock ).toHaveAttribute(
+ 'contenteditable',
+ 'true'
+ );
+ await paragraphBlock.fill( 'new value' );
+ // Check that the paragraph content attribute didn't change.
+ const [ paragraphBlockObject ] = await editor.getBlocks();
+ expect( paragraphBlockObject.attributes.content ).toBe(
+ 'paragraph default content'
+ );
+ // Check the value of the custom field is being updated by visiting the frontend.
+ const previewPage = await editor.openPreviewPage();
+ await expect(
+ previewPage.locator( '#paragraph-binding' )
+ ).toHaveText( 'new value' );
+ } );
+
+ test( 'should be possible to edit the value of the url custom field from the button', async ( {
+ editor,
+ page,
+ pageUtils,
+ } ) => {
+ await editor.insertBlock( {
+ name: 'core/buttons',
+ innerBlocks: [
+ {
+ name: 'core/button',
+ attributes: {
+ anchor: 'button-url-binding',
+ text: 'button default text',
+ url: '#default-url',
+ metadata: {
+ bindings: {
+ url: {
+ source: 'core/post-meta',
+ args: { key: 'url_custom_field' },
+ },
+ },
+ },
+ },
+ },
+ ],
+ } );
+
+ // Edit the url.
+ const buttonBlock = editor.canvas
+ .getByRole( 'document', {
+ name: 'Block: Button',
+ exact: true,
+ } )
+ .getByRole( 'textbox' );
+ await buttonBlock.click();
+ await page
+ .getByRole( 'button', { name: 'Edit link', exact: true } )
+ .click();
+ await page
+ .getByPlaceholder( 'Search or type URL' )
+ .fill( '#url-custom-field-modified' );
+ await pageUtils.pressKeys( 'Enter' );
+
+ // Check that the button url attribute didn't change.
+ const [ buttonsObject ] = await editor.getBlocks();
+ expect( buttonsObject.innerBlocks[ 0 ].attributes.url ).toBe(
+ '#default-url'
+ );
+ // Check the value of the custom field is being updated by visiting the frontend.
+ const previewPage = await editor.openPreviewPage();
+ await expect(
+ previewPage.locator( '#button-url-binding a' )
+ ).toHaveAttribute( 'href', '#url-custom-field-modified' );
+ } );
+
+ test( 'should be possible to edit the value of the url custom field from the image', async ( {
+ editor,
+ page,
+ pageUtils,
+ requestUtils,
+ } ) => {
+ const customFieldMedia = await requestUtils.uploadMedia(
+ path.join(
+ './test/e2e/assets',
+ '1024x768_e2e_test_image_size.jpeg'
+ )
+ );
+ imageCustomFieldSrc = customFieldMedia.source_url;
+
+ await editor.insertBlock( {
+ name: 'core/image',
+ attributes: {
+ anchor: 'image-url-binding',
+ url: imagePlaceholderSrc,
+ alt: 'default alt value',
+ title: 'default title value',
+ metadata: {
+ bindings: {
+ url: {
+ source: 'core/post-meta',
+ args: { key: 'url_custom_field' },
+ },
+ },
+ },
+ },
+ } );
+
+ // Edit image url.
+ await page
+ .getByRole( 'toolbar', { name: 'Block tools' } )
+ .getByRole( 'button', {
+ name: 'Replace',
+ } )
+ .click();
+ await page
+ .getByRole( 'button', { name: 'Edit link', exact: true } )
+ .click();
+ await page
+ .getByPlaceholder( 'Search or type URL' )
+ .fill( imageCustomFieldSrc );
+ await pageUtils.pressKeys( 'Enter' );
+
+ // Check that the image url attribute didn't change and still uses the placeholder.
+ const [ imageBlockObject ] = await editor.getBlocks();
+ expect( imageBlockObject.attributes.url ).toBe(
+ imagePlaceholderSrc
+ );
+
+ // Check the value of the custom field is being updated by visiting the frontend.
+ const previewPage = await editor.openPreviewPage();
+ await expect(
+ previewPage.locator( '#image-url-binding img' )
+ ).toHaveAttribute( 'src', imageCustomFieldSrc );
+ } );
+
+ test( 'should be possible to edit the value of the text custom field from the image alt', async ( {
+ editor,
+ page,
+ } ) => {
+ await editor.insertBlock( {
+ name: 'core/image',
+ attributes: {
+ anchor: 'image-alt-binding',
+ url: imagePlaceholderSrc,
+ alt: 'default alt value',
+ metadata: {
+ bindings: {
+ alt: {
+ source: 'core/post-meta',
+ args: { key: 'text_custom_field' },
+ },
+ },
+ },
+ },
+ } );
+ const imageBlockImg = editor.canvas
+ .getByRole( 'document', {
+ name: 'Block: Image',
+ } )
+ .locator( 'img' );
+ await imageBlockImg.click();
+
+ // Edit the custom field value in the alt textarea.
+ const altInputArea = page
+ .getByRole( 'tabpanel', { name: 'Settings' } )
+ .getByLabel( 'Alternative text' );
+ await expect( altInputArea ).not.toHaveAttribute( 'readonly' );
+ await altInputArea.fill( 'new value' );
+
+ // Check that the image alt attribute didn't change.
+ const [ imageBlockObject ] = await editor.getBlocks();
+ expect( imageBlockObject.attributes.alt ).toBe(
+ 'default alt value'
+ );
+ // Check the value of the custom field is being updated by visiting the frontend.
+ const previewPage = await editor.openPreviewPage();
+ await expect(
+ previewPage.locator( '#image-alt-binding img' )
+ ).toHaveAttribute( 'alt', 'new value' );
+ } );
+ } );
} );
} );
diff --git a/test/e2e/specs/editor/various/pattern-overrides.spec.js b/test/e2e/specs/editor/various/pattern-overrides.spec.js
index 976f1c378daa97..f4648a03efe956 100644
--- a/test/e2e/specs/editor/various/pattern-overrides.spec.js
+++ b/test/e2e/specs/editor/various/pattern-overrides.spec.js
@@ -105,7 +105,7 @@ test.describe( 'Pattern Overrides', () => {
metadata: {
name: editableParagraphName,
bindings: {
- content: {
+ __default: {
source: 'core/pattern-overrides',
},
},
@@ -234,7 +234,7 @@ test.describe( 'Pattern Overrides', () => {
const paragraphName = 'paragraph-name';
const { id } = await requestUtils.createBlock( {
title: 'Pattern',
- content: `
+ content: `