diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml
index ce830c04f651d..0f813267b586b 100644
--- a/.github/workflows/build-plugin-zip.yml
+++ b/.github/workflows/build-plugin-zip.yml
@@ -72,7 +72,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
token: ${{ secrets.GUTENBERG_TOKEN }}
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -168,13 +168,13 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Use desired version of Node.js
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
check-latest: true
@@ -225,7 +225,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 2
ref: ${{ needs.bump-version.outputs.release_branch }}
@@ -314,14 +314,14 @@ jobs:
if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }}
steps:
- name: Checkout (for CLI)
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: main
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Checkout (for publishing)
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: publish
# Later, we switch this branch in the script that publishes packages.
@@ -336,7 +336,7 @@ jobs:
git config user.email gutenberg@wordpress.org
- name: Setup Node.js
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: 'main/.nvmrc'
registry-url: 'https://registry.npmjs.org'
diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml
index 499a2c020255c..e24b30eea7ba7 100644
--- a/.github/workflows/bundle-size.yml
+++ b/.github/workflows/bundle-size.yml
@@ -37,13 +37,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 1
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Use desired version of Node.js
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
check-latest: true
diff --git a/.github/workflows/check-backport-changelog.yml b/.github/workflows/check-backport-changelog.yml
index 366bad9fdbc24..cf07b1a3936b9 100644
--- a/.github/workflows/check-backport-changelog.yml
+++ b/.github/workflows/check-backport-changelog.yml
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
diff --git a/.github/workflows/check-components-changelog.yml b/.github/workflows/check-components-changelog.yml
index 1f6863b4a486e..40fbfe22bea56 100644
--- a/.github/workflows/check-components-changelog.yml
+++ b/.github/workflows/check-components-changelog.yml
@@ -22,7 +22,7 @@ jobs:
- name: 'Get PR commit count'
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- name: Checkout code
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
diff --git a/.github/workflows/cherry-pick-wp-release.yml b/.github/workflows/cherry-pick-wp-release.yml
index b43b0cc267314..11688a7cfba98 100644
--- a/.github/workflows/cherry-pick-wp-release.yml
+++ b/.github/workflows/cherry-pick-wp-release.yml
@@ -70,7 +70,7 @@ jobs:
- name: Checkout repository
if: env.cherry_pick == 'true'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
token: ${{ secrets.GUTENBERG_TOKEN }}
fetch-depth: 0
diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml
index 0de1b9ee6566a..d20b3e353c31e 100644
--- a/.github/workflows/create-block.yml
+++ b/.github/workflows/create-block.yml
@@ -24,7 +24,7 @@ jobs:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml
index 99166989cd68c..bbf033222a4b3 100644
--- a/.github/workflows/end2end-test.yml
+++ b/.github/workflows/end2end-test.yml
@@ -27,7 +27,7 @@ jobs:
totalParts: [8]
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -102,7 +102,7 @@ jobs:
steps:
# Checkout defaults to using the branch which triggered the event, which
# isn't necessarily `trunk` (e.g. in the case of a merge).
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml
index 8cc11b9bd913b..4715e1e09c2b8 100644
--- a/.github/workflows/gradle-wrapper-validation.yml
+++ b/.github/workflows/gradle-wrapper-validation.yml
@@ -6,7 +6,7 @@ jobs:
name: 'Validation'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- uses: gradle/wrapper-validation-action@v3
diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml
index 98615b93b8a17..9c4bee3af473c 100644
--- a/.github/workflows/performance.yml
+++ b/.github/workflows/performance.yml
@@ -33,7 +33,7 @@ jobs:
WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml
index a24e501247402..66f8130ece2f0 100644
--- a/.github/workflows/publish-npm-packages.yml
+++ b/.github/workflows/publish-npm-packages.yml
@@ -31,7 +31,7 @@ jobs:
steps:
- name: Checkout (for CLI)
if: ${{ github.event.inputs.release_type != 'wp' }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: cli
ref: trunk
@@ -39,7 +39,7 @@ jobs:
- name: Checkout (for publishing)
if: ${{ github.event.inputs.release_type != 'wp' }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: publish
# Later, we switch this branch in the script that publishes packages.
@@ -49,7 +49,7 @@ jobs:
- name: Checkout (for publishing WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: publish
ref: wp/${{ github.event.inputs.wp_version }}
@@ -67,7 +67,7 @@ jobs:
- name: Setup Node.js
if: ${{ github.event.inputs.release_type != 'wp' }}
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'
@@ -75,7 +75,7 @@ jobs:
- name: Setup Node.js (for WP major version)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: 'publish/.nvmrc'
registry-url: 'https://registry.npmjs.org'
diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml
index 996bb1667ada5..2006eafd81cc7 100644
--- a/.github/workflows/pull-request-automation.yml
+++ b/.github/workflows/pull-request-automation.yml
@@ -12,13 +12,13 @@ jobs:
steps:
# Checkout defaults to using the branch which triggered the event, which
# isn't necessarily `trunk` (e.g. in the case of a merge).
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Use desired version of Node.js
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
check-latest: true
diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml
index 2c3998c295280..917ee6144087e 100644
--- a/.github/workflows/rnmobile-android-runner.yml
+++ b/.github/workflows/rnmobile-android-runner.yml
@@ -23,7 +23,7 @@ jobs:
steps:
- name: checkout
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml
index 2926e494b09f8..cf065ad1cdf7d 100644
--- a/.github/workflows/rnmobile-ios-runner.yml
+++ b/.github/workflows/rnmobile-ios-runner.yml
@@ -23,11 +23,11 @@ jobs:
native-test-name: [gutenberg-editor-rendering]
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- - uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
+ - uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1.194.0
with:
# `.ruby-version` file location
working-directory: packages/react-native-editor/ios
diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml
index 1efd248bf7f30..1af2bb0ec7927 100644
--- a/.github/workflows/static-checks.yml
+++ b/.github/workflows/static-checks.yml
@@ -22,12 +22,12 @@ jobs:
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
- name: Use desired version of Node.js
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
+ uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'
check-latest: true
diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml
index 65dd46b3a7610..83f7fdb96f926 100644
--- a/.github/workflows/storybook-pages.yml
+++ b/.github/workflows/storybook-pages.yml
@@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: trunk
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/sync-backport-changelog.yml b/.github/workflows/sync-backport-changelog.yml
index bbc5663cf715b..b71d9440c38a1 100644
--- a/.github/workflows/sync-backport-changelog.yml
+++ b/.github/workflows/sync-backport-changelog.yml
@@ -20,7 +20,7 @@ jobs:
)
steps:
- name: Checkout
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 2 # Fetch the last two commits to compare changes
- name: Check for changes in backport-changelog
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index b80804b824e3c..bfa35492589a4 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -32,7 +32,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -70,7 +70,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -121,7 +121,7 @@ jobs:
name: Build JavaScript assets for PHP unit tests
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -155,6 +155,7 @@ jobs:
- '8.0'
- '8.1'
- '8.2'
+ - '8.3'
multisite: [false, true]
wordpress: [''] # Latest WordPress version.
include:
@@ -163,7 +164,7 @@ jobs:
wordpress: 'previous major version'
- php: '7.4'
wordpress: 'previous major version'
- - php: '8.2'
+ - php: '8.3'
wordpress: 'previous major version'
env:
@@ -172,7 +173,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -197,12 +198,6 @@ jobs:
- name: Override PHP version in composer.json
run: composer config platform.php ${{ matrix.php }}
- # The spatie/phpunit-watcher package is not compatible with PHP < 7.2.
- # It must be removed before running the tests.
- - name: Remove incompatible Composer packages
- if: ${{ matrix.php < '7.2' }}
- run: composer remove spatie/phpunit-watcher --dev --no-update
-
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
@@ -283,7 +278,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
@@ -353,7 +348,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml
index 81a9c4739ac19..d09e2af3dd213 100644
--- a/.github/workflows/upload-release-to-plugin-repo.yml
+++ b/.github/workflows/upload-release-to-plugin-repo.yml
@@ -96,7 +96,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
ref: ${{ matrix.branch }}
token: ${{ secrets.GUTENBERG_TOKEN }}
diff --git a/composer.json b/composer.json
index 3571377bd58bd..982a71a975223 100644
--- a/composer.json
+++ b/composer.json
@@ -23,14 +23,15 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
- }
+ },
+ "lock": false
},
"require-dev": {
"phpcompatibility/phpcompatibility-wp": "^2.1.3",
"wp-coding-standards/wpcs": "^3.0",
"sirbrillig/phpcs-variable-analysis": "^2.8",
"spatie/phpunit-watcher": "^1.23",
- "yoast/phpunit-polyfills": "^1.0",
+ "yoast/phpunit-polyfills": "^1.1.0",
"gutenberg/gutenberg-coding-standards": "@dev"
},
"repositories": [
@@ -43,7 +44,7 @@
}
],
"require": {
- "composer/installers": "~1.0"
+ "composer/installers": "^1.0 || ^2.0"
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
diff --git a/docs/manifest.json b/docs/manifest.json
index d76717fbdedfc..8387b9079694c 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -1098,33 +1098,9 @@
"parent": "components"
},
{
- "title": "NavigatorBackButton",
- "slug": "navigator-back-button",
- "markdown_source": "../packages/components/src/navigator/navigator-back-button/README.md",
- "parent": "components"
- },
- {
- "title": "NavigatorButton",
- "slug": "navigator-button",
- "markdown_source": "../packages/components/src/navigator/navigator-button/README.md",
- "parent": "components"
- },
- {
- "title": "NavigatorProvider",
- "slug": "navigator-provider",
- "markdown_source": "../packages/components/src/navigator/navigator-provider/README.md",
- "parent": "components"
- },
- {
- "title": "NavigatorScreen",
- "slug": "navigator-screen",
- "markdown_source": "../packages/components/src/navigator/navigator-screen/README.md",
- "parent": "components"
- },
- {
- "title": "NavigatorToParentButton",
- "slug": "navigator-to-parent-button",
- "markdown_source": "../packages/components/src/navigator/navigator-to-parent-button/README.md",
+ "title": "Navigator",
+ "slug": "navigator",
+ "markdown_source": "../packages/components/src/navigator/README.md",
"parent": "components"
},
{
diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md
index 4b3ca78f74d29..956e8dd010581 100644
--- a/docs/reference-guides/data/data-core-block-editor.md
+++ b/docs/reference-guides/data/data-core-block-editor.md
@@ -262,7 +262,7 @@ _Returns_
### getBlockInsertionPoint
-Returns the insertion point, the index at which the new inserted block would be placed. Defaults to the last index.
+Returns the location of the insertion cue. Defaults to the last index.
_Parameters_
@@ -982,7 +982,7 @@ _Returns_
### isBlockInsertionPointVisible
-Returns true if we should show the block insertion point.
+Returns true if the block insertion point is visible.
_Parameters_
diff --git a/docs/reference-guides/data/data-core-editor.md b/docs/reference-guides/data/data-core-editor.md
index 4fea2c51fa54f..a4c1a59f0c423 100644
--- a/docs/reference-guides/data/data-core-editor.md
+++ b/docs/reference-guides/data/data-core-editor.md
@@ -1422,6 +1422,10 @@ _Parameters_
- _value_ `boolean|Object`: Whether the inserter should be opened (true) or closed (false). To specify an insertion point, use an object.
- _value.rootClientId_ `string`: The root client ID to insert at.
- _value.insertionIndex_ `number`: The index to insert at.
+- _value.filterValue_ `string`: A query to filter the inserter results.
+- _value.onSelect_ `Function`: A callback when an item is selected.
+- _value.tab_ `string`: The tab to open in the inserter.
+- _value.category_ `string`: The category to initialize in the inserter.
_Returns_
diff --git a/lib/compat/wordpress-6.7/script-modules.php b/lib/compat/wordpress-6.7/script-modules.php
index 0a440ec81688d..2282a3d4bd5ac 100644
--- a/lib/compat/wordpress-6.7/script-modules.php
+++ b/lib/compat/wordpress-6.7/script-modules.php
@@ -102,3 +102,46 @@ function () {
},
20
);
+
+/**
+ * Prints HTML for the a11y Script Module.
+ *
+ * a11y relies on some DOM elements to use as ARIA live regions.
+ * Ideally, these elements are part of the initial HTML of the page
+ * so that accessibility tools can find them and observe updates.
+ */
+function gutenberg_a11y_script_module_html() {
+ $a11y_module_available = false;
+
+ $get_marked_for_enqueue = new ReflectionMethod( 'WP_Script_Modules', 'get_marked_for_enqueue' );
+ $get_marked_for_enqueue->setAccessible( true );
+ $get_import_map = new ReflectionMethod( 'WP_Script_Modules', 'get_import_map' );
+ $get_import_map->setAccessible( true );
+
+ foreach ( array_keys( $get_marked_for_enqueue->invoke( wp_script_modules() ) ) as $id ) {
+ if ( '@wordpress/a11y' === $id ) {
+ $a11y_module_available = true;
+ break;
+ }
+ }
+ if ( ! $a11y_module_available ) {
+ foreach ( array_keys( $get_import_map->invoke( wp_script_modules() )['imports'] ) as $id ) {
+ if ( '@wordpress/a11y' === $id ) {
+ $a11y_module_available = true;
+ break;
+ }
+ }
+ }
+ if ( ! $a11y_module_available ) {
+ return;
+ }
+ echo '
'
+ . '
' . esc_html__( 'Notifications', 'default' ) . '
'
+ . '
'
+ . '
'
+ . '
';
+}
+if ( ! method_exists( 'WP_Script_Modules', 'print_a11y_script_module_html' ) ) {
+ add_action( 'wp_footer', 'gutenberg_a11y_script_module_html' );
+ add_action( 'admin_footer', 'gutenberg_a11y_script_module_html' );
+}
diff --git a/lib/experimental/media/load.php b/lib/experimental/media/load.php
index 5cb16d84e1d8d..bcb02accf62a6 100644
--- a/lib/experimental/media/load.php
+++ b/lib/experimental/media/load.php
@@ -186,6 +186,24 @@ function gutenberg_rest_get_attachment_filesize( array $post ): ?int {
return null;
}
+/**
+ * Filters the list of rewrite rules formatted for output to an .htaccess file.
+ *
+ * Adds support for serving wasm-vips locally.
+ *
+ * @param string $rules mod_rewrite Rewrite rules formatted for .htaccess.
+ * @return string Filtered rewrite rules.
+ */
+function gutenberg_filter_mod_rewrite_rules( string $rules ): string {
+ $rules .= "\n# BEGIN Gutenberg client-side media processing experiment\n" .
+ "AddType application/wasm wasm\n" .
+ "# END Gutenberg client-side media processing experiment\n";
+
+ return $rules;
+}
+
+add_filter( 'mod_rewrite_rules', 'gutenberg_filter_mod_rewrite_rules' );
+
/**
* Enables cross-origin isolation in the block editor.
*
@@ -236,16 +254,11 @@ function gutenberg_start_cross_origin_isolation_output_buffer(): void {
$coep = $is_safari ? 'require-corp' : 'credentialless';
ob_start(
- function ( string $output, ?int $phase ) use ( $coep ): string {
- // Only send the header when the buffer is not being cleaned.
- if ( ( $phase & PHP_OUTPUT_HANDLER_CLEAN ) === 0 ) {
- header( 'Cross-Origin-Opener-Policy: same-origin' );
- header( "Cross-Origin-Embedder-Policy: $coep" );
-
- $output = gutenberg_add_crossorigin_attributes( $output );
- }
+ function ( string $output ) use ( $coep ): string {
+ header( 'Cross-Origin-Opener-Policy: same-origin' );
+ header( "Cross-Origin-Embedder-Policy: $coep" );
- return $output;
+ return gutenberg_add_crossorigin_attributes( $output );
}
);
}
diff --git a/lib/experimental/script-modules.php b/lib/experimental/script-modules.php
index fe23786fc0362..5a14e1418ed6d 100644
--- a/lib/experimental/script-modules.php
+++ b/lib/experimental/script-modules.php
@@ -200,44 +200,3 @@ function gutenberg_dequeue_module( $module_identifier ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 17.6.0', 'wp_dequeue_script_module' );
wp_script_modules()->dequeue( $module_identifier );
}
-
-/**
- * Prints HTML for the a11y Script Module.
- *
- * a11y relies on some DOM elements to use as ARIA live regions.
- * Ideally, these elements are part of the initial HTML of the page
- * so that accessibility tools can find them and observe updates.
- */
-function gutenberg_a11y_script_module_html() {
- $a11y_module_available = false;
-
- $get_marked_for_enqueue = new ReflectionMethod( 'WP_Script_Modules', 'get_marked_for_enqueue' );
- $get_marked_for_enqueue->setAccessible( true );
- $get_import_map = new ReflectionMethod( 'WP_Script_Modules', 'get_import_map' );
- $get_import_map->setAccessible( true );
-
- foreach ( array_keys( $get_marked_for_enqueue->invoke( wp_script_modules() ) ) as $id ) {
- if ( '@wordpress/a11y' === $id ) {
- $a11y_module_available = true;
- break;
- }
- }
- if ( ! $a11y_module_available ) {
- foreach ( array_keys( $get_import_map->invoke( wp_script_modules() )['imports'] ) as $id ) {
- if ( '@wordpress/a11y' === $id ) {
- $a11y_module_available = true;
- break;
- }
- }
- }
- if ( ! $a11y_module_available ) {
- return;
- }
- echo ''
- . '
' . esc_html__( 'Notifications', 'default' ) . '
'
- . '
'
- . '
'
- . '
';
-}
-add_action( 'wp_footer', 'gutenberg_a11y_script_module_html' );
-add_action( 'admin_footer', 'gutenberg_a11y_script_module_html' );
diff --git a/packages/base-styles/_mixins.scss b/packages/base-styles/_mixins.scss
index 91017c8bb9932..65f98bf6f15bf 100644
--- a/packages/base-styles/_mixins.scss
+++ b/packages/base-styles/_mixins.scss
@@ -1,6 +1,74 @@
@import "./functions";
@import "./long-content-fade";
+/**
+ * Typography
+ */
+
+@mixin _text-heading() {
+ font-family: $font-family-headings;
+ font-weight: $font-weight-medium;
+}
+
+@mixin _text-body() {
+ font-family: $font-family-body;
+ font-weight: $font-weight-regular;
+}
+
+@mixin heading-small() {
+ @include _text-heading();
+ font-size: $font-size-x-small;
+ line-height: $line-height-x-small;
+}
+
+@mixin heading-medium() {
+ @include _text-heading();
+ font-size: $font-size-medium;
+ line-height: $line-height-small;
+}
+
+@mixin heading-large() {
+ @include _text-heading();
+ font-size: $font-size-large;
+ line-height: $line-height-small;
+}
+
+@mixin heading-x-large() {
+ @include _text-heading();
+ font-size: $font-size-x-large;
+ line-height: $line-height-medium;
+}
+
+@mixin heading-2x-large() {
+ @include _text-heading();
+ font-size: $font-size-2x-large;
+ line-height: $font-line-height-2x-large;
+}
+
+@mixin body-small() {
+ @include _text-body();
+ font-size: $font-size-small;
+ line-height: $line-height-x-small;
+}
+
+@mixin body-medium() {
+ @include _text-body();
+ font-size: $font-size-medium;
+ line-height: $line-height-small;
+}
+
+@mixin body-large() {
+ @include _text-body();
+ font-size: $font-size-large;
+ line-height: $line-height-medium;
+}
+
+@mixin body-x-large() {
+ @include _text-body();
+ font-size: $font-size-x-large;
+ line-height: $line-height-x-large;
+}
+
/**
* Breakpoint mixins
*/
diff --git a/packages/base-styles/_variables.scss b/packages/base-styles/_variables.scss
index 35092033c552b..ec0bdf91f2489 100644
--- a/packages/base-styles/_variables.scss
+++ b/packages/base-styles/_variables.scss
@@ -12,15 +12,37 @@
* Fonts & basic variables.
*/
-$default-font: -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,"Helvetica Neue", sans-serif;
-$default-font-size: 13px;
-$default-line-height: 1.4;
-$editor-html-font: Menlo, Consolas, monaco, monospace;
-$editor-font-size: 16px;
-$default-block-margin: 28px; // This value provides a consistent, contiguous spacing between blocks.
-$text-editor-font-size: 15px;
-$editor-line-height: 1.8;
-$mobile-text-min-font-size: 16px; // Any font size below 16px will cause Mobile Safari to "zoom in".
+$default-font: -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell,"Helvetica Neue", sans-serif; // Todo: deprecate in favor of $family variables
+$default-line-height: 1.4; // Todo: deprecate in favor of $line-height tokens
+
+/**
+ * Typography
+ */
+
+// Sizes
+$font-size-x-small: 11px;
+$font-size-small: 12px;
+$font-size-medium: 13px;
+$font-size-large: 15px;
+$font-size-x-large: 20px;
+$font-size-2x-large: 32px;
+
+// Line heights
+$font-line-height-x-small: 16px;
+$font-line-height-small: 20px;
+$font-line-height-medium: 24px;
+$font-line-height-large: 28px;
+$font-line-height-x-large: 32px;
+$font-line-height-2x-large: 40px;
+
+// Weights
+$font-weight-regular: 400;
+$font-weight-medium: 500;
+
+// Families
+$font-family-headings: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+$font-family-body: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+$font-family-mono: Menlo, Consolas, monaco, monospace;
/**
* Grid System.
@@ -91,7 +113,12 @@ $spinner-size: 16px;
$canvas-padding: $grid-unit-20;
/**
- * Editor widths.
+ * Mobile specific styles
+ */
+$mobile-text-min-font-size: 16px; // Any font size below 16px will cause Mobile Safari to "zoom in".
+
+/**
+ * Editor styles.
*/
$sidebar-width: 280px;
@@ -99,6 +126,11 @@ $content-width: 840px;
$wide-content-width: 1100px;
$widget-area-width: 700px;
$secondary-sidebar-width: 350px;
+$editor-font-size: 16px;
+$default-block-margin: 28px; // This value provides a consistent, contiguous spacing between blocks.
+$text-editor-font-size: 15px;
+$editor-line-height: 1.8;
+$editor-html-font: $font-family-mono;
/**
* Block & Editor UI.
@@ -117,7 +149,7 @@ $block-padding: 14px; // Used to define space between block footprint and surrou
$radius-block-ui: $radius-small;
$shadow-popover: $elevation-x-small;
$shadow-modal: $elevation-large;
-
+$default-font-size: $font-size-medium;
/**
* Block paddings.
diff --git a/packages/block-directory/src/components/downloadable-block-list-item/style.scss b/packages/block-directory/src/components/downloadable-block-list-item/style.scss
index fa5e5906cb1b9..6fce5e1b5b32a 100644
--- a/packages/block-directory/src/components/downloadable-block-list-item/style.scss
+++ b/packages/block-directory/src/components/downloadable-block-list-item/style.scss
@@ -69,6 +69,11 @@
align-items: center;
justify-content: center;
}
+
+ .is-installing & {
+ // Adding an extra 6px to avoid the UI from jumping when the rating bar gets hidden
+ margin-right: $grid-unit-20 + 6px;
+ }
}
.block-directory-block-ratings {
diff --git a/packages/block-editor/src/components/block-draggable/style.scss b/packages/block-editor/src/components/block-draggable/style.scss
index 349afa2c3563c..f716f2d32a1d4 100644
--- a/packages/block-editor/src/components/block-draggable/style.scss
+++ b/packages/block-editor/src/components/block-draggable/style.scss
@@ -8,7 +8,7 @@
.block-editor-block-draggable-chip {
background-color: $gray-900;
border-radius: $radius-small;
- box-shadow: 0 6px 8px rgba($black, 0.3);
+ box-shadow: $elevation-small;
color: $white;
cursor: grabbing;
display: inline-flex;
@@ -77,6 +77,6 @@
.block-editor-block-draggable-chip__disabled.block-editor-block-draggable-chip__disabled {
background-color: $gray-700;
opacity: 1;
- box-shadow: 0 4px 8px rgba($black, 0.2);
+ box-shadow: $elevation-small;
}
}
diff --git a/packages/block-editor/src/components/block-heading-level-dropdown/index.js b/packages/block-editor/src/components/block-heading-level-dropdown/index.js
index 71cb2ede989b5..6b9bad09978a5 100644
--- a/packages/block-editor/src/components/block-heading-level-dropdown/index.js
+++ b/packages/block-editor/src/components/block-heading-level-dropdown/index.js
@@ -40,12 +40,18 @@ export default function HeadingLevelDropdown( {
value,
onChange,
} ) {
+ const validOptions = options
+ .filter(
+ ( option ) => option === 0 || HEADING_LEVELS.includes( option )
+ )
+ .sort( ( a, b ) => a - b ); // Sorts numerically in ascending order;
+
return (
}
label={ __( 'Change level' ) }
- controls={ options.map( ( targetLevel ) => {
+ controls={ validOptions.map( ( targetLevel ) => {
const isActive = targetLevel === value;
return {
icon: ,
diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js
index 90c39649319dc..2cecd941dfa3b 100644
--- a/packages/block-editor/src/components/block-list/block.js
+++ b/packages/block-editor/src/components/block-list/block.js
@@ -25,6 +25,7 @@ import {
getBlockDefaultClassName,
hasBlockSupport,
store as blocksStore,
+ privateApis as blocksPrivateApis,
} from '@wordpress/blocks';
import { withFilters } from '@wordpress/components';
import { withDispatch, useDispatch, useSelect } from '@wordpress/data';
@@ -46,6 +47,8 @@ import { PrivateBlockContext } from './private-block-context';
import { unlock } from '../../lock-unlock';
+const { isUnmodifiedBlockContent } = unlock( blocksPrivateApis );
+
/**
* Merges wrapper props with special handling for classNames and styles.
*
@@ -350,12 +353,48 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
removeBlock( _clientId );
} else {
registry.batch( () => {
+ const firstBlock = getBlock( firstClientId );
+ const isFirstBlockContentUnmodified =
+ isUnmodifiedBlockContent( firstBlock );
+ const defaultBlockName = getDefaultBlockName();
+ const replacement = switchToBlockType(
+ firstBlock,
+ defaultBlockName
+ );
+ const canTransformToDefaultBlock =
+ !! replacement?.length &&
+ replacement.every( ( block ) =>
+ canInsertBlockType( block.name, _clientId )
+ );
+
if (
+ isFirstBlockContentUnmodified &&
+ canTransformToDefaultBlock
+ ) {
+ // Step 1: If the block is empty and can be transformed to the default block type.
+ replaceBlocks(
+ firstClientId,
+ replacement,
+ changeSelection
+ );
+ } else if (
+ isFirstBlockContentUnmodified &&
+ firstBlock.name === defaultBlockName
+ ) {
+ // Step 2: If the block is empty and is already the default block type.
+ removeBlock( firstClientId );
+ const nextBlockClientId =
+ getNextBlockClientId( clientId );
+ if ( nextBlockClientId ) {
+ selectBlock( nextBlockClientId );
+ }
+ } else if (
canInsertBlockType(
- getBlockName( firstClientId ),
+ firstBlock.name,
targetRootClientId
)
) {
+ // Step 3: If the block can be moved up.
moveBlocksToPosition(
[ firstClientId ],
_clientId,
@@ -363,21 +402,17 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
getBlockIndex( _clientId )
);
} else {
- const replacement = switchToBlockType(
- getBlock( firstClientId ),
- getDefaultBlockName()
- );
-
- if (
- replacement &&
- replacement.length &&
+ const canLiftAndTransformToDefaultBlock =
+ !! replacement?.length &&
replacement.every( ( block ) =>
canInsertBlockType(
block.name,
targetRootClientId
)
- )
- ) {
+ );
+
+ if ( canLiftAndTransformToDefaultBlock ) {
+ // Step 4: If the block can be transformed to the default block type and moved up.
insertBlocks(
replacement,
getBlockIndex( _clientId ),
@@ -386,6 +421,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
);
removeBlock( firstClientId, false );
} else {
+ // Step 5: Continue the default behavior.
switchToDefaultOrRemove();
}
}
diff --git a/packages/block-editor/src/components/block-list/content.scss b/packages/block-editor/src/components/block-list/content.scss
index 3e3865e689bea..c5fda109d8b67 100644
--- a/packages/block-editor/src/components/block-list/content.scss
+++ b/packages/block-editor/src/components/block-list/content.scss
@@ -411,6 +411,18 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
margin-left: -1px;
margin-right: -1px;
transition: background-color 0.3s ease;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: $default-font-size;
+ font-family: $default-font;
+ color: $black;
+ font-weight: normal;
+
+ .is-zoomed-out & {
+ // Scale the font size based on the zoom level.
+ font-size: calc(#{$default-font-size} * ( 2 - var(--wp-block-editor-iframe-zoom-out-scale) ));
+ }
&.is-dragged-over {
background: $gray-400;
diff --git a/packages/block-editor/src/components/block-list/zoom-out-separator.js b/packages/block-editor/src/components/block-list/zoom-out-separator.js
index be5af54963060..9e0d087c2267c 100644
--- a/packages/block-editor/src/components/block-list/zoom-out-separator.js
+++ b/packages/block-editor/src/components/block-list/zoom-out-separator.js
@@ -13,6 +13,7 @@ import {
import { useReducedMotion } from '@wordpress/compose';
import { useSelect } from '@wordpress/data';
import { useState } from '@wordpress/element';
+import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
@@ -29,14 +30,16 @@ export function ZoomOutSeparator( {
const {
sectionRootClientId,
sectionClientIds,
- blockInsertionPoint,
+ insertionPoint,
blockInsertionPointVisible,
+ blockInsertionPoint,
} = useSelect( ( select ) => {
const {
- getBlockInsertionPoint,
+ getInsertionPoint,
getBlockOrder,
- isBlockInsertionPointVisible,
getSectionRootClientId,
+ isBlockInsertionPointVisible,
+ getBlockInsertionPoint,
} = unlock( select( blockEditorStore ) );
const root = getSectionRootClientId();
@@ -45,6 +48,7 @@ export function ZoomOutSeparator( {
sectionRootClientId: root,
sectionClientIds: sectionRootClientIds,
blockOrder: getBlockOrder( root ),
+ insertionPoint: getInsertionPoint(),
blockInsertionPoint: getBlockInsertionPoint(),
blockInsertionPointVisible: isBlockInsertionPointVisible(),
};
@@ -67,17 +71,30 @@ export function ZoomOutSeparator( {
return null;
}
+ const hasTopInsertionPoint =
+ insertionPoint?.index === 0 &&
+ clientId === sectionClientIds[ insertionPoint.index ];
+ const hasBottomInsertionPoint =
+ insertionPoint &&
+ insertionPoint.hasOwnProperty( 'index' ) &&
+ clientId === sectionClientIds[ insertionPoint.index - 1 ];
+ // We want to show the zoom out separator in either of these conditions:
+ // 1. If the inserter has an insertion index set
+ // 2. We are dragging a pattern over an insertion point
if ( position === 'top' ) {
isVisible =
- blockInsertionPointVisible &&
- blockInsertionPoint.index === 0 &&
- clientId === sectionClientIds[ blockInsertionPoint.index ];
+ hasTopInsertionPoint ||
+ ( blockInsertionPointVisible &&
+ blockInsertionPoint.index === 0 &&
+ clientId === sectionClientIds[ blockInsertionPoint.index ] );
}
if ( position === 'bottom' ) {
isVisible =
- blockInsertionPointVisible &&
- clientId === sectionClientIds[ blockInsertionPoint.index - 1 ];
+ hasBottomInsertionPoint ||
+ ( blockInsertionPointVisible &&
+ clientId ===
+ sectionClientIds[ blockInsertionPoint.index - 1 ] );
}
return (
@@ -103,7 +120,19 @@ export function ZoomOutSeparator( {
data-is-insertion-point="true"
onDragOver={ () => setIsDraggedOver( true ) }
onDragLeave={ () => setIsDraggedOver( false ) }
- >
+ >
+
+ { __( 'Drop pattern.' ) }
+
+
) }
);
diff --git a/packages/block-editor/src/components/block-navigation/dropdown.js b/packages/block-editor/src/components/block-navigation/dropdown.js
index 035a38604b029..0bf8fd0532018 100644
--- a/packages/block-editor/src/components/block-navigation/dropdown.js
+++ b/packages/block-editor/src/components/block-navigation/dropdown.js
@@ -27,8 +27,7 @@ function BlockNavigationDropdownToggle( {
} ) {
return (