diff --git a/.github/workflows/php-changes-detection.yml b/.github/workflows/php-changes-detection.yml
index 2eeaea561eb7e..d003d149a9a09 100644
--- a/.github/workflows/php-changes-detection.yml
+++ b/.github/workflows/php-changes-detection.yml
@@ -54,7 +54,7 @@ jobs:
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.
- If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core Github repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
+ If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core GitHub repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
If you're unsure, you can always ask for help in the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
@@ -76,7 +76,7 @@ jobs:
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.
- If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core Github repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
+ If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core GitHub repository](https://github.com/WordPress/wordpress-develop) soon after this pull request is merged.
If you're unsure, you can always ask for help in the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml
index 60ecacb2a8d70..9bb40a3f06cbc 100644
--- a/.github/workflows/upload-release-to-plugin-repo.yml
+++ b/.github/workflows/upload-release-to-plugin-repo.yml
@@ -51,7 +51,7 @@ jobs:
return $?
}
- # Only update trunk *if* the published release's version in Github is GREATER
+ # Only update trunk *if* the published release's version in GitHub is GREATER
# than the version currently published in the WP plugins repo. If not, then it
# will upload it as a new tag.
shouldUpdateTrunk=false
diff --git a/backport-changelog/6.6/6785.md b/backport-changelog/6.6/6785.md
new file mode 100644
index 0000000000000..ad26227bf1256
--- /dev/null
+++ b/backport-changelog/6.6/6785.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6785
+
+* https://github.com/WordPress/gutenberg/pull/62459
diff --git a/backport-changelog/6.6/6797.md b/backport-changelog/6.6/6797.md
new file mode 100644
index 0000000000000..630b677655ddc
--- /dev/null
+++ b/backport-changelog/6.6/6797.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6797
+
+* https://github.com/WordPress/gutenberg/pull/62526
\ No newline at end of file
diff --git a/backport-changelog/6.6/6824.md b/backport-changelog/6.6/6824.md
new file mode 100644
index 0000000000000..7dc6e090f0149
--- /dev/null
+++ b/backport-changelog/6.6/6824.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6824
+
+* https://github.com/WordPress/gutenberg/pull/62550
diff --git a/backport-changelog/6.6/6825.md b/backport-changelog/6.6/6825.md
new file mode 100644
index 0000000000000..73e5f46600d89
--- /dev/null
+++ b/backport-changelog/6.6/6825.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6825
+
+* https://github.com/WordPress/gutenberg/pull/62552
diff --git a/backport-changelog/6.7/6750.md b/backport-changelog/6.7/6750.md
new file mode 100644
index 0000000000000..257ebe3a5aa69
--- /dev/null
+++ b/backport-changelog/6.7/6750.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/6750
+
+* https://github.com/WordPress/gutenberg/pull/62357
\ No newline at end of file
diff --git a/bin/cherry-pick.mjs b/bin/cherry-pick.mjs
index d81bc017fc0be..e6b2b6f0692a5 100644
--- a/bin/cherry-pick.mjs
+++ b/bin/cherry-pick.mjs
@@ -466,7 +466,7 @@ function getCurrentBranch() {
*/
async function reportGhUnavailable() {
console.log(
- 'Github CLI is not setup. This script will not be able to automatically'
+ 'GitHub CLI is not setup. This script will not be able to automatically'
);
console.log(
'comment on the processed PRs and remove the backport label from them.'
diff --git a/bin/packages/build-worker.js b/bin/packages/build-worker.js
index 3f1512ef0feb7..06e30efc6c6dc 100644
--- a/bin/packages/build-worker.js
+++ b/bin/packages/build-worker.js
@@ -13,6 +13,8 @@ const postcss = require( 'postcss' );
*/
const getBabelConfig = require( './get-babel-config' );
+const isDev = process.env.NODE_ENV === 'development';
+
/**
* Path to packages directory.
*
@@ -27,10 +29,12 @@ const PACKAGES_DIR = path
*
* @type {Object}
*/
-const JS_ENVIRONMENTS = {
- main: 'build',
- module: 'build-module',
-};
+const JS_ENVIRONMENTS = isDev
+ ? { module: 'build-module' }
+ : {
+ main: 'build',
+ module: 'build-module',
+ };
/**
* Promisified fs.readFile.
@@ -122,9 +126,10 @@ async function buildCSS( file ) {
data: ''.concat( '@use "sass:math";', importLists, contents ),
} );
- const result = await postcss(
- require( '@wordpress/postcss-plugins-preset' )
- ).process( builtSass.css, {
+ const result = await postcss( [
+ require( 'postcss-local-keyframes' ),
+ ...require( '@wordpress/postcss-plugins-preset' ),
+ ] ).process( builtSass.css, {
from: 'src/app.css',
to: 'dest/app.css',
} );
diff --git a/bin/packages/check-build-type-declaration-files.js b/bin/packages/check-build-type-declaration-files.js
index 3d70145ceb588..ffc68c83b8da8 100644
--- a/bin/packages/check-build-type-declaration-files.js
+++ b/bin/packages/check-build-type-declaration-files.js
@@ -70,7 +70,7 @@ async function getDecFile( packagePath ) {
async function typecheckDeclarations( file ) {
return new Promise( ( resolve, reject ) => {
exec(
- `npx tsc --target esnext --moduleResolution node --noEmit "${ file }"`,
+ `npx tsc --target esnext --moduleResolution node --noEmit --skipLibCheck "${ file }"`,
( error, stdout, stderr ) => {
if ( error ) {
reject( { file, error, stderr, stdout } );
diff --git a/bin/plugin/commands/changelog.js b/bin/plugin/commands/changelog.js
index 652c6e97a6c0a..43164a80ab24a 100644
--- a/bin/plugin/commands/changelog.js
+++ b/bin/plugin/commands/changelog.js
@@ -606,11 +606,11 @@ function getEntry( issue ) {
/**
* Builds a formatted string of the Issue/PR title with a link
- * to the Github URL for that item.
+ * to the GitHub URL for that item.
*
* @param {string} title the title of the Issue/PR.
* @param {number} number the ID/number of the Issue/PR.
- * @param {string} url the URL of the Github Issue/PR.
+ * @param {string} url the URL of the GitHub Issue/PR.
* @return {string} the formatted item
*/
function getFormattedItemDescription( title, number, url ) {
@@ -856,7 +856,7 @@ function sortFeatureGroups( featureGroups ) {
}
/**
- * Returns a list of PRs created by first time contributors based on the Github
+ * Returns a list of PRs created by first time contributors based on the GitHub
* label associated with the PR. Also filters out any "bots".
*
* @param {IssuesListForRepoResponseItem[]} pullRequests List of pull requests.
diff --git a/bin/plugin/commands/test/changelog.js b/bin/plugin/commands/test/changelog.js
index 12420fd1e4b6f..9c9d423d18d1c 100644
--- a/bin/plugin/commands/test/changelog.js
+++ b/bin/plugin/commands/test/changelog.js
@@ -25,7 +25,7 @@ import _pullRequests from './fixtures/pull-requests.json';
import botPullRequestFixture from './fixtures/bot-pull-requests.json';
/**
- * pull-requests.json is a static snapshot of real data from the Github API.
+ * pull-requests.json is a static snapshot of real data from the GitHub API.
* We merge this with dummy fixture data for a "bot" pull request so as to
* ensure future updates to the pull-requests.json doesn't reduce test coverage
* of filtering out of bot PRs.
diff --git a/changelog.txt b/changelog.txt
index decdb88ea9a7a..8679f4a40ba9e 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1378,7 +1378,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@tellthemachines @arthur791004
+@tellthemachines @arthur791004
= 18.1.1 =
@@ -1392,7 +1392,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@okmttdhr @ntsekouras
+@okmttdhr @ntsekouras
= 18.1.0 =
@@ -2423,7 +2423,7 @@ The following contributors merged PRs in this release:
- Rich text: Fix typing into empty flex element. ([59473](https://github.com/WordPress/gutenberg/pull/59473))
- URLPopover: Fix a problem with the layout of link settings. ([58906](https://github.com/WordPress/gutenberg/pull/58906))
- Fix issue with appender jumping when creating a new pattern. ([59582](https://github.com/WordPress/gutenberg/pull/59582))
-- Allow event bubbling even if keydown is passed. ([59474](https://github.com/WordPress/gutenberg/pull/59474))
+- Allow event bubbling even if keydown is passed. ([59474](https://github.com/WordPress/gutenberg/pull/59474))
#### Custom Fields
- Block Bindings: Fix console error when selecting a bound block. ([59598](https://github.com/WordPress/gutenberg/pull/59598))
@@ -3344,7 +3344,7 @@ The following contributors merged PRs in this release:
- Docs: Copy and formatting edits for the "Static or Dynamic rendering" guide. ([58681](https://github.com/WordPress/gutenberg/pull/58681))
- Docs: Copy and formatting edits for the "The block in the Editor" guide. ([58697](https://github.com/WordPress/gutenberg/pull/58697))
- Docs: Copy and formatting edits for the "The block wrapper" guide. ([58704](https://github.com/WordPress/gutenberg/pull/58704))
-- Docs: Copy and formatting edits for the "Working with Javascript for the Block Editor" guide. ([58651](https://github.com/WordPress/gutenberg/pull/58651))
+- Docs: Copy and formatting edits for the "Working with JavaScript for the Block Editor" guide. ([58651](https://github.com/WordPress/gutenberg/pull/58651))
- Docs: Copy and formatting edits for the "block.json" guide. ([58732](https://github.com/WordPress/gutenberg/pull/58732))
- Docs: Copy edits and list formatting for main Block Editor Handbook readme. ([58652](https://github.com/WordPress/gutenberg/pull/58652))
- Docs: Fix list formatting and some grammar in the Entities explanation doc. ([58655](https://github.com/WordPress/gutenberg/pull/58655))
@@ -3563,7 +3563,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@ramonjd
+@ramonjd
= 17.7.0-rc.1 =
@@ -3918,7 +3918,7 @@ The following contributors merged PRs in this release:
- Docs: Copy and formatting edits for the "Static or Dynamic rendering" guide. ([58681](https://github.com/WordPress/gutenberg/pull/58681))
- Docs: Copy and formatting edits for the "The block in the Editor" guide. ([58697](https://github.com/WordPress/gutenberg/pull/58697))
- Docs: Copy and formatting edits for the "The block wrapper" guide. ([58704](https://github.com/WordPress/gutenberg/pull/58704))
-- Docs: Copy and formatting edits for the "Working with Javascript for the Block Editor" guide. ([58651](https://github.com/WordPress/gutenberg/pull/58651))
+- Docs: Copy and formatting edits for the "Working with JavaScript for the Block Editor" guide. ([58651](https://github.com/WordPress/gutenberg/pull/58651))
- Docs: Copy and formatting edits for the "block.json" guide. ([58732](https://github.com/WordPress/gutenberg/pull/58732))
- Docs: Copy edits and list formatting for main Block Editor Handbook readme. ([58652](https://github.com/WordPress/gutenberg/pull/58652))
- Docs: Fix list formatting and some grammar in the Entities explanation doc. ([58655](https://github.com/WordPress/gutenberg/pull/58655))
@@ -4145,7 +4145,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@dd32
+@dd32
= 17.6.2 =
@@ -4663,7 +4663,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@andrewserong @t-hamano @luisherranz @pbking
+@andrewserong @t-hamano @luisherranz @pbking
= 17.6.0-rc.1 =
@@ -5090,7 +5090,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@fullofcaffeine
+@fullofcaffeine
@@ -5107,7 +5107,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@youknowriad @fullofcaffeine
+@youknowriad @fullofcaffeine
@@ -5380,7 +5380,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@glendaviesnz
+@glendaviesnz
@@ -5412,7 +5412,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@ellatrix
+@ellatrix
@@ -5487,7 +5487,7 @@ The following contributors merged PRs in this release:
- Gallery: Hide some controls when multi-editing blocks. ([57378](https://github.com/WordPress/gutenberg/pull/57378))
- Image Block: Get lightbox trigger button ref via data-wp-init. ([57089](https://github.com/WordPress/gutenberg/pull/57089))
- Image: Hide caption control when multi-editing images. ([57357](https://github.com/WordPress/gutenberg/pull/57357))
-- Video: Hide some controls when multi-editing blocks. ([57375](https://github.com/WordPress/gutenberg/pull/57375))
+- Video: Hide some controls when multi-editing blocks. ([57375](https://github.com/WordPress/gutenberg/pull/57375))
- Image Block: Fix deprecation when width/height attribute is number. ([57063](https://github.com/WordPress/gutenberg/pull/57063))
#### Patterns
@@ -5500,7 +5500,7 @@ The following contributors merged PRs in this release:
- Fix image upload bug. ([57040](https://github.com/WordPress/gutenberg/pull/57040))
- Reduce clearance around the Frame in the site editor. ([57023](https://github.com/WordPress/gutenberg/pull/57023))
- Swap Template: Show the right templates for the right post type. ([57149](https://github.com/WordPress/gutenberg/pull/57149))
-- Save Button: Fix the translation of the Activate button. ([57147](https://github.com/WordPress/gutenberg/pull/57147))
+- Save Button: Fix the translation of the Activate button. ([57147](https://github.com/WordPress/gutenberg/pull/57147))
- SlotFill: Allow contextual SlotFillProviders. ([56779](https://github.com/WordPress/gutenberg/pull/56779))
#### Post Editor
@@ -5729,7 +5729,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@glendaviesnz
+@glendaviesnz
@@ -6418,7 +6418,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@jorgefilipecosta
+@jorgefilipecosta
= 17.2.0 =
@@ -6662,7 +6662,7 @@ The following contributors merged PRs in this release:
- Docs: Fundamentals of Block Development - File structure of a block. ([56551](https://github.com/WordPress/gutenberg/pull/56551))
- Docs: Fundamentals of Block Development - Registration of a block. ([56334](https://github.com/WordPress/gutenberg/pull/56334))
- Docs: Fundamentals of Block Development - The block wrapper. ([56596](https://github.com/WordPress/gutenberg/pull/56596))
-- Docs: Fundamentals of Block Development - Working with Javascript in the Block Editor. ([56553](https://github.com/WordPress/gutenberg/pull/56553))
+- Docs: Fundamentals of Block Development - Working with JavaScript in the Block Editor. ([56553](https://github.com/WordPress/gutenberg/pull/56553))
- Docs: Fundamentals of Block Development - block.json. ([56435](https://github.com/WordPress/gutenberg/pull/56435))
- Docs: Improve downloadBlob example. ([56225](https://github.com/WordPress/gutenberg/pull/56225))
- Documentation - Block Editor Handbook - Add end user documentation about Block Editor as a resource on the Landing Page of the Block Editor Handbook. ([49854](https://github.com/WordPress/gutenberg/pull/49854))
@@ -6991,7 +6991,7 @@ The following contributors merged PRs in this release:
- Docs: Fundamentals of Block Development - File structure of a block. ([56551](https://github.com/WordPress/gutenberg/pull/56551))
- Docs: Fundamentals of Block Development - Registration of a block. ([56334](https://github.com/WordPress/gutenberg/pull/56334))
- Docs: Fundamentals of Block Development - The block wrapper. ([56596](https://github.com/WordPress/gutenberg/pull/56596))
-- Docs: Fundamentals of Block Development - Working with Javascript in the Block Editor. ([56553](https://github.com/WordPress/gutenberg/pull/56553))
+- Docs: Fundamentals of Block Development - Working with JavaScript in the Block Editor. ([56553](https://github.com/WordPress/gutenberg/pull/56553))
- Docs: Fundamentals of Block Development - block.json. ([56435](https://github.com/WordPress/gutenberg/pull/56435))
- Docs: Improve downloadBlob example. ([56225](https://github.com/WordPress/gutenberg/pull/56225))
- Documentation - Block Editor Handbook - Add end user documentation about Block Editor as a resource on the Landing Page of the Block Editor Handbook. ([49854](https://github.com/WordPress/gutenberg/pull/49854))
@@ -8077,7 +8077,7 @@ The following contributors merged PRs in this release:
## Changelog
This copies the commits from the 16.7.1 patch release into the 16.8.0 main release.
-
+
### Tools
#### Build Tooling
@@ -9536,7 +9536,7 @@ The following contributors merged PRs in this release:
- Button: Remove default border from the destructive button. ([53607](https://github.com/WordPress/gutenberg/pull/53607))
- LineHeightControl: Allow for more granular control of decimal places. ([52902](https://github.com/WordPress/gutenberg/pull/52902))
- Snackbar: Design and motion improvements. ([53248](https://github.com/WordPress/gutenberg/pull/53248))
-- Modal:
+- Modal:
- Add `headerActions` prop to enable buttons or other elements to be injected in the header. ([53328](https://github.com/WordPress/gutenberg/pull/53328))
- Enhance overlay interactions, enabling outside interactions without dismissal. ([52994](https://github.com/WordPress/gutenberg/pull/52994))
- ProgressBar: Update colors, including gray 300 for track color ([53349](https://github.com/WordPress/gutenberg/pull/53349)), theme system accent for indicator color ([53347](https://github.com/WordPress/gutenberg/pull/53347)), and the theme accent color variable. ([53632](https://github.com/WordPress/gutenberg/pull/53632)).
@@ -9546,7 +9546,7 @@ The following contributors merged PRs in this release:
- Add a `stretch` option to block's vertical alignment options. ([53325](https://github.com/WordPress/gutenberg/pull/53325))
- Exit upon pressing enter in an empty paragraph at the end of the block. ([53311](https://github.com/WordPress/gutenberg/pull/53311))
- Classic block: Increase dimensions of modal and allow toggling fullscreen. ([53449](https://github.com/WordPress/gutenberg/pull/53449))
-- Details block:
+- Details block:
- Add `accordion` and `toggle` keywords to improve block's discoverability. ([53501](https://github.com/WordPress/gutenberg/pull/53501))
- Add layout and block spacing options. ([53282](https://github.com/WordPress/gutenberg/pull/53282))
- File block: Add block spacing options. ([45107](https://github.com/WordPress/gutenberg/pull/45107))
@@ -9586,7 +9586,7 @@ The following contributors merged PRs in this release:
### Bug Fixes
-#### Commands
+#### Commands
- Style tweaks to fix metrics for resting and no results view in command palette. ([53497](https://github.com/WordPress/gutenberg/pull/53497))
- Order template results in Site Editor, to fix some templates not displaying. ([53286](https://github.com/WordPress/gutenberg/pull/53286))
- Don't allow access to Styles-related pages via the command palette in the hybrid theme. ([53123](https://github.com/WordPress/gutenberg/pull/53123))
@@ -9594,12 +9594,12 @@ The following contributors merged PRs in this release:
#### Block Library
- Button block: Avoid losing user changes when the `ButtonEdit` component re-renders. ([53507](https://github.com/WordPress/gutenberg/pull/53507))
- Cover block: Fix flickering when inserted in templates and also fix `isDark` calculation bugs. ([53253](https://github.com/WordPress/gutenberg/pull/53253))
-- Footnotes block:
+- Footnotes block:
- Ensure autosave works and escapes quotes as expected. ([53664](https://github.com/WordPress/gutenberg/pull/53664))
- Fix accidental override. ([53663](https://github.com/WordPress/gutenberg/pull/53663))
- Fix recursion into updating attributes when attributes is not an object. ([53257](https://github.com/WordPress/gutenberg/pull/53257))
- Remove Footnotes when interactive formatting is disabled. ([53474](https://github.com/WordPress/gutenberg/pull/53474))
-- Image block:
+- Image block:
- Fix image stretching with only height. ([53443](https://github.com/WordPress/gutenberg/pull/53443))
- Don't render `DimensionsTool` if it is not resizable. ([53181](https://github.com/WordPress/gutenberg/pull/53181))
- Fix stretched images constrained by max-width. ([53274](https://github.com/WordPress/gutenberg/pull/53274))
@@ -9715,7 +9715,7 @@ The following contributors merged PRs in this release:
- Fix outdated specification in the "Anatomy of a Block". ([53581](https://github.com/WordPress/gutenberg/pull/53581))
#### How To Guides
-- Block Tutorial:
+- Block Tutorial:
- Adds import from `@wordpress/i18n` in code example. ([53504](https://github.com/WordPress/gutenberg/pull/53504))
- Adds package.json configuration instructions to tutorial. ([53689](https://github.com/WordPress/gutenberg/pull/53689))
- Building a Custom Block Editor: Consolidate and update the guide. ([53159](https://github.com/WordPress/gutenberg/pull/53159))
@@ -9731,7 +9731,7 @@ The following contributors merged PRs in this release:
- Edit Post: Update "PluginDocumentSettingPanel" documentation. ([53393](https://github.com/WordPress/gutenberg/pull/53393))
- Interface: Fix "complimentary" typo with "complementary". ([53413](https://github.com/WordPress/gutenberg/pull/53413))
-#### Interactivity API
+#### Interactivity API
- Revamp of README to include API Reference among other indications. ([53385](https://github.com/WordPress/gutenberg/pull/53385))
- Add missing section in ToC and minor improvements to Getting Started Guide. ([53362](https://github.com/WordPress/gutenberg/pull/53362))
- Update Interactivity API package README with clear references to documentation. ([53388](https://github.com/WordPress/gutenberg/pull/53388))
@@ -9753,7 +9753,7 @@ The following contributors merged PRs in this release:
#### Block Library
- Button block: Replace the `isSmall` deprecated prop in the `WidthPanel`. ([53472](https://github.com/WordPress/gutenberg/pull/53472))
- Details block: Remove unnecessary comment attributes. ([51610](https://github.com/WordPress/gutenberg/pull/51610))
-- Footnotes block:
+- Footnotes block:
- Add some test coverage for footnotes logic in useEntityBlockEditor. ([53376](https://github.com/WordPress/gutenberg/pull/53376))
- Checking type before using count(). ([53660](https://github.com/WordPress/gutenberg/pull/53660))
- LinkControl/LinkUI: Remove unused `className` prop. ([53348](https://github.com/WordPress/gutenberg/pull/53348))
@@ -10121,7 +10121,7 @@ The following contributors merged PRs in this release:
### Tools
- Add GH action to enforce PR labels. ([52760](https://github.com/WordPress/gutenberg/pull/52760))
-- Changelog automation:
+- Changelog automation:
- Make Accessibility a top-level section. ([52900](https://github.com/WordPress/gutenberg/pull/52900))
- Update to work with consolidated a11y labels. ([52896](https://github.com/WordPress/gutenberg/pull/52896))
- Use the correct label to filter Mobile app PRs. ([53024](https://github.com/WordPress/gutenberg/pull/53024))
@@ -10420,7 +10420,7 @@ The following contributors merged PRs in this release:
#### Project Management
- Update issue gardening automation with new label. ([52173](https://github.com/WordPress/gutenberg/pull/52173))
- Revert "Update Changelog for 16.1.2". ([52433](https://github.com/WordPress/gutenberg/pull/52433))
-- Github workflow: Add a PHP backport changes action. ([52096](https://github.com/WordPress/gutenberg/pull/52096))
+- GitHub workflow: Add a PHP backport changes action. ([52096](https://github.com/WordPress/gutenberg/pull/52096))
## First time contributors
@@ -10459,7 +10459,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@getdave @mcsf
+@getdave @mcsf
= 16.2.0 =
@@ -10523,13 +10523,13 @@ The following contributors merged PRs in this release:
- Footnotes: save numbering through the entity provider (https://github.com/WordPress/gutenberg/pull/52423)
#### Code Quality / Performance
-- Iframe: avoid asset parsing & fix script localisation
+- Iframe: avoid asset parsing & fix script localisation
## Contributors
The following contributors merged PRs in this release:
-@ellatrix @ockham @t-hamano
+@ellatrix @ockham @t-hamano
= 16.2.0-rc.1 =
@@ -10782,7 +10782,7 @@ The following contributors merged PRs in this release:
- Update delete page button label. ([51812](https://github.com/WordPress/gutenberg/pull/51812))
- Update versions in WP for 6.3. ([51984](https://github.com/WordPress/gutenberg/pull/51984))
- Wrap "Move to trash" and "Switch to draft" buttons when labels are too long to fit on a single row. ([52249](https://github.com/WordPress/gutenberg/pull/52249))
-- [Github-Actions-Workflows][Plugin-Release] Allow shipping a point-release for an older stable release. ([49082](https://github.com/WordPress/gutenberg/pull/49082))
+- [GitHub-Actions-Workflows][Plugin-Release] Allow shipping a point-release for an older stable release. ([49082](https://github.com/WordPress/gutenberg/pull/49082))
#### Block Library
- Block Editor: Unify texts for Create pattern modal. ([52151](https://github.com/WordPress/gutenberg/pull/52151))
@@ -11097,7 +11097,7 @@ The following contributors merged PRs in this release:
- Update delete page button label. ([51812](https://github.com/WordPress/gutenberg/pull/51812))
- Update versions in WP for 6.3. ([51984](https://github.com/WordPress/gutenberg/pull/51984))
- Wrap "Move to trash" and "Switch to draft" buttons when labels are too long to fit on a single row. ([52249](https://github.com/WordPress/gutenberg/pull/52249))
-- [Github-Actions-Workflows][Plugin-Release] Allow shipping a point-release for an older stable release. ([49082](https://github.com/WordPress/gutenberg/pull/49082))
+- [GitHub-Actions-Workflows][Plugin-Release] Allow shipping a point-release for an older stable release. ([49082](https://github.com/WordPress/gutenberg/pull/49082))
#### Block Library
- Block Editor: Unify texts for Create pattern modal. ([52151](https://github.com/WordPress/gutenberg/pull/52151))
@@ -11423,7 +11423,7 @@ The following contributors merged PRs in this release:
#### Block Variations
- [Block Library - Post Terms]: Custom taxonomies do not show icons when transforming from the toolbar. ([51476](https://github.com/WordPress/gutenberg/pull/51476))
-#### Page Content Focus
+#### Page Content Focus
- Switch to Page panel when deselecting a block [51881](https://github.com/WordPress/gutenberg/pull/51881)
- Don't show 'Back to page' notification when navigating away from page [51880](https://github.com/WordPress/gutenberg/pull/51880)
- useBlockSync(): Reset inner blocks when component unmounts [51783](https://github.com/WordPress/gutenberg/pull/51783)
@@ -11563,7 +11563,7 @@ The following contributors merged PRs in this release:
- Babel config: Enable useSpread option for JSX transform to reduce transpilation. ([51574](https://github.com/WordPress/gutenberg/pull/51574))
- Lodash: Remove from lint staged type check. ([51698](https://github.com/WordPress/gutenberg/pull/51698))
- Performance Tests: Update the base point to compare against. ([51689](https://github.com/WordPress/gutenberg/pull/51689))
-- wp-env: Try to fix failing PHP Github actions. ([51513](https://github.com/WordPress/gutenberg/pull/51513))
+- wp-env: Try to fix failing PHP GitHub actions. ([51513](https://github.com/WordPress/gutenberg/pull/51513))
- npm lockfile: Hoist reakit and date-fns packages to the top. ([51500](https://github.com/WordPress/gutenberg/pull/51500))
#### Plugin
@@ -11582,7 +11582,7 @@ The following PRs were merged by first time contributors:
The following contributors merged PRs in this release:
-@aaronrobertshaw @afercia @alexstine @andrewserong @aristath @artemiomorales @aurooba @bangank36 @c4rl0sbr4v0 @carolinan @ciampo @dcalhoun @derekblank @diegohaz @draganescu @ellatrix @fabiankaegy @fluiddot @geriux @getdave @glendaviesnz @jameskoster @jasmussen @jeryj @jhnstn @jsnajdr @juanfra @kozer @luisherranz @MaggieCabrera @Mamaduka @matiasbenedetto @mcliwanow @mcsf @mikachan @n2erjo00 @noahtallen @noisysocks @ntsekouras @oandregal @okmttdhr @paulopmt1 @pbking @peterwilsoncc @pooja-muchandikar @ramonjd @richtabor @samnajian @SantosGuillamot @SavPhill @SaxonF @scruffian @shimotmk @Sidsector9 @SiobhyB @spacedmonkey @stokesman @sunyatasattva @t-hamano @talldan @tellthemachines @tyxla @walbo @WunderBart @xerpa43 @youknowriad @priethor @ajlende @mirka
+@aaronrobertshaw @afercia @alexstine @andrewserong @aristath @artemiomorales @aurooba @bangank36 @c4rl0sbr4v0 @carolinan @ciampo @dcalhoun @derekblank @diegohaz @draganescu @ellatrix @fabiankaegy @fluiddot @geriux @getdave @glendaviesnz @jameskoster @jasmussen @jeryj @jhnstn @jsnajdr @juanfra @kozer @luisherranz @MaggieCabrera @Mamaduka @matiasbenedetto @mcliwanow @mcsf @mikachan @n2erjo00 @noahtallen @noisysocks @ntsekouras @oandregal @okmttdhr @paulopmt1 @pbking @peterwilsoncc @pooja-muchandikar @ramonjd @richtabor @samnajian @SantosGuillamot @SavPhill @SaxonF @scruffian @shimotmk @Sidsector9 @SiobhyB @spacedmonkey @stokesman @sunyatasattva @t-hamano @talldan @tellthemachines @tyxla @walbo @WunderBart @xerpa43 @youknowriad @priethor @ajlende @mirka
@@ -11840,7 +11840,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@hellofromtonya @ndiego
+@hellofromtonya @ndiego
= 15.9.0 =
@@ -11900,7 +11900,7 @@ The following contributors merged PRs in this release:
- Remove `unwrap` from transforms and add `ungroup` to more blocks. ([50385](https://github.com/WordPress/gutenberg/pull/50385))
- Add new API to allow inserter items to be prioritised. ([50510](https://github.com/WordPress/gutenberg/pull/50510))
- Integrate `prioritizedInserterBlocks` API to slash inserter. ([50658](https://github.com/WordPress/gutenberg/pull/50658))
-
+
#### Global Styles
- Custom CSS: Force display of in custom css input boxes to LTR. ([50768](https://github.com/WordPress/gutenberg/pull/50768))
- Styles Navigation Screen: Add Style Book. ([50566](https://github.com/WordPress/gutenberg/pull/50566))
@@ -11919,7 +11919,7 @@ The following contributors merged PRs in this release:
#### Accessibility
- Modals: Update the Cancel action's button design. ([50544](https://github.com/WordPress/gutenberg/pull/50544))
- Writing flow: Improve keyboard navigation on certain input types. ([43667](https://github.com/WordPress/gutenberg/pull/43667))
-
+
#### Icons
- Add new `HeadingLevel` icons. ([50856](https://github.com/WordPress/gutenberg/pull/50856))
- Smaller external link icon. ([50728](https://github.com/WordPress/gutenberg/pull/50728))
@@ -12631,7 +12631,7 @@ Continued the work refactor away from Lodash usages to reduce the build size
- Re-write of the landing page. ([49643](https://github.com/WordPress/gutenberg/pull/49643))
- Improve insertBlock(s) documentation. ([50078](https://github.com/WordPress/gutenberg/pull/50078))
- Small Typo: Remove dots. ([49853](https://github.com/WordPress/gutenberg/pull/49853))
-
+
### Code Quality
- Fix PrivateInserter import. ([50038](https://github.com/WordPress/gutenberg/pull/50038))
@@ -12649,7 +12649,7 @@ Continued the work refactor away from Lodash usages to reduce the build size
- Migrate CPT end-to-end tests to Playwright. ([50031](https://github.com/WordPress/gutenberg/pull/50031))
- Fonts API: Add tests for gutenberg_add_registered_fonts_to_theme_json(). ([50049](https://github.com/WordPress/gutenberg/pull/50049))
- Expand multi-line block tests. ([49732](https://github.com/WordPress/gutenberg/pull/49732))
-- Rich text test helpers mimic user events. ([49804](https://github.com/WordPress/gutenberg/pull/49804))
+- Rich text test helpers mimic user events. ([49804](https://github.com/WordPress/gutenberg/pull/49804))
- Fix editor canvas detaching error in end-to-end tests. ([49374](https://github.com/WordPress/gutenberg/pull/49374))
#### Build Tooling
@@ -12819,7 +12819,7 @@ The following contributors merged PRs in this release:
### Performance
-- Continued the work refactor away from Lodash usages to reduce the build size
+- Continued the work refactor away from Lodash usages to reduce the build size
([49725](https://github.com/WordPress/gutenberg/pull/49725), [49724](https://github.com/WordPress/gutenberg/pull/49724), [49638](https://github.com/WordPress/gutenberg/pull/49638), [49654](https://github.com/WordPress/gutenberg/pull/49654), [49639](https://github.com/WordPress/gutenberg/pull/49639), [49637](https://github.com/WordPress/gutenberg/pull/49637), [49727](https://github.com/WordPress/gutenberg/pull/49727))
### Documentation
@@ -13515,7 +13515,7 @@ The following contributors merged PRs in this release:
- Create automatic change higher order reducer. ([48312](https://github.com/WordPress/gutenberg/pull/48312))
- [Inserter]: Preload media categories empty check - client side. ([47503](https://github.com/WordPress/gutenberg/pull/47503))
-#### Post Editor
+#### Post Editor
- Revert iframed editor for WP core only. ([48076](https://github.com/WordPress/gutenberg/pull/48076))
- PageAttributesCheck: Return boolean value directly from the selector. ([48336](https://github.com/WordPress/gutenberg/pull/48336))
- Apply busy status to the publish button in progress and unify button width. ([48444](https://github.com/WordPress/gutenberg/pull/48444))
@@ -13633,7 +13633,7 @@ The following contributors merged PRs in this release:
### Performance
-#### Block Editor
+#### Block Editor
- Block Editor: Improve empty `getBlockParents()` perf. ([48242](https://github.com/WordPress/gutenberg/pull/48242))
- Fix perf regression in duotone hooks. ([48401](https://github.com/WordPress/gutenberg/pull/48401))
- Writing flow: Avoid recalc style on every selection change. ([48409](https://github.com/WordPress/gutenberg/pull/48409))
@@ -13664,7 +13664,7 @@ The following contributors merged PRs in this release:
- Lodash: Remove some `_.get()` from Image block. ([48489](https://github.com/WordPress/gutenberg/pull/48489))
- Playwright: Fix request utils for non Docker envs. ([48206](https://github.com/WordPress/gutenberg/pull/48206))
- [Private APIs] Only prevent module re-registration if IS_WORDPRESS_CORE. ([48352](https://github.com/WordPress/gutenberg/pull/48352))
-- Add a manual performance job that we can trigger from Github UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
+- Add a manual performance job that we can trigger from GitHub UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
- Track new front-end metric: LCP-TTFB. ([48288](https://github.com/WordPress/gutenberg/pull/48288))
### Documentation
@@ -13678,7 +13678,7 @@ The following contributors merged PRs in this release:
- Updates to the curating the editor experience to include 6.1 & 6.2 items. ([48294](https://github.com/WordPress/gutenberg/pull/48294))
### Tools
-#### Testing
+#### Testing
- Migrate `switch-to-draft` to Playwright. ([48120](https://github.com/WordPress/gutenberg/pull/48120))
- VizReg end-to-end tests: Programmatically test all combinations of a given list of props/values. ([48260](https://github.com/WordPress/gutenberg/pull/48260))
- Update end-to-end test snapshots to Jest 29 default. ([48626](https://github.com/WordPress/gutenberg/pull/48626))
@@ -13740,7 +13740,7 @@ The following contributors merged PRs in this release:
- Create automatic change higher order reducer. ([48312](https://github.com/WordPress/gutenberg/pull/48312))
- [Inserter]: Preload media categories empty check - client side. ([47503](https://github.com/WordPress/gutenberg/pull/47503))
-#### Post Editor
+#### Post Editor
- Revert iframed editor for WP core only. ([48076](https://github.com/WordPress/gutenberg/pull/48076))
- PageAttributesCheck: Return boolean value directly from the selector. ([48336](https://github.com/WordPress/gutenberg/pull/48336))
- Apply busy status to the publish button in progress and unify button width. ([48444](https://github.com/WordPress/gutenberg/pull/48444))
@@ -13858,7 +13858,7 @@ The following contributors merged PRs in this release:
### Performance
-#### Block Editor
+#### Block Editor
- Block Editor: Improve empty `getBlockParents()` perf. ([48242](https://github.com/WordPress/gutenberg/pull/48242))
- Fix perf regression in duotone hooks. ([48401](https://github.com/WordPress/gutenberg/pull/48401))
- Writing flow: Avoid recalc style on every selection change. ([48409](https://github.com/WordPress/gutenberg/pull/48409))
@@ -13889,7 +13889,7 @@ The following contributors merged PRs in this release:
- Lodash: Remove some `_.get()` from Image block. ([48489](https://github.com/WordPress/gutenberg/pull/48489))
- Playwright: Fix request utils for non Docker envs. ([48206](https://github.com/WordPress/gutenberg/pull/48206))
- [Private APIs] Only prevent module re-registration if IS_WORDPRESS_CORE. ([48352](https://github.com/WordPress/gutenberg/pull/48352))
-- Add a manual performance job that we can trigger from Github UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
+- Add a manual performance job that we can trigger from GitHub UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
- Track new front-end metric: LCP-TTFB. ([48288](https://github.com/WordPress/gutenberg/pull/48288))
### Documentation
@@ -13903,7 +13903,7 @@ The following contributors merged PRs in this release:
- Updates to the curating the editor experience to include 6.1 & 6.2 items. ([48294](https://github.com/WordPress/gutenberg/pull/48294))
### Tools
-#### Testing
+#### Testing
- Migrate `switch-to-draft` to Playwright. ([48120](https://github.com/WordPress/gutenberg/pull/48120))
- VizReg end-to-end tests: Programmatically test all combinations of a given list of props/values. ([48260](https://github.com/WordPress/gutenberg/pull/48260))
- Update end-to-end test snapshots to Jest 29 default. ([48626](https://github.com/WordPress/gutenberg/pull/48626))
@@ -14162,7 +14162,7 @@ The following contributors merged PRs in this release:
- [Automated Testing]: Fix wrong button fixture. ([48305](https://github.com/WordPress/gutenberg/pull/48305))
#### Build Tooling
-- Add a manual performance job that we can trigger from Github UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
+- Add a manual performance job that we can trigger from GitHub UI. ([48302](https://github.com/WordPress/gutenberg/pull/48302))
- Add command to run performance tests in debug mode. ([48614](https://github.com/WordPress/gutenberg/pull/48614))
- Make the performance tests more stable. ([48094](https://github.com/WordPress/gutenberg/pull/48094))
- SpacingSizesControl: Fix white dot on thumb. ([48574](https://github.com/WordPress/gutenberg/pull/48574))
@@ -14257,7 +14257,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@jsnajdr
+@jsnajdr
= 15.2.2 =
@@ -15342,7 +15342,7 @@ The following contributors merged PRs in this release:
### Bug Fixes
#### Block Editor
-- Move block variation picker styles in the iframe ([47109](https://github.com/WordPress/gutenberg/pull/47109))
+- Move block variation picker styles in the iframe ([47109](https://github.com/WordPress/gutenberg/pull/47109))
- Add useBlockPreview styles in iframe ([47110](https://github.com/WordPress/gutenberg/pull/47110))
#### Block Library
@@ -15897,7 +15897,7 @@ Fixes compatibility with WordPress 6.0.x. This includes the following PRs:
- #46809
Broadly, this needed to include the two refactors of the Theme_JSON compatibility files, along with two fixes switching `wp_*` and `gutenberg_*` function variants as needed.
-
+
## Contributors
The following contributors were involved with this release:
@@ -16204,7 +16204,7 @@ The following contributors merged PRs in this release:
### Tools
#### Build Tooling
-- Adds Github Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247))
+- Adds GitHub Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247))
- Prevent api-fetch and core-data from being imported in the block editor package. ([46302](https://github.com/WordPress/gutenberg/pull/46302))
- Serialize the map objects properly in the Redux dev tools. ([46282](https://github.com/WordPress/gutenberg/pull/46282))
@@ -16482,7 +16482,7 @@ The following contributors merged PRs in this release:
### Tools
#### Build Tooling
-- Adds Github Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247))
+- Adds GitHub Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247))
- Prevent api-fetch and core-data from being imported in the block editor package. ([46302](https://github.com/WordPress/gutenberg/pull/46302))
- Serialize the map objects properly in the Redux dev tools. ([46282](https://github.com/WordPress/gutenberg/pull/46282))
@@ -16519,7 +16519,7 @@ The following contributors merged PRs in this release:
The following contributors merged PRs in this release:
-@youknowriad
+@youknowriad
= 14.7.2 =
@@ -17880,7 +17880,7 @@ The following contributors merged PRs in this release:
- Query Loop: Hide instructions for FormTokenField. ([44641](https://github.com/WordPress/gutenberg/pull/44641))
- Tag Cloud: Remove `strtolower` around taxonomy name. ([16112](https://github.com/WordPress/gutenberg/pull/16112))
- Video: Update placeholder style. ([44215](https://github.com/WordPress/gutenberg/pull/44215))
-
+
#### Components
- FontSizePicker: Make control take up full width. ([44559](https://github.com/WordPress/gutenberg/pull/44559))
- Placeholder: Remove unnecessary background color. ([44497](https://github.com/WordPress/gutenberg/pull/44497))
@@ -18313,7 +18313,7 @@ The following PRs were merged by first time contributors:
The following contributors merged PRs in this release:
-@aaronrobertshaw @ajlende @annezazu @apmatthews @aristath @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @dcalhoun @draganescu @ellatrix @geriux @glendaviesnz @gziolo @jasmussen @jorgefilipecosta @kebbet @kkoppenhaver @Mamaduka @matiasbenedetto @mcsf @michalczaplinski @mirka @mtias @noisysocks @ntsekouras @pagelab @ramonjd @t-hamano @talldan @tellthemachines @tyxla @walbo @youknowriad
+@aaronrobertshaw @ajlende @annezazu @apmatthews @aristath @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @dcalhoun @draganescu @ellatrix @geriux @glendaviesnz @gziolo @jasmussen @jorgefilipecosta @kebbet @kkoppenhaver @Mamaduka @matiasbenedetto @mcsf @michalczaplinski @mirka @mtias @noisysocks @ntsekouras @pagelab @ramonjd @t-hamano @talldan @tellthemachines @tyxla @walbo @youknowriad
@@ -20690,7 +20690,7 @@ The following contributors merged PRs in this release:
- JS Error Tracking: Allow custom error reporting logic to be called in Error Boundaries via a WP action hook. ([42024](https://github.com/WordPress/gutenberg/pull/42024))
-### Accessibility
+### Accessibility
- Add aria-checked to the selected heading level menu item. ([42273](https://github.com/WordPress/gutenberg/pull/42273))
- Fix tabbing from first or last block in site editor. ([42036](https://github.com/WordPress/gutenberg/pull/42036))
@@ -20799,7 +20799,7 @@ The following contributors merged PRs in this release:
- Tip: Covert component to TypeScript. ([42262](https://github.com/WordPress/gutenberg/pull/42262))
- VisuallyHidden: Convert component to TypeScript. ([42220](https://github.com/WordPress/gutenberg/pull/42220))
- Spacer: Complete TypeScript migration of component. ([42013](https://github.com/WordPress/gutenberg/pull/42013))
--
+-
#### Components
- Add eslint to prevent SSR breakage. ([42248](https://github.com/WordPress/gutenberg/pull/42248))
- Fix typos in components changelog. ([42244](https://github.com/WordPress/gutenberg/pull/42244))
@@ -20889,7 +20889,7 @@ The following contributors merged PRs in this release:
### Enhancements
-#### UI
+#### UI
- Increase fade intensity during spotlight mode. ([40454](https://github.com/WordPress/gutenberg/pull/40454))
- Improvements to "inherit default layout" toggle. ([41893](https://github.com/WordPress/gutenberg/pull/41893))
- Make it easier to select "Edit visually" when in "Edit as HTML. ([41516](https://github.com/WordPress/gutenberg/pull/41516))
@@ -20949,7 +20949,7 @@ The following contributors merged PRs in this release:
- [Block Editor]: Fix content loss from `replaceInnerBlocks` with controlled blocks. ([41948](https://github.com/WordPress/gutenberg/pull/41948))
- Fix action button spacing on the widget editor. ([41915](https://github.com/WordPress/gutenberg/pull/41915))
- Render duotone presets in pattern preview. ([41249](https://github.com/WordPress/gutenberg/pull/41249))
-
+
#### Block Library
- List v2:
- Fix impossible to outdent multiple list items. ([41713](https://github.com/WordPress/gutenberg/pull/41713))
@@ -22265,7 +22265,7 @@ The following contributors merged PRs in this release:
### Bug Fixes
-- Fix the position of the block inserter in between blocks ([40919](https://github.com/WordPress/gutenberg/pull/40919))
+- Fix the position of the block inserter in between blocks ([40919](https://github.com/WordPress/gutenberg/pull/40919))
= 13.2.0 =
@@ -22635,7 +22635,7 @@ The following PRs were merged by first time contributors:
- Fixed focus loss when navigating the guide component. ([40324](https://github.com/WordPress/gutenberg/pull/40324))
- Navigation block: After choosing an option from Select Menu, focus after block rerender. ([40390](https://github.com/WordPress/gutenberg/pull/40390))
- Block Styles: Remove unnecessary button role and 'onKeyDown' handler. ([40427](https://github.com/WordPress/gutenberg/pull/40427))
-
+
### Performance
- Added a context param to sidebar entity request. ([40148](https://github.com/WordPress/gutenberg/pull/40148))
@@ -22673,12 +22673,12 @@ The following PRs were merged by first time contributors:
- Stop exporting individual color objects from color values file. ([40387](https://github.com/WordPress/gutenberg/pull/40387))
- Added reusable BlockPopover and BlockPopoverInbetween components. ([40441](https://github.com/WordPress/gutenberg/pull/40441))
- Cleaned BlockMover component and styles. ([40379](https://github.com/WordPress/gutenberg/pull/40379))
-
+
#### Packages
- Block Editor: Remove unused sub-components in list view. ([40448](https://github.com/WordPress/gutenberg/pull/40448))
- Data: Cancel render queue in a more straightforward way. ([40433](https://github.com/WordPress/gutenberg/pull/40433))
-
+
#### Plugin
- Added `edit` context to patterns REST controllers. ([40259](https://github.com/WordPress/gutenberg/pull/40259))
@@ -39722,7 +39722,7 @@ Add knobs to the [ColorIndicator Story](https://github.com/WordPress/gutenberg/p
* `is_gutenberg_page` incorrectly assumes `get_current_screen` exists, add check.
* Brings code inline with CSS standards by switching font weight to numeric values.
* Wrapped component would not the most up-to-date store values if it incurred a store state change during its own mount (e.g. dispatching during its own constructor), resolved by rerunning selection.
-* Display an error message if Javascript is disabled.
+* Display an error message if JavaScript is disabled.
* Update to React 16.6.3.
* Adds missing components dependency for RichText.
* Refactors list block to remove previously exposed RichText/TinyMCE logic.
diff --git a/docs/contributors/code/release.md b/docs/contributors/code/release.md
index 4c8950eb5e7cd..f304ec9cd3a48 100644
--- a/docs/contributors/code/release.md
+++ b/docs/contributors/code/release.md
@@ -320,13 +320,13 @@ If an RC already exists for a new version, you _need_ to cherry-pick the same co
The cherry-picking process can be automated with the [`npm run cherry-pick`](/docs/contributors/code/auto-cherry-picking.md) script, but be sure to use the `Backport to Gutenberg Minor Release` label when running the script.
-You must also ensure that all PRs being included are assigned to the Github Milestone on which the minor release is based. Bear in mind, that when PRs are _merged_ they are automatically assigned a milestone for the next _stable_ release. Therefore you will need to go back through each PR in Github and re-assign the Milestone.
+You must also ensure that all PRs being included are assigned to the GitHub Milestone on which the minor release is based. Bear in mind, that when PRs are _merged_ they are automatically assigned a milestone for the next _stable_ release. Therefore you will need to go back through each PR in GitHub and re-assign the Milestone.
For example, if you are releasing version `12.5.4`, then all PRs picked for that release must be unassigned from the `12.6` Milestone and instead assigned to the `12.5` Milestone.
Once cherry picking is complete, you can also remove the `Backport to Gutenberg Minor Release` label from the PRs.
-Once you have the stable release branch in order and the correct Milestone assigned to your PRs you can _push the branch to Github_ and continue with the release process using the Github website GUI.
+Once you have the stable release branch in order and the correct Milestone assigned to your PRs you can _push the branch to GitHub_ and continue with the release process using the GitHub website GUI.
#### Running the minor release
diff --git a/docs/explanations/architecture/performance.md b/docs/explanations/architecture/performance.md
index de3b7b5dcdbd5..4c8b6386b9263 100644
--- a/docs/explanations/architecture/performance.md
+++ b/docs/explanations/architecture/performance.md
@@ -69,7 +69,7 @@ The performance results for each commit are pushed to codevitals and can be seen
It's thus very important to ensure that the metric being computed is stable. Meaning, if you run the same test twice with the same code and environment, you'll get results that are close.
-Our performance job runs Github CI which means that we can't trust the consistency of the numbers that we get between two similar job runs. Github CI may allocate different CPU and memory resources for us over time for instance. To alleviate this problem, each time we run the performance job on the trunk branch, we compare the current commit's performance to a fixed reference commit hash, which allows us to track the relative difference between the current commit and the reference commit consistently regardless of environment changes.
+Our performance job runs GitHub CI which means that we can't trust the consistency of the numbers that we get between two similar job runs. GitHub CI may allocate different CPU and memory resources for us over time for instance. To alleviate this problem, each time we run the performance job on the trunk branch, we compare the current commit's performance to a fixed reference commit hash, which allows us to track the relative difference between the current commit and the reference commit consistently regardless of environment changes.
### Update the reference commit
@@ -77,7 +77,7 @@ Gutenberg supports only two WP versions, this impacts the performance job in two
- The base WP version used to run the performance job needs to be updated, when the minimum version supported by Gutenberg changes. In order to do that, we rely on the `Tested up to` flag of the plugin's `readme.txt` file. So each time that flag is changed, the version used for the performance job is changed as well.
- - Updating the WP version used for performance jobs means that there's a high chance that the reference commit used for performance test stability becomes incompatible with the WP version that is used. So every time, the `Tested up to` flag is updated in the `readme.txt` is changed, we also have to update the reference commit that is used in `.github/workflows/performance.yml`.
+ - Updating the WP version used for performance jobs means that there's a high chance that the reference commit used for performance test stability becomes incompatible with the WP version that is used. So every time, the `Tested up to` flag is updated in the `readme.txt` is changed, we also have to update the reference commit that is used in `.github/workflows/performance.yml`.
The new reference commit hash that is chosen needs to meet the following requirements:
diff --git a/docs/getting-started/fundamentals/README.md b/docs/getting-started/fundamentals/README.md
index fd2941711dd01..42dbace9d7ba3 100644
--- a/docs/getting-started/fundamentals/README.md
+++ b/docs/getting-started/fundamentals/README.md
@@ -9,4 +9,4 @@ This section provides an introduction to the most relevant concepts in block dev
1. **[The block in the Editor](https://developer.wordpress.org/block-editor/getting-started/fundamentals/block-in-the-editor):** How a block, as a React component, is loaded in the Block Editor and an overview of its structure.
1. **[Markup representation of a block](https://developer.wordpress.org/block-editor/getting-started/fundamentals/markup-representation-block):** How blocks are represented in the database, theme templates, and patterns.
1. **[Static or Dynamic rendering of a block](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering):** How blocks generate their front-end output either dynamically or statically.
-1. **[Javascript in the Block Editor](https://developer.wordpress.org/block-editor/getting-started/fundamentals/javascript-in-the-block-editor):** How to work with modern Javascript when developing for the Block Editor.
+1. **[JavaScript in the Block Editor](https://developer.wordpress.org/block-editor/getting-started/fundamentals/javascript-in-the-block-editor):** How to work with modern JavaScript when developing for the Block Editor.
diff --git a/docs/getting-started/fundamentals/javascript-in-the-block-editor.md b/docs/getting-started/fundamentals/javascript-in-the-block-editor.md
index 42d7363b6aa4d..348b95ba88da3 100644
--- a/docs/getting-started/fundamentals/javascript-in-the-block-editor.md
+++ b/docs/getting-started/fundamentals/javascript-in-the-block-editor.md
@@ -1,20 +1,20 @@
-# Working with Javascript for the Block Editor
+# Working with JavaScript for the Block Editor
Developing blocks for the Block Editor often involves using modern JavaScript (ESNext and JSX), and most examples here in the Block Editor Handbook are written in these syntaxes.
-However, this form of JavaScript must be transformed into a browser-compatible format, necessitating a build step. This process transforms, bundles, and optimizes JavaScript source code and related assets into a format suitable for production environments.
+However, this form of JavaScript must be transformed into a browser-compatible format, necessitating a build step. This process transforms, bundles, and optimizes JavaScript source code and related assets into a format suitable for production environments.
## JavaScript with a build process
Using a build process for block development unlocks the full potential of modern JavaScript, facilitating the use of ESNext and JSX.
-[ESNext](https://developer.mozilla.org/en-US/docs/Web/JavaScript/JavaScript_technologies_overview#standardization_process) refers to Javascript's most recent syntax and features. [JSX](https://react.dev/learn/writing-markup-with-jsx) is a syntax extension developed by the React project that enables you to write JavaScript that resembles HTML.
+[ESNext](https://developer.mozilla.org/en-US/docs/Web/JavaScript/JavaScript_technologies_overview#standardization_process) refers to JavaScript's most recent syntax and features. [JSX](https://react.dev/learn/writing-markup-with-jsx) is a syntax extension developed by the React project that enables you to write JavaScript that resembles HTML.
Since browsers cannot directly execute ESNext and JSX, these syntaxes must be transformed into browser-compatible JavaScript.
[webpack](https://webpack.js.org/concepts/why-webpack/) is a pluggable tool that processes and bundles JavaScript for browser compatibility. [Babel](https://babeljs.io/), a plugin for webpack, converts ESNext and JSX into standard JavaScript.
-Configuring webpack and Babel can be challenging, so it's recommended that you use the [`@wordpress/scripts`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) package. This tool simplifies development by preconfiguring both, so you rarely need to write custom webpack or Babel configurations.
+Configuring webpack and Babel can be challenging, so it's recommended that you use the [`@wordpress/scripts`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) package. This tool simplifies development by preconfiguring both, so you rarely need to write custom webpack or Babel configurations.
For an introduction, refer to the [Get started with wp-scripts](/docs/getting-started/devenv/get-started-with-wp-scripts.md) guide.
@@ -28,21 +28,21 @@ The diagram below provides an overview of the build process when using the `wp-s
- **Development Mode (`npm run start`):** This mode is tailored for active development. It skips minification for easier debugging, generates source maps for better error tracking, and watches your source files for changes. When a change is detected, it automatically rebuilds the affected files, allowing you to see updates in real-time.
-The `wp-scripts` package also facilitates the use of JavaScript modules, allowing code distribution across multiple files and resulting in a streamlined bundle after the build process. The [block-development-example](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/data-basics-59c8f8) GitHub repository provides some good examples.
+The `wp-scripts` package also facilitates the use of JavaScript modules, allowing code distribution across multiple files and resulting in a streamlined bundle after the build process. The [block-development-example](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/data-basics-59c8f8) GitHub repository provides some good examples.
In most situations, no customization will be needed, but you can provide a webpack.config.js when using wp-scripts to modify the build process to suit your needs.
-## Javascript without a build process
+## JavaScript without a build process
Integrating JavaScript into your WordPress projects without a build process can be the most straightforward approach in specific scenarios. This is particularly true for projects that don't leverage JSX or other advanced JavaScript features requiring compilation.
-When you opt out of a build process, you interact directly with WordPress's [Javascript APIs](/docs/reference-guides/packages/) through the global `wp` object. This means that all the methods and packages provided by WordPress are readily available, but with one caveat: you must manually manage script dependencies. This is done by adding [the handle](/docs/contributors/code/scripts.md) of each corresponding package to the dependency array of your enqueued JavaScript file.
+When you opt out of a build process, you interact directly with WordPress's [JavaScript APIs](/docs/reference-guides/packages/) through the global `wp` object. This means that all the methods and packages provided by WordPress are readily available, but with one caveat: you must manually manage script dependencies. This is done by adding [the handle](/docs/contributors/code/scripts.md) of each corresponding package to the dependency array of your enqueued JavaScript file.
For example, suppose you're creating a script that registers a new block [variation](/docs/reference-guides/block-api/block-variations.md) using the `registerBlockVariation` function from the [`blocks`](/docs/reference-guides/packages/packages-blocks.md) package. You must include `wp-blocks` in your script's dependency array. This guarantees that the `wp.blocks.registerBlockVariation` method is available and defined by the time your script executes.
-In the following example, the `wp-blocks` dependency is defined when enqueuing the `variations.js` file.
+In the following example, the `wp-blocks` dependency is defined when enqueuing the `variations.js` file.
```php
function example_enqueue_block_variations() {
@@ -84,10 +84,10 @@ Refer to [Enqueueing assets in the Editor](/docs/how-to-guides/enqueueing-assets
## Additional resources
- [Package reference](/docs/reference-guides/packages.md)
-- [Get started with wp-scripts](/docs/getting-started/devenv/get-started-with-wp-scripts.md)
-- [Enqueueing assets in the Editor](/docs/how-to-guides/enqueueing-assets-in-the-editor.md)
-- [WordPress package handles](/docs/contributors/code/scripts.md)
-- [Javascript reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript) | MDN Web Docs
+- [Get started with wp-scripts](/docs/getting-started/devenv/get-started-with-wp-scripts.md)
+- [Enqueueing assets in the Editor](/docs/how-to-guides/enqueueing-assets-in-the-editor.md)
+- [WordPress package handles](/docs/contributors/code/scripts.md)
+- [JavaScript reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript) | MDN Web Docs
- [block-development-examples](https://github.com/WordPress/block-development-examples) | GitHub repository
- [block-theme-examples](https://github.com/wptrainingteam/block-theme-examples) | GitHub repository
- [How webpack and WordPress packages interact](https://developer.wordpress.org/news/2023/04/how-webpack-and-wordpress-packages-interact/) | Developer Blog
diff --git a/docs/getting-started/tutorial.md b/docs/getting-started/tutorial.md
index b57391a806cf6..641ecad07ab9b 100644
--- a/docs/getting-started/tutorial.md
+++ b/docs/getting-started/tutorial.md
@@ -156,7 +156,7 @@ Save the file and select the block in the Editor. You will now see both Color an
#### Removing unnecessary code
-For simplicity, the styling for the Copyright Date Block will be controlled entirely by the color and typography block supports. This block also does not have any front-end Javascript. Therefore, you don't need to specify stylesheets or a `viewScript` in the `block.json` file.
+For simplicity, the styling for the Copyright Date Block will be controlled entirely by the color and typography block supports. This block also does not have any front-end JavaScript. Therefore, you don't need to specify stylesheets or a `viewScript` in the `block.json` file.
1. Remove the line for `editorStyle`
2. Remove the line for `style`
diff --git a/docs/how-to-guides/data-basics/3-building-an-edit-form.md b/docs/how-to-guides/data-basics/3-building-an-edit-form.md
index 34136ff408080..65c4d0a5486a0 100644
--- a/docs/how-to-guides/data-basics/3-building-an-edit-form.md
+++ b/docs/how-to-guides/data-basics/3-building-an-edit-form.md
@@ -215,7 +215,7 @@ As you can see, the `title` of an Entity Record is an object, but the `title` of
This is no accident. Fields like `title`, `excerpt`, and `content` may contain [shortcodes](https://developer.wordpress.org/apis/handbook/shortcode/) or [dynamic blocks](/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md), which means they can only be rendered on the server. For such fields, the REST API exposes both the `raw` markup _and_ the `rendered` string. For example, in the block editor, `content.rendered` could used as a visual preview, and `content.raw` could be used to populate the code editor.
-So why is the `content` of an Edited Entity Record a string? Since Javascript is not be able to properly render arbitrary block markup, it stores only the `raw` markup without the `rendered` part. And since that's a string, the entire field becomes a string.
+So why is the `content` of an Edited Entity Record a string? Since JavaScript is not be able to properly render arbitrary block markup, it stores only the `raw` markup without the `rendered` part. And since that's a string, the entire field becomes a string.
We can now update `EditPageForm` accordingly. We can access the actions using the [`useDispatch`](/packages/data/README.md#usedispatch) hook similarly to how we use `useSelect` to access selectors:
diff --git a/docs/how-to-guides/enqueueing-assets-in-the-editor.md b/docs/how-to-guides/enqueueing-assets-in-the-editor.md
index 02d9020d351e3..fb0efb88e6796 100644
--- a/docs/how-to-guides/enqueueing-assets-in-the-editor.md
+++ b/docs/how-to-guides/enqueueing-assets-in-the-editor.md
@@ -18,7 +18,7 @@ There are different hooks to use depending on the answers to these questions, an
Whenever you need to enqueue assets for the Editor itself (i.e. not the user-generated content), you should use the [`enqueue_block_editor_assets`](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/) hook coupled with the standard [`wp_enqueue_script`](https://developer.wordpress.org/reference/functions/wp_enqueue_script/) and [`wp_enqueue_style`](https://developer.wordpress.org/reference/functions/wp_enqueue_style/) functions.
-Examples might be adding custom inspector or toolbar controls, registering block styles and variations in Javascript, registering Editor plugins, etc.
+Examples might be adding custom inspector or toolbar controls, registering block styles and variations in JavaScript, registering Editor plugins, etc.
```php
/**
@@ -31,7 +31,7 @@ function example_enqueue_editor_assets() {
);
wp_enqueue_style(
'example-editor-styles',
- plugins_url( 'editor-styles.css', __FILE__ )
+ plugins_url( 'editor-styles.css', __FILE__ )
);
}
add_action( 'enqueue_block_editor_assets', 'example_enqueue_editor_assets' );
diff --git a/docs/manifest.json b/docs/manifest.json
index ac269e4784633..1704e6d711510 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -102,7 +102,7 @@
"parent": "fundamentals"
},
{
- "title": "Working with Javascript for the Block Editor",
+ "title": "Working with JavaScript for the Block Editor",
"slug": "javascript-in-the-block-editor",
"markdown_source": "../docs/getting-started/fundamentals/javascript-in-the-block-editor.md",
"parent": "fundamentals"
diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md
index 21bb576f12a1c..93ab0a031800f 100644
--- a/docs/reference-guides/core-blocks.md
+++ b/docs/reference-guides/core-blocks.md
@@ -616,7 +616,7 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/
- **Name:** core/post-content
- **Category:** theme
-- **Supports:** align (full, wide), color (background, gradients, link, text), dimensions (minHeight), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~
+- **Supports:** align (full, wide), background (backgroundImage, backgroundSize), color (background, gradients, link, text), dimensions (minHeight), layout, spacing (blockGap, padding), typography (fontSize, lineHeight), ~~html~~
## Date
diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md
index f687eb79732b5..4b66ad9eb6cb4 100644
--- a/docs/reference-guides/data/data-core-block-editor.md
+++ b/docs/reference-guides/data/data-core-block-editor.md
@@ -81,7 +81,6 @@ _Parameters_
- _state_ `Object`: Editor state.
- _clientId_ `string`: The block client Id.
-- _rootClientId_ `?string`: Optional root client ID of block list.
_Returns_
@@ -95,7 +94,6 @@ _Parameters_
- _state_ `Object`: Editor state.
- _clientIds_ `string`: The block client IDs to be moved.
-- _rootClientId_ `?string`: Optional root client ID of block list.
_Returns_
@@ -109,7 +107,6 @@ _Parameters_
- _state_ `Object`: Editor state.
- _clientId_ `string`: The block client Id.
-- _rootClientId_ `?string`: Optional root client ID of block list.
_Returns_
@@ -123,7 +120,6 @@ _Parameters_
- _state_ `Object`: Editor state.
- _clientIds_ `string`: The block client IDs to be removed.
-- _rootClientId_ `?string`: Optional root client ID of block list.
_Returns_
diff --git a/docs/reference-guides/interactivity-api/README.md b/docs/reference-guides/interactivity-api/README.md
index b6e0d639c3fc8..85255af785cbb 100644
--- a/docs/reference-guides/interactivity-api/README.md
+++ b/docs/reference-guides/interactivity-api/README.md
@@ -1,6 +1,6 @@
# Interactivity API Reference
-The Interactivity API, [introduced in WordPress 6.5](https://make.wordpress.org/core/2024/02/19/merge-announcement-interactivity-api/), provides a standard way for developers to add interactions to the front end of their blocks. The API is also used in many Core WordPress blocks, including Search, Query, Navigation, and File.
+The Interactivity API, [introduced in WordPress 6.5](https://make.wordpress.org/core/2024/02/19/merge-announcement-interactivity-api/), provides a standard way for developers to add interactions to the front end of their blocks. The API is also used in many Core WordPress blocks, including Search, Query, Navigation, and File.
This standard makes it easier for developers to create rich, interactive user experiences, from simple counters or pop-ups to more complex features like instant page navigation, instant search, shopping carts, or checkouts.
@@ -32,7 +32,7 @@ To get a deeper understanding of what the Interactivity API is or find answers t
Interactivity API is included in Core in WordPress 6.5. For versions below, you'll need Gutenberg 17.5 or higher installed and activated in your WordPress installation.
-It’s also important to highlight that the block creation workflow doesn’t change, and all the [prerequisites](https://developer.wordpress.org/block-editor/getting-started/devenv/) remain the same. These include:
+It’s also important to highlight that the block creation workflow doesn’t change, and all the [prerequisites](https://developer.wordpress.org/block-editor/getting-started/devenv/) remain the same. These include:
- [Code Editor](https://developer.wordpress.org/block-editor/getting-started/devenv/#code-editor)
- [Node.js development tools](https://developer.wordpress.org/block-editor/getting-started/devenv/#node-js-development-tools)
@@ -55,7 +55,7 @@ To indicate that the block [supports](https://developer.wordpress.org/block-edit
Refer to the [`interactivity` support property docs](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#interactivity) to get a more detailed description of this property.
-#### Load Interactivity API Javascript code with `viewScriptModule`
+#### Load Interactivity API JavaScript code with `viewScriptModule`
The Interactivity API provides the `@wordpress/interactivity` Script Module. JavaScript using the Interactivity API should be implemented as Script Modules so they can depend on `@wordpress/interactivity`. [Script Modules have been available since WordPress 6.5](https://make.wordpress.org/core/2024/03/04/script-modules-in-6-5/). Blocks can use [`viewScriptModule` block metadata](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script-module) to enqueue their Script Modules easily:
@@ -82,7 +82,7 @@ The use of `viewScriptModule` also requires the `--experimental-modules` flag fo
#### Add `wp-interactive` directive to a DOM element
-To "activate" the Interactivity API in a DOM element (and its children), add the [`wp-interactive`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#wp-interactive) directive to the DOM element in the block's `render.php` or `save.js` files.
+To "activate" the Interactivity API in a DOM element (and its children), add the [`wp-interactive`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-interactivity/packages-interactivity-api-reference/#wp-interactive) directive to the DOM element in the block's `render.php` or `save.js` files.
diff --git a/lib/README.md b/lib/README.md
index cbc86d67a18f7..8e22f676a153d 100644
--- a/lib/README.md
+++ b/lib/README.md
@@ -6,7 +6,7 @@ The Gutenberg plugin is continuously enhancing existing features and creating ne
During a WordPress release, new features, bugfixes and other changes are "synced" between the Gutenberg plugin and WordPress Core. Consistent naming and directory structures make this process easier by preventing naming conflicts and compartmentalizing release-specific code.
-The following documentation is intended to act as a guide only. If you're unsure about naming or where to place new PHP files, please don't hesitate to ping other contributors on Github or ask in the #core-editor channel on [WordPress Slack](https://make.wordpress.org/chat/).
+The following documentation is intended to act as a guide only. If you're unsure about naming or where to place new PHP files, please don't hesitate to ping other contributors on GitHub or ask in the #core-editor channel on [WordPress Slack](https://make.wordpress.org/chat/).
## File structure
@@ -194,10 +194,10 @@ Existing comments in `lib/load.php` should act as a guide.
If you've changed or added PHP files to the Gutenberg plugin, you'll need to confirm whether the changes are to be synced to WordPress Core, and therefore featured in the next release of WordPress.
-The Gutenberg Github pull request in question should be labeled with the `Needs PHP backport` label if the changes are to be synced to Core.
+The Gutenberg GitHub pull request in question should be labeled with the `Needs PHP backport` label if the changes are to be synced to Core.
-If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core Github repository](https://github.com/WordPress/wordpress-develop) soon after your pull request is merged.
+If so, it is recommended to create a [new Trac ticket](https://core.trac.wordpress.org/newticket) and submit a pull request to the [WordPress Core GitHub repository](https://github.com/WordPress/wordpress-develop) soon after your pull request is merged.
-So too, if you've made changes in WordPress Core to code that also lives in the Gutenberg plugin, these changes will need to be synced (often called "backporting") to Gutenberg. The relevant Gutenberg Github pull request should be labeled with the `Backport from WordPress Core` label.
+So too, if you've made changes in WordPress Core to code that also lives in the Gutenberg plugin, these changes will need to be synced (often called "backporting") to Gutenberg. The relevant Gutenberg GitHub pull request should be labeled with the `Backport from WordPress Core` label.
If you're unsure, you can always ask for help in the #core-editor channel in [WordPress Slack](https://make.wordpress.org/chat/).
diff --git a/lib/block-editor-settings.php b/lib/block-editor-settings.php
index 53668e114e04c..defd7cd391b16 100644
--- a/lib/block-editor-settings.php
+++ b/lib/block-editor-settings.php
@@ -58,7 +58,7 @@ function gutenberg_get_block_editor_settings( $settings ) {
* entered by users does not break other global styles.
*/
$global_styles[] = array(
- 'css' => gutenberg_get_global_styles_custom_css(),
+ 'css' => gutenberg_get_global_stylesheet( array( 'custom-css' ) ),
'__unstableType' => 'user',
'isGlobalStyles' => true,
);
diff --git a/lib/block-supports/block-style-variations.php b/lib/block-supports/block-style-variations.php
index f2bc6af92e9de..e078b50b19d5a 100644
--- a/lib/block-supports/block-style-variations.php
+++ b/lib/block-supports/block-style-variations.php
@@ -244,7 +244,7 @@ function gutenberg_resolve_block_style_variations( $variations ) {
* Block style variations read in via standalone theme.json partials
* need to have their name set to the kebab case version of their title.
*/
- $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] );
+ $variation_name = $have_named_variations ? $key : ( $variation['slug'] ?? _wp_to_kebab_case( $variation['title'] ) );
foreach ( $supported_blocks as $block_type ) {
// Add block style variation data under current block type.
@@ -455,7 +455,7 @@ function gutenberg_register_block_style_variations_from_theme_json_data( $variat
* Block style variations read in via standalone theme.json partials
* need to have their name set to the kebab case version of their title.
*/
- $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] );
+ $variation_name = $have_named_variations ? $key : ( $variation['slug'] ?? _wp_to_kebab_case( $variation['title'] ) );
$variation_label = $variation['title'] ?? $variation_name;
foreach ( $supported_blocks as $block_type ) {
diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php
index a1e79a56a683b..deb4d850d271f 100644
--- a/lib/class-wp-theme-json-gutenberg.php
+++ b/lib/class-wp-theme-json-gutenberg.php
@@ -357,6 +357,7 @@ class WP_Theme_JSON_Gutenberg {
'styles',
'templateParts',
'title',
+ 'slug',
'version',
);
@@ -1355,6 +1356,12 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
$stylesheet .= $this->get_preset_classes( $setting_nodes, $origins );
}
+ // Load the custom CSS last so it has the highest specificity.
+ if ( in_array( 'custom-css', $types, true ) ) {
+ // Add the global styles root CSS.
+ $stylesheet .= _wp_array_get( $this->theme_json, array( 'styles', 'css' ) );
+ }
+
return $stylesheet;
}
@@ -1399,10 +1406,12 @@ protected function process_blocks_custom_css( $css, $selector ) {
* Returns the global styles custom css.
*
* @since 6.2.0
+ * @deprecated 6.7.0 Use {@see 'get_stylesheet'} instead.
*
* @return string The global styles custom CSS.
*/
public function get_custom_css() {
+ _deprecated_function( __METHOD__, '6.7.0', 'get_stylesheet' );
$block_custom_css = '';
$block_nodes = $this->get_block_custom_css_nodes();
foreach ( $block_nodes as $node ) {
@@ -1415,23 +1424,23 @@ public function get_custom_css() {
/**
* Returns the global styles base custom CSS.
- *
- * @since 6.6.0
+ * This function is deprecated; please do not sync to core.
*
* @return string The global styles base custom CSS.
*/
public function get_base_custom_css() {
+ _deprecated_function( __METHOD__, 'Gutenberg 18.6.0', 'get_stylesheet' );
return isset( $this->theme_json['styles']['css'] ) ? $this->theme_json['styles']['css'] : '';
}
/**
* Returns the block nodes with custom CSS.
- *
- * @since 6.6.0
+ * This function is deprecated; please do not sync to core.
*
* @return array The block nodes.
*/
public function get_block_custom_css_nodes() {
+ _deprecated_function( __METHOD__, 'Gutenberg 18.6.0', 'get_block_nodes' );
$block_nodes = array();
// Add the global styles block CSS.
@@ -1455,8 +1464,7 @@ public function get_block_custom_css_nodes() {
/**
* Returns the global styles custom CSS for a single block.
- *
- * @since 6.6.0
+ * This function is deprecated; please do not sync to core.
*
* @param array $css The block css node.
* @param string $selector The block selector.
@@ -1464,6 +1472,7 @@ public function get_block_custom_css_nodes() {
* @return string The global styles custom CSS for the block.
*/
public function get_block_custom_css( $css, $selector ) {
+ _deprecated_function( __METHOD__, 'Gutenberg 18.6.0', 'get_styles_for_block' );
return $this->process_blocks_custom_css( $css, $selector );
}
@@ -2646,6 +2655,7 @@ private static function get_block_nodes( $theme_json, $selectors = array() ) {
'selectors' => $feature_selectors,
'duotone' => $duotone_selector,
'variations' => $variation_selectors,
+ 'css' => $selector,
);
if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'] ) ) {
@@ -2694,6 +2704,7 @@ public function get_styles_for_block( $block_metadata ) {
// If there are style variations, generate the declarations for them, including any feature selectors the block may have.
$style_variation_declarations = array();
+ $style_variation_custom_css = array();
if ( ! empty( $block_metadata['variations'] ) ) {
foreach ( $block_metadata['variations'] as $style_variation ) {
$style_variation_node = _wp_array_get( $this->theme_json, $style_variation['path'], array() );
@@ -2720,9 +2731,12 @@ static function ( $split_selector ) use ( $clean_style_variation_selector ) {
// Add the new declarations to the overall results under the modified selector.
$style_variation_declarations[ $combined_selectors ] = $new_declarations;
}
-
// Compute declarations for remaining styles not covered by feature level selectors.
$style_variation_declarations[ $style_variation['selector'] ] = static::compute_style_properties( $style_variation_node, $settings, null, $this->theme_json );
+ // Store custom CSS for the style variation.
+ if ( isset( $style_variation_node['css'] ) ) {
+ $style_variation_custom_css[ $style_variation['selector'] ] = $this->process_blocks_custom_css( $style_variation_node['css'], $style_variation['selector'] );
+ }
}
}
@@ -2853,6 +2867,14 @@ static function ( $pseudo_selector ) use ( $selector ) {
// 6. Generate and append the style variation rulesets.
foreach ( $style_variation_declarations as $style_variation_selector => $individual_style_variation_declarations ) {
$block_rules .= static::to_ruleset( ":root :where($style_variation_selector)", $individual_style_variation_declarations );
+ if ( isset( $style_variation_custom_css[ $style_variation_selector ] ) ) {
+ $block_rules .= $style_variation_custom_css[ $style_variation_selector ];
+ }
+ }
+
+ // 7. Generate and append any custom CSS rules.
+ if ( isset( $node['css'] ) && ! $is_root_selector ) {
+ $block_rules .= $this->process_blocks_custom_css( $node['css'], $selector );
}
return $block_rules;
diff --git a/lib/compat/wordpress-6.5/html-api/class-gutenberg-html-tag-processor-6-5.php b/lib/compat/wordpress-6.5/html-api/class-gutenberg-html-tag-processor-6-5.php
index 5c371f4bf6569..f93a48515d93b 100644
--- a/lib/compat/wordpress-6.5/html-api/class-gutenberg-html-tag-processor-6-5.php
+++ b/lib/compat/wordpress-6.5/html-api/class-gutenberg-html-tag-processor-6-5.php
@@ -298,8 +298,8 @@
*
* The special elements are:
* - `SCRIPT` whose contents are treated as raw plaintext but supports a legacy
- * style of including Javascript inside of HTML comments to avoid accidentally
- * closing the SCRIPT from inside a Javascript string. E.g. `console.log( '' )`.
+ * style of including JavaScript inside of HTML comments to avoid accidentally
+ * closing the SCRIPT from inside a JavaScript string. E.g. `console.log( '' )`.
* - `TITLE` and `TEXTAREA` whose contents are treated as plaintext and then any
* character references are decoded. E.g. `1 < 2 < 3` becomes `1 < 2 < 3`.
* - `IFRAME`, `NOSCRIPT`, `NOEMBED`, `NOFRAME`, `STYLE` whose contents are treated as
diff --git a/lib/global-styles-and-settings.php b/lib/global-styles-and-settings.php
index 4ceade6c7125b..79c7028e32543 100644
--- a/lib/global-styles-and-settings.php
+++ b/lib/global-styles-and-settings.php
@@ -144,6 +144,7 @@ function gutenberg_get_global_settings( $path = array(), $context = array() ) {
* @return string
*/
function gutenberg_get_global_styles_custom_css() {
+ _deprecated_function( __FUNCTION__, 'Gutenberg 18.6.0', 'gutenberg_get_global_stylesheet' );
// Ignore cache when `WP_DEBUG` is enabled, so it doesn't interfere with the theme developers workflow.
$can_use_cached = ! WP_DEBUG;
$cache_key = 'gutenberg_get_global_custom_css';
@@ -177,6 +178,7 @@ function gutenberg_get_global_styles_custom_css() {
* @return string The global base custom CSS.
*/
function gutenberg_get_global_styles_base_custom_css() {
+ _deprecated_function( __FUNCTION__, 'Gutenberg 18.6.0', 'gutenberg_get_global_stylesheet' );
if ( ! wp_theme_has_theme_json() ) {
return '';
}
@@ -211,6 +213,7 @@ function gutenberg_get_global_styles_base_custom_css() {
* @global WP_Styles $wp_styles
*/
function gutenberg_add_global_styles_block_custom_css() {
+ _deprecated_function( __FUNCTION__, 'Gutenberg 18.6.0', 'gutenberg_add_global_styles_for_blocks' );
global $wp_styles;
if ( ! wp_theme_has_theme_json() || ! wp_should_load_separate_core_block_assets() ) {
diff --git a/lib/script-loader.php b/lib/script-loader.php
index 01008a0da8967..59df13556e9cf 100644
--- a/lib/script-loader.php
+++ b/lib/script-loader.php
@@ -43,45 +43,29 @@ function gutenberg_enqueue_global_styles() {
add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' );
$stylesheet = gutenberg_get_global_stylesheet();
- if ( empty( $stylesheet ) ) {
- return;
- }
-
- wp_register_style( 'global-styles', false );
- wp_add_inline_style( 'global-styles', $stylesheet );
- wp_enqueue_style( 'global-styles' );
-
- // Add each block as an inline css.
- gutenberg_add_global_styles_for_blocks();
/*
- * Add the custom CSS for the global styles.
- * Before that, dequeue the Customizer's custom CSS
+ * Dequeue the Customizer's custom CSS
* and add it before the global styles custom CSS.
- * Don't enqueue Customizer's custom CSS separately.
*/
remove_action( 'wp_head', 'wp_custom_css_cb', 101 );
+ // Get the custom CSS from the Customizer and add it to the global stylesheet.
+ $custom_css = wp_get_custom_css();
+ $stylesheet .= $custom_css;
- $custom_css = wp_get_custom_css();
+ // Add the global styles custom CSS at the end.
+ $stylesheet .= gutenberg_get_global_stylesheet( array( 'custom-css' ) );
- if ( ! wp_should_load_separate_core_block_assets() ) {
- /*
- * If loading all block assets together, add both
- * the base and block custom CSS at once. Else load
- * the base custom CSS only, and the block custom CSS
- * will be added to the inline CSS for each block in
- * gutenberg_add_global_styles_block_custom_css().
- */
- $custom_css .= gutenberg_get_global_styles_custom_css();
- } else {
- $custom_css .= gutenberg_get_global_styles_base_custom_css();
+ if ( empty( $stylesheet ) ) {
+ return;
}
- if ( ! empty( $custom_css ) ) {
- wp_add_inline_style( 'global-styles', $custom_css );
- }
+ wp_register_style( 'global-styles', false );
+ wp_add_inline_style( 'global-styles', $stylesheet );
+ wp_enqueue_style( 'global-styles' );
- gutenberg_add_global_styles_block_custom_css();
+ // Add each block as an inline css.
+ gutenberg_add_global_styles_for_blocks();
}
add_action( 'wp_enqueue_scripts', 'gutenberg_enqueue_global_styles' );
add_action( 'wp_footer', 'gutenberg_enqueue_global_styles', 1 );
diff --git a/lib/theme-i18n.json b/lib/theme-i18n.json
index e4d14502132cb..fe541e65c676b 100644
--- a/lib/theme-i18n.json
+++ b/lib/theme-i18n.json
@@ -81,6 +81,15 @@
}
}
},
+ "styles": {
+ "blocks": {
+ "variations": {
+ "*": {
+ "title": "Style variation name"
+ }
+ }
+ }
+ },
"customTemplates": [
{
"title": "Custom template name"
diff --git a/package-lock.json b/package-lock.json
index 4f2901c8fe8bd..7a297c7d427e4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -80,7 +80,8 @@
"@wordpress/warning": "file:packages/warning",
"@wordpress/widgets": "file:packages/widgets",
"@wordpress/wordcount": "file:packages/wordcount",
- "es-module-shims": "^1.8.2"
+ "es-module-shims": "^1.8.2",
+ "postcss-local-keyframes": "^0.0.2"
},
"devDependencies": {
"@actions/core": "1.9.1",
@@ -42422,6 +42423,17 @@
"webpack": "^5.0.0"
}
},
+ "node_modules/postcss-local-keyframes": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-local-keyframes/-/postcss-local-keyframes-0.0.2.tgz",
+ "integrity": "sha512-nRN01llvxnqLw1TZu4kBknHwpxPPK3DLLJClQ3eTGhS+jBNyoIAMx0hw+fdiDOy7TXjfnojamPwUm/UxBEZDTw==",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "postcss": "^8.2.8"
+ }
+ },
"node_modules/postcss-media-query-parser": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz",
@@ -88797,6 +88809,11 @@
"semver": "^7.3.5"
}
},
+ "postcss-local-keyframes": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-local-keyframes/-/postcss-local-keyframes-0.0.2.tgz",
+ "integrity": "sha512-nRN01llvxnqLw1TZu4kBknHwpxPPK3DLLJClQ3eTGhS+jBNyoIAMx0hw+fdiDOy7TXjfnojamPwUm/UxBEZDTw=="
+ },
"postcss-media-query-parser": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz",
diff --git a/package.json b/package.json
index ca8ebb89876a6..382f09c9b81a1 100644
--- a/package.json
+++ b/package.json
@@ -92,7 +92,8 @@
"@wordpress/warning": "file:packages/warning",
"@wordpress/widgets": "file:packages/widgets",
"@wordpress/wordcount": "file:packages/wordcount",
- "es-module-shims": "^1.8.2"
+ "es-module-shims": "^1.8.2",
+ "postcss-local-keyframes": "^0.0.2"
},
"devDependencies": {
"@actions/core": "1.9.1",
@@ -274,8 +275,8 @@
"build:plugin-zip": "bash ./bin/build-plugin-zip.sh",
"clean:package-types": "tsc --build --clean && rimraf \"./packages/*/build-types\"",
"clean:packages": "rimraf \"./packages/*/@(build|build-module|build-style)\"",
- "dev": "npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"",
- "dev:packages": "concurrently \"node ./bin/packages/watch.js\" \"tsc --build --watch\"",
+ "dev": "cross-env NODE_ENV=development npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"",
+ "dev:packages": "cross-env NODE_ENV=development concurrently \"node ./bin/packages/watch.js\" \"tsc --build --watch\"",
"distclean": "git clean --force -d -X",
"docs:api-ref": "node ./bin/api-docs/update-api-docs.js",
"docs:blocks": "node ./bin/api-docs/gen-block-lib-list.js",
diff --git a/packages/autop/CHANGELOG.md b/packages/autop/CHANGELOG.md
index a1af20c63ba0b..ee2659f9bb6e6 100644
--- a/packages/autop/CHANGELOG.md
+++ b/packages/autop/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### Internal
+
+- Refactor to TypeScript ([#62583](https://github.com/WordPress/gutenberg/pull/62583)).
+
## 4.0.0 (2024-05-31)
### Breaking Changes
diff --git a/packages/autop/src/index.js b/packages/autop/src/index.ts
similarity index 92%
rename from packages/autop/src/index.js
rename to packages/autop/src/index.ts
index 596a028f46164..e4a4b7ff27cb2 100644
--- a/packages/autop/src/index.js
+++ b/packages/autop/src/index.ts
@@ -1,9 +1,7 @@
/**
* The regular expression for an HTML element.
- *
- * @type {RegExp}
*/
-const htmlSplitRegex = ( () => {
+const htmlSplitRegex: RegExp = ( () => {
/* eslint-disable no-multi-spaces */
const comments =
'!' + // Start of comment, after the <.
@@ -51,11 +49,11 @@ const htmlSplitRegex = ( () => {
/**
* Separate HTML elements and comments from the text.
*
- * @param {string} input The text which has to be formatted.
+ * @param input The text which has to be formatted.
*
- * @return {string[]} The formatted text.
+ * @return The formatted text.
*/
-function htmlSplit( input ) {
+function htmlSplit( input: string ): string[] {
const parts = [];
let workingInput = input;
@@ -65,7 +63,7 @@ function htmlSplit( input ) {
// If the `g` flag is omitted, `index` is included.
// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.
// Assert `match.index` is a number.
- const index = /** @type {number} */ ( match.index );
+ const index = match.index as number;
parts.push( workingInput.slice( 0, index ) );
parts.push( match[ 0 ] );
@@ -82,12 +80,15 @@ function htmlSplit( input ) {
/**
* Replace characters or phrases within HTML elements only.
*
- * @param {string} haystack The text which has to be formatted.
- * @param {Record} replacePairs In the form {from: 'to', …}.
+ * @param haystack The text which has to be formatted.
+ * @param replacePairs In the form {from: 'to', …}.
*
- * @return {string} The formatted text.
+ * @return The formatted text.
*/
-function replaceInHtmlTags( haystack, replacePairs ) {
+function replaceInHtmlTags(
+ haystack: string,
+ replacePairs: Record< string, string >
+): string {
// Find all elements.
const textArr = htmlSplit( haystack );
let changed = false;
@@ -125,9 +126,9 @@ function replaceInHtmlTags( haystack, replacePairs ) {
* replace double line-breaks with HTML paragraph tags. The remaining line-
* breaks after conversion become ` ` tags, unless br is set to 'false'.
*
- * @param {string} text The text which has to be formatted.
- * @param {boolean} br Optional. If set, will convert all remaining line-
- * breaks after paragraphing. Default true.
+ * @param text The text which has to be formatted.
+ * @param br Optional. If set, will convert all remaining line-
+ * breaks after paragraphing. Default true.
*
* @example
*```js
@@ -135,10 +136,10 @@ function replaceInHtmlTags( haystack, replacePairs ) {
* autop( 'my text' ); // "
my text
"
* ```
*
- * @return {string} Text which has been converted into paragraph tags.
+ * @return Text which has been converted into paragraph tags.
*/
-export function autop( text, br = true ) {
- const preTags = [];
+export function autop( text: string, br: boolean = true ): string {
+ const preTags: Array< [ string, string ] > = [];
if ( text.trim() === '' ) {
return '';
@@ -330,7 +331,7 @@ export function autop( text, br = true ) {
* Replaces `
` tags with two line breaks except where the `
` has attributes.
* Unifies whitespace. Indents `
`, `
` and `
` for better readability.
*
- * @param {string} html The content from the editor.
+ * @param html The content from the editor.
*
* @example
* ```js
@@ -338,15 +339,14 @@ export function autop( text, br = true ) {
* removep( '
my text
' ); // "my text"
* ```
*
- * @return {string} The content with stripped paragraph tags.
+ * @return The content with stripped paragraph tags.
*/
-export function removep( html ) {
+export function removep( html: string ): string {
const blocklist =
'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';
const blocklist1 = blocklist + '|div|p';
const blocklist2 = blocklist + '|pre';
- /** @type {string[]} */
- const preserve = [];
+ const preserve: string[] = [];
let preserveLinebreaks = false;
let preserveBr = false;
@@ -480,7 +480,7 @@ export function removep( html ) {
// Restore preserved tags.
if ( preserve.length ) {
html = html.replace( //g, () => {
- return /** @type {string} */ ( preserve.shift() );
+ return preserve.shift() as string;
} );
}
diff --git a/packages/autop/src/test/index.test.js b/packages/autop/src/test/index.test.ts
similarity index 98%
rename from packages/autop/src/test/index.test.js
rename to packages/autop/src/test/index.test.ts
index 734a20ff37be2..466aade0f25f1 100644
--- a/packages/autop/src/test/index.test.js
+++ b/packages/autop/src/test/index.test.ts
@@ -311,7 +311,7 @@ test( 'that_autop_treats_block_level_elements_as_blocks', () => {
];
// Check whitespace normalization.
- let content = [];
+ let content: string[] = [];
blocks.forEach( ( block ) => {
content.push( `<${ block }>foo${ block }>` );
@@ -388,18 +388,18 @@ test( 'that autop treats inline elements as inline', () => {
'select',
];
- let content = [];
- let expected = [];
+ const content: string[] = [];
+ const expected: string[] = [];
inlines.forEach( ( inline ) => {
content.push( `<${ inline }>foo${ inline }>` );
expected.push( `
<${ inline }>foo${ inline }>
` );
} );
- content = content.join( '\n\n' );
- expected = expected.join( '\n' );
+ const contentString = content.join( '\n\n' );
+ const expectedString = expected.join( '\n' );
- expect( autop( content ).trim() ).toBe( expected );
+ expect( autop( contentString ).trim() ).toBe( expectedString );
} );
test( 'element sanity', () => {
diff --git a/packages/blob/CHANGELOG.md b/packages/blob/CHANGELOG.md
index 50b6143dfb3e6..51fc2b54f9fa2 100644
--- a/packages/blob/CHANGELOG.md
+++ b/packages/blob/CHANGELOG.md
@@ -2,6 +2,10 @@
## Unreleased
+### Internal
+
+- Refactor to TypeScript ([#62569](https://github.com/WordPress/gutenberg/pull/62569)).
+
## 4.0.0 (2024-05-31)
### Breaking Changes
diff --git a/packages/blob/README.md b/packages/blob/README.md
index 64520a98bd6a7..d315cdab5e4a4 100644
--- a/packages/blob/README.md
+++ b/packages/blob/README.md
@@ -61,7 +61,7 @@ _Parameters_
_Returns_
-- `File|undefined`: The file for the blob URL.
+- `File | undefined`: The file for the blob URL.
### getBlobTypeByURL
@@ -73,7 +73,7 @@ _Parameters_
_Returns_
-- `string|undefined`: The blob type.
+- `string | undefined`: The blob type.
### isBlobURL
@@ -81,7 +81,7 @@ Check whether a url is a blob url.
_Parameters_
-- _url_ `string|undefined`: The URL.
+- _url_ `string | undefined`: The URL.
_Returns_
diff --git a/packages/blob/src/index.js b/packages/blob/src/index.ts
similarity index 66%
rename from packages/blob/src/index.js
rename to packages/blob/src/index.ts
index 2493f81fc4c65..62a6671db6154 100644
--- a/packages/blob/src/index.js
+++ b/packages/blob/src/index.ts
@@ -1,16 +1,13 @@
-/**
- * @type {Record}
- */
-const cache = {};
+const cache: Record< string, File > = {};
/**
* Create a blob URL from a file.
*
- * @param {File} file The file to create a blob URL for.
+ * @param file The file to create a blob URL for.
*
- * @return {string} The blob URL.
+ * @return The blob URL.
*/
-export function createBlobURL( file ) {
+export function createBlobURL( file: File ): string {
const url = window.URL.createObjectURL( file );
cache[ url ] = file;
@@ -23,11 +20,11 @@ export function createBlobURL( file ) {
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
* `undefined`.
*
- * @param {string} url The blob URL.
+ * @param url The blob URL.
*
- * @return {File|undefined} The file for the blob URL.
+ * @return The file for the blob URL.
*/
-export function getBlobByURL( url ) {
+export function getBlobByURL( url: string ): File | undefined {
return cache[ url ];
}
@@ -36,20 +33,20 @@ export function getBlobByURL( url ) {
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
* `undefined`.
*
- * @param {string} url The blob URL.
+ * @param url The blob URL.
*
- * @return {string|undefined} The blob type.
+ * @return The blob type.
*/
-export function getBlobTypeByURL( url ) {
+export function getBlobTypeByURL( url: string ): string | undefined {
return getBlobByURL( url )?.type.split( '/' )[ 0 ]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
}
/**
* Remove the resource and file cache from memory.
*
- * @param {string} url The blob URL.
+ * @param url The blob URL.
*/
-export function revokeBlobURL( url ) {
+export function revokeBlobURL( url: string ): void {
if ( cache[ url ] ) {
window.URL.revokeObjectURL( url );
}
@@ -60,11 +57,11 @@ export function revokeBlobURL( url ) {
/**
* Check whether a url is a blob url.
*
- * @param {string|undefined} url The URL.
+ * @param url The URL.
*
- * @return {boolean} Is the url a blob url?
+ * @return Is the url a blob url?
*/
-export function isBlobURL( url ) {
+export function isBlobURL( url: string | undefined ): boolean {
if ( ! url || ! url.indexOf ) {
return false;
}
@@ -90,11 +87,15 @@ export function isBlobURL( url ) {
* downloadBlob( filename, fileContent, 'application/json' );
* ```
*
- * @param {string} filename File name.
- * @param {BlobPart} content File content (BufferSource | Blob | string).
- * @param {string} contentType (Optional) File mime type. Default is `''`.
+ * @param filename File name.
+ * @param content File content (BufferSource | Blob | string).
+ * @param contentType (Optional) File mime type. Default is `''`.
*/
-export function downloadBlob( filename, content, contentType = '' ) {
+export function downloadBlob(
+ filename: string,
+ content: BlobPart,
+ contentType: string = ''
+): void {
if ( ! filename || ! content ) {
return;
}
diff --git a/packages/blob/src/test/index.js b/packages/blob/src/test/index.ts
similarity index 83%
rename from packages/blob/src/test/index.js
rename to packages/blob/src/test/index.ts
index 47dcb5019ee25..381b04fd817a6 100644
--- a/packages/blob/src/test/index.js
+++ b/packages/blob/src/test/index.ts
@@ -1,7 +1,7 @@
/**
* Internal dependencies
*/
-import { isBlobURL, getBlobTypeByURL, downloadBlob } from '../';
+import { isBlobURL, getBlobTypeByURL, downloadBlob } from '..';
describe( 'isBlobURL', () => {
it( 'returns true if the url starts with "blob:"', () => {
@@ -13,17 +13,23 @@ describe( 'isBlobURL', () => {
} );
it( 'returns false if the url is not defined', () => {
- expect( isBlobURL() ).toBe( false );
+ expect(
+ // @ts-expect-error This is not a valid call according to types.
+ isBlobURL()
+ ).toBe( false );
} );
} );
describe( 'getBlobTypeByURL', () => {
it( 'returns undefined if the blob is not found', () => {
- expect( getBlobTypeByURL( 'blob:notexisting' ) ).toBe( undefined );
+ expect( getBlobTypeByURL( 'blob:notexisting' ) ).toBeUndefined();
} );
it( 'returns undefined if the url is not defined', () => {
- expect( getBlobTypeByURL() ).toBe( undefined );
+ expect(
+ // @ts-expect-error This is not a valid call according to types.
+ getBlobTypeByURL()
+ ).toBeUndefined();
} );
} );
@@ -36,13 +42,17 @@ describe( 'downloadBlob', () => {
const createElementSpy = jest
.spyOn( global.document, 'createElement' )
.mockReturnValue( mockAnchorElement );
+
const mockBlob = jest.fn();
- const blobSpy = jest.spyOn( window, 'Blob' ).mockReturnValue( mockBlob );
+ const blobSpy = jest
+ .spyOn( window, 'Blob' )
+ .mockReturnValue( mockBlob as unknown as Blob );
jest.spyOn( document.body, 'appendChild' );
jest.spyOn( document.body, 'removeChild' );
beforeEach( () => {
// Can't seem to spy on these static methods. They are `undefined`.
// Possibly overwritten: https://github.com/WordPress/gutenberg/blob/trunk/packages/jest-preset-default/scripts/setup-globals.js#L5
+ // @ts-expect-error This is not a valid URL object.
window.URL = {
createObjectURL,
revokeObjectURL,
diff --git a/packages/block-editor/src/components/block-actions/index.js b/packages/block-editor/src/components/block-actions/index.js
index b34f8eea93615..5e12165c67942 100644
--- a/packages/block-editor/src/components/block-actions/index.js
+++ b/packages/block-editor/src/components/block-actions/index.js
@@ -31,12 +31,10 @@ export default function BlockActions( {
getDirectInsertBlock,
canMoveBlocks,
canRemoveBlocks,
- getBlockEditingMode,
} = select( blockEditorStore );
const blocks = getBlocksByClientId( clientIds );
const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
- const rootBlockEditingMode = getBlockEditingMode( rootClientId );
const canInsertDefaultBlock = canInsertBlockType(
getDefaultBlockName(),
rootClientId
@@ -46,11 +44,9 @@ export default function BlockActions( {
: null;
return {
- canMove: canMoveBlocks( clientIds, rootClientId ),
- canRemove: canRemoveBlocks( clientIds, rootClientId ),
- canInsertBlock:
- ( canInsertDefaultBlock || !! directInsertBlock ) &&
- rootBlockEditingMode === 'default',
+ canMove: canMoveBlocks( clientIds ),
+ canRemove: canRemoveBlocks( clientIds ),
+ canInsertBlock: canInsertDefaultBlock || !! directInsertBlock,
canCopyStyles: blocks.every( ( block ) => {
return (
!! block &&
diff --git a/packages/block-editor/src/components/block-draggable/index.js b/packages/block-editor/src/components/block-draggable/index.js
index c86bc55e8ed07..0ba2b857bc693 100644
--- a/packages/block-editor/src/components/block-draggable/index.js
+++ b/packages/block-editor/src/components/block-draggable/index.js
@@ -53,7 +53,7 @@ const BlockDraggable = ( {
return {
srcRootClientId: rootClientId,
- isDraggable: canMoveBlocks( clientIds, rootClientId ),
+ isDraggable: canMoveBlocks( clientIds ),
icon: variation?.icon || _getBlockType( blockName )?.icon,
visibleInserter: isBlockInsertionPointVisible(),
getBlockType: _getBlockType,
diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js
index 030d08b42ce4d..bdf33c944deb1 100644
--- a/packages/block-editor/src/components/block-list/block.js
+++ b/packages/block-editor/src/components/block-list/block.js
@@ -623,8 +623,8 @@ function BlockListBlockProvider( props ) {
}
const _isSelected = isBlockSelected( clientId );
- const canRemove = canRemoveBlock( clientId, rootClientId );
- const canMove = canMoveBlock( clientId, rootClientId );
+ const canRemove = canRemoveBlock( clientId );
+ const canMove = canMoveBlock( clientId );
const match = getActiveBlockVariation( blockName, attributes );
const isMultiSelected = isBlockMultiSelected( clientId );
const checkDeep = true;
diff --git a/packages/block-editor/src/components/block-list/block.native.js b/packages/block-editor/src/components/block-list/block.native.js
index f76021b50fc4b..4112d614da35f 100644
--- a/packages/block-editor/src/components/block-list/block.native.js
+++ b/packages/block-editor/src/components/block-list/block.native.js
@@ -432,8 +432,8 @@ const applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {
const attributes = getBlockAttributes( clientId );
const isSelected = isBlockSelected( clientId );
const templateLock = getTemplateLock( rootClientId );
- const canRemove = canRemoveBlock( clientId, rootClientId );
- const canMove = canMoveBlock( clientId, rootClientId );
+ const canRemove = canRemoveBlock( clientId );
+ const canMove = canMoveBlock( clientId );
// The fallback to `{}` is a temporary fix.
// This function should never be called when a block is not present in
diff --git a/packages/block-editor/src/components/block-list/use-in-between-inserter.js b/packages/block-editor/src/components/block-list/use-in-between-inserter.js
index 044e5b185a224..68fa8628c54c7 100644
--- a/packages/block-editor/src/components/block-list/use-in-between-inserter.js
+++ b/packages/block-editor/src/components/block-list/use-in-between-inserter.js
@@ -40,7 +40,9 @@ export function useInBetweenInserter() {
}
function onMouseMove( event ) {
- if ( openRef.current ) {
+ // openRef is the reference to the insertion point between blocks.
+ // If the reference is not set or the insertion point is already open, return.
+ if ( openRef === undefined || openRef.current ) {
return;
}
diff --git a/packages/block-editor/src/components/block-lock/use-block-lock.js b/packages/block-editor/src/components/block-lock/use-block-lock.js
index da6ccc4092096..9917a739eacd8 100644
--- a/packages/block-editor/src/components/block-lock/use-block-lock.js
+++ b/packages/block-editor/src/components/block-lock/use-block-lock.js
@@ -24,14 +24,12 @@ export default function useBlockLock( clientId ) {
canRemoveBlock,
canLockBlockType,
getBlockName,
- getBlockRootClientId,
getTemplateLock,
} = select( blockEditorStore );
- const rootClientId = getBlockRootClientId( clientId );
const canEdit = canEditBlock( clientId );
- const canMove = canMoveBlock( clientId, rootClientId );
- const canRemove = canRemoveBlock( clientId, rootClientId );
+ const canMove = canMoveBlock( clientId );
+ const canRemove = canRemoveBlock( clientId );
return {
canEdit,
diff --git a/packages/block-editor/src/components/block-mover/index.js b/packages/block-editor/src/components/block-mover/index.js
index a143ab391a43f..24f259613351d 100644
--- a/packages/block-editor/src/components/block-mover/index.js
+++ b/packages/block-editor/src/components/block-mover/index.js
@@ -46,7 +46,7 @@ function BlockMover( {
const blockOrder = getBlockOrder( _rootClientId );
return {
- canMove: canMoveBlocks( clientIds, _rootClientId ),
+ canMove: canMoveBlocks( clientIds ),
rootClientId: _rootClientId,
isFirst: firstIndex === 0,
isLast: lastIndex === blockOrder.length - 1,
diff --git a/packages/block-editor/src/components/block-mover/index.native.js b/packages/block-editor/src/components/block-mover/index.native.js
index 326479cd3bc6e..74a72aec01dbe 100644
--- a/packages/block-editor/src/components/block-mover/index.native.js
+++ b/packages/block-editor/src/components/block-mover/index.native.js
@@ -166,7 +166,7 @@ export default compose(
numberOfBlocks: blockOrder.length - 1,
isFirst: firstIndex === 0,
isLast: lastIndex === blockOrder.length - 1,
- canMove: canMoveBlocks( clientIds, rootClientId ),
+ canMove: canMoveBlocks( clientIds ),
rootClientId,
};
} ),
diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js
index 62c5ff4a5f158..069bd2c9ff1ee 100644
--- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js
+++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js
@@ -256,7 +256,7 @@ export function BlockSettingsDropdown( {
{ __( 'Duplicate' ) }
) }
- { canInsertBlock && (
+ { canInsertBlock && ! isContentOnly && (
<>