diff --git a/.github/setup-node/action.yml b/.github/setup-node/action.yml
index 22cb81618a1efb..fccce2e4e93bcf 100644
--- a/.github/setup-node/action.yml
+++ b/.github/setup-node/action.yml
@@ -14,6 +14,7 @@ runs:
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
+ check-latest: true
cache: npm
- name: Get Node.js and npm version
diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml
index 8f649f1e15889d..a2628bf7af6160 100644
--- a/.github/workflows/build-plugin-zip.yml
+++ b/.github/workflows/build-plugin-zip.yml
@@ -174,6 +174,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
+ check-latest: true
cache: npm
- name: Build Gutenberg plugin ZIP file
@@ -336,6 +337,7 @@ jobs:
with:
node-version-file: 'main/.nvmrc'
registry-url: 'https://registry.npmjs.org'
+ check-latest: true
- name: Publish packages to npm ("latest" dist-tag)
run: |
diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml
index 3b4d51bddbda0b..23b245cb6f114b 100644
--- a/.github/workflows/bundle-size.yml
+++ b/.github/workflows/bundle-size.yml
@@ -46,6 +46,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
+ check-latest: true
cache: npm
- uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0
diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml
index 0e4325b53f69da..d817ac1e0be976 100644
--- a/.github/workflows/create-block.yml
+++ b/.github/workflows/create-block.yml
@@ -14,14 +14,14 @@ concurrency:
jobs:
checks:
- name: Checks
+ name: Checks w/Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
- node: ['16']
- os: [macos-latest, ubuntu-latest, windows-latest]
+ node: ['20', '21']
+ os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml
index ddbf714cb50232..d065bf8afad44d 100644
--- a/.github/workflows/end2end-test.yml
+++ b/.github/workflows/end2end-test.yml
@@ -20,8 +20,6 @@ jobs:
name: Puppeteer
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
- strategy:
- fail-fast: false
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml
index 18bdb63a6c3770..163012451d6002 100644
--- a/.github/workflows/publish-npm-packages.yml
+++ b/.github/workflows/publish-npm-packages.yml
@@ -71,6 +71,7 @@ jobs:
with:
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'
+ check-latest: true
- name: Setup Node.js (for WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
@@ -78,6 +79,7 @@ jobs:
with:
node-version-file: 'publish/.nvmrc'
registry-url: 'https://registry.npmjs.org'
+ check-latest: true
- name: Publish development packages to npm ("next" dist-tag)
if: ${{ github.event.inputs.release_type == 'development' }}
diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml
index b8154e335776a2..785b42a19054db 100644
--- a/.github/workflows/pull-request-automation.yml
+++ b/.github/workflows/pull-request-automation.yml
@@ -8,9 +8,6 @@ jobs:
pull-request-automation:
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' }}
- strategy:
- matrix:
- node: ['16']
steps:
# Checkout defaults to using the branch which triggered the event, which
@@ -23,7 +20,8 @@ jobs:
- name: Use desired version of Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
- node-version: ${{ matrix.node }}
+ node-version-file: '.nvmrc'
+ check-latest: true
- name: Cache NPM packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml
index ff8c27b14e39e8..2465f357a97cf0 100644
--- a/.github/workflows/static-checks.yml
+++ b/.github/workflows/static-checks.yml
@@ -30,6 +30,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
+ check-latest: true
cache: npm
- name: Npm install
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index 78f70cc4ed9f74..b6d5465ab43a6c 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -21,14 +21,13 @@ concurrency:
jobs:
unit-js:
- name: JavaScript
+ name: JavaScript (Node.js ${{ matrix.node }})
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
-
strategy:
fail-fast: false
matrix:
- node: ['16']
+ node: ['20', '21']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -40,7 +39,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- - name: Npm build
+ - name: npm build
# It's not necessary to run the full build, since Jest can interpret
# source files with `babel-jest`. Some packages have their own custom
# build tasks, however. These must be run.
diff --git a/.nvmrc b/.nvmrc
index b6a7d89c68e0ca..209e3ef4b6247c 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-16
+20
diff --git a/changelog.txt b/changelog.txt
index c8aa6254923aab..0b70b68c9377ee 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,342 @@
== Changelog ==
+= 17.3.0 =
+
+
+
+## Changelog
+
+### Bug Fixes
+
+- (edit-site)(use-init-edited-entity-from-url) Safely access `toString()` on `siteData`'s `page_on_front`. ([57035](https://github.com/WordPress/gutenberg/pull/57035))
+
+#### Components
+- Fix form token field suggestion list reopening after blurring the input. ([57002](https://github.com/WordPress/gutenberg/pull/57002))
+
+
+
+
+## Contributors
+
+The following contributors merged PRs in this release:
+
+@fullofcaffeine @talldan
+
+= 17.3.0-rc.1 =
+
+
+## Changelog
+
+### Enhancements
+
+- Components: Replace `TabPanel` with `Tabs` in the editor's `ColorPanel`. ([56878](https://github.com/WordPress/gutenberg/pull/56878))
+- Editor: Move the edit template blocks notification to editor package. ([56901](https://github.com/WordPress/gutenberg/pull/56901))
+- Editor: Unify the preview dropdown between post and site editors. ([56921](https://github.com/WordPress/gutenberg/pull/56921))
+- Editor: Use the same PostTemplatePanel between post and site editors. ([56817](https://github.com/WordPress/gutenberg/pull/56817))
+- Tabs: Replace `id` with new `tabId` prop. ([56883](https://github.com/WordPress/gutenberg/pull/56883))
+- Update main toolbar buttons to all be compact. ([56635](https://github.com/WordPress/gutenberg/pull/56635), [56729](https://github.com/WordPress/gutenberg/pull/56729))
+- Update preferences organization. ([56481](https://github.com/WordPress/gutenberg/pull/56481))
+
+#### Components
+- FocalPointPicker with __next40pxDefaultSize. ([56021](https://github.com/WordPress/gutenberg/pull/56021))
+- Font Library: Improve usability of font variant selection. ([56158](https://github.com/WordPress/gutenberg/pull/56158))
+- Tabs: Sync browser focus to selected tab in controlled mode. ([56658](https://github.com/WordPress/gutenberg/pull/56658))
+- Use consistent styling for duotone panels. ([56801](https://github.com/WordPress/gutenberg/pull/56801))
+- `BorderControl`: Fix button styles. ([56730](https://github.com/WordPress/gutenberg/pull/56730))
+- `DimensionControl`: Add __next40pxDefaultSize prop. ([56805](https://github.com/WordPress/gutenberg/pull/56805))
+- `FontSizePicker`: Add opt-in prop for 40px default size. ([56804](https://github.com/WordPress/gutenberg/pull/56804))
+- `QueryControls`: Add opt-in prop for 40px default size. ([56576](https://github.com/WordPress/gutenberg/pull/56576))
+
+#### Block Library
+- Control dimensions (margin and padding) of the list-item block. ([55874](https://github.com/WordPress/gutenberg/pull/55874))
+- Consistent default typography controls across blocks. ([55208](https://github.com/WordPress/gutenberg/pull/55208))
+- Social Icons: Add Gravatar service. ([56544](https://github.com/WordPress/gutenberg/pull/56544))
+- Tweak table block placeholder with __next40pxDefaultSize props. ([56935](https://github.com/WordPress/gutenberg/pull/56935))
+
+#### Site Editor
+- Merge the post only mode and the post editor. ([56671](https://github.com/WordPress/gutenberg/pull/56671))
+- Site Editor Sidebar: Add "Areas" details panel to all templates and update icon. ([55677](https://github.com/WordPress/gutenberg/pull/55677))
+
+#### Block Editor
+- Allow dragging between adjacent container blocks based on a threshold. ([56466](https://github.com/WordPress/gutenberg/pull/56466))
+- Components: Replace `TabPanel` with `Tabs` in the editor's `ColorGradientControl`. ([56351](https://github.com/WordPress/gutenberg/pull/56351))
+
+#### Data Views
+- Update data view layout. ([56786](https://github.com/WordPress/gutenberg/pull/56786))
+
+#### Layout
+- Match the front end layout classname in the editor. ([56774](https://github.com/WordPress/gutenberg/pull/56774))
+
+#### Global Styles
+- Global style revisions: Show change summary on selected item. ([56577](https://github.com/WordPress/gutenberg/pull/56577))
+
+#### Icons
+- Another round of HiDPI icon tweaks. ([56532](https://github.com/WordPress/gutenberg/pull/56532))
+
+#### Media
+- Update external images panel in post publish sidebar. ([55524](https://github.com/WordPress/gutenberg/pull/55524))
+
+#### Post Editor
+- Implement `Tabs` in editor settings. ([55360](https://github.com/WordPress/gutenberg/pull/55360))
+
+
+### Bug Fixes
+
+- Create-block-interactive-template: Add all files to the generated plugin zip. ([56943](https://github.com/WordPress/gutenberg/pull/56943))
+- Create-block-interactive-template: Prevent crash when Gutenberg plugin is not installed. ([56941](https://github.com/WordPress/gutenberg/pull/56941))
+- Fix end-to-end test: Update how we find the template title to match markup changes. ([56992](https://github.com/WordPress/gutenberg/pull/56992))
+- Fix: Fatal php error if a template was created by an author that was deleted. ([56990](https://github.com/WordPress/gutenberg/pull/56990))
+- Fix: PHP 8.1 deprecated warning strpos(). ([56171](https://github.com/WordPress/gutenberg/pull/56171))
+- Fix: Use span on template list titles. ([56955](https://github.com/WordPress/gutenberg/pull/56955))
+- Font Library: Add font family and font face preview keys to schema. ([56793](https://github.com/WordPress/gutenberg/pull/56793))
+- Remove unnecessary CSS for shrinking central header area. ([56220](https://github.com/WordPress/gutenberg/pull/56220))
+- Revert format types hook refactor. ([56859](https://github.com/WordPress/gutenberg/pull/56859))
+- Show template center UI when no block is selected. ([56217](https://github.com/WordPress/gutenberg/pull/56217))
+- setImmutably: Don't clone all objects. ([56612](https://github.com/WordPress/gutenberg/pull/56612))
+
+#### Block Library
+- Fix error when using a navigation block that returns an empty fallback result. ([56629](https://github.com/WordPress/gutenberg/pull/56629))
+- Fixture Tests: Correctly generate fixture files for form-related blocks. ([56719](https://github.com/WordPress/gutenberg/pull/56719))
+- Image: Fix resetting behaviour for alt image text. ([56809](https://github.com/WordPress/gutenberg/pull/56809))
+- Social Links Block: Prevent Theme Styles Distorting Size. ([56301](https://github.com/WordPress/gutenberg/pull/56301))
+- Update image block save to only save align none class. ([56449](https://github.com/WordPress/gutenberg/pull/56449))
+
+#### Components
+- DropdownMenuV2Ariakit: Prevent prefix collapsing if all radios or checkboxes are unselected. ([56720](https://github.com/WordPress/gutenberg/pull/56720))
+- FormToggle: Do not use "/" math operator. ([56672](https://github.com/WordPress/gutenberg/pull/56672))
+- PaletteEdit: Temporary custom gradient not saving. ([56896](https://github.com/WordPress/gutenberg/pull/56896))
+- `ToggleGroupControl`: React correctly to external controlled updates. ([56678](https://github.com/WordPress/gutenberg/pull/56678))
+
+#### Block Editor
+- Apply __next40pxDefaultSize to TextControl and Button component in renaming UIs. ([56933](https://github.com/WordPress/gutenberg/pull/56933))
+- Pattern inserter: Fix Broken preview layout. ([56814](https://github.com/WordPress/gutenberg/pull/56814))
+- Patterns: Keep synced pattern when added via drag and drop. ([56924](https://github.com/WordPress/gutenberg/pull/56924))
+
+#### Design Tools
+- Background image support: Fix duplicate output of styling rules. ([56997](https://github.com/WordPress/gutenberg/pull/56997))
+- Fix sticky position in classic themes with appearance tools support. ([56743](https://github.com/WordPress/gutenberg/pull/56743))
+
+#### Post Editor
+- Editor Canvas: Fix animation when device type changes. ([56970](https://github.com/WordPress/gutenberg/pull/56970))
+- Editor: Fix display of edit template blocks notification. ([56978](https://github.com/WordPress/gutenberg/pull/56978))
+
+#### Site Editor
+- Fix active edited post. ([56863](https://github.com/WordPress/gutenberg/pull/56863))
+- Show back button when editing navigation and template area in-place with no URL params. ([56741](https://github.com/WordPress/gutenberg/pull/56741))
+
+#### Typography
+- Fix order of typography sizes and families. ([56659](https://github.com/WordPress/gutenberg/pull/56659))
+- Font Library: Fix font uninstallation. ([56762](https://github.com/WordPress/gutenberg/pull/56762))
+
+#### Navigation in Site View
+- Navigation editor: Fix content mode. ([56856](https://github.com/WordPress/gutenberg/pull/56856))
+
+#### Patterns
+- Fix top position and height of Pattern Modal Sidebar. ([56787](https://github.com/WordPress/gutenberg/pull/56787))
+
+#### Interactivity API
+- Start using modules in the interactive create-block template. ([56694](https://github.com/WordPress/gutenberg/pull/56694))
+
+#### Layout
+- Fix input not showing when switching to "Fixed" width. ([56660](https://github.com/WordPress/gutenberg/pull/56660))
+
+#### Data Views
+- Align data view icon usage. ([56602](https://github.com/WordPress/gutenberg/pull/56602))
+
+#### Block Styles
+- Consolidate and resolve display issues between InserterPreviewPanel and BlockStylesPreviewPanel. ([56011](https://github.com/WordPress/gutenberg/pull/56011))
+
+#### Inspector Controls
+- Decode some characters if used in taxonomy name so it's displayed correctly in Query Loop filters. ([50376](https://github.com/WordPress/gutenberg/pull/50376))
+
+
+### Accessibility
+
+#### Data Views
+- Add scroll padding to dataviews container. ([56946](https://github.com/WordPress/gutenberg/pull/56946))
+- Adding `aria-sort` to table view headers. ([56860](https://github.com/WordPress/gutenberg/pull/56860))
+- Fix: Use span instead of heading for the template titles. ([56785](https://github.com/WordPress/gutenberg/pull/56785))
+
+#### Post Editor
+- Avoid to show unnecessary Tooltip for the Post Schedule button. ([56759](https://github.com/WordPress/gutenberg/pull/56759))
+
+#### Block Editor
+- Increase right padding of URL field to take the Submit button into account. ([56685](https://github.com/WordPress/gutenberg/pull/56685))
+
+#### Site Editor
+- Shorter screen reader announcement after changing pages. ([56339](https://github.com/WordPress/gutenberg/pull/56339))
+
+#### Components
+- Use tooltip for the Timezone only when necessary. ([56214](https://github.com/WordPress/gutenberg/pull/56214))
+
+
+### Performance
+
+- Block editor: Make all BlockEdit hooks pure. ([56813](https://github.com/WordPress/gutenberg/pull/56813))
+- Block editor: Remove 4 useSelect in favour of context. ([56915](https://github.com/WordPress/gutenberg/pull/56915))
+- Block editor: hooks: Avoid BlockEdit filter for content locking UI. ([56957](https://github.com/WordPress/gutenberg/pull/56957))
+- Block editor: hooks: Share block settings. ([56852](https://github.com/WordPress/gutenberg/pull/56852))
+- Keycodes: Avoid regex for capital case. ([56822](https://github.com/WordPress/gutenberg/pull/56822))
+- Measure typing without inspector. ([56753](https://github.com/WordPress/gutenberg/pull/56753))
+- Media upload component: Lazy mount. ([56958](https://github.com/WordPress/gutenberg/pull/56958))
+- Paragraph: Store subscription for selected block only. ([56967](https://github.com/WordPress/gutenberg/pull/56967))
+- Perf: Reopen inspector for remaining tests. ([56780](https://github.com/WordPress/gutenberg/pull/56780))
+- useBlockProps: Combine store subscriptions. ([56847](https://github.com/WordPress/gutenberg/pull/56847))
+
+#### Block Editor
+- Improve opening inserter in post editor. ([57006](https://github.com/WordPress/gutenberg/pull/57006))
+- hooks: Subscribe only to relevant attributes. ([56783](https://github.com/WordPress/gutenberg/pull/56783))
+
+#### Site Editor
+- Fix typing performance by not rendering sidebar. ([56927](https://github.com/WordPress/gutenberg/pull/56927))
+
+#### Components
+- ToolsPanel: Fix deregister/register on type. ([56770](https://github.com/WordPress/gutenberg/pull/56770))
+
+#### Modules API
+- Load the import map polyfill only when there is an import map. ([56699](https://github.com/WordPress/gutenberg/pull/56699))
+
+#### Post Editor
+- Editor: Avoid double parsing content in 'getSuggestedPostFormat' selelector. ([56679](https://github.com/WordPress/gutenberg/pull/56679))
+
+
+### Experiments
+
+#### Data Views
+- DataViews: Add story. ([56761](https://github.com/WordPress/gutenberg/pull/56761))
+- DataViews: Add support for `NOT IN` operator in filter. ([56479](https://github.com/WordPress/gutenberg/pull/56479))
+- DataViews: Centralize the view definition and rename `list` to `table`. ([56693](https://github.com/WordPress/gutenberg/pull/56693))
+- DataViews: Do not export strings constants. ([56754](https://github.com/WordPress/gutenberg/pull/56754))
+- DataViews: Export the view components as defaults. ([56677](https://github.com/WordPress/gutenberg/pull/56677))
+- DataViews: Fix dropdown menu actions with modal. ([56760](https://github.com/WordPress/gutenberg/pull/56760))
+- DataViews: Hide pagination if we have only one page. ([56948](https://github.com/WordPress/gutenberg/pull/56948))
+- DataViews: Implement `NOT IN` operator for author filter in templates. ([56777](https://github.com/WordPress/gutenberg/pull/56777))
+- DataViews: Iterate on list view. ([56746](https://github.com/WordPress/gutenberg/pull/56746))
+- DataViews: Make `Actions` styles the same as any other column header. ([56654](https://github.com/WordPress/gutenberg/pull/56654))
+- DataViews: Make `mediaField` not hidable. ([56643](https://github.com/WordPress/gutenberg/pull/56643))
+- DataViews: Rename view components. ([56709](https://github.com/WordPress/gutenberg/pull/56709))
+- DataViews: Render data async conditionally. ([56851](https://github.com/WordPress/gutenberg/pull/56851))
+- DataViews: Set proper role for AddFilter's items. ([56714](https://github.com/WordPress/gutenberg/pull/56714))
+- DataViews: Set proper semantics for dropdown items. ([56676](https://github.com/WordPress/gutenberg/pull/56676))
+- DataViews: Update sorting semantics. ([56717](https://github.com/WordPress/gutenberg/pull/56717))
+- Dataviews: Extract to dedicated bundled package. ([56721](https://github.com/WordPress/gutenberg/pull/56721))
+
+#### Block Validation/Deprecation
+- Input Field Block: Use `useblockProps` hook in save function. ([56507](https://github.com/WordPress/gutenberg/pull/56507))
+
+#### Patterns
+- Implement partially synced patterns behind an experimental flag. ([56235](https://github.com/WordPress/gutenberg/pull/56235))
+
+
+### Documentation
+
+- Add the nested blocks chapter to the platform documentation. ([56689](https://github.com/WordPress/gutenberg/pull/56689))
+- Components: Update CHANGELOG.md. ([56960](https://github.com/WordPress/gutenberg/pull/56960))
+- Doc: Search Control - add Storybook link. ([56815](https://github.com/WordPress/gutenberg/pull/56815))
+- Doc: Spinner - add Storybook link. ([56818](https://github.com/WordPress/gutenberg/pull/56818))
+- Docs: Add storybook link for spinner component. ([56953](https://github.com/WordPress/gutenberg/pull/56953))
+- Docs: Fix {% end %} tab position to show the text. ([56735](https://github.com/WordPress/gutenberg/pull/56735))
+- Docs: Fundamentals of Block Development - Minor fixes - registration-of-a-block. ([56731](https://github.com/WordPress/gutenberg/pull/56731))
+- Docs: Fundamentals of Block Development - add links. ([56700](https://github.com/WordPress/gutenberg/pull/56700))
+- Docs: Fundamentals of Block Development ---- Small fixes for "Block wrapper". ([56651](https://github.com/WordPress/gutenberg/pull/56651))
+- Link to Dashicons. ([56872](https://github.com/WordPress/gutenberg/pull/56872))
+- Platform Docs: Add trusted by section. ([56749](https://github.com/WordPress/gutenberg/pull/56749))
+- Revert "Doc: Spinner - add Storybook link". ([56913](https://github.com/WordPress/gutenberg/pull/56913))
+- Update Getting Started Guide for Gutenberg 17.2. ([56674](https://github.com/WordPress/gutenberg/pull/56674))
+- Update InnerBlocks defaultblock doc usage. ([56728](https://github.com/WordPress/gutenberg/pull/56728))
+- Update formatting and fix grammar in the Block Editor Handbook readme. ([56798](https://github.com/WordPress/gutenberg/pull/56798))
+
+
+### Code Quality
+
+- Block editor: hooks: Avoid getEditWrapperProps. ([56912](https://github.com/WordPress/gutenberg/pull/56912))
+- Block lib: Use RichText.isEmpty where forgotten. ([56726](https://github.com/WordPress/gutenberg/pull/56726))
+- Block library: Reusable caption component util. ([56606](https://github.com/WordPress/gutenberg/pull/56606))
+- Core data revisions: Remove hardcoded supports constant. ([56701](https://github.com/WordPress/gutenberg/pull/56701))
+- Editor: Cleanup default editor mode handling. ([56819](https://github.com/WordPress/gutenberg/pull/56819))
+- Editor: Move the BlockCanvas component within the EditorCanvas component. ([56850](https://github.com/WordPress/gutenberg/pull/56850))
+- Editor: Move the device type state to the editor package. ([56866](https://github.com/WordPress/gutenberg/pull/56866))
+- Editor: Unify device preview styles. ([56904](https://github.com/WordPress/gutenberg/pull/56904))
+- Fix PHP linter failing. ([56905](https://github.com/WordPress/gutenberg/pull/56905))
+- Framework: Bundle the BlockTools component within BlockCanvas. ([56996](https://github.com/WordPress/gutenberg/pull/56996))
+- Move `useDebouncedInput` hook to @wordpress/compose package. ([56744](https://github.com/WordPress/gutenberg/pull/56744))
+- Post Editor: Rely on the editor store for the template mode state. ([56716](https://github.com/WordPress/gutenberg/pull/56716))
+- Refactor
supports
generates a set of properties that need to be manually added to the wrapping element of the block so they're properly stored as part of the block data
+The use of supports
generates a set of properties that need to be manually added to the wrapping element of the block so they're properly stored as part of the block data.
+
+```
+
+The [markup representation of a block is parsed for the Block Editor](https://developer.wordpress.org/block-editor/explanations/architecture/data-flow/) and the block's output for the front end:
+- In the editor, WordPress parses this block markup, captures its data and loads its `edit` version
+- In the front end, WordPress parses this block markup, captures its data and generates its final HTML markup
+
+Whenever a block is saved, the `save` function, defined when the [block is registered in the client](https://developer.wordpress.org/block-editor/getting-started/fundamentals/registration-of-a-block/#registration-of-the-block-with-javascript-client-side), is called to return the markup that will be saved into the database within the block delimiter's comment. If `save` is `null` (common case for blocks with dynamic rendering), only a single line block delimiter's comment is stored, along with any attributes
+
+The Post Editor checks that the markup created by the `save` function is identical to the block's markup saved to the database:
+- If there are any differences, the Post Editor trigger a **block validation error**.
+- Block validation errors usually happen when a block’s `save` function is updated to change the markup produced by the block.
+- A block developer can mitigate these issues by adding a [**block deprecation**](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/) to register the change in the block.
+
+The markup of a **block with dynamic rendering** is expected to change so the markup of these blocks is not saved to the database. What is saved in the DB as representation of the block, for blocks with dynamic rendering, is a single line of HTML consisting on just the block delimiter's comment (including block attributes values). That HTML is not subject to the Post Editor’s validation.
+
+_Example: Markup representation of a block with dynamic rendering (`save` = `null`) and attributes_
+
+
+```html
+
+```
+
+## Additional Resources
+
+- [Data Flow and Data Format](https://developer.wordpress.org/block-editor/explanations/architecture/data-flow/)
+- [Static vs. dynamic blocks: What’s the difference?](https://developer.wordpress.org/news/2023/02/27/static-vs-dynamic-blocks-whats-the-difference/)
+- [Block deprecation – a tutorial](https://developer.wordpress.org/news/2023/03/10/block-deprecation-a-tutorial/)
+- [Introduction to Templates > Block markup](https://developer.wordpress.org/themes/templates/introduction-to-templates/#block-markup) | Theme Handbook
\ No newline at end of file
diff --git a/docs/how-to-guides/platform/README.md b/docs/how-to-guides/platform/README.md
index 2ed96d6c83d876..731ae26a1ead58 100644
--- a/docs/how-to-guides/platform/README.md
+++ b/docs/how-to-guides/platform/README.md
@@ -57,4 +57,5 @@ For more info, see the [Getting Started with JavaScript tutorial](/docs/how-to-g
The [`@wordpress/block-editor` package](https://developer.wordpress.org/block-editor/packages/packages-block-editor/) allows you to create and use standalone block editors.
-You can learn more by reading the [tutorial "Building a custom block editor"](/docs/how-to-guides/platform/custom-block-editor/README.md).
+You can learn more by reading the [tutorial "Building a custom block editor"](/docs/how-to-guides/platform/custom-block-editor.md).
+
diff --git a/docs/manifest.json b/docs/manifest.json
index fb6d8550fa7ec9..7bb1e847ce03fd 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -89,6 +89,12 @@
"markdown_source": "../docs/getting-started/fundamentals/block-in-the-editor.md",
"parent": "fundamentals"
},
+ {
+ "title": "Markup representation of a block",
+ "slug": "markup-representation-block",
+ "markdown_source": "../docs/getting-started/fundamentals/markup-representation-block.md",
+ "parent": "fundamentals"
+ },
{
"title": "Working with Javascript for the Block Editor",
"slug": "javascript-in-the-block-editor",
diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md
index 2ba78177e9ec60..9f25ad0a594b89 100644
--- a/docs/reference-guides/core-blocks.md
+++ b/docs/reference-guides/core-blocks.md
@@ -341,7 +341,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute
- **Name:** core/group
- **Category:** design
-- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage), color (background, button, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
+- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage, backgroundSize), color (background, button, gradients, heading, link, text), dimensions (minHeight), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** allowedBlocks, tagName, templateLock
## Heading
diff --git a/docs/reference-guides/filters/block-filters.md b/docs/reference-guides/filters/block-filters.md
index e269ba9ef19917..4c7e3df7cec128 100644
--- a/docs/reference-guides/filters/block-filters.md
+++ b/docs/reference-guides/filters/block-filters.md
@@ -116,7 +116,7 @@ wp.hooks.addFilter(
);
```
-#### `blocks.getSaveContent.extraProps`
+### `blocks.getSaveContent.extraProps`
A filter that applies to all blocks returning a WP Element in the `save` function. This filter is used to add extra props to the root element of the `save` function. For example: to add a className, an id, or any valid prop for this element.
@@ -229,7 +229,7 @@ const withMyPluginControls = createHigherOrderComponent( ( BlockEdit ) => {
}, 'withMyPluginControls' );
```
-#### `editor.BlockListBlock`
+### `editor.BlockListBlock`
Used to modify the block's wrapper component containing the block's `edit` component and all toolbars. It receives the original `BlockListBlock` component and returns a new wrapped component.
diff --git a/docs/toc.json b/docs/toc.json
index 4b4f5bbd69a5f6..961fc88fae4f52 100644
--- a/docs/toc.json
+++ b/docs/toc.json
@@ -39,6 +39,9 @@
{
"docs/getting-started/fundamentals/block-in-the-editor.md": []
},
+ {
+ "docs/getting-started/fundamentals/markup-representation-block.md": []
+ },
{
"docs/getting-started/fundamentals/javascript-in-the-block-editor.md": []
}
diff --git a/lib/block-supports/background.php b/lib/block-supports/background.php
index ab2fa84361fc20..c43603046c0c08 100644
--- a/lib/block-supports/background.php
+++ b/lib/block-supports/background.php
@@ -54,6 +54,8 @@ function gutenberg_render_background_support( $block_content, $block ) {
$background_image_source = $block_attributes['style']['background']['backgroundImage']['source'] ?? null;
$background_image_url = $block_attributes['style']['background']['backgroundImage']['url'] ?? null;
$background_size = $block_attributes['style']['background']['backgroundSize'] ?? 'cover';
+ $background_position = $block_attributes['style']['background']['backgroundPosition'] ?? null;
+ $background_repeat = $block_attributes['style']['background']['backgroundRepeat'] ?? null;
$background_block_styles = array();
@@ -64,8 +66,15 @@ function gutenberg_render_background_support( $block_content, $block ) {
// Set file based background URL.
// TODO: In a follow-up, similar logic could be added to inject a featured image url.
$background_block_styles['backgroundImage']['url'] = $background_image_url;
- // Only output the background size when an image url is set.
- $background_block_styles['backgroundSize'] = $background_size;
+ // Only output the background size and repeat when an image url is set.
+ $background_block_styles['backgroundSize'] = $background_size;
+ $background_block_styles['backgroundRepeat'] = $background_repeat;
+ $background_block_styles['backgroundPosition'] = $background_position;
+
+ // If the background size is set to `contain` and no position is set, set the position to `center`.
+ if ( 'contain' === $background_size && ! isset( $background_position ) ) {
+ $background_block_styles['backgroundPosition'] = 'center';
+ }
}
$styles = gutenberg_style_engine_get_styles( array( 'background' => $background_block_styles ) );
diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php
index 43a3772a1c3af0..4fe5a3a3bf6a88 100644
--- a/lib/class-wp-theme-json-gutenberg.php
+++ b/lib/class-wp-theme-json-gutenberg.php
@@ -354,6 +354,7 @@ class WP_Theme_JSON_Gutenberg {
'useRootPaddingAwareAlignments' => null,
'background' => array(
'backgroundImage' => null,
+ 'backgroundSize' => null,
),
'border' => array(
'color' => null,
@@ -650,6 +651,7 @@ public static function get_element_class_name( $element ) {
*/
const APPEARANCE_TOOLS_OPT_INS = array(
array( 'background', 'backgroundImage' ),
+ array( 'background', 'backgroundSize' ),
array( 'border', 'color' ),
array( 'border', 'radius' ),
array( 'border', 'style' ),
diff --git a/lib/class-wp-theme-json-resolver-gutenberg.php b/lib/class-wp-theme-json-resolver-gutenberg.php
index 950d9e00e6243f..189d411db2257f 100644
--- a/lib/class-wp-theme-json-resolver-gutenberg.php
+++ b/lib/class-wp-theme-json-resolver-gutenberg.php
@@ -322,9 +322,6 @@ public static function get_theme_data( $deprecated = array(), $options = array()
}
$theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;
- // Classic themes without a theme.json don't support global duotone.
- $theme_support_data['settings']['color']['defaultDuotone'] = false;
-
// Allow themes to enable all border settings via theme_support.
if ( current_theme_supports( 'border' ) ) {
$theme_support_data['settings']['border']['color'] = true;
diff --git a/lib/compat/wordpress-6.4/block-patterns.php b/lib/compat/wordpress-6.4/block-patterns.php
deleted file mode 100644
index 65c31fb7a22af4..00000000000000
--- a/lib/compat/wordpress-6.4/block-patterns.php
+++ /dev/null
@@ -1,36 +0,0 @@
-= 6.4.
- *
- * @see https://github.com/WordPress/gutenberg/pull/53163
- *
- * @return void
- */
-function gutenberg_register_taxonomy_patterns() {
- $args = array(
- 'public' => false,
- 'publicly_queryable' => false,
- 'hierarchical' => false,
- 'labels' => array(
- 'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
- 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
- ),
- 'query_var' => false,
- 'rewrite' => false,
- 'show_ui' => true,
- '_builtin' => true,
- 'show_in_nav_menus' => false,
- 'show_in_rest' => true,
- 'show_admin_column' => true,
- );
- register_taxonomy( 'wp_pattern_category', array( 'wp_block' ), $args );
-}
-add_action( 'init', 'gutenberg_register_taxonomy_patterns' );
diff --git a/lib/compat/wordpress-6.5/block-patterns.php b/lib/compat/wordpress-6.5/block-patterns.php
index 4521d5e4e578f3..f43acda2a1035c 100644
--- a/lib/compat/wordpress-6.5/block-patterns.php
+++ b/lib/compat/wordpress-6.5/block-patterns.php
@@ -31,3 +31,49 @@ function gutenberg_register_media_pattern_categories() {
);
}
add_action( 'init', 'gutenberg_register_media_pattern_categories' );
+
+/**
+ * Adds a new taxonomy for organizing user created patterns.
+ *
+ * @see https://github.com/WordPress/gutenberg/pull/53163
+ *
+ * @return void
+ */
+function gutenberg_register_taxonomy_patterns() {
+ $args = array(
+ 'public' => false,
+ 'publicly_queryable' => false,
+ 'hierarchical' => false,
+ 'labels' => array(
+ 'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
+ 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
+ 'add_new_item' => __( 'Add New Category' ),
+ 'add_or_remove_items' => __( 'Add or remove pattern categories' ),
+ 'back_to_items' => __( '← Go to pattern categories' ),
+ 'choose_from_most_used' => __( 'Choose from the most used pattern categories' ),
+ 'edit_item' => __( 'Edit Pattern Category' ),
+ 'item_link' => __( 'Pattern Category Link' ),
+ 'item_link_description' => __( 'A link to a pattern category.' ),
+ 'items_list' => __( 'Pattern Categories list' ),
+ 'items_list_navigation' => __( 'Pattern Categories list navigation' ),
+ 'new_item_name' => __( 'New Pattern Category Name' ),
+ 'no_terms' => __( 'No pattern categories' ),
+ 'not_found' => __( 'No pattern categories found.' ),
+ 'popular_items' => __( 'Popular Pattern Categories' ),
+ 'search_items' => __( 'Search Pattern Categories' ),
+ 'separate_items_with_commas' => __( 'Separate pattern categories with commas' ),
+ 'update_item' => __( 'Update Pattern Category' ),
+ 'view_item' => __( 'View Pattern Category' ),
+ ),
+ 'query_var' => false,
+ 'rewrite' => false,
+ 'show_ui' => true,
+ '_builtin' => true,
+ 'show_in_nav_menus' => false,
+ 'show_in_rest' => true,
+ 'show_admin_column' => true,
+ 'show_tagcloud' => false,
+ );
+ register_taxonomy( 'wp_pattern_category', array( 'wp_block' ), $args );
+}
+add_action( 'init', 'gutenberg_register_taxonomy_patterns' );
diff --git a/lib/compat/wordpress-6.5/kses.php b/lib/compat/wordpress-6.5/kses.php
new file mode 100644
index 00000000000000..038d78645786f7
--- /dev/null
+++ b/lib/compat/wordpress-6.5/kses.php
@@ -0,0 +1,18 @@
+rest_base = 'font-collections';
+ $this->namespace = 'wp/v2';
+ }
+
+ /**
+ * Registers the routes for the objects of the controller.
+ *
+ * @since 6.5.0
+ */
+ public function register_routes() {
+ register_rest_route(
+ $this->namespace,
+ '/' . $this->rest_base,
+ array(
+ array(
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => array( $this, 'get_font_collections' ),
+ 'permission_callback' => array( $this, 'update_font_library_permissions_check' ),
+ ),
+ )
+ );
+
+ register_rest_route(
+ $this->namespace,
+ '/' . $this->rest_base . '/(?P