diff --git a/.eslintrc.js b/.eslintrc.js index 01f8a506addc7a..67671070aa2a71 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,11 +46,6 @@ const restrictedImports = [ name: 'lodash', message: 'Please use native functionality instead.', }, - { - name: 'reakit', - message: - 'Please use Reakit API through `@wordpress/components` instead.', - }, { name: '@ariakit/react', message: diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 5163a343541ca7..340bb4df402105 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -171,7 +171,7 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - name: Use desired version of Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' check-latest: true @@ -183,7 +183,7 @@ jobs: NO_CHECKS: 'true' - name: Upload artifact - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: gutenberg-plugin path: ./gutenberg.zip @@ -206,7 +206,7 @@ jobs: - name: Upload release notes artifact if: ${{ needs.bump-version.outputs.new_version }} - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: release-notes path: ./release-notes.txt @@ -270,12 +270,12 @@ jobs: run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT - name: Download Plugin Zip Artifact - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: gutenberg-plugin - name: Download Release Notes Artifact - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: release-notes @@ -333,7 +333,7 @@ jobs: git config user.email gutenberg@wordpress.org - name: Setup Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 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 c7959b2992f0eb..8c8a5da8eb62ad 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -43,7 +43,7 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - name: Use desired version of Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' check-latest: true diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index 362aec73cd6241..694a48f0266367 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -41,7 +41,7 @@ jobs: npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" - name: Archive debug artifacts (screenshots, HTML snapshots) - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: failures-artifacts @@ -49,7 +49,7 @@ jobs: if-no-files-found: ignore - name: Archive flaky tests report - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: flaky-tests-report @@ -92,7 +92,7 @@ jobs: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e:playwright -- --shard=${{ matrix.part }}/${{ matrix.totalParts }} - name: Archive debug artifacts (screenshots, traces) - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: failures-artifacts @@ -100,7 +100,7 @@ jobs: if-no-files-found: ignore - name: Archive flaky tests report - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: flaky-tests-report @@ -120,7 +120,7 @@ jobs: ref: trunk show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - uses: actions/download-artifact@v4.1.0 + - uses: actions/download-artifact@v4.1.2 id: download_artifact # Don't fail the job if there isn't any flaky tests report. continue-on-error: true diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index bc457758b8385b..ade7ecd3e9a060 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -9,4 +9,4 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/wrapper-validation-action@v2 diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 12063c0eb7d496..b84e8c569dc51a 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -68,13 +68,13 @@ jobs: - name: Compare performance with base branch if: github.event_name == 'push' # The base hash used here need to be a commit that is compatible with the current WP version - # The current one is b61dde2e5ec29d98801e623de968bfb286c5be3f and it needs to be updated every WP major release. + # The current one is 9bb75b35ec0daa46e8cd60c46619f522c7edd453 and it needs to be updated every WP major release. # It is used as a base comparison point to avoid fluctuation in the performance metrics. run: | WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt) IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION" WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" - ./bin/plugin/cli.js perf $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" + ./bin/plugin/cli.js perf $GITHUB_SHA 9bb75b35ec0daa46e8cd60c46619f522c7edd453 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" - name: Compare performance with custom branches if: github.event_name == 'workflow_dispatch' @@ -86,7 +86,7 @@ jobs: - name: Archive performance results if: success() - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: performance-results path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json @@ -97,10 +97,10 @@ jobs: CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }} run: | COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI") - ./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA b61dde2e5ec29d98801e623de968bfb286c5be3f $COMMITTED_AT + ./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 9bb75b35ec0daa46e8cd60c46619f522c7edd453 $COMMITTED_AT - name: Archive debug artifacts (screenshots, HTML snapshots) - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: failure() with: name: failures-artifacts diff --git a/.github/workflows/php-changes-detection.yml b/.github/workflows/php-changes-detection.yml index fc0ba83b95dbc4..6a13d4d014fc69 100644 --- a/.github/workflows/php-changes-detection.yml +++ b/.github/workflows/php-changes-detection.yml @@ -17,7 +17,7 @@ jobs: - name: Get changed PHP files id: changed-files-php - uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f # v41.0.1 + uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 # v42.0.2 with: files: | *.{php} @@ -38,7 +38,7 @@ jobs: echo "formatted_change_list=$formatted_change_list" >> $GITHUB_OUTPUT - name: Find Comment - uses: peter-evans/find-comment@v2 + uses: peter-evans/find-comment@v3 id: find-comment with: issue-number: ${{ github.event.pull_request.number }} @@ -47,7 +47,7 @@ jobs: - name: Create comment if: steps.find-comment.outputs.comment-id == '' && steps.changed-files-php.outputs.any_changed == 'true' - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body: | @@ -67,7 +67,7 @@ jobs: - name: Update comment if: steps.find-comment.outputs.comment-id != '' && steps.changed-files-php.outputs.any_changed == 'true' - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} @@ -89,7 +89,7 @@ jobs: - name: Update comment if: steps.find-comment.outputs.comment-id != '' && steps.changed-files-php.outputs.any_changed != 'true' - uses: peter-evans/create-or-update-comment@v3 + uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.find-comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} diff --git a/.github/workflows/props-bot.yml b/.github/workflows/props-bot.yml new file mode 100644 index 00000000000000..0f21f47ef14f99 --- /dev/null +++ b/.github/workflows/props-bot.yml @@ -0,0 +1,88 @@ +name: Props Bot + +on: + # This event runs anytime a PR is (re)opened, updated, marked ready for review, or labeled. + # GitHub does not allow filtering the `labeled` event by a specific label. + # However, the logic below will short-circuit the workflow when the `props-bot` label is not the one being added. + # Note: The pull_request_target event is used instead of pull_request because this workflow needs permission to comment + # on the pull request. Because this event grants extra permissions to `GITHUB_TOKEN`, any code changes within the PR + # should be considered untrusted. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/. + pull_request_target: + types: + - opened + - synchronize + - reopened + - labeled + - ready_for_review + # This event runs anytime a comment is added or deleted. + # You cannot filter this event for PR comments only. + # However, the logic below does short-circuit the workflow for issues. + issue_comment: + type: + - created + # This event will run everytime a new PR review is initially submitted. + pull_request_review: + types: + - submitted + # This event runs anytime a PR review comment is created or deleted. + pull_request_review_comment: + types: + - created + +# Cancels all previous workflow runs for pull requests that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name for pull requests + # or the commit hash for any other events. + group: ${{ github.workflow }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }} + cancel-in-progress: true + +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + +jobs: + # Compiles a list of props for a pull request. + # + # Performs the following steps: + # - Collects a list of contributor props and leaves a comment. + # - Removes the props-bot label, if necessary. + props-bot: + name: Generate a list of props + runs-on: ubuntu-latest + permissions: + # The action needs permission `write` permission for PRs in order to add a comment. + pull-requests: write + contents: read + timeout-minutes: 20 + # The job will run when pull requests are open, ready for review and: + # + # - A comment is added to the pull request. + # - A review is created or commented on. + # - The pull request is opened, synchronized, marked ready for review, or reopened. + # - The `props-bot` label is added to the pull request. + if: | + ( + github.event_name == 'issue_comment' && github.event.issue.pull_request || + contains( fromJSON( '["pull_request_review", "pull_request_review_comment"]' ), github.event_name ) || + github.event_name == 'pull_request_target' && github.event.action != 'labeled' || + 'props-bot' == github.event.label.name + ) && + ( ! github.event.pull_request.draft && github.event.pull_request.state == 'open' || ! github.event.issue.draft && github.event.issue.state == 'open' ) + + steps: + - name: Gather a list of contributors + uses: WordPress/props-bot-action@trunk + + - name: Remove the props-bot label + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + if: ${{ github.event.action == 'labeled' && 'props-bot' == github.event.label.name }} + with: + retries: 2 + retry-exempt-status-codes: 418 + script: | + github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: '${{ github.event.number }}', + name: 'props-bot' + }); diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index ad108f5db5b049..c9de22a5c31955 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -67,7 +67,7 @@ jobs: - name: Setup Node.js if: ${{ github.event.inputs.release_type != 'wp' }} - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 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@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 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 d0b8778a1d3c7c..8a52bfc1dbb01b 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -18,13 +18,13 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - name: Use desired version of Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' check-latest: true - name: Cache NPM packages - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml index e0a3b9639cf389..c123090edab227 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -37,7 +37,7 @@ jobs: uses: ./.github/setup-node - name: Restore tests setup cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: | ~/.appium @@ -47,10 +47,10 @@ jobs: run: npm run native test:e2e:setup - name: Gradle cache - uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1 + uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0 - name: AVD cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 id: avd-cache with: path: | @@ -60,7 +60,7 @@ jobs: - name: Create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@99a4aac18b4df9b3af66c4a1f04c1f23fa10c270 # v2.29.0 + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 with: api-level: ${{ matrix.api-level }} force-avd-creation: false @@ -71,7 +71,7 @@ jobs: script: echo "Generated AVD snapshot for caching." - name: Run tests - uses: reactivecircus/android-emulator-runner@99a4aac18b4df9b3af66c4a1f04c1f23fa10c270 # v2.29.0 + uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2.30.1 with: api-level: ${{ matrix.api-level }} force-avd-creation: false @@ -81,13 +81,13 @@ jobs: profile: Nexus 6 script: npm run native test:e2e:android:local ${{ matrix.native-test-name }} - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: android-screen-recordings path: packages/react-native-editor/android-screen-recordings - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: appium-logs diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 9ead788343b8dc..9504e8e5db0b02 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -37,7 +37,7 @@ jobs: uses: ./.github/setup-node - name: Restore tests setup cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: | ~/.appium @@ -50,7 +50,7 @@ jobs: run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt - name: Restore build cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: | packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app @@ -58,7 +58,7 @@ jobs: key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }} - name: Restore pods cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: | packages/react-native-editor/ios/Pods @@ -84,13 +84,13 @@ jobs: rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle rm -rf packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/assets - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: ios-screen-recordings path: packages/react-native-editor/ios-screen-recordings - - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 if: always() with: name: appium-logs diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index e0a899908bbd46..789e64a25fa205 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -27,7 +27,7 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - name: Use desired version of Node.js - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version-file: '.nvmrc' check-latest: true diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index b6d5465ab43a6c..523418a79ef49a 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -125,7 +125,7 @@ jobs: # dependency versions are installed and cached. ## - name: Set up PHP - uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0 + uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2.29.0 with: php-version: '${{ matrix.php }}' ini-file: development @@ -225,7 +225,7 @@ jobs: show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - name: Set up PHP - uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0 + uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2.29.0 with: php-version: '7.4' coverage: none @@ -238,7 +238,7 @@ jobs: run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT - name: Cache PHPCS scan cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 with: path: .cache/phpcs.json key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index d6d5f8da1102bb..ab1b7ff0d90b31 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -147,7 +147,7 @@ jobs: fi - name: Upload Changelog artifact - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: changelog ${{ matrix.label }} path: ./changelog.txt @@ -189,7 +189,7 @@ jobs: sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./trunk/readme.txt - name: Download Changelog Artifact - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: changelog trunk path: trunk @@ -247,7 +247,7 @@ jobs: sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt" - name: Download Changelog Artifact - uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0 + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: changelog trunk path: ${{ github.event.release.name }} diff --git a/.wp-env.json b/.wp-env.json index 79810b194b667c..90457c8da459ec 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -10,7 +10,8 @@ "wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins", "wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes", "wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip", - "wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip" + "wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip", + "wp-content/themes/gutenberg-test-themes/twentytwentyfour": "https://downloads.wordpress.org/theme/twentytwentyfour.1.0.zip" } } } diff --git a/bin/docker-compose.override.yml.template b/bin/docker-compose.override.yml.template deleted file mode 100644 index 465211fe7a4a63..00000000000000 --- a/bin/docker-compose.override.yml.template +++ /dev/null @@ -1,17 +0,0 @@ -services: - wordpress-develop: - volumes: - - %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% - - %PLUGIN_MOUNT_DIR%/packages/e2e-tests/plugins:/var/www/${LOCAL_DIR-src}/wp-content/plugins/gutenberg-test-plugins - - %PLUGIN_MOUNT_DIR%/packages/e2e-tests/mu-plugins:/var/www/${LOCAL_DIR-src}/wp-content/mu-plugins - php: - volumes: - - %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% - - %PLUGIN_MOUNT_DIR%/packages/e2e-tests/plugins:/var/www/${LOCAL_DIR-src}/wp-content/plugins/gutenberg-test-plugins - - %PLUGIN_MOUNT_DIR%/packages/e2e-tests/mu-plugins:/var/www/${LOCAL_DIR-src}/wp-content/mu-plugins - cli: - volumes: - - %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% - phpunit: - volumes: - - %PLUGIN_MOUNT_DIR%:/var/www/${LOCAL_DIR-src}/wp-content/plugins/%PLUGIN_INSTALL_DIR% diff --git a/bin/packages/check-build-type-declaration-files.js b/bin/packages/check-build-type-declaration-files.js index fff0b51e32fc24..74c7cfa5e3c2ac 100644 --- a/bin/packages/check-build-type-declaration-files.js +++ b/bin/packages/check-build-type-declaration-files.js @@ -69,13 +69,16 @@ async function getDecFile( packagePath ) { async function typecheckDeclarations( file ) { return new Promise( ( resolve, reject ) => { - exec( `npx tsc --noEmit ${ file }`, ( error, stdout, stderr ) => { - if ( error ) { - reject( { file, error, stderr, stdout } ); - } else { - resolve( { file, stdout } ); + exec( + `npx tsc --target esnext --moduleResolution node --noEmit ${ file }`, + ( error, stdout, stderr ) => { + if ( error ) { + reject( { file, error, stderr, stdout } ); + } else { + resolve( { file, stdout } ); + } } - } ); + ); } ); } diff --git a/bin/plugin/commands/changelog.js b/bin/plugin/commands/changelog.js index 0b2bb4c2b2c0cc..652c6e97a6c0a2 100644 --- a/bin/plugin/commands/changelog.js +++ b/bin/plugin/commands/changelog.js @@ -108,6 +108,7 @@ const LABEL_FEATURE_MAPPING = { '[Feature] Patterns': 'Patterns', '[Feature] Blocks': 'Block Library', '[Feature] Inserter': 'Block Editor', + '[Feature] Interactivity API': 'Interactivity API', '[Feature] Drag and Drop': 'Block Editor', '[Feature] Block Multi Selection': 'Block Editor', '[Feature] Link Editing': 'Block Editor', diff --git a/changelog.txt b/changelog.txt index dcccd8d335abf0..c11c4246a60bdb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,640 @@ == Changelog == += 17.6.6 = + +## Changelog + +### Bug Fixes + +- Script loader 6.4 compat: check for init hook completion ([58406](https://github.com/WordPress/gutenberg/pull/58406)) + +## Contributors + +The following contributors merged PRs in this release: + +@ramonjd + + += 17.7.0-rc.1 = + + +## Changelog + +### Features + +#### Interactivity API +- Allow global configs for namespaces. ([58749](https://github.com/WordPress/gutenberg/pull/58749)) + +#### Global Styles +- Add support for transform and letter spacing controls in Global Styles > Typography > Elements. ([58142](https://github.com/WordPress/gutenberg/pull/58142)) + +#### Block Library +- Add shadow support for column, columns and image. ([57982](https://github.com/WordPress/gutenberg/pull/57982)) + + +### Enhancements + +- Improve translators comments for wp.date.setSettings in compat file. ([58488](https://github.com/WordPress/gutenberg/pull/58488)) +- Interactive Template: Use viewScriptModule. ([58211](https://github.com/WordPress/gutenberg/pull/58211)) + +#### Components +- Adding `constrainTabbing` prop to `useDialog` hook. ([57962](https://github.com/WordPress/gutenberg/pull/57962)) +- Allow limiting the number of maximum visible Snackbars. ([58559](https://github.com/WordPress/gutenberg/pull/58559)) +- ConfirmDialog: Add `__next40pxDefaultSize` to buttons. ([58421](https://github.com/WordPress/gutenberg/pull/58421)) +- Expand theming support in COLORS. ([58097](https://github.com/WordPress/gutenberg/pull/58097)) +- FocalPointPicker: Apply modern styling. ([58459](https://github.com/WordPress/gutenberg/pull/58459)) +- Implement Tabs in widget editor settings. ([57886](https://github.com/WordPress/gutenberg/pull/57886)) +- Implement `Tabs` in site-editor settings. ([56959](https://github.com/WordPress/gutenberg/pull/56959)) +- Implementing `useCompositeState` with Ariakit. ([57304](https://github.com/WordPress/gutenberg/pull/57304)) +- InputBase: Add `isBorderless` prop. ([58750](https://github.com/WordPress/gutenberg/pull/58750)) +- Replace `TabPanel` with `Tabs` in the editor Document Overview sidebar. ([57082](https://github.com/WordPress/gutenberg/pull/57082)) +- SearchControl: Refactor to use InputControl internally. ([56524](https://github.com/WordPress/gutenberg/pull/56524)) +- Show borders for disabled secondary buttons. ([58606](https://github.com/WordPress/gutenberg/pull/58606)) + +#### Data Views +- Add outline to template preview in table layout. ([58738](https://github.com/WordPress/gutenberg/pull/58738)) +- Add: Delete bulk action to patterns. ([58747](https://github.com/WordPress/gutenberg/pull/58747)) +- Add: Selection and bulk actions to grid view. ([58144](https://github.com/WordPress/gutenberg/pull/58144)) +- DataViews: Add primary filter API. ([58427](https://github.com/WordPress/gutenberg/pull/58427)) +- DataViews: In patterns page, show sync status filter by default. ([58367](https://github.com/WordPress/gutenberg/pull/58367)) +- DataViews: Redesign of filters. ([58569](https://github.com/WordPress/gutenberg/pull/58569)) +- Remove min-width style on table cells. ([58204](https://github.com/WordPress/gutenberg/pull/58204)) +- Update 'Rows per page' view option label to account for Grid layout. ([58457](https://github.com/WordPress/gutenberg/pull/58457)) +- Update dataviews search input placeholder. ([58742](https://github.com/WordPress/gutenberg/pull/58742)) +- Update spacing around title in grid layout. ([58739](https://github.com/WordPress/gutenberg/pull/58739)) + +#### Interactivity API +- Add `block supports` for `clientNavigation` and `interactive` properties on `block.json` schema. ([58132](https://github.com/WordPress/gutenberg/pull/58132)) +- Image block: Refactor and remove `data-wp-body`. ([58835](https://github.com/WordPress/gutenberg/pull/58835)) +- Interactivity Router: Fix initial page cache. ([58496](https://github.com/WordPress/gutenberg/pull/58496)) +- Interactivity Router: Move ARIA live region and loading bar to the Interactivity Router. ([58377](https://github.com/WordPress/gutenberg/pull/58377)) +- Limit the exported APIs. ([58864](https://github.com/WordPress/gutenberg/pull/58864)) +- Mark all core block stores as private. ([58722](https://github.com/WordPress/gutenberg/pull/58722)) +- Server Directive Processor for `data-wp-each`. ([58498](https://github.com/WordPress/gutenberg/pull/58498)) +- Support setting a namespace using a string in `data-wp-interactive`. ([58743](https://github.com/WordPress/gutenberg/pull/58743)) + +#### Block Library +- Follow up on the Post navigation link taxonomy filters. ([57949](https://github.com/WordPress/gutenberg/pull/57949)) +- Home Link: Render Home text if there is no attribute label present. ([58387](https://github.com/WordPress/gutenberg/pull/58387)) +- Organize gallery controls. ([58407](https://github.com/WordPress/gutenberg/pull/58407)) +- Pattern: Use the '__experimentalLabel' method to get a title. ([58646](https://github.com/WordPress/gutenberg/pull/58646)) +- Social Icons: Update Patreon icon. ([56951](https://github.com/WordPress/gutenberg/pull/56951)) +- Try: Disable text selection for post content placeholder block. ([58169](https://github.com/WordPress/gutenberg/pull/58169)) +- Update pattern block copy in light of pattern overrides. ([58231](https://github.com/WordPress/gutenberg/pull/58231)) + +#### Global Styles +- Add style engine support for nested at-rules. ([58867](https://github.com/WordPress/gutenberg/pull/58867)) +- Font Library: Show 'Add fonts' button when there are no fonts installed. ([58580](https://github.com/WordPress/gutenberg/pull/58580)) +- Move Shadow controls to Border panel. ([58466](https://github.com/WordPress/gutenberg/pull/58466)) +- Shadow: Update shadow support to allow explicit skipping of serialization. ([58306](https://github.com/WordPress/gutenberg/pull/58306)) +- Try: Remove shadow preset overflow. ([58663](https://github.com/WordPress/gutenberg/pull/58663)) +- Update return values from getGlobalStylesChanges(). ([58707](https://github.com/WordPress/gutenberg/pull/58707)) + +#### Block Editor +- Drag and drop: Allow dragging from inserter or desktop to template parts. ([58589](https://github.com/WordPress/gutenberg/pull/58589)) +- Drag and drop: Allow dropping within template parts. ([58423](https://github.com/WordPress/gutenberg/pull/58423)) +- Implement "Add block" UI for Nav block Link UI. ([57756](https://github.com/WordPress/gutenberg/pull/57756)) +- Implementing new UX for invoking rich text Link UI. ([57986](https://github.com/WordPress/gutenberg/pull/57986)) +- Remove open in new tab from link preview. ([58744](https://github.com/WordPress/gutenberg/pull/58744)) +- Use consistent labels, remove additional settings, and copySmall icon LinkControl. ([58183](https://github.com/WordPress/gutenberg/pull/58183)) + +#### Site Editor +- Apply 40px across summary panel. ([58730](https://github.com/WordPress/gutenberg/pull/58730)) +- Apply custom scroll style to fixed header block toolbar. ([57444](https://github.com/WordPress/gutenberg/pull/57444)) +- Improve SiteIcon display and transition. ([58472](https://github.com/WordPress/gutenberg/pull/58472)) +- Only show 'Back' button when user came from an editor canvas. ([58710](https://github.com/WordPress/gutenberg/pull/58710)) +- Update "focus mode" to consistently use the Document Bar's Back button. ([58528](https://github.com/WordPress/gutenberg/pull/58528)) + +#### Patterns +- Add a confirmation dialog when a user tries to delete a synced pattern with overrides. ([58796](https://github.com/WordPress/gutenberg/pull/58796)) +- Add the block name to the pattern content data. ([58715](https://github.com/WordPress/gutenberg/pull/58715)) +- Flash editable block outlines instead of always showing them. ([58159](https://github.com/WordPress/gutenberg/pull/58159)) + +#### Design Tools +- Background image support: Add background position controls. ([58592](https://github.com/WordPress/gutenberg/pull/58592)) +- Tweak metrics and labels for background size controls. ([58854](https://github.com/WordPress/gutenberg/pull/58854)) + +#### Post Editor +- Editor: Limit visible Snackbars from the consumers. ([58598](https://github.com/WordPress/gutenberg/pull/58598)) +- Save entities panel: Update styles. ([58706](https://github.com/WordPress/gutenberg/pull/58706)) + +#### Font Library +- Add sanitize from schema util. ([58571](https://github.com/WordPress/gutenberg/pull/58571)) +- Font Collections: Update registration function signature and add caching. ([58363](https://github.com/WordPress/gutenberg/pull/58363)) + +#### Inspector Controls +- Tweak FocalPointPicker inspector controls. ([58448](https://github.com/WordPress/gutenberg/pull/58448)) +- Tweak Media & Text inspector controls. ([58447](https://github.com/WordPress/gutenberg/pull/58447)) + +#### Custom Fields +- Block Bindings: Ensure to pass bound attributes. ([58844](https://github.com/WordPress/gutenberg/pull/58844)) + +#### Commands +- Try debouncing search for post-type navigation. ([58810](https://github.com/WordPress/gutenberg/pull/58810)) + +#### Document Settings +- Tweak revisions panel for improved scanning. ([58751](https://github.com/WordPress/gutenberg/pull/58751)) + +#### Synced Patterns +- Support button's link settings for Pattern Overrides. ([58587](https://github.com/WordPress/gutenberg/pull/58587)) + +#### Block API +- Block Hooks: Set ignoredHookedBlocks metada attr upon insertion. ([58553](https://github.com/WordPress/gutenberg/pull/58553)) + +#### List View +- Add keyboard clipboard events for cut, copy, paste. ([57838](https://github.com/WordPress/gutenberg/pull/57838)) + + +### New APIs + +#### Block API +- Blocks: Add handling for block.json viewScriptModule. ([58731](https://github.com/WordPress/gutenberg/pull/58731)) + + +### Bug Fixes + +- Core data: useEntityBlockEditor: Fix parsed blocks cache. ([58841](https://github.com/WordPress/gutenberg/pull/58841)) +- Footnotes: Fix anchor order replacing. ([58791](https://github.com/WordPress/gutenberg/pull/58791)) + +#### Block Editor +- Block Switcher: Use consistent labels. ([58240](https://github.com/WordPress/gutenberg/pull/58240)) +- Don't move focus within the toolbar if it is already focused. ([58570](https://github.com/WordPress/gutenberg/pull/58570)) +- Don't show Link preview when no selection. ([58771](https://github.com/WordPress/gutenberg/pull/58771)) +- Fix Link UI popover anchor in rich text. ([58282](https://github.com/WordPress/gutenberg/pull/58282)) +- Fix empty link preview after creating link from empty selection. ([58863](https://github.com/WordPress/gutenberg/pull/58863)) +- Hide the 'Content' panel for locked blocks when there's no content. ([58259](https://github.com/WordPress/gutenberg/pull/58259)) +- ImageURLInputUI: Fix focus loss when settings are changed. ([58647](https://github.com/WordPress/gutenberg/pull/58647)) +- Link UI: Polish lightbox pieces. ([58666](https://github.com/WordPress/gutenberg/pull/58666)) +- Media Replace Flow: Vertically align the URL. ([58621](https://github.com/WordPress/gutenberg/pull/58621)) +- MediaReplaceFlow: Restore popover width. ([58597](https://github.com/WordPress/gutenberg/pull/58597)) +- Rich Text: Only apply focus to elements not selection. ([58745](https://github.com/WordPress/gutenberg/pull/58745)) +- Rich text: Preserve white space should strip \r. ([58805](https://github.com/WordPress/gutenberg/pull/58805)) +- Settings may be undefined. ([58658](https://github.com/WordPress/gutenberg/pull/58658)) +- useOnBlockDrop: Fix the Gallery block check. ([58711](https://github.com/WordPress/gutenberg/pull/58711)) + +#### Components +- Add a timezone offset value for display purposes. ([56682](https://github.com/WordPress/gutenberg/pull/56682)) +- Fix Placeholder component padding when body text font size is changed. ([58323](https://github.com/WordPress/gutenberg/pull/58323)) +- Fix URLPopover preview overflow. ([58741](https://github.com/WordPress/gutenberg/pull/58741)) +- Fix the Snackbar auto-dismissal timers. ([58604](https://github.com/WordPress/gutenberg/pull/58604)) +- Popover: Add `box-sizing` reset style. ([58871](https://github.com/WordPress/gutenberg/pull/58871)) +- Set post editor sidebar tabs to manual activation. ([58041](https://github.com/WordPress/gutenberg/pull/58041)) +- Tabs: Delay `activeId` updates until focus can be properly detected. ([58625](https://github.com/WordPress/gutenberg/pull/58625)) +- Tabs: Fix infinite loop in useEffect. ([58861](https://github.com/WordPress/gutenberg/pull/58861)) +- Tabs: Improve Controlled Mode Focus Handling. ([57696](https://github.com/WordPress/gutenberg/pull/57696)) +- Try: Fix lightbox URL popover position. ([58600](https://github.com/WordPress/gutenberg/pull/58600)) + +#### Block Library +- Fix #54352 prevent php 8.1 fatal when template parts are not found in non-debug environments. ([54354](https://github.com/WordPress/gutenberg/pull/54354)) +- Fix Query pagination not working in template parts and patterns. ([58602](https://github.com/WordPress/gutenberg/pull/58602)) +- Fix URL escaping for array parameters in Navigation links. ([58068](https://github.com/WordPress/gutenberg/pull/58068)) +- Fix missing data in email submissions. ([55691](https://github.com/WordPress/gutenberg/pull/55691)) +- Fix: Removing footnotes from the allowed blocks does not remove footnotes. ([58855](https://github.com/WordPress/gutenberg/pull/58855)) +- Navigation Link: Use get_block_type_variations to register variations. ([58389](https://github.com/WordPress/gutenberg/pull/58389)) +- Prevent usage of `gutenberg_url` in block-library. ([58242](https://github.com/WordPress/gutenberg/pull/58242)) +- Template Part: Reflect name updates without saving changes. ([58644](https://github.com/WordPress/gutenberg/pull/58644)) +- Try: Make gallery randomization work when nested. ([58733](https://github.com/WordPress/gutenberg/pull/58733)) + +#### Data Views +- DataViews: Fix applied default layout props. ([58400](https://github.com/WordPress/gutenberg/pull/58400)) +- DataViews: Fix nested buttons and placeholder text in list layout. ([58304](https://github.com/WordPress/gutenberg/pull/58304)) +- DataViews: Fix some small issues with featured image. ([58371](https://github.com/WordPress/gutenberg/pull/58371)) +- DataViews: Make it possible to toggle Author field in templates and template parts. ([58609](https://github.com/WordPress/gutenberg/pull/58609)) +- DataViews: Remove test artifact (status filter was set as primary). ([58682](https://github.com/WordPress/gutenberg/pull/58682)) +- DataViews: Use chips for filter summary. ([58816](https://github.com/WordPress/gutenberg/pull/58816)) +- Fix double scrollbar in grid layout. ([58536](https://github.com/WordPress/gutenberg/pull/58536)) +- Fix: Dataviews selection on patterns grid view. ([58726](https://github.com/WordPress/gutenberg/pull/58726)) + +#### Site Editor +- Add context for the All translatable string and enforce l10n best practices. ([58196](https://github.com/WordPress/gutenberg/pull/58196)) +- Break long URL in page sidebar. ([58763](https://github.com/WordPress/gutenberg/pull/58763)) +- Editor: Fix block context defined for template parts. ([58807](https://github.com/WordPress/gutenberg/pull/58807)) +- Fix line-height in block card. ([58246](https://github.com/WordPress/gutenberg/pull/58246)) +- Hide export button if non-block-based theme. ([58346](https://github.com/WordPress/gutenberg/pull/58346)) +- Mobile site editor header toolbar button bugfix. ([58852](https://github.com/WordPress/gutenberg/pull/58852)) + +#### Post Editor +- Editor: Don't hide authors' Combobox if the current author is missing. ([58719](https://github.com/WordPress/gutenberg/pull/58719)) +- Fix permalink input field text overflow ellipsis for Firefox. ([57310](https://github.com/WordPress/gutenberg/pull/57310)) +- Fix the position and size of the Options menu,. ([57515](https://github.com/WordPress/gutenberg/pull/57515)) +- Fix: Use old template panel if user doesn’t have access to view templates. ([58485](https://github.com/WordPress/gutenberg/pull/58485)) +- Template editing: Update fullscreen WP back functionality. ([58534](https://github.com/WordPress/gutenberg/pull/58534)) + +#### Interactivity API +- Add `supports.interactivity` to the Query block. ([58316](https://github.com/WordPress/gutenberg/pull/58316)) +- Fix state intialization for asynchronous private stores. ([58754](https://github.com/WordPress/gutenberg/pull/58754)) +- Remove non default suffix data wp context processing. ([58664](https://github.com/WordPress/gutenberg/pull/58664)) +- Use compat versions of HTML APIs. ([58846](https://github.com/WordPress/gutenberg/pull/58846)) + +#### Global Styles +- Block Styles: Fix block style variation selector generation. ([58051](https://github.com/WordPress/gutenberg/pull/58051)) +- Fix Global styles text settings bleeding into placeholder component. ([58303](https://github.com/WordPress/gutenberg/pull/58303)) +- Global styles revisions: Fix is-selected rules from affecting other areas of the editor. ([58228](https://github.com/WordPress/gutenberg/pull/58228)) +- Site Editor: Prevent classic theme from accessing global style menu. ([58345](https://github.com/WordPress/gutenberg/pull/58345)) + +#### List View +- Fix error when switching between template preview modes. ([58533](https://github.com/WordPress/gutenberg/pull/58533)) +- Navigation Submenu Block: Make block name affect list view. ([58296](https://github.com/WordPress/gutenberg/pull/58296)) +- Template Part: Fix site editor error when loading with list view set to always display. ([58868](https://github.com/WordPress/gutenberg/pull/58868)) + +#### Font Library +- Avoid mutating fontface data. ([58473](https://github.com/WordPress/gutenberg/pull/58473)) +- Avoid running init functions when font library is available in core. ([58793](https://github.com/WordPress/gutenberg/pull/58793)) +- Fix size of demo text. ([58849](https://github.com/WordPress/gutenberg/pull/58849)) + +#### Typography +- Fix font library modal dialog translatable strings. ([58256](https://github.com/WordPress/gutenberg/pull/58256)) +- Font Library: Change referenced tab name on Google Fonts confirmation dialog. ([58584](https://github.com/WordPress/gutenberg/pull/58584)) +- Font size: Allow for custom font size handling. ([58422](https://github.com/WordPress/gutenberg/pull/58422)) + +#### Script Modules API +- Add import map polyfill. ([58263](https://github.com/WordPress/gutenberg/pull/58263)) +- Import Maps: Only emit CDATA wrappers for inline scripts for JavaScript. ([58818](https://github.com/WordPress/gutenberg/pull/58818)) + +#### Extensibility +- Fix broken list markup in navigation block when 3rd party blocks are used as decendants of navigation block. ([55551](https://github.com/WordPress/gutenberg/pull/55551)) +- Navigation block: Check Block Hooks API callback hasn't already been added. ([58772](https://github.com/WordPress/gutenberg/pull/58772)) + +#### Synced Patterns +- Disable overriding links of images inside pattern instances. ([58660](https://github.com/WordPress/gutenberg/pull/58660)) +- Fix nested pattern overrides and disable editing inner pattern. ([58541](https://github.com/WordPress/gutenberg/pull/58541)) + +#### Inspector Controls +- Add missing PanelBody title for the columns block inspector. ([58452](https://github.com/WordPress/gutenberg/pull/58452)) +- Add spacing between input controls with custom values. ([58410](https://github.com/WordPress/gutenberg/pull/58410)) + +#### Custom Fields +- Block Bindings: Update bindings registry with latest changes. ([58843](https://github.com/WordPress/gutenberg/pull/58843)) + +#### History +- Columns: Batch vertical alignment updates. ([58801](https://github.com/WordPress/gutenberg/pull/58801)) + +#### Document Settings +- Editor: Ensure the current author is included in the dropdown. ([58716](https://github.com/WordPress/gutenberg/pull/58716)) + +#### Rich Text +- Add aria-readonly attribute to Rich Text component. ([58687](https://github.com/WordPress/gutenberg/pull/58687)) + +#### Navigation Menus +- Navigation: Update the fallback block list to avoid a PHP Warning. ([58588](https://github.com/WordPress/gutenberg/pull/58588)) + +#### Patterns +- Update the bindings attribs of blocks added during experimental phase. ([58483](https://github.com/WordPress/gutenberg/pull/58483)) + +#### Distraction Free +- Add default restoration of UI when exiting distraction free mode. ([58455](https://github.com/WordPress/gutenberg/pull/58455)) + + +### Accessibility + +- Escape as Select/Edit mode Toggle. ([58637](https://github.com/WordPress/gutenberg/pull/58637)) +- Global styles revisions: Update text color contrast. ([58340](https://github.com/WordPress/gutenberg/pull/58340)) + +#### Components +- CustomSelect: Disable `virtualFocus` to fix issue for screenreaders. ([58585](https://github.com/WordPress/gutenberg/pull/58585)) +- Font Library modal: Try to improve checkbox labelling. ([58339](https://github.com/WordPress/gutenberg/pull/58339)) +- PaletteEdit: Fix palette item accessibility. ([58214](https://github.com/WordPress/gutenberg/pull/58214)) + +#### Font Library +- Buttons position and accessibility. ([58212](https://github.com/WordPress/gutenberg/pull/58212)) +- Fix focus loss when update/install button is pressed. ([58364](https://github.com/WordPress/gutenberg/pull/58364)) +- Removed
and
- +
{ !! fontSizes.length && shouldUseSelectControl && ! showCustomValueControl && ( @@ -196,7 +181,6 @@ const UnforwardedFontSizePicker = ( { @@ -243,9 +227,7 @@ const UnforwardedFontSizePicker = ( ) } - +
); }; diff --git a/packages/components/src/font-size-picker/stories/index.story.tsx b/packages/components/src/font-size-picker/stories/index.story.tsx index 69043278389c75..6ea47742ba783f 100644 --- a/packages/components/src/font-size-picker/stories/index.story.tsx +++ b/packages/components/src/font-size-picker/stories/index.story.tsx @@ -66,7 +66,6 @@ const TwoFontSizePickersWithState: StoryFn< typeof FontSizePicker > = ( { export const Default: StoryFn< typeof FontSizePicker > = FontSizePickerWithState.bind( {} ); Default.args = { - __nextHasNoMarginBottom: true, disableCustomFontSizes: false, fontSizes: [ { diff --git a/packages/components/src/font-size-picker/styles.ts b/packages/components/src/font-size-picker/styles.ts index ef8ec8ebb30cb2..f47ca41b51eb71 100644 --- a/packages/components/src/font-size-picker/styles.ts +++ b/packages/components/src/font-size-picker/styles.ts @@ -36,10 +36,3 @@ export const HeaderLabel = styled( BaseControl.VisualLabel )` export const HeaderHint = styled.span` color: ${ COLORS.gray[ 700 ] }; `; - -export const Controls = styled.div< { - __nextHasNoMarginBottom: boolean; -} >` - ${ ( props ) => - ! props.__nextHasNoMarginBottom && `margin-bottom: ${ space( 6 ) };` } -`; diff --git a/packages/components/src/font-size-picker/test/index.tsx b/packages/components/src/font-size-picker/test/index.tsx index 0d7816399b3652..9bb3b2d8677b69 100644 --- a/packages/components/src/font-size-picker/test/index.tsx +++ b/packages/components/src/font-size-picker/test/index.tsx @@ -21,13 +21,7 @@ describe( 'FontSizePicker', () => { async ( { value, expectedValue } ) => { const user = userEvent.setup(); const onChange = jest.fn(); - render( - - ); + render( ); const input = screen.getByLabelText( 'Custom' ); await user.clear( input ); await user.type( input, '80' ); @@ -48,7 +42,6 @@ describe( 'FontSizePicker', () => { const onChange = jest.fn(); render( @@ -99,12 +92,7 @@ describe( 'FontSizePicker', () => { it( 'displays a select control', async () => { const user = userEvent.setup(); - render( - - ); + render( ); await user.click( screen.getByRole( 'button', { name: 'Font size' } ) ); @@ -128,11 +116,7 @@ describe( 'FontSizePicker', () => { 'displays $expectedLabel as label when value is $value', ( { value, expectedLabel } ) => { render( - + ); expect( screen.getByLabelText( expectedLabel ) @@ -158,7 +142,6 @@ describe( 'FontSizePicker', () => { const onChange = jest.fn(); render( { it( 'displays a select control', async () => { const user = userEvent.setup(); - render( - - ); + render( ); await user.click( screen.getByRole( 'button', { name: 'Font size' } ) ); @@ -244,11 +222,7 @@ describe( 'FontSizePicker', () => { 'defaults to $option when value is $value', ( { value, option } ) => { render( - + ); expect( screen.getByRole( 'button', { name: 'Font size' } ) @@ -267,11 +241,7 @@ describe( 'FontSizePicker', () => { 'displays $expectedLabel as label when value is $value', ( { value, expectedLabel } ) => { render( - + ); expect( screen.getByLabelText( expectedLabel ) @@ -315,7 +285,6 @@ describe( 'FontSizePicker', () => { const onChange = jest.fn(); render( { ]; it( 'displays a toggle group control with t-shirt sizes', () => { - render( - - ); + render( ); const options = screen.getAllByRole( 'radio' ); expect( options ).toHaveLength( 5 ); expect( options[ 0 ] ).toHaveTextContent( 'S' ); @@ -394,11 +358,7 @@ describe( 'FontSizePicker', () => { 'displays $expectedLabel as label when value is $value', ( { value, expectedLabel } ) => { render( - + ); expect( screen.getByLabelText( expectedLabel ) @@ -410,11 +370,7 @@ describe( 'FontSizePicker', () => { const user = userEvent.setup(); const onChange = jest.fn(); render( - + ); await user.click( screen.getByRole( 'radio', { name: 'Medium' } ) ); expect( onChange ).toHaveBeenCalledTimes( 1 ); @@ -450,12 +406,7 @@ describe( 'FontSizePicker', () => { ]; it( 'displays a toggle group control with t-shirt sizes', () => { - render( - - ); + render( ); const options = screen.getAllByRole( 'radio' ); expect( options ).toHaveLength( 4 ); expect( options[ 0 ] ).toHaveTextContent( 'S' ); @@ -481,11 +432,7 @@ describe( 'FontSizePicker', () => { 'displays $expectedLabel as label when value is $value', ( { value, expectedLabel } ) => { render( - + ); expect( screen.getByLabelText( expectedLabel ) @@ -511,7 +458,6 @@ describe( 'FontSizePicker', () => { const onChange = jest.fn(); render( @@ -532,7 +478,6 @@ describe( 'FontSizePicker', () => { it( 'defaults to M when value is 16px', () => { render( @@ -546,11 +491,7 @@ describe( 'FontSizePicker', () => { 'has no selection when value is %p', ( value ) => { render( - + ); expect( screen.getByRole( 'radiogroup' ) ).toBeInTheDocument(); expect( @@ -565,11 +506,7 @@ describe( 'FontSizePicker', () => { const user = userEvent.setup(); const onChange = jest.fn(); render( - + ); await user.click( screen.getByRole( 'button', { name: 'Font size' } ) @@ -584,13 +521,7 @@ describe( 'FontSizePicker', () => { function commonTests( fontSizes: FontSize[] ) { it( 'shows custom input when value is unknown', () => { - render( - - ); + render( ); expect( screen.getByLabelText( 'Custom' ) ).toBeInTheDocument(); } ); @@ -598,11 +529,7 @@ describe( 'FontSizePicker', () => { const user = userEvent.setup(); const onChange = jest.fn(); render( - + ); await user.click( screen.getByRole( 'button', { name: 'Set custom size' } ) @@ -615,7 +542,6 @@ describe( 'FontSizePicker', () => { it( 'does not allow custom values when disableCustomFontSizes is set', () => { render( @@ -627,12 +553,7 @@ describe( 'FontSizePicker', () => { it( 'does not display a slider by default', async () => { const user = userEvent.setup(); - render( - - ); + render( ); await user.click( screen.getByRole( 'button', { name: 'Set custom size' } ) ); @@ -646,7 +567,6 @@ describe( 'FontSizePicker', () => { const onChange = jest.fn(); render( { const onChange = jest.fn(); render( { const user = userEvent.setup(); render( { render( & { fontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >; onChange: NonNullable< FontSizePickerProps[ 'onChange' ] >; diff --git a/packages/components/src/form-token-field/index.tsx b/packages/components/src/form-token-field/index.tsx index 895cbad033212b..2e7ada0dfe6566 100644 --- a/packages/components/src/form-token-field/index.tsx +++ b/packages/components/src/form-token-field/index.tsx @@ -74,10 +74,7 @@ export function FormTokenField( props: FormTokenFieldProps ) { __experimentalAutoSelectFirstMatch = false, __nextHasNoMarginBottom = false, tokenizeOnBlur = false, - } = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >( - props, - 'wp.components.FormTokenField' - ); + } = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >( props ); const instanceId = useInstanceId( FormTokenField ); diff --git a/packages/components/src/gradient-picker/README.md b/packages/components/src/gradient-picker/README.md index c092c8b5673cc9..815b3d8eb5dd75 100644 --- a/packages/components/src/gradient-picker/README.md +++ b/packages/components/src/gradient-picker/README.md @@ -17,7 +17,6 @@ const myGradientPicker = () => { return ( setGradient( currentGradient ) } gradients={ [ @@ -89,13 +88,6 @@ If true, the gradient picker will not be displayed and only defined gradients fr - Required: No - Default: false -### `__nextHasNoMargin`: `boolean` - -Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 6.4. (The prop can be safely removed once this happens.) - -- Required: No -- Default: `false` - ### `headingLevel`: `1 | 2 | 3 | 4 | 5 | 6 | '1' | '2' | '3' | '4' | '5' | '6'` The heading level. Only applies in cases where gradients are provided from multiple origins (ie. when the array passed as the `gradients` prop contains two or more items). diff --git a/packages/components/src/gradient-picker/index.tsx b/packages/components/src/gradient-picker/index.tsx index 52e7e716642da9..8368279b8afd70 100644 --- a/packages/components/src/gradient-picker/index.tsx +++ b/packages/components/src/gradient-picker/index.tsx @@ -4,7 +4,6 @@ import { __, sprintf } from '@wordpress/i18n'; import { useInstanceId } from '@wordpress/compose'; import { useCallback, useMemo } from '@wordpress/element'; -import deprecated from '@wordpress/deprecated'; /** * Internal dependencies @@ -13,7 +12,6 @@ import CircularOptionPicker from '../circular-option-picker'; import CustomGradientPicker from '../custom-gradient-picker'; import { VStack } from '../v-stack'; import { ColorHeading } from '../color-palette/styles'; -import { Spacer } from '../spacer'; import type { GradientPickerComponentProps, PickerProps, @@ -181,7 +179,6 @@ function Component( props: PickerProps< any > ) { * * return ( * setGradient( currentGradient ) } * gradients={ [ @@ -211,8 +208,6 @@ function Component( props: PickerProps< any > ) { * */ export function GradientPicker( { - /** Start opting into the new margin-free styles that will become the default in a future version. */ - __nextHasNoMargin = false, className, gradients = [], onChange, @@ -228,58 +223,39 @@ export function GradientPicker( { [ onChange ] ); - if ( ! __nextHasNoMargin ) { - deprecated( 'Outer margin styles for wp.components.GradientPicker', { - since: '6.1', - version: '6.4', - hint: 'Set the `__nextHasNoMargin` prop to true to start opting into the new styles, which will become the default in a future version', - } ); - } - - const deprecatedMarginSpacerProps = ! __nextHasNoMargin - ? { - marginTop: ! gradients.length ? 3 : undefined, - marginBottom: ! clearable ? 6 : 0, - } - : {}; - return ( - // Outmost Spacer wrapper can be removed when deprecation period is over - - - { ! disableCustomGradients && ( - - ) } - { ( gradients.length > 0 || clearable ) && ( - - { __( 'Clear' ) } - - ) - } - headingLevel={ headingLevel } - /> - ) } - - + + { ! disableCustomGradients && ( + + ) } + { ( gradients.length > 0 || clearable ) && ( + + { __( 'Clear' ) } + + ) + } + headingLevel={ headingLevel } + /> + ) } + ); } diff --git a/packages/components/src/gradient-picker/stories/index.story.tsx b/packages/components/src/gradient-picker/stories/index.story.tsx index 039a2f0da1729c..b5f3a9dbca15a5 100644 --- a/packages/components/src/gradient-picker/stories/index.story.tsx +++ b/packages/components/src/gradient-picker/stories/index.story.tsx @@ -85,7 +85,6 @@ const Template: StoryFn< typeof GradientPicker > = ( { export const Default = Template.bind( {} ); Default.args = { - __nextHasNoMargin: true, gradients: GRADIENTS, }; diff --git a/packages/components/src/gradient-picker/types.ts b/packages/components/src/gradient-picker/types.ts index 8deb9513cc0dbe..b563653e33e4c4 100644 --- a/packages/components/src/gradient-picker/types.ts +++ b/packages/components/src/gradient-picker/types.ts @@ -93,6 +93,8 @@ export type GradientPickerComponentProps = GradientPickerBaseProps & { * can be safely removed once this happens.) * * @default false + * @deprecated Default behavior since WP 6.5. Prop can be safely removed. + * @ignore */ __nextHasNoMargin?: boolean; /** diff --git a/packages/components/src/input-control/backdrop.tsx b/packages/components/src/input-control/backdrop.tsx index c85efad03a8052..9ef9138f196528 100644 --- a/packages/components/src/input-control/backdrop.tsx +++ b/packages/components/src/input-control/backdrop.tsx @@ -7,12 +7,17 @@ import { memo } from '@wordpress/element'; */ import { BackdropUI } from './styles/input-control-styles'; -function Backdrop( { disabled = false, isFocused = false } ) { +function Backdrop( { + disabled = false, + isBorderless = false, + isFocused = false, +} ) { return (