diff --git a/.eslintrc.js b/.eslintrc.js index 4669050d0619b..46c930ee0fb73 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -36,6 +36,162 @@ const typedFiles = glob( 'packages/*/package.json' ) .filter( ( fileName ) => require( join( __dirname, fileName ) ).types ) .map( ( fileName ) => fileName.replace( 'package.json', '**/*.js' ) ); +const restrictedImports = [ + { + name: 'framer-motion', + message: + 'Please use the Framer Motion API through `@wordpress/components` instead.', + }, + { + name: 'lodash', + importNames: [ + 'camelCase', + 'capitalize', + 'castArray', + 'chunk', + 'clamp', + 'cloneDeep', + 'compact', + 'concat', + 'countBy', + 'debounce', + 'deburr', + 'defaults', + 'defaultTo', + 'delay', + 'difference', + 'differenceWith', + 'dropRight', + 'each', + 'escape', + 'escapeRegExp', + 'every', + 'extend', + 'filter', + 'find', + 'findIndex', + 'findKey', + 'findLast', + 'first', + 'flatMap', + 'flatten', + 'flattenDeep', + 'flow', + 'flowRight', + 'forEach', + 'fromPairs', + 'has', + 'identity', + 'includes', + 'invoke', + 'isArray', + 'isBoolean', + 'isEqual', + 'isFinite', + 'isFunction', + 'isMatch', + 'isNil', + 'isNumber', + 'isObject', + 'isObjectLike', + 'isPlainObject', + 'isString', + 'isUndefined', + 'keyBy', + 'keys', + 'last', + 'lowerCase', + 'mapKeys', + 'maxBy', + 'memoize', + 'negate', + 'noop', + 'nth', + 'omit', + 'omitBy', + 'once', + 'orderby', + 'overEvery', + 'partial', + 'partialRight', + 'pick', + 'random', + 'reduce', + 'reject', + 'repeat', + 'reverse', + 'size', + 'snakeCase', + 'some', + 'sortBy', + 'startCase', + 'startsWith', + 'stubFalse', + 'stubTrue', + 'sum', + 'sumBy', + 'take', + 'throttle', + 'times', + 'toString', + 'trim', + 'truncate', + 'unionBy', + 'uniq', + 'uniqBy', + 'uniqueId', + 'uniqWith', + 'upperFirst', + 'values', + 'without', + 'words', + 'xor', + 'zip', + ], + message: + 'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.', + }, + { + name: 'reakit', + message: + 'Please use Reakit API through `@wordpress/components` instead.', + }, + { + name: 'redux', + importNames: [ 'combineReducers' ], + message: 'Please use `combineReducers` from `@wordpress/data` instead.', + }, + { + name: 'puppeteer-testing-library', + message: '`puppeteer-testing-library` is still experimental.', + }, + { + name: '@emotion/css', + message: + 'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.', + }, + { + name: '@wordpress/edit-post', + message: + "edit-post is a WordPress top level package that shouldn't be imported into other packages", + }, + { + name: '@wordpress/edit-site', + message: + "edit-site is a WordPress top level package that shouldn't be imported into other packages", + }, + { + name: '@wordpress/edit-widgets', + message: + "edit-widgets is a WordPress top level package that shouldn't be imported into other packages", + }, + { + name: '@wordpress/edit-navigation', + message: + "edit-navigation is a WordPress top level package that shouldn't be imported into other packages", + }, +]; + module.exports = { root: true, extends: [ @@ -70,129 +226,7 @@ module.exports = { 'no-restricted-imports': [ 'error', { - paths: [ - { - name: 'framer-motion', - message: - 'Please use the Framer Motion API through `@wordpress/components` instead.', - }, - { - name: 'lodash', - importNames: [ - 'camelCase', - 'capitalize', - 'chunk', - 'clamp', - 'cloneDeep', - 'compact', - 'concat', - 'countBy', - 'debounce', - 'deburr', - 'defaults', - 'defaultTo', - 'delay', - 'difference', - 'differenceWith', - 'dropRight', - 'each', - 'escapeRegExp', - 'extend', - 'findIndex', - 'findKey', - 'findLast', - 'first', - 'flatMap', - 'flatten', - 'flattenDeep', - 'flow', - 'flowRight', - 'forEach', - 'fromPairs', - 'has', - 'identity', - 'invoke', - 'isArray', - 'isBoolean', - 'isFinite', - 'isFunction', - 'isMatch', - 'isNil', - 'isNumber', - 'isObject', - 'isObjectLike', - 'isPlainObject', - 'isString', - 'isUndefined', - 'keyBy', - 'keys', - 'last', - 'lowerCase', - 'mapKeys', - 'maxBy', - 'memoize', - 'negate', - 'noop', - 'nth', - 'once', - 'overEvery', - 'partial', - 'partialRight', - 'random', - 'reject', - 'repeat', - 'reverse', - 'size', - 'snakeCase', - 'sortBy', - 'startCase', - 'startsWith', - 'stubFalse', - 'stubTrue', - 'sum', - 'sumBy', - 'take', - 'throttle', - 'times', - 'toString', - 'trim', - 'truncate', - 'unionBy', - 'uniq', - 'uniqBy', - 'uniqueId', - 'uniqWith', - 'upperFirst', - 'values', - 'words', - 'xor', - 'zip', - ], - message: - 'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.', - }, - { - name: 'reakit', - message: - 'Please use Reakit API through `@wordpress/components` instead.', - }, - { - name: 'redux', - importNames: [ 'combineReducers' ], - message: - 'Please use `combineReducers` from `@wordpress/data` instead.', - }, - { - name: 'puppeteer-testing-library', - message: - '`puppeteer-testing-library` is still experimental.', - }, - { - name: '@emotion/css', - message: - 'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.', - }, - ], + paths: restrictedImports, }, ], '@typescript-eslint/no-restricted-imports': [ @@ -314,11 +348,31 @@ module.exports = { ], }, }, + { + files: [ 'packages/components/src/**/*.[tj]s?(x)' ], + excludedFiles: [ ...developmentFiles ], + rules: { + 'react-hooks/exhaustive-deps': 'error', + }, + }, { files: [ 'packages/jest*/**/*.js', '**/test/**/*.js' ], excludedFiles: [ 'test/e2e/**/*.js' ], extends: [ 'plugin:@wordpress/eslint-plugin/test-unit' ], }, + { + files: [ '**/test/**/*.[tj]s?(x)' ], + excludedFiles: [ + '**/*.@(android|ios|native).[tj]s?(x)', + 'packages/react-native-*/**/*.[tj]s?(x)', + 'test/native/**/*.[tj]s?(x)', + 'test/e2e/**/*.[tj]s?(x)', + ], + extends: [ + 'plugin:jest-dom/recommended', + 'plugin:testing-library/react', + ], + }, { files: [ 'packages/e2e-test*/**/*.js' ], excludedFiles: [ 'packages/e2e-test-utils-playwright/**/*.js' ], @@ -357,7 +411,7 @@ module.exports = { }, }, { - files: [ 'bin/**/*.js', 'packages/env/**' ], + files: [ 'bin/**/*.js', 'bin/**/*.mjs', 'packages/env/**' ], rules: { 'no-console': 'off', }, @@ -386,5 +440,28 @@ module.exports = { plugins: [ 'ssr-friendly' ], extends: [ 'plugin:ssr-friendly/recommended' ], }, + { + files: [ 'packages/block-editor/**' ], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + ...restrictedImports, + { + name: '@wordpress/api-fetch', + message: + "block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.", + }, + { + name: '@wordpress/core-data', + message: + "block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.", + }, + ], + }, + ], + }, + }, ], }; diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2cc7b0ce34bd1..6427516035a5e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -87,7 +87,6 @@ /packages/compose @ajitbohra /packages/element @ajitbohra /packages/notices @ajitbohra -/packages/nux @ajitbohra /packages/viewport @ajitbohra /packages/base-styles /packages/icons diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2ac98e4c82aef..1798e22778e38 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,4 +16,7 @@ https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md --> +### Testing Instructions for Keyboard + + ## Screenshots or screencast diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000000..f6202ef81dea8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Configure Dependabot scanning. +version: 2 + +updates: + # Check for updates to GitHub Actions. + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + labels: + - 'GitHub Actions' + - 'Automated Testing' + - '[Type] Build Tooling' diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml index 30a598c93c7ef..c738026529315 100644 --- a/.github/workflows/build-plugin-zip.yml +++ b/.github/workflows/build-plugin-zip.yml @@ -36,11 +36,11 @@ jobs: "https://api.github.com/repos/${{ github.repository }}/releases/latest" LATEST_STABLE_TAG=$(jq --raw-output '.tag_name' latest.json) IFS='.' read LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" - echo "::set-output name=current_stable_branch::release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" + echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> $GITHUB_OUTPUT if [[ ${LATEST_STABLE_MINOR} == "9" ]]; then - echo "::set-output name=next_stable_branch::release/$((LATEST_STABLE_MAJOR + 1)).0" + echo "next_stable_branch=release/$((LATEST_STABLE_MAJOR + 1)).0" >> $GITHUB_OUTPUT else - echo "::set-output name=next_stable_branch::release/${LATEST_STABLE_MAJOR}.$((LATEST_STABLE_MINOR + 1))" + echo "next_stable_branch=release/${LATEST_STABLE_MAJOR}.$((LATEST_STABLE_MINOR + 1))" >> $GITHUB_OUTPUT fi bump-version: @@ -69,7 +69,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: token: ${{ secrets.GUTENBERG_TOKEN }} @@ -77,7 +77,7 @@ jobs: id: get_version run: | OLD_VERSION=$(jq --raw-output '.version' package.json) - echo "::set-output name=old_version::$(echo $OLD_VERSION)" + echo "old_version=${OLD_VERSION}" >> $GITHUB_OUTPUT if [[ ${{ github.event.inputs.version }} == 'stable' ]]; then NEW_VERSION=$(npx semver $OLD_VERSION -i patch) else @@ -93,10 +93,10 @@ jobs: fi fi fi - echo "::set-output name=new_version::$(echo $NEW_VERSION)" + echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT IFS='.' read -r -a NEW_VERSION_ARRAY <<< "$NEW_VERSION" RELEASE_BRANCH="release/${NEW_VERSION_ARRAY[0]}.${NEW_VERSION_ARRAY[1]}" - echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)" + echo "release_branch=${RELEASE_BRANCH}" >> $GITHUB_OUTPUT - name: Configure git user name and email run: | @@ -131,7 +131,7 @@ jobs: git add gutenberg.php package.json package-lock.json git commit -m "Bump plugin version to ${{ steps.get_version.outputs.new_version }}" git push --set-upstream origin "${{ steps.get_version.outputs.release_branch }}" - echo "::set-output name=version_bump_commit::$(git rev-parse --verify --short HEAD)" + echo "version_bump_commit=$(git rev-parse --verify --short HEAD)" >> $GITHUB_OUTPUT - name: Fetch trunk if: ${{ github.ref != 'refs/heads/trunk' }} @@ -146,7 +146,7 @@ jobs: if [[ ${{ steps.get_version.outputs.old_version }} == "$TRUNK_VERSION" ]]; then git cherry-pick "${{ steps.get_version.outputs.release_branch }}" git push - echo "::set-output name=version_bump_commit::$(git rev-parse --verify --short HEAD)" + echo "version_bump_commit=$(git rev-parse --verify --short HEAD)" >> $GITHUB_OUTPUT fi build: @@ -164,12 +164,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: ${{ needs.bump-version.outputs.release_branch || github.ref }} - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -180,7 +180,7 @@ jobs: NO_CHECKS: 'true' - name: Upload artifact - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 with: name: gutenberg-plugin path: ./gutenberg.zip @@ -203,7 +203,7 @@ jobs: - name: Upload release notes artifact if: ${{ needs.bump-version.outputs.new_version }} - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 with: name: release-notes path: ./release-notes.txt @@ -219,7 +219,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: fetch-depth: 2 ref: ${{ needs.bump-version.outputs.release_branch }} @@ -263,15 +263,15 @@ jobs: id: get_release_version env: VERSION: ${{ needs.bump-version.outputs.new_version }} - run: echo ::set-output name=version::$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' ) + run: echo "version=$(echo $VERSION | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> $GITHUB_OUTPUT - name: Download Plugin Zip Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 with: name: gutenberg-plugin - name: Download Release Notes Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 with: name: release-notes @@ -307,13 +307,13 @@ jobs: if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }} steps: - name: Checkout (for CLI) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: main ref: trunk - name: Checkout (for publishing) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: publish # Later, we switch this branch in the script that publishes packages. @@ -327,7 +327,7 @@ jobs: git config user.email gutenberg@wordpress.org - name: Setup Node (for CLI) - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 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 d2b1298e484bb..5a07b367ffa11 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -37,17 +37,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: fetch-depth: 1 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm - - uses: preactjs/compressed-size-action@df6e03e187079aef959a2878311639c77b95ee2e # v2.2.0 + - uses: preactjs/compressed-size-action@8119d3d31b6e57b167e09c81dfa877eada3bcb35 # v2.5.0 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' pattern: '{build/**/*.min.js,build/**/*.css}' diff --git a/.github/workflows/create-block.yml b/.github/workflows/create-block.yml index ba264fed3bfc1..9b98d3d9d4116 100644 --- a/.github/workflows/create-block.yml +++ b/.github/workflows/create-block.yml @@ -24,10 +24,10 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} cache: npm diff --git a/.github/workflows/end2end-test-playwright.yml b/.github/workflows/end2end-test-playwright.yml deleted file mode 100644 index b67c15834b832..0000000000000 --- a/.github/workflows/end2end-test-playwright.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: End-to-End Tests Playwright - -on: - pull_request: - push: - branches: - - trunk - - 'release/**' - - 'wp/**' - -# 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 }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - e2e: - name: E2E Tests - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - - - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Npm install and build - run: | - npm ci - npm run build - - - name: Install Playwright dependencies - run: | - npx playwright install chromium --with-deps - - - name: Install WordPress and start the server - run: | - npm run wp-env start - - - name: Run the tests - run: | - npm run test:e2e:playwright - - - name: Archive debug artifacts (screenshots, traces) - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 - if: always() - with: - name: failures-artifacts - path: artifacts - if-no-files-found: ignore - - - name: Archive flaky tests report - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 - if: always() - with: - name: flaky-tests-report-playwright - path: flaky-tests - if-no-files-found: ignore diff --git a/.github/workflows/end2end-test.yml b/.github/workflows/end2end-test.yml index e8e140bcd0e77..46278d6384a5b 100644 --- a/.github/workflows/end2end-test.yml +++ b/.github/workflows/end2end-test.yml @@ -16,8 +16,8 @@ concurrency: cancel-in-progress: true jobs: - admin: - name: Admin - ${{ matrix.part }} + e2e-puppeteer: + name: Puppeteer - ${{ matrix.part }} runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: @@ -26,10 +26,10 @@ jobs: part: [1, 2, 3, 4] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -49,7 +49,7 @@ jobs: $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests ) - name: Archive debug artifacts (screenshots, HTML snapshots) - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: name: failures-artifacts @@ -57,9 +57,100 @@ jobs: if-no-files-found: ignore - name: Archive flaky tests report - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: - name: flaky-tests-report-${{ matrix.part }} + name: flaky-tests-report path: flaky-tests if-no-files-found: ignore + + e2e-playwright: + name: Playwright + runs-on: ubuntu-latest + if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + + - name: Use desired version of NodeJS + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Npm install and build + run: | + npm ci + npm run build + + - name: Install Playwright dependencies + run: | + npx playwright install chromium firefox webkit --with-deps + + - name: Install WordPress and start the server + run: | + npm run wp-env start + + - name: Run the tests + run: | + xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e:playwright + + - name: Archive debug artifacts (screenshots, traces) + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 + if: always() + with: + name: failures-artifacts + path: artifacts/test-results + if-no-files-found: ignore + + - name: Archive flaky tests report + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 + if: always() + with: + name: flaky-tests-report + path: flaky-tests + if-no-files-found: ignore + + report-to-issues: + name: Report to GitHub + needs: [e2e-puppeteer, e2e-playwright] + if: ${{ always() }} + runs-on: ubuntu-latest + 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@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + ref: trunk + + - uses: actions/download-artifact@v3 + id: download_artifact + # Don't fail the job if there isn't any flaky tests report. + continue-on-error: true + with: + name: flaky-tests-report + path: flaky-tests + + - name: Use desired version of NodeJS + if: ${{ steps.download_artifact.outcome == 'success' }} + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Npm install and build + if: ${{ steps.download_artifact.outcome == 'success' }} + # TODO: We don't have to build the entire project, just the action itself. + run: | + npm ci + npm run build:packages + + - name: Report flaky tests + if: ${{ steps.download_artifact.outcome == 'success' }} + uses: ./packages/report-flaky-tests + with: + repo-token: '${{ secrets.GITHUB_TOKEN }}' + label: '[Type] Flaky Test' + artifact-path: flaky-tests diff --git a/.github/workflows/flaky-tests.yml b/.github/workflows/flaky-tests.yml deleted file mode 100644 index 80ed85d498733..0000000000000 --- a/.github/workflows/flaky-tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Report Flaky Tests - -on: - workflow_run: - workflows: ['End-to-End Tests', 'End-to-End Tests Playwright'] - types: - - completed - -jobs: - report-to-issues: - name: Report to GitHub issues - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - 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@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - ref: trunk - - - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Npm install and build - # TODO: We don't have to build the entire project, just the action itself. - run: | - npm ci - npm run build:packages - - - name: Report flaky tests - uses: ./packages/report-flaky-tests - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' - label: '[Type] Flaky Test' - artifact-name-prefix: flaky-tests-report diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000000000..390f121b570f4 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,10 @@ +name: 'Validate Gradle Wrapper' +on: [push, pull_request] + +jobs: + validation: + name: 'Validation' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index f45c1f229666a..675642df3c26c 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -21,10 +21,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -35,7 +35,7 @@ jobs: - name: Compare performance with trunk if: github.event_name == 'pull_request' - run: ./bin/plugin/cli.js perf --ci $GITHUB_SHA trunk --tests-branch $GITHUB_SHA + run: ./bin/plugin/cli.js perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA - name: Compare performance with current WordPress Core and previous Gutenberg versions if: github.event_name == 'release' @@ -50,7 +50,7 @@ jobs: 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 --ci "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --wp-version "$WP_MAJOR" + ./bin/plugin/cli.js perf "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --wp-version "$WP_MAJOR" - name: Compare performance with base branch if: github.event_name == 'push' @@ -61,15 +61,15 @@ jobs: 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 --ci $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" + ./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" - - uses: actions/github-script@0.3.0 + - uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3 if: github.event_name == 'push' id: commit-timestamp with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); + const commit_details = await github.rest.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0)) - name: Publish performance results diff --git a/.github/workflows/publish-npm-packages.yml b/.github/workflows/publish-npm-packages.yml index b0644c7368e63..5a8249e1d1be9 100644 --- a/.github/workflows/publish-npm-packages.yml +++ b/.github/workflows/publish-npm-packages.yml @@ -30,13 +30,13 @@ jobs: environment: WordPress packages steps: - name: Checkout (for CLI) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: main ref: trunk - name: Checkout (for publishing) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: path: publish # Later, we switch this branch in the script that publishes packages. @@ -50,7 +50,7 @@ jobs: git config user.email gutenberg@wordpress.org - name: Setup Node (for CLI) - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: 'main/.nvmrc' registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml index 5337acc848134..e6e4f1bdfb84e 100644 --- a/.github/workflows/pull-request-automation.yml +++ b/.github/workflows/pull-request-automation.yml @@ -15,17 +15,17 @@ 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@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: trunk - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} - name: Cache NPM packages - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 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 226ed1a1ba864..093c2a99ad4a0 100644 --- a/.github/workflows/rnmobile-android-runner.yml +++ b/.github/workflows/rnmobile-android-runner.yml @@ -14,51 +14,73 @@ concurrency: jobs: test: - runs-on: macos-latest + runs-on: macos-12 if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} strategy: matrix: native-test-name: [gutenberg-editor-initial-html] + api-level: [29] steps: - name: checkout - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of Java - uses: actions/setup-java@v2 + uses: actions/setup-java@de1bb2b0c5634f0fc4438d7aa9944e68f9bf86cc # v3.6.0 with: distribution: 'temurin' java-version: '11' - cache: 'gradle' - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm - run: npm ci - - name: Restore Gradle cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + - name: Gradle cache + uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # v2.3.3 + + - name: AVD cache + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + + - name: Create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # v2.27.0 with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + arch: x86_64 + profile: Nexus 6 + script: echo "Generated AVD snapshot for caching." - - uses: reactivecircus/android-emulator-runner@5de26e4bd23bf523e8a4b7f077df8bfb8e52b50e # v2.19.1 + - name: Run tests + uses: reactivecircus/android-emulator-runner@50986b1464923454c95e261820bc626f38490ec0 # v2.27.0 with: - api-level: 28 - emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160#issuecomment-868615730 - profile: pixel_xl + api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + arch: x86_64 + profile: Nexus 6 script: npm run native test:e2e:android:local ${{ matrix.native-test-name }} - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: name: android-screen-recordings path: packages/react-native-editor/android-screen-recordings - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: name: appium-logs diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml index 96b69bf43ad6d..36dc3a5dc30c9 100644 --- a/.github/workflows/rnmobile-ios-runner.yml +++ b/.github/workflows/rnmobile-ios-runner.yml @@ -19,14 +19,14 @@ jobs: strategy: matrix: xcode: ['13.2.1'] - device: ['iPhone 11'] + device: ['iPhone 13'] native-test-name: [gutenberg-editor-initial-html] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -37,7 +37,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@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: path: | packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app @@ -45,7 +45,7 @@ jobs: key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }} - name: Restore pods cache - uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6 + uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 with: path: | packages/react-native-editor/ios/Pods @@ -77,13 +77,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@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: name: ios-screen-recordings path: packages/react-native-editor/ios-screen-recordings - - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 if: always() with: name: appium-logs diff --git a/.github/workflows/stale-issue-add-needs-testing.yml b/.github/workflows/stale-issue-add-needs-testing.yml deleted file mode 100644 index de0442785a3aa..0000000000000 --- a/.github/workflows/stale-issue-add-needs-testing.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark old issues as needs confirmation' -on: - schedule: - - cron: '45 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." - days-before-stale: 180 - days-before-close: -1 - remove-stale-when-updated: false - stale-issue-label: 'Needs Testing' diff --git a/.github/workflows/stale-issue-flaky-test.yml b/.github/workflows/stale-issue-flaky-test.yml deleted file mode 100644 index c17935e2eb144..0000000000000 --- a/.github/workflows/stale-issue-flaky-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark old flaky tests issues as stale' -on: - schedule: - - cron: '20 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has gone 30 days without any activity.' - days-before-stale: 30 - days-before-close: 1 - only-labels: '[Type] Flaky Test' - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/stale-issue-gardening.yml b/.github/workflows/stale-issue-gardening.yml new file mode 100644 index 0000000000000..bcf72182262ba --- /dev/null +++ b/.github/workflows/stale-issue-gardening.yml @@ -0,0 +1,53 @@ +name: 'Stale Issue Gardening' + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + issue-gardening: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + if: ${{ github.repository == 'WordPress/gutenberg' }} + strategy: + matrix: + include: + - name: 'Issues that require more info' + message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.' + days-before-stale: 15 + days-before-close: -1 + only-labels: '[Status] Needs More Info' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Issues that have needed testing for a period of time' + message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." + days-before-stale: 30 + days-before-close: -1 + only-labels: 'Needs Testing' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Flaky test issues without activity' + message: 'This issue has gone 30 days without any activity.' + days-before-stale: 30 + days-before-close: 1 + only-labels: '[Type] Flaky Test' + remove-stale-when-updated: true + stale-issue-label: '[Status] Stale' + - name: 'Issues without recent updates that need confirmation' + message: "Hi,\nThis issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." + days-before-stale: 180 + days-before-close: -1 + remove-stale-when-updated: false + stale-issue-label: 'Needs Testing' + + steps: + - name: Update issues + uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # v6.0.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: ${{ matrix.message }} + days-before-stale: ${{ matrix.days-before-stale }} + days-before-close: ${{ matrix.days-before-close }} + only-labels: ${{ matrix.only-labels }} + remove-stale-when-updated: ${{ matrix.remove-stale-when-updated }} + stale-issue-label: ${{ matrix.stale-issue-label }} diff --git a/.github/workflows/stale-issue-mark-stale.yml b/.github/workflows/stale-issue-mark-stale.yml deleted file mode 100644 index 28154b35a0b70..0000000000000 --- a/.github/workflows/stale-issue-mark-stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: 'Mark issues stale after needs testing for 30 days' -on: - schedule: - - cron: '55 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." - days-before-stale: 30 - days-before-close: -1 - only-labels: 'Needs Testing' - skip-stale-issue-message: true - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/stale-issue-needs-info.yml b/.github/workflows/stale-issue-needs-info.yml deleted file mode 100644 index f7886f9f46bbd..0000000000000 --- a/.github/workflows/stale-issue-needs-info.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Mark issues stale that require info' -on: - schedule: - - cron: '30 1 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - uses: actions/stale@996798eb71ef485dc4c7b4d3285842d714040c4a # v3.0.17 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.' - days-before-stale: 15 - days-before-close: -1 - only-labels: '[Status] Needs More Info' - stale-issue-label: '[Status] Stale' diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index 684c13710fdab..4abc1f1a354d8 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -22,10 +22,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml index 6efe56a8891f6..e0ce7283b28ba 100644 --- a/.github/workflows/storybook-pages.yml +++ b/.github/workflows/storybook-pages.yml @@ -12,12 +12,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: trunk - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -29,7 +29,7 @@ jobs: run: npm run storybook:build - name: Deploy - uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 + uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935 # v3.9.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./storybook/build diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 4ed5c3d750fee..c1fd9850191da 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -29,10 +29,10 @@ jobs: node: ['14'] steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version: ${{ matrix.node }} cache: npm @@ -57,10 +57,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm @@ -91,10 +91,10 @@ jobs: if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 - name: Use desired version of NodeJS - uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 with: node-version-file: '.nvmrc' cache: npm diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 59cfed85c1b8f..a09a27be328cc 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -20,7 +20,7 @@ jobs: run: | IFS='.' read -r -a VERSION_ARRAY <<< "${TAG#v}" RELEASE_BRANCH="release/${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}" - echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)" + echo "release_branch=${RELEASE_BRANCH}" >> $GITHUB_OUTPUT update-changelog: name: Update Changelog on ${{ matrix.branch }} branch @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 with: ref: ${{ matrix.branch }} token: ${{ secrets.GUTENBERG_TOKEN }} @@ -79,7 +79,7 @@ jobs: - name: Commit the Changelog update run: | git add changelog.txt - # Remove files that are not meant to be commited + # Remove files that are not meant to be committed # ie. release_notes.txt created on the previous step. git clean -fd # Only attempt to commit changelog if it has been modified. @@ -89,7 +89,7 @@ jobs: fi - name: Upload Changelog artifact - uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2 + uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 with: name: changelog ${{ matrix.label }} path: ./changelog.txt @@ -113,7 +113,7 @@ jobs: - name: Get previous stable version id: get_previous_stable_version - run: echo ::set-output name=stable_version::$(awk -F ':\ ' '$1 == "Stable tag" {print $2}' ./trunk/readme.txt) + run: echo "stable_version=$(awk -F ':\ ' '$1 == "Stable tag" {print $2}' ./trunk/readme.txt)" >> $GITHUB_OUTPUT - name: Delete everything working-directory: ./trunk @@ -134,7 +134,7 @@ jobs: run: sed -i "s/${STABLE_TAG_PLACEHOLDER}/${STABLE_TAG}/g" ./trunk/readme.txt - name: Download Changelog Artifact - uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8 + uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 with: name: changelog trunk path: trunk diff --git a/.gitignore b/.gitignore index 8121a1132e5b5..aebfcd623ad2f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ yarn.lock /composer.lock .cache +.eslintcache *.tsbuildinfo # Operating system specific files diff --git a/bin/api-docs/gen-theme-reference.js b/bin/api-docs/gen-theme-reference.js index d051261963daf..45edecf6bd1a2 100644 --- a/bin/api-docs/gen-theme-reference.js +++ b/bin/api-docs/gen-theme-reference.js @@ -127,7 +127,8 @@ const getStylePropertiesMarkup = ( struct ) => { props[ key ].type === 'object' ? keys( props[ key ].properties ).sort().join( ', ' ) : ''; - markup += `| ${ key } | ${ props[ key ].type } | ${ ps } |\n`; + const type = formatType( props[ key ] ); + markup += `| ${ key } | ${ type } | ${ ps } |\n`; } ); return markup; @@ -160,6 +161,32 @@ ${ markupFn( data ) } let autogen = ''; +/** + * Format list of types. + * + * @param {Object} prop + * @return {string} type + */ +const formatType = ( prop ) => { + let type = prop.type || ''; + + if ( prop.hasOwnProperty( 'anyOf' ) || prop.hasOwnProperty( 'oneOf' ) ) { + const propTypes = prop.anyOf || prop.oneOf; + const types = []; + + propTypes.forEach( ( item ) => { + if ( item.type ) types.push( item.type ); + // refComplete is always an object + if ( item.$ref && item.$ref === '#/definitions/refComplete' ) + types.push( 'object' ); + } ); + + type = [ ...new Set( types ) ].join( ', ' ); + } + + return type; +}; + // Settings const settings = Object.entries( themejson.definitions ) .filter( ( [ settingsKey ] ) => diff --git a/bin/cherry-pick.mjs b/bin/cherry-pick.mjs index 0bf1d7926b5bd..44bf05d230402 100644 --- a/bin/cherry-pick.mjs +++ b/bin/cherry-pick.mjs @@ -6,11 +6,10 @@ import readline from 'readline'; import { spawnSync } from 'node:child_process'; -const LABEL = process.argv[2] || "Backport to WP Minor Release"; +const LABEL = process.argv[ 2 ] || 'Backport to WP Minor Release'; const BRANCH = getCurrentBranch(); -const GITHUB_CLI_AVAILABLE = spawnSync( 'gh', ['auth', 'status'] ) - ?.stderr - ?.toString() +const GITHUB_CLI_AVAILABLE = spawnSync( 'gh', [ 'auth', 'status' ] ) + ?.stderr?.toString() .includes( '✓ Logged in to github.com as' ); const AUTO_PROPAGATE_RESULTS_TO_GITHUB = GITHUB_CLI_AVAILABLE; @@ -28,30 +27,34 @@ const AUTO_PROPAGATE_RESULTS_TO_GITHUB = GITHUB_CLI_AVAILABLE; * * Reports the results */ async function main() { - if ( !GITHUB_CLI_AVAILABLE ) { + if ( ! GITHUB_CLI_AVAILABLE ) { await reportGhUnavailable(); } - console.log( `You are on branch "${BRANCH}".` ); + console.log( `You are on branch "${ BRANCH }".` ); console.log( `This script will:` ); - console.log( `• Cherry-pick the merged PRs labeled as "${LABEL}" to this branch` ); + console.log( + `• Cherry-pick the merged PRs labeled as "${ LABEL }" to this branch` + ); console.log( `• Ask whether you want to push this branch` ); console.log( `• Comment on each PR` ); console.log( `• Remove the label from each PR` ); - console.log( `The last two actions will be performed USING YOUR GITHUB ACCOUNT that` ) - console.log( `you've linked to your GitHub CLI (gh command)` ) + console.log( + `The last two actions will be performed USING YOUR GITHUB ACCOUNT that` + ); + console.log( `you've linked to your GitHub CLI (gh command)` ); console.log( `` ); await promptDoYouWantToProceed(); console.log( `$ git pull origin ${ BRANCH } --rebase...` ); - cli( 'git', ['pull', 'origin', BRANCH, '--rebase'], true ); + cli( 'git', [ 'pull', 'origin', BRANCH, '--rebase' ], true ); console.log( `$ git fetch origin trunk...` ); - cli( 'git', ['fetch', 'origin', 'trunk'], true ); + cli( 'git', [ 'fetch', 'origin', 'trunk' ], true ); const PRs = await fetchPRs(); console.log( 'Trying to cherry-pick one by one...' ); - const [successes, failures] = cherryPickAll( PRs ); + const [ successes, failures ] = cherryPickAll( PRs ); console.log( 'Cherry-picking finished!' ); reportSummaryNextSteps( successes, failures ); @@ -60,17 +63,17 @@ async function main() { if ( AUTO_PROPAGATE_RESULTS_TO_GITHUB ) { console.log( `About to push to origin/${ BRANCH }` ); await promptDoYouWantToProceed(); - cli( 'git', ['push', 'origin', BRANCH] ); + cli( 'git', [ 'push', 'origin', BRANCH ] ); console.log( `Commenting and removing labels...` ); successes.forEach( GHcommentAndRemoveLabel ); } else { - console.log( "Cherry-picked PRs with copy-able comments:" ); + console.log( 'Cherry-picked PRs with copy-able comments:' ); successes.forEach( reportSuccessManual ); } } if ( failures.length ) { - console.log( "PRs that could not be cherry-picked automatically:" ); + console.log( 'PRs that could not be cherry-picked automatically:' ); failures.forEach( reportFailure ); } console.log( `Done!` ); @@ -79,9 +82,9 @@ async function main() { /** * Synchronously executes a CLI command and returns the result or throws an error on failure. * - * @param {string} command A command to execute. - * @param {string[]} args CLI args. - * @param {boolean} pipe If true, pipes the output to this process's stdout and stderr. + * @param {string} command A command to execute. + * @param {string[]} args CLI args. + * @param {boolean} pipe If true, pipes the output to this process's stdout and stderr. * @return {string} Command's output. */ function cli( command, args, pipe = false ) { @@ -91,7 +94,11 @@ function cli( command, args, pipe = false ) { stdio: 'pipe', encoding: 'utf-8', }; - const result = spawnSync( command, args, ...( pipe ? [ pipeOptions ] : [] ) ); + const result = spawnSync( + command, + args, + ...( pipe ? [ pipeOptions ] : [] ) + ); if ( result.status !== 0 ) { throw new Error( result.stderr?.toString()?.trim() ); } @@ -105,30 +112,39 @@ function cli( command, args, pipe = false ) { */ async function fetchPRs() { const { items } = await GitHubFetch( - `/search/issues?q=is:pr state:closed sort:updated label:"${ LABEL }" repo:WordPress/gutenberg`, + `/search/issues?q=is:pr state:closed sort:updated label:"${ LABEL }" repo:WordPress/gutenberg` ); - const PRs = items.map( ( { id, number, title } ) => ( { id, number, title } ) ); + const PRs = items.map( ( { id, number, title } ) => ( { + id, + number, + title, + } ) ); console.log( 'Found the following PRs to cherry-pick: ' ); - PRs.forEach( ( { number, title } ) => console.log( indent( `#${ number } – ${ title }` ) ) ); + PRs.forEach( ( { number, title } ) => + console.log( indent( `#${ number } – ${ title }` ) ) + ); console.log( 'Fetching commit IDs...' ); const PRsWithMergeCommit = []; for ( const PR of PRs ) { - const { merge_commit_sha } = await GitHubFetch( - '/repos/WordPress/Gutenberg/pulls/' + PR.number, + const { merge_commit_sha: mergeCommitHash } = await GitHubFetch( + '/repos/WordPress/Gutenberg/pulls/' + PR.number ); PRsWithMergeCommit.push( { ...PR, - mergeCommitHash: merge_commit_sha, + mergeCommitHash, } ); - if ( !merge_commit_sha ) { - throw new Error( `Cannot fetch the merge commit sha for ${ prToString( PR ) }` ); + if ( ! mergeCommitHash ) { + throw new Error( + `Cannot fetch the merge commit sha for ${ prToString( PR ) }` + ); } } console.log( 'Done!' ); - PRsWithMergeCommit - .forEach( ( msg ) => console.log( indent( `${ prToString( msg ) }` ) ) ); + PRsWithMergeCommit.forEach( ( msg ) => + console.log( indent( `${ prToString( msg ) }` ) ) + ); return PRsWithMergeCommit; } @@ -139,14 +155,11 @@ async function fetchPRs() { * @return {Promise} Parsed response JSON. */ async function GitHubFetch( path ) { - const response = await fetch( - 'https://api.github.com' + path, - { - headers: { - Accept: 'application/vnd.github.v3+json', - }, + const response = await fetch( 'https://api.github.com' + path, { + headers: { + Accept: 'application/vnd.github.v3+json', }, - ); + } ); return await response.json(); } @@ -160,20 +173,22 @@ async function GitHubFetch( path ) { * @return {Array} A two-tuple containing a list of successful cherry-picks and a list of failed ones. */ function cherryPickAll( PRs ) { - let remainingPRs = [...PRs]; + let remainingPRs = [ ...PRs ]; let i = 1; let allSuccesses = []; while ( remainingPRs.length ) { - console.log( `Cherry-picking round ${ i ++ }: ` ); - const [successes, failures] = cherryPickRound( remainingPRs ); - allSuccesses = [...allSuccesses, ...successes]; + console.log( `Cherry-picking round ${ i++ }: ` ); + const [ successes, failures ] = cherryPickRound( remainingPRs ); + allSuccesses = [ ...allSuccesses, ...successes ]; remainingPRs = failures; - if ( !successes.length ) { - console.log( 'Nothing merged cleanly in the last round, breaking.' ); + if ( ! successes.length ) { + console.log( + 'Nothing merged cleanly in the last round, breaking.' + ); break; } } - return [allSuccesses, remainingPRs]; + return [ allSuccesses, remainingPRs ]; } /** @@ -185,7 +200,7 @@ function cherryPickAll( PRs ) { * @return {Array} A two-tuple containing a list of successful cherry-picks and a list of failed ones. */ function cherryPickRound( PRs ) { - const stack = [...PRs]; + const stack = [ ...PRs ]; const successes = []; const failures = []; while ( stack.length ) { @@ -198,7 +213,12 @@ function cherryPickRound( PRs ) { } ); console.log( indent( - `✅ cherry-pick commit: ${ cherryPickHash } for PR: ${ prToString( PR, false ) }` ) ); + `✅ cherry-pick commit: ${ cherryPickHash } for PR: ${ prToString( + PR, + false + ) }` + ) + ); } catch ( e ) { failures.push( { ...PR, @@ -207,7 +227,7 @@ function cherryPickRound( PRs ) { console.log( indent( `❌ ${ prToString( PR ) }` ) ); } } - return [successes, failures]; + return [ successes, failures ]; } /** @@ -216,48 +236,64 @@ function cherryPickRound( PRs ) { * @param {*} x Input. * @return {*} Input */ -const identity = x => x; +const identity = ( x ) => x; /** * Formats a PR object in a human readable way. * - * @param {Object} PR PR details. + * @param {Object} PR PR details. + * @param {number} PR.number + * @param {string} PR.mergeCommitHash + * @param {string} PR.title * @param {boolean} withMergeCommitHash Should include the commit hash in the output? * @return {string} Formatted text */ -function prToString( { number, mergeCommitHash, title }, withMergeCommitHash = true ) { +function prToString( + { number, mergeCommitHash, title }, + withMergeCommitHash = true +) { return [ `#${ number }`, withMergeCommitHash ? mergeCommitHash?.substr( 0, 20 ) : '', `${ title?.substr( 0, 30 ) }${ title?.length > 30 ? '...' : '' }`, - ].filter( identity ).join( ' – ' ); + ] + .filter( identity ) + .join( ' – ' ); } /** * Indents a block of text with {width} spaces * - * @param {string} text The text to indent. + * @param {string} text The text to indent. * @param {number} width Number of spaces to use. * @return {string} Indented text. */ function indent( text, width = 3 ) { - const indent = ' '.repeat( width ); - return text.split( "\n" ).map( line => indent + line ).join( "\n" ); + const _indent = ' '.repeat( width ); + return text + .split( '\n' ) + .map( ( line ) => _indent + line ) + .join( '\n' ); } /** * Attempts to cherry-pick a given commit into the current branch, * + * @param {string} commit A commit hash. * @return {string} Branch name. */ function cherryPickOne( commit ) { - const result = spawnSync( 'git', ['cherry-pick', commit] ); + const result = spawnSync( 'git', [ 'cherry-pick', commit ] ); const message = result.stdout.toString().trim(); - if ( result.status !== 0 || !message.includes( 'Author: ' ) ) { - spawnSync( 'git', ['reset', '--hard'] ); + if ( result.status !== 0 || ! message.includes( 'Author: ' ) ) { + spawnSync( 'git', [ 'reset', '--hard' ] ); throw new Error( result.stderr.toString().trim() ); } - const commitHashOutput = spawnSync( 'git', ['rev-parse', '--short', 'HEAD'] ); + const commitHashOutput = spawnSync( 'git', [ + 'rev-parse', + '--short', + 'HEAD', + ] ); return commitHashOutput.stdout.toString().trim(); } @@ -266,17 +302,24 @@ function cherryPickOne( commit ) { * and informs about the next steps to take. * * @param {Array} successes Successful cherry-picks. - * @param {Array} failures Failed cherry-picks. + * @param {Array} failures Failed cherry-picks. */ function reportSummaryNextSteps( successes, failures ) { console.log( 'Summary:' ); - console.log( indent( `✅ ${ successes.length } PRs got cherry-picked cleanly` ) ); console.log( - indent( `${ failures.length > 0 ? '❌' : '✅' } ${ failures.length } PRs failed` ) ); + indent( `✅ ${ successes.length } PRs got cherry-picked cleanly` ) + ); + console.log( + indent( + `${ failures.length > 0 ? '❌' : '✅' } ${ + failures.length + } PRs failed` + ) + ); console.log( '' ); const nextSteps = []; - if ( successes.length && !AUTO_PROPAGATE_RESULTS_TO_GITHUB ) { + if ( successes.length && ! AUTO_PROPAGATE_RESULTS_TO_GITHUB ) { nextSteps.push( 'Push this branch' ); nextSteps.push( 'Go to each of the cherry-picked Pull Requests' ); nextSteps.push( `Remove the ${ LABEL } label` ); @@ -287,8 +330,8 @@ function reportSummaryNextSteps( successes, failures ) { nextSteps.push( 'Manually cherry-pick the PRs that failed' ); } if ( nextSteps.length ) { - console.log( "Next steps:" ); - for ( let i = 0; i < nextSteps.length; i ++ ) { + console.log( 'Next steps:' ); + for ( let i = 0; i < nextSteps.length; i++ ) { console.log( indent( `${ i + 1 }. ${ nextSteps[ i ] }` ) ); } console.log( '' ); @@ -307,8 +350,8 @@ function GHcommentAndRemoveLabel( pr ) { const { number, cherryPickHash } = pr; const comment = prComment( cherryPickHash ); try { - cli( 'gh', ['pr', 'comment', number, '--body', comment] ); - cli( 'gh', ['pr', 'edit', number, '--remove-label', LABEL] ); + cli( 'gh', [ 'pr', 'comment', number, '--body', comment ] ); + cli( 'gh', [ 'pr', 'edit', number, '--remove-label', LABEL ] ); console.log( `✅ ${ number }: ${ comment }` ); } catch ( e ) { console.log( `❌ ${ number }. ${ comment } ` ); @@ -322,7 +365,10 @@ function GHcommentAndRemoveLabel( pr ) { /** * When cherry-pick succeeds, this function outputs the manual next steps to take. * - * @param {Object} PR PR details. + * @param {Object} PR PR details. + * @param {number} PR.number + * @param {string} PR.title + * @param {string} PR.cherryPickHash */ function reportSuccessManual( { number, title, cherryPickHash } ) { console.log( indent( prUrl( number ) ) ); @@ -334,7 +380,11 @@ function reportSuccessManual( { number, title, cherryPickHash } ) { /** * When cherry-pick fails, this function outputs the details. * - * @param {Object} PR PR details. + * @param {Object} PR PR details. + * @param {number} PR.number + * @param {string} PR.title + * @param {string} PR.error + * @param {string} PR.mergeCommitHash */ function reportFailure( { number, title, error, mergeCommitHash } ) { console.log( indent( prUrl( number ) ) ); @@ -348,6 +398,7 @@ function reportFailure( { number, title, error, mergeCommitHash } ) { /** * Returns the URL of the Gutenberg PR given its number. * + * @param {number} number * @return {string} PR URL. */ function prUrl( number ) { @@ -371,7 +422,9 @@ function prComment( cherryPickHash ) { * @return {string} Branch name. */ function getCurrentBranch() { - return spawnSync( 'git', ['rev-parse', '--abbrev-ref', 'HEAD'] ).stdout.toString().trim(); + return spawnSync( 'git', [ 'rev-parse', '--abbrev-ref', 'HEAD' ] ) + .stdout.toString() + .trim(); } /** @@ -381,12 +434,19 @@ function getCurrentBranch() { * @return {Promise} */ async function reportGhUnavailable() { - console.log( 'Github CLI is not setup. This script will not be able to automatically' ); - console.log( 'comment on the processed PRs and remove the backport label from them.' ); - console.log( 'Instead, you will see a detailed list of next steps to perform manually.' ); + console.log( + 'Github CLI is not setup. This script will not be able to automatically' + ); + console.log( + 'comment on the processed PRs and remove the backport label from them.' + ); + console.log( + 'Instead, you will see a detailed list of next steps to perform manually.' + ); console.log( '' ); console.log( - 'To enable automatic handling, install the `gh` utility from https://cli.github.com/' ); + 'To enable automatic handling, install the `gh` utility from https://cli.github.com/' + ); console.log( '' ); await promptDoYouWantToProceed(); } @@ -403,10 +463,11 @@ async function promptDoYouWantToProceed() { output: process.stdout, } ); - const question = ( prompt ) => new Promise( ( resolve ) => rl.question( prompt, resolve ) ); + const question = ( prompt ) => + new Promise( ( resolve ) => rl.question( prompt, resolve ) ); do { const answer = await question( 'Do you want to proceed? (Y/n)' ); - if ( !answer || answer === 'Y' ) { + if ( ! answer || answer === 'Y' ) { break; } if ( answer === 'n' ) { diff --git a/bin/packages/watch.js b/bin/packages/watch.js index ec5c504c0202f..8686aa82a588f 100644 --- a/bin/packages/watch.js +++ b/bin/packages/watch.js @@ -176,7 +176,7 @@ watch( PACKAGES_DIR, { recursive: true, delay: 500, filter: isWatchableFile }, ( event, filename ) => { - // Double check whether we're dealing with a file that needs watching, to accomodate for + // Double check whether we're dealing with a file that needs watching, to accommodate for // the inability to watch recursively on linux-based operating systems. if ( ! isSourceFile( filename ) || ! isModulePackage( filename ) ) { return; diff --git a/bin/plugin/cli.js b/bin/plugin/cli.js index ed2fef4a5b05f..0101c9169171e 100755 --- a/bin/plugin/cli.js +++ b/bin/plugin/cli.js @@ -94,6 +94,10 @@ program .command( 'performance-tests [branches...]' ) .alias( 'perf' ) .option( ...ciOption ) + .option( + '--rounds ', + 'Run each test suite this many times for each branch; results are summarized, default = 1' + ) .option( '--tests-branch ', "Use this branch's performance test files" diff --git a/bin/plugin/commands/common.js b/bin/plugin/commands/common.js index fc540b073a1ff..59abfa93447ef 100644 --- a/bin/plugin/commands/common.js +++ b/bin/plugin/commands/common.js @@ -1,72 +1,26 @@ /** * External dependencies */ -const fs = require( 'fs' ); -const rimraf = require( 'rimraf' ); const semver = require( 'semver' ); +const SimpleGit = require( 'simple-git' ); /** * Internal dependencies */ -const { log, formats } = require( '../lib/logger' ); -const { runStep, readJSONFile } = require( '../lib/utils' ); -const git = require( '../lib/git' ); -const config = require( '../config' ); - -/** - * Clone the repository and returns the working directory. - * - * @param {string} abortMessage Abort message. - * - * @return {Promise} Repository local path. - */ -async function runGitRepositoryCloneStep( abortMessage ) { - // Cloning the repository. - let gitWorkingDirectoryPath; - await runStep( 'Cloning the Git repository', abortMessage, async () => { - log( '>> Cloning the Git repository' ); - gitWorkingDirectoryPath = await git.clone( config.gitRepositoryURL ); - log( - '>> The Git repository has been successfully cloned in the following temporary folder: ' + - formats.success( gitWorkingDirectoryPath ) - ); - } ); - - return gitWorkingDirectoryPath; -} - -/** - * Clean the working directories. - * - * @param {string[]} folders Folders to clean. - * @param {string} abortMessage Abort message. - */ -async function runCleanLocalFoldersStep( folders, abortMessage ) { - await runStep( 'Cleaning the temporary folders', abortMessage, async () => { - await Promise.all( - folders.map( async ( directoryPath ) => { - if ( fs.existsSync( directoryPath ) ) { - await rimraf( directoryPath, ( err ) => { - if ( err ) { - throw err; - } - } ); - } - } ) - ); - } ); -} +const { readJSONFile } = require( '../lib/utils' ); /** * Finds the name of the current plugin release branch based on the version in - * the package.json file. + * the package.json file and the latest `trunk` branch in `git`. * * @param {string} gitWorkingDirectoryPath Path to the project's working directory. * * @return {string} Name of the plugin release branch. */ async function findPluginReleaseBranchName( gitWorkingDirectoryPath ) { - await git.checkoutRemoteBranch( gitWorkingDirectoryPath, 'trunk' ); + await SimpleGit( gitWorkingDirectoryPath ) + .fetch( 'origin', 'trunk' ) + .checkout( 'trunk' ); const packageJsonPath = gitWorkingDirectoryPath + '/package.json'; const mainPackageJson = readJSONFile( packageJsonPath ); @@ -141,6 +95,4 @@ function calculateVersionBumpFromChangelog( module.exports = { calculateVersionBumpFromChangelog, findPluginReleaseBranchName, - runGitRepositoryCloneStep, - runCleanLocalFoldersStep, }; diff --git a/bin/plugin/commands/packages.js b/bin/plugin/commands/packages.js index e715ee69345ad..c085201a23500 100644 --- a/bin/plugin/commands/packages.js +++ b/bin/plugin/commands/packages.js @@ -6,20 +6,24 @@ const path = require( 'path' ); const glob = require( 'fast-glob' ); const fs = require( 'fs' ); const { inc: semverInc } = require( 'semver' ); +const rimraf = require( 'rimraf' ); const readline = require( 'readline' ); +const SimpleGit = require( 'simple-git' ); /** * Internal dependencies */ const { log, formats } = require( '../lib/logger' ); -const { askForConfirmation, runStep, readJSONFile } = require( '../lib/utils' ); +const { + askForConfirmation, + runStep, + readJSONFile, + getRandomTemporaryPath, +} = require( '../lib/utils' ); const { calculateVersionBumpFromChangelog, findPluginReleaseBranchName, - runGitRepositoryCloneStep, - runCleanLocalFoldersStep, } = require( './common' ); -const git = require( '../lib/git' ); const { join } = require( 'path' ); /** @@ -55,6 +59,17 @@ const { join } = require( 'path' ); * @property {ReleaseType} releaseType The selected release type. */ +/** + * Throws if given an error in the node.js callback style. + * + * @param {any|null} error If callback failed, this will hold a value. + */ +const rethrow = ( error ) => { + if ( error ) { + throw error; + } +}; + /** * Checks out the npm release branch. * @@ -64,9 +79,28 @@ async function checkoutNpmReleaseBranch( { gitWorkingDirectoryPath, npmReleaseBranch, } ) { - // Creating the release branch. - await git.checkoutRemoteBranch( gitWorkingDirectoryPath, npmReleaseBranch ); - await git.fetch( gitWorkingDirectoryPath, [ '--depth=100' ] ); + /* + * Create the release branch. + * + * Note that we are grabbing an arbitrary depth of commits + * during the fetch. When `lerna` attempts to determine if + * a package needs an update, it looks at `git` history, + * and if we have pruned that history it will pre-emptively + * publish when it doesn't need to. + * + * We could set a different arbitrary depth if this isn't + * long enough or if it's excessive. We could also try and + * find a way to more specifically fetch what we expect to + * change. For example, if we knew we'll be performing + * updates every two weeks, we might be conservative and + * use `--shallow-since=4.weeks.ago`. + * + * At the time of writing, a depth of 100 pulls in all + * `trunk` commits from within the past week. + */ + await SimpleGit( gitWorkingDirectoryPath ) + .fetch( npmReleaseBranch, [ '--depth=100' ] ) + .checkout( npmReleaseBranch ); log( '>> The local npm release branch ' + formats.success( npmReleaseBranch ) + @@ -105,13 +139,19 @@ async function runNpmReleaseBranchSyncStep( pluginReleaseBranch, config ) { `>> Syncing the latest plugin release to "${ pluginReleaseBranch }".` ); - await git.replaceContentFromRemoteBranch( - gitWorkingDirectoryPath, - pluginReleaseBranch - ); + const repo = SimpleGit( gitWorkingDirectoryPath ); + + /* + * Replace content from remote branch. + * + * @TODO: What is our goal here? Could `git reset --hard origin/${pluginReleaseBranch}` work? + * Why are we manually removing and then adding files back in? + */ + await repo + .raw( 'rm', '-r', '.' ) + .raw( 'checkout', `origin/${ pluginReleaseBranch }`, '--', '.' ); - const commitHash = await git.commit( - gitWorkingDirectoryPath, + const { commit: commitHash } = await repo.commit( `Merge changes published in the Gutenberg plugin "${ pluginReleaseBranch }" branch` ); @@ -223,6 +263,7 @@ async function updatePackages( config ) { '>> Recommended version bumps based on the changes detected in CHANGELOG files:' ); + // e.g. "2022-11-01T00:13:26.102Z" -> "2022-11-01" const publishDate = new Date().toISOString().split( 'T' )[ 0 ]; await Promise.all( packagesToUpdate.map( @@ -234,11 +275,8 @@ async function updatePackages( config ) { version, } ) => { // Update changelog. - const content = await fs.promises.readFile( - changelogPath, - 'utf8' - ); - await fs.promises.writeFile( + const content = fs.readFileSync( changelogPath, 'utf8' ); + fs.writeFileSync( changelogPath, content.replace( '## Unreleased', @@ -280,11 +318,10 @@ async function updatePackages( config ) { ); } - const commitHash = await git.commit( - gitWorkingDirectoryPath, - 'Update changelog files', - [ './*' ] - ); + const { commit: commitHash } = await SimpleGit( gitWorkingDirectoryPath ) + .add( [ './*' ] ) + .commit( 'Update changelog files' ); + if ( commitHash ) { await runPushGitChangesStep( config ); } @@ -313,8 +350,8 @@ async function runPushGitChangesStep( { abortMessage ); } - await git.pushBranchToOrigin( - gitWorkingDirectoryPath, + await SimpleGit( gitWorkingDirectoryPath ).push( + 'origin', npmReleaseBranch ); } ); @@ -345,9 +382,9 @@ async function publishPackagesToNpm( { stdio: 'inherit', } ); - const beforeCommitHash = await git.getLastCommitHash( + const beforeCommitHash = await SimpleGit( gitWorkingDirectoryPath - ); + ).revparse( [ '--short', 'HEAD' ] ); const yesFlag = interactive ? '' : '--yes'; const noVerifyAccessFlag = interactive ? '' : '--no-verify-access'; @@ -403,8 +440,8 @@ async function publishPackagesToNpm( { ); } - const afterCommitHash = await git.getLastCommitHash( - gitWorkingDirectoryPath + const afterCommitHash = await SimpleGit( gitWorkingDirectoryPath ).revparse( + [ '--short', 'HEAD' ] ); if ( afterCommitHash === beforeCommitHash ) { return; @@ -439,18 +476,23 @@ async function backportCommitsToBranch( log( `>> Backporting commits to "${ branchName }".` ); - await git.resetLocalBranchAgainstOrigin( - gitWorkingDirectoryPath, - branchName - ); + const repo = SimpleGit( gitWorkingDirectoryPath ); + + /* + * Reset any local changes and replace them with the origin branch's copy. + * + * Perform an additional fetch to ensure that when we push our changes that + * it's very unlikely that new commits could have appeared at the origin + * HEAD between when we started running this script and now when we're + * pushing our changes back upstream. + */ + await repo.fetch().checkout( branchName ).pull( 'origin', branchName ); + for ( const commitHash of commits ) { - await git.cherrypickCommitIntoBranch( - gitWorkingDirectoryPath, - branchName, - commitHash - ); + await repo.raw( 'cherry-pick', commitHash ); } - await git.pushBranchToOrigin( gitWorkingDirectoryPath, branchName ); + + await repo.push( 'origin', branchName ); log( `>> Backporting successfully finished.` ); } @@ -478,11 +520,20 @@ async function runPackagesRelease( config, customMessages ) { const temporaryFolders = []; if ( ! config.gitWorkingDirectoryPath ) { - // Cloning the Git repository. - config.gitWorkingDirectoryPath = await runGitRepositoryCloneStep( - config.abortMessage + const gitPath = getRandomTemporaryPath(); + config.gitWorkingDirectoryPath = gitPath; + fs.mkdirSync( gitPath, { recursive: true } ); + temporaryFolders.push( gitPath ); + + await runStep( + 'Cloning the Git repository', + config.abortMessage, + async () => { + log( '>> Cloning the Git repository' ); + await SimpleGit( gitPath ).clone( config.gitRepositoryURL ); + log( ` >> successfully clone into: ${ gitPath }` ); + } ); - temporaryFolders.push( config.gitWorkingDirectoryPath ); } let pluginReleaseBranch; @@ -518,7 +569,16 @@ async function runPackagesRelease( config, customMessages ) { } } - await runCleanLocalFoldersStep( temporaryFolders, 'Cleaning failed.' ); + await runStep( + 'Cleaning the temporary folders', + 'Cleaning failed', + async () => + await Promise.all( + temporaryFolders + .filter( ( tempDir ) => fs.existsSync( tempDir ) ) + .map( ( tempDir ) => rimraf( tempDir, rethrow ) ) + ) + ); log( '\n>> 🎉 WordPress packages are now published!\n\n', diff --git a/bin/plugin/commands/performance.js b/bin/plugin/commands/performance.js index 1b0d85a2bb140..81aa39820c8b5 100644 --- a/bin/plugin/commands/performance.js +++ b/bin/plugin/commands/performance.js @@ -4,6 +4,7 @@ const fs = require( 'fs' ); const path = require( 'path' ); const { mapValues, kebabCase } = require( 'lodash' ); +const SimpleGit = require( 'simple-git' ); /** * Internal dependencies @@ -15,13 +16,13 @@ const { askForConfirmation, getRandomTemporaryPath, } = require( '../lib/utils' ); -const git = require( '../lib/git' ); const config = require( '../config' ); /** * @typedef WPPerformanceCommandOptions * * @property {boolean=} ci Run on CI. + * @property {number=} rounds Run each test suite this many times for each branch. * @property {string=} testsBranch The branch whose performance test files will be used for testing. * @property {string=} wpVersion The WordPress version to be used as the base install for testing. */ @@ -36,6 +37,7 @@ const config = require( '../config' ); * @property {number[]} firstContentfulPaint Represents the time when the browser first renders any text or media. * @property {number[]} firstBlock Represents the time when Puppeteer first sees a block selector in the DOM. * @property {number[]} type Average type time. + * @property {number[]} typeContainer Average type time within a container. * @property {number[]} focus Average block selection time. * @property {number[]} inserterOpen Average time to open global inserter. * @property {number[]} inserterSearch Average time to search the inserter. @@ -55,6 +57,9 @@ const config = require( '../config' ); * @property {number=} type Average type time. * @property {number=} minType Minimum type time. * @property {number=} maxType Maximum type time. + * @property {number=} typeContainer Average type time within a container. + * @property {number=} minTypeContainer Minimum type time within a container. + * @property {number=} maxTypeContainer Maximum type time within a container. * @property {number=} focus Average block selection time. * @property {number=} minFocus Min block selection time. * @property {number=} maxFocus Max block selection time. @@ -128,6 +133,9 @@ function curateResults( results ) { type: average( results.type ), minType: Math.min( ...results.type ), maxType: Math.max( ...results.type ), + typeContainer: average( results.typeContainer ), + minTypeContainer: Math.min( ...results.typeContainer ), + maxTypeContainer: Math.max( ...results.typeContainer ), focus: average( results.focus ), minFocus: Math.min( ...results.focus ), maxFocus: Math.max( ...results.focus ), @@ -146,27 +154,6 @@ function curateResults( results ) { }; } -/** - * Set up the given branch for testing. - * - * @param {string} branch Branch name. - * @param {string} environmentDirectory Path to the plugin environment's clone. - */ -async function setUpGitBranch( branch, environmentDirectory ) { - // Restore clean working directory (e.g. if `package-lock.json` has local - // changes after install). - await git.discardLocalChanges( environmentDirectory ); - - log( ' >> Fetching the ' + formats.success( branch ) + ' branch' ); - await git.checkoutRemoteBranch( environmentDirectory, branch ); - - log( ' >> Building the ' + formats.success( branch ) + ' branch' ); - await runShellScript( - 'npm install && npm run build', - environmentDirectory - ); -} - /** * Runs the performance tests on the current branch. * @@ -196,6 +183,9 @@ async function runTestSuite( testSuite, performanceTestDirectory ) { * @param {WPPerformanceCommandOptions} options Command options. */ async function runPerformanceTests( branches, options ) { + const runningInCI = !! process.env.CI || !! options.ci; + const TEST_ROUNDS = options.rounds || 1; + // The default value doesn't work because commander provides an array. if ( branches.length === 0 ) { branches = [ 'trunk' ]; @@ -204,38 +194,61 @@ async function runPerformanceTests( branches, options ) { log( formats.title( '\n💃 Performance Tests 🕺\n' ), '\nWelcome! This tool runs the performance tests on multiple branches and displays a comparison table.\n' + - 'In order to run the tests, the tool is going to load a WordPress environment on 8888 and 8889 ports.\n' + + 'In order to run the tests, the tool is going to load a WordPress environment on ports 8888 and 8889.\n' + 'Make sure these ports are not used before continuing.\n' ); - if ( ! options.ci ) { + if ( ! runningInCI ) { await askForConfirmation( 'Ready to go? ' ); } // 1- Preparing the tests directory. log( '\n>> Preparing the tests directories' ); log( ' >> Cloning the repository' ); - const baseDirectory = await git.clone( config.gitRepositoryURL ); + + /** + * @type {string[]} git refs against which to run tests; + * could be commit SHA, branch name, tag, etc... + */ + if ( branches.length < 2 ) { + throw new Error( `Need at least two git refs to run` ); + } + + const baseDirectory = getRandomTemporaryPath(); + fs.mkdirSync( baseDirectory, { recursive: true } ); + + // @ts-ignore + const git = SimpleGit( baseDirectory ); + await git + .raw( 'init' ) + .raw( 'remote', 'add', 'origin', config.gitRepositoryURL ); + + for ( const branch of branches ) { + await git.raw( 'fetch', '--depth=1', 'origin', branch ); + } + + await git.raw( 'checkout', branches[ 0 ] ); + const rootDirectory = getRandomTemporaryPath(); const performanceTestDirectory = rootDirectory + '/tests'; await runShellScript( 'mkdir -p ' + rootDirectory ); await runShellScript( 'cp -R ' + baseDirectory + ' ' + performanceTestDirectory ); + if ( !! options.testsBranch ) { - log( - ' >> Fetching the test branch: ' + - formats.success( options.testsBranch ) + - ' branch' - ); - await git.checkoutRemoteBranch( - performanceTestDirectory, - options.testsBranch - ); + const branchName = formats.success( options.testsBranch ); + log( ` >> Fetching the test-runner branch: ${ branchName }` ); + + // @ts-ignore + await SimpleGit( performanceTestDirectory ) + .raw( 'fetch', '--depth=1', 'origin', options.testsBranch ) + .raw( 'checkout', options.testsBranch ); } + log( ' >> Installing dependencies and building packages' ); await runShellScript( - 'npm install && npm run build:packages', + 'npm ci && node ./bin/packages/build.js', performanceTestDirectory ); log( ' >> Creating the environment folders' ); @@ -245,16 +258,36 @@ async function runPerformanceTests( branches, options ) { log( '\n>> Preparing an environment directory per branch' ); const branchDirectories = {}; for ( const branch of branches ) { - log( ' >> Branch: ' + branch ); + log( ` >> Branch: ${ branch }` ); const environmentDirectory = rootDirectory + '/envs/' + kebabCase( branch ); // @ts-ignore branchDirectories[ branch ] = environmentDirectory; + const buildPath = `${ environmentDirectory }/plugin`; await runShellScript( 'mkdir ' + environmentDirectory ); - await runShellScript( - 'cp -R ' + baseDirectory + ' ' + environmentDirectory + '/plugin' - ); - await setUpGitBranch( branch, environmentDirectory + '/plugin' ); + await runShellScript( `cp -R ${ baseDirectory } ${ buildPath }` ); + + const fancyBranch = formats.success( branch ); + + if ( branch === options.testsBranch ) { + log( + ` >> Re-using the testing branch for ${ fancyBranch }` + ); + await runShellScript( + `cp -R ${ performanceTestDirectory } ${ buildPath }` + ); + } else { + log( ` >> Fetching the ${ fancyBranch } branch` ); + // @ts-ignore + await SimpleGit( buildPath ).reset( 'hard' ).checkout( branch ); + + log( ` >> Building the ${ fancyBranch } branch` ); + await runShellScript( + 'npm ci && npm run prebuild:packages && node ./bin/packages/build.js && npx wp-scripts build', + buildPath + ); + } + await runShellScript( 'cp ' + path.resolve( @@ -303,13 +336,9 @@ async function runPerformanceTests( branches, options ) { formats.success( performanceTestDirectory ) ); for ( const branch of branches ) { - log( - '>> Environment Directory (' + - branch + - ') : ' + - // @ts-ignore - formats.success( branchDirectories[ branch ] ) - ); + // @ts-ignore + const envPath = formats.success( branchDirectories[ branch ] ); + log( `>> Environment Directory (${ branch }) : ${ envPath }` ); } // 4- Running the tests. @@ -324,12 +353,12 @@ async function runPerformanceTests( branches, options ) { /** @type {Array>} */ const rawResults = []; // Alternate three times between branches. - for ( let i = 0; i < 3; i++ ) { + for ( let i = 0; i < TEST_ROUNDS; i++ ) { rawResults[ i ] = {}; for ( const branch of branches ) { // @ts-ignore const environmentDirectory = branchDirectories[ branch ]; - log( ' >> Branch: ' + branch + ', Suite: ' + testSuite ); + log( ` >> Branch: ${ branch }, Suite: ${ testSuite }` ); log( ' >> Starting the environment.' ); await runShellScript( '../../tests/node_modules/.bin/wp-env start', @@ -371,6 +400,15 @@ async function runPerformanceTests( branches, options ) { type: rawResults.map( ( r ) => r[ branch ].type ), minType: rawResults.map( ( r ) => r[ branch ].minType ), maxType: rawResults.map( ( r ) => r[ branch ].maxType ), + typeContainer: rawResults.map( + ( r ) => r[ branch ].typeContainer + ), + minTypeContainer: rawResults.map( + ( r ) => r[ branch ].minTypeContainer + ), + maxTypeContainer: rawResults.map( + ( r ) => r[ branch ].maxTypeContainer + ), focus: rawResults.map( ( r ) => r[ branch ].focus ), minFocus: rawResults.map( ( r ) => r[ branch ].minFocus ), maxFocus: rawResults.map( ( r ) => r[ branch ].maxFocus ), diff --git a/bin/plugin/lib/git.js b/bin/plugin/lib/git.js deleted file mode 100644 index 8208efa7164d1..0000000000000 --- a/bin/plugin/lib/git.js +++ /dev/null @@ -1,202 +0,0 @@ -// @ts-nocheck -/** - * External dependencies - */ -const SimpleGit = require( 'simple-git' ); - -/** - * Internal dependencies - */ -const { getRandomTemporaryPath } = require( './utils' ); - -/** - * Clones a GitHub repository. - * - * @param {string} repositoryUrl - * - * @return {Promise} Repository local Path - */ -async function clone( repositoryUrl ) { - const gitWorkingDirectoryPath = getRandomTemporaryPath(); - const simpleGit = SimpleGit(); - await simpleGit.clone( repositoryUrl, gitWorkingDirectoryPath, [ - '--depth=1', - '--no-single-branch', - ] ); - return gitWorkingDirectoryPath; -} - -/** - * Fetches changes from the repository. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string[]|Object} options Git options to apply. - */ -async function fetch( gitWorkingDirectoryPath, options = [] ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.fetch( options ); -} - -/** - * Commits changes to the repository. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} message Commit message. - * @param {string[]} filesToAdd Files to add. - * - * @return {Promise} Commit Hash - */ -async function commit( gitWorkingDirectoryPath, message, filesToAdd = [] ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.add( filesToAdd ); - const commitData = await simpleGit.commit( message ); - const commitHash = commitData.commit; - - return commitHash; -} - -/** - * Creates a local branch. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} branchName Branch Name - */ -async function createLocalBranch( gitWorkingDirectoryPath, branchName ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.checkoutLocalBranch( branchName ); -} - -/** - * Checkout a local branch. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} branchName Branch Name - */ -async function checkoutRemoteBranch( gitWorkingDirectoryPath, branchName ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.fetch( 'origin', branchName ); - await simpleGit.checkout( branchName ); -} - -/** - * Creates a local tag. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} tagName Tag Name - */ -async function createLocalTag( gitWorkingDirectoryPath, tagName ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.addTag( tagName ); -} - -/** - * Pushes a local branch to the origin. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} branchName Branch Name - */ -async function pushBranchToOrigin( gitWorkingDirectoryPath, branchName ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.push( 'origin', branchName ); -} - -/** - * Pushes tags to the origin. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - */ -async function pushTagsToOrigin( gitWorkingDirectoryPath ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.pushTags( 'origin' ); -} - -/** - * Discard local changes. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - */ -async function discardLocalChanges( gitWorkingDirectoryPath ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.reset( 'hard' ); -} - -/** - * Reset local branch against the origin. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} branchName Branch Name - */ -async function resetLocalBranchAgainstOrigin( - gitWorkingDirectoryPath, - branchName -) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.fetch(); - await simpleGit.checkout( branchName ); - await simpleGit.pull( 'origin', branchName ); -} - -/** - * Gets the commit hash for the last commit in the current branch. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * - * @return {string} Commit hash. - */ -async function getLastCommitHash( gitWorkingDirectoryPath ) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - return await simpleGit.revparse( [ '--short', 'HEAD' ] ); -} - -/** - * Cherry-picks a commit into trunk - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} branchName Branch name. - * @param {string} commitHash Commit hash. - */ -async function cherrypickCommitIntoBranch( - gitWorkingDirectoryPath, - branchName, - commitHash -) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.checkout( branchName ); - await simpleGit.raw( [ 'cherry-pick', commitHash ] ); -} - -/** - * Replaces the local branch's content with the content from another branch. - * - * @param {string} gitWorkingDirectoryPath Local repository path. - * @param {string} sourceBranchName Branch Name - */ -async function replaceContentFromRemoteBranch( - gitWorkingDirectoryPath, - sourceBranchName -) { - const simpleGit = SimpleGit( gitWorkingDirectoryPath ); - await simpleGit.raw( [ 'rm', '-r', '.' ] ); - await simpleGit.raw( [ - 'checkout', - `origin/${ sourceBranchName }`, - '--', - '.', - ] ); -} - -module.exports = { - clone, - commit, - checkoutRemoteBranch, - createLocalBranch, - createLocalTag, - fetch, - pushBranchToOrigin, - pushTagsToOrigin, - discardLocalChanges, - resetLocalBranchAgainstOrigin, - getLastCommitHash, - cherrypickCommitIntoBranch, - replaceContentFromRemoteBranch, -}; diff --git a/bin/tsconfig.json b/bin/tsconfig.json index 86d2a07c742f8..f3d576c178d0c 100644 --- a/bin/tsconfig.json +++ b/bin/tsconfig.json @@ -25,7 +25,6 @@ "./plugin/lib/version.js", "./plugin/lib/logger.js", "./plugin/lib/utils.js", - "./plugin/lib/git.js", "./validate-package-lock.js" ] } diff --git a/changelog.txt b/changelog.txt index 4399018de2286..93cdbecad9ad8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,2262 @@ == Changelog == += 14.8.4 = + + + +## Changelog + +### Various + +- Fixes an issue where gutenberg bundled `theme.json` was not utilized. ([46810](https://github.com/WordPress/gutenberg/pull/46810)) This meant that Gutenberg features newer than the WordPress `theme.json` file were unavailable in 14.8. + +## Contributors + +The following contributors merged PRs in this release: + +@madhusudhand + + += 14.8.3 = + + + +## Changelog + +### Bug Fixes + +#### Plugin +Fixes compatibility with WordPress 6.0.x. This includes the following PRs: +- #46579 +- #46750 +- #46806 +- #46809 + +Broadly, this needed to include the two refactors of the Theme_JSON compatibility files, along with two fixes switching `wp_*` and `gutenberg_*` function variants as needed. + +## Contributors + +The following contributors were involved with this release: + +@geriux @Mamaduka @oandregal @noahtallen + + += 14.8.2 = + + + +## Changelog + +### Bug Fixes + +#### Block Editor +- rich-text: Fix bug where bare tag name format types could not be registered. ([46798](https://github.com/WordPress/gutenberg/pull/46798)) + + +## First time contributors + +The following PRs were merged by first time contributors: + + + +## Contributors + +The following contributors merged PRs in this release: + +@davilera + + += 14.8.1 = + +## Changelog + +### Bug Fixes + +- Update the script registration of the react scripts with a cache version to prevent browser cache issues. ([46768](https://github.com/WordPress/gutenberg/pull/46768)) + + +## Contributors + +The following contributors merged PRs in this release: + +@youknowriad + + += 14.8.0 = + +## Changelog + +### Enhancements + +#### Block Library +- Add a current-menu-ancestor class to navigation items. ([40778](https://github.com/WordPress/gutenberg/pull/40778)) +- Page List Block: Adds a longdash tree to the parent selector. ([46336](https://github.com/WordPress/gutenberg/pull/46336)) +- Page List Block: Hide page list edit button if no pages are available. ([46331](https://github.com/WordPress/gutenberg/pull/46331)) +- Page List: Add convert panel to Inspector Controls when within Nav block. ([46352](https://github.com/WordPress/gutenberg/pull/46352)) +- Page List: Prevent users from adding inner blocks to Page List. ([46269](https://github.com/WordPress/gutenberg/pull/46269)) +- Reusable block: Pluralize the message "Convert to regular blocks" depending on the number of blocks contained. ([45819](https://github.com/WordPress/gutenberg/pull/45819)) +- Add page list to Link UI transforms in Nav block. ([46426](https://github.com/WordPress/gutenberg/pull/46426)) +- Heading Block: Don't rely on the experimental selector anymore. ([46284](https://github.com/WordPress/gutenberg/pull/46284)) +- Media & Text Block: Create undo history when media width is changed. ([46084](https://github.com/WordPress/gutenberg/pull/46084)) +- Navigation block: Add location->primary to fallback nav creation for classic menus. ([45976](https://github.com/WordPress/gutenberg/pull/45976)) +- Navigation block: Update fallback nav creation to the most recently created menu. ([46286](https://github.com/WordPress/gutenberg/pull/46286)) +- Navigation: Add a 'open list view' button. ([46335](https://github.com/WordPress/gutenberg/pull/46335)) +- Navigation: Removes the header from the navigation list view in the experiment. ([46070](https://github.com/WordPress/gutenberg/pull/46070)) +- Query: Remove color block supports. ([46147](https://github.com/WordPress/gutenberg/pull/46147)) +- Table block: Make `figcaption` styles consistent between editor and front end. ([46172](https://github.com/WordPress/gutenberg/pull/46172)) +- List/quote: Unwrap inner block when pressing Backspace at start. ([45075](https://github.com/WordPress/gutenberg/pull/45075)) + +#### Inspector Controls +- Sidebar Tabs: Refine the use of inspector tabs and disable filters for Nav blocks. ([46346](https://github.com/WordPress/gutenberg/pull/46346)) +- Sidebar Tabs: Use editor settings to override display. ([46321](https://github.com/WordPress/gutenberg/pull/46321)) +- Summary panel: Try improving spacing and grid. ([46267](https://github.com/WordPress/gutenberg/pull/46267)) + +#### Global Styles +- Add Style Book to Global Styles. ([45960](https://github.com/WordPress/gutenberg/pull/45960)) +- Add block preview component in global styles. ([45719](https://github.com/WordPress/gutenberg/pull/45719)) +- Move border from layout to own menu. ([45995](https://github.com/WordPress/gutenberg/pull/45995)) +- Add a css style to theme.json to allow setting of custom css strings. ([46255](https://github.com/WordPress/gutenberg/pull/46255)) +- Expose before filter hook in useSettings for injecting block settings in the editor. ([45089](https://github.com/WordPress/gutenberg/pull/45089)) +- Global styles: Add custom CSS panel to site editor. ([46141](https://github.com/WordPress/gutenberg/pull/46141)) + +#### Site Editor +- Reorganize the site editor to introduce Browse Mode. ([44770](https://github.com/WordPress/gutenberg/pull/44770)) +- Allow adding new templates and template parts directly from the sidebar. ([46458](https://github.com/WordPress/gutenberg/pull/46458)) +- Synchronize the sidebar state in the URL. ([46433](https://github.com/WordPress/gutenberg/pull/46433)) +- Try template drill down on the shell sidebar (browse mode). ([45100](https://github.com/WordPress/gutenberg/pull/45100)) + +#### Block Editor +- Update the synced block hover styles in Inserter. ([46442](https://github.com/WordPress/gutenberg/pull/46442)) +- Add new selector getLastInsertedBlockClientId. ([46531](https://github.com/WordPress/gutenberg/pull/46531)) +- Block editor: Hide fixed contextual toolbar. ([46298](https://github.com/WordPress/gutenberg/pull/46298)) +- Inserter: Pattern title tooltip. ([46419](https://github.com/WordPress/gutenberg/pull/46419)) +- useNestedSettingsUpdate: Prevent unneeded syncing of falsy templateLock values. ([46357](https://github.com/WordPress/gutenberg/pull/46357)) +- Design: Augmented shadows for modals and popovers. ([46228](https://github.com/WordPress/gutenberg/pull/46228)) + +#### Components +- Tabs: Try a simpler tab focus style, alt. ([46276](https://github.com/WordPress/gutenberg/pull/46276)) +- BaseControl: Add convenience hook to generate id-related props. ([46170](https://github.com/WordPress/gutenberg/pull/46170)) +- Dashicon: Refactor to TypeScript. ([45924](https://github.com/WordPress/gutenberg/pull/45924)) +- Lighten borders to gray-600. ([46252](https://github.com/WordPress/gutenberg/pull/46252)) +- Popover: Check positioning by adding and testing is-positioned class. ([46429](https://github.com/WordPress/gutenberg/pull/46429)) + +### Icons +- Icons: Update the border icon. ([46264](https://github.com/WordPress/gutenberg/pull/46264)) + +#### Testing +- Tests: Fix `toBePositionedPopover` matcher message function. ([46239](https://github.com/WordPress/gutenberg/pull/46239)) + +#### Plugin +- Update the Gutenberg plugin to require at least the WP 6.0 version. ([46102](https://github.com/WordPress/gutenberg/pull/46102)) +- PHP: Backport changes from core theme resolver. ([46250](https://github.com/WordPress/gutenberg/pull/46250)) +- Update: Move gutenberg_register_core_block_patterns from 6.1 to 6.2. ([46249](https://github.com/WordPress/gutenberg/pull/46249)) +- Upgrade React packages to v18. ([45235](https://github.com/WordPress/gutenberg/pull/45235)) + +#### Themes +- Empty Theme: Add the `$schema` property in `theme.json` and rename template directories. ([46300](https://github.com/WordPress/gutenberg/pull/46300)) + +#### Mobile +- Mobile: Disable Unsupported Block Editor Tests (Android). ([46542](https://github.com/WordPress/gutenberg/pull/46542)) +- Mobile: Inserter - Remove `.done()` usage. ([46460](https://github.com/WordPress/gutenberg/pull/46460)) +- Mobile: Update Heading block end-to-end test. ([46220](https://github.com/WordPress/gutenberg/pull/46220)) +- Mobile: Updates packages to not use Git HTTPS URLs. ([46422](https://github.com/WordPress/gutenberg/pull/46422)) + +### Bug Fixes + +#### Block Library +- Fix Nav Submenu block Link UI text control. ([46243](https://github.com/WordPress/gutenberg/pull/46243)) +- Fix auto Nav menu creation due to page list inner blocks. ([46223](https://github.com/WordPress/gutenberg/pull/46223)) +- Handle innerContent too when removing innerBlocks. ([46377](https://github.com/WordPress/gutenberg/pull/46377)) +- Image Block: Ensure drag handle matches cursor position when resizing a center aligned image. ([46497](https://github.com/WordPress/gutenberg/pull/46497)) +- Navigation Block: Add social link singular to list of blocks to be allowed. ([46374](https://github.com/WordPress/gutenberg/pull/46374)) +- Navigation Block: Fixes adding a submenu. ([46364](https://github.com/WordPress/gutenberg/pull/46364)) +- Navigation Block: Prevent circular references in navigation block rendering. ([46387](https://github.com/WordPress/gutenberg/pull/46387)) +- Navigation Block: Recursively remove Navigation block’s from appearing inside Navigation block on front of site. ([46279](https://github.com/WordPress/gutenberg/pull/46279)) +- Navigation link: Use stripHTML. ([46317](https://github.com/WordPress/gutenberg/pull/46317)) +- Page List Block: Fix error loading page list parent options. ([46327](https://github.com/WordPress/gutenberg/pull/46327)) +- Query Loop Block: Add migration of colors to v2 deprecation. ([46522](https://github.com/WordPress/gutenberg/pull/46522)) +- Site Logo: Correctly set the image's natural height and width. ([46214](https://github.com/WordPress/gutenberg/pull/46214)) +- Strip markup from link label data in inspector. ([46171](https://github.com/WordPress/gutenberg/pull/46171)) +- Template Parts: Fix modal search stacking context. ([46421](https://github.com/WordPress/gutenberg/pull/46421)) +- Video: Avoid an error when removal is locked. ([46324](https://github.com/WordPress/gutenberg/pull/46324)) +- Layout child fixed size should not be fixed by default and should always have a value set. ([46139](https://github.com/WordPress/gutenberg/pull/46139)) + +#### Blocks +- Paste handler: Remove styles on inline paste. ([46402](https://github.com/WordPress/gutenberg/pull/46402)) +- Improve performance of gutenberg_render_layout_support_flag. ([46074](https://github.com/WordPress/gutenberg/pull/46074)) + +#### Global Styles +- Allow indirect properties when unfiltered_html is not allowed. ([46388](https://github.com/WordPress/gutenberg/pull/46388)) +- Fix Reset to defaults action by moving fills to be within context provider. ([46486](https://github.com/WordPress/gutenberg/pull/46486)) +- Fix duplication of synced block colors in CSS output. ([46297](https://github.com/WordPress/gutenberg/pull/46297)) +- Make style book label font size 11px. ([46341](https://github.com/WordPress/gutenberg/pull/46341)) +- Style Book: Clear Global Styles navigation history when selecting a block. ([46391](https://github.com/WordPress/gutenberg/pull/46391)) +- - Global Styles REST API endpoint: Check custom CSS is included before attempting to validate. ([46561](https://github.com/WordPress/gutenberg/pull/46561)) +- Reverts the custom CSS to an experiment while we resolve the handling of unfiltered html capabilities. ([46663](https://github.com/WordPress/gutenberg/pull/46663)) + +#### Block Editor +- Block Editor: Fix content locked patterns. ([46494](https://github.com/WordPress/gutenberg/pull/46494)) +- Block Editor: Fix memoized pattern selector dependant arguments. ([46238](https://github.com/WordPress/gutenberg/pull/46238)) +- Block Editor: Restore draggable chip styles. ([46396](https://github.com/WordPress/gutenberg/pull/46396)) +- Block Editor: Revert deoptimization useNestedSettingsUpdate. ([46350](https://github.com/WordPress/gutenberg/pull/46350)) +- Block Editor: Fix some usages of useSelect that return unstable results. ([46226](https://github.com/WordPress/gutenberg/pull/46226)) +- useInnerBlockTemplateSync: Cancel template sync on innerBlocks change or unmount. ([46307](https://github.com/WordPress/gutenberg/pull/46307)) + +#### Patterns +- Add new pattern categories. ([46144](https://github.com/WordPress/gutenberg/pull/46144)) +- Block Editor: Add initial view mode in `BlockPatternSetup`. ([46399](https://github.com/WordPress/gutenberg/pull/46399)) + +#### Site Editor +- Do not remount iframe. ([46431](https://github.com/WordPress/gutenberg/pull/46431)) +- Fix the top bar 'exit' animation. ([46533](https://github.com/WordPress/gutenberg/pull/46533)) +- Keep edited entity in sync when Editor canvas isn't mounted. ([46524](https://github.com/WordPress/gutenberg/pull/46524)) +- [Site Editor]: Add default white background for themes with no `background color` set. ([46314](https://github.com/WordPress/gutenberg/pull/46314)) + +#### Components +- InputControl: Fix `Flex` wrapper usage. ([46213](https://github.com/WordPress/gutenberg/pull/46213)) +- Modal: Fix unexpected modal closing in IME Composition. ([46453](https://github.com/WordPress/gutenberg/pull/46453)) +- MaybeCategoryPanel: Avoid 403 requests for users with low permissions. ([46349](https://github.com/WordPress/gutenberg/pull/46349)) +- Rich text: Add button to clear unknown format. ([44086](https://github.com/WordPress/gutenberg/pull/44086)) + +#### Document Settings +- Fix template title in `summary` panel and requests for low privileged users. ([46304](https://github.com/WordPress/gutenberg/pull/46304)) +- Permalink: Hide edit field for users without publishing capabilities. ([46361](https://github.com/WordPress/gutenberg/pull/46361)) + +#### Patterns +- Content lock: Make filter hook namespace unique. ([46344](https://github.com/WordPress/gutenberg/pull/46344)) + +#### Layout +- Child Layout controls: Fix help text for height. ([46319](https://github.com/WordPress/gutenberg/pull/46319)) + +#### Widgets Editor +- Shortcuts: Add Ctrl+Y for redo to all editor instances on Windows. ([43392](https://github.com/WordPress/gutenberg/pull/43392)) + +#### Block API +- HTML block: Fix parsing. ([27268](https://github.com/WordPress/gutenberg/pull/27268)) + +#### Mobile +- Social Links mobile test: Wait for URL bottom sheet to appear. ([46308](https://github.com/WordPress/gutenberg/pull/46308)) + +### Performance + +#### Components +- Avoid paint on popover when hovering content. ([46201](https://github.com/WordPress/gutenberg/pull/46201)) +- CircularOption: Avoid paint on circular option hover. ([46197](https://github.com/WordPress/gutenberg/pull/46197)) +- Lodash: Replace `_.isEqual()` with `fastDeepEqual`. ([46200](https://github.com/WordPress/gutenberg/pull/46200)) +- Popover: Avoid paint on popovers when scrolling. ([46187](https://github.com/WordPress/gutenberg/pull/46187)) +- Resizable Box: Avoid paint on resizable-box handles. ([46196](https://github.com/WordPress/gutenberg/pull/46196)) +- ListView: Avoid paint on list view item hover. ([46188](https://github.com/WordPress/gutenberg/pull/46188)) + +#### Code Quality +- Lodash: Refactor `blocks` away from `_.find()`. ([46428](https://github.com/WordPress/gutenberg/pull/46428)) +- Lodash: Refactor `core-data` away from `_.find()`. ([46468](https://github.com/WordPress/gutenberg/pull/46468)) +- Lodash: Refactor `edit-site` away from `_.find()`. ([46539](https://github.com/WordPress/gutenberg/pull/46539)) +- Lodash: Refactor away from `_.orderBy()`. ([45146](https://github.com/WordPress/gutenberg/pull/45146)) +- Lodash: Refactor block library away from `_.find()`. ([46430](https://github.com/WordPress/gutenberg/pull/46430)) +- Remove usage of get_default_block_editor_settings. ([46112](https://github.com/WordPress/gutenberg/pull/46112)) + +#### Post Editor +- Lodash: Refactor editor away from `_.find()`. ([46464](https://github.com/WordPress/gutenberg/pull/46464)) +- Lodash: Refactor post editor away from `_.find()`. ([46432](https://github.com/WordPress/gutenberg/pull/46432)) + +#### Block Editor +- Avoid paint on inserter animation. ([46185](https://github.com/WordPress/gutenberg/pull/46185)) +- Improve inserter search performance. ([46153](https://github.com/WordPress/gutenberg/pull/46153)) +- Block Editor: Refactor the "order" state in the block editor reducer to use a map instead of a plain object. ([46221](https://github.com/WordPress/gutenberg/pull/46221)) +- Block Editor: Refactor the block-editor parents state to use maps instead of objects. ([46225](https://github.com/WordPress/gutenberg/pull/46225)) +- Refactor the block-editor "tree" state to use maps instead of objects. ([46229](https://github.com/WordPress/gutenberg/pull/46229)) +- Refactor the block-editor byClientId redux state to use maps instead of plain objects. ([46204](https://github.com/WordPress/gutenberg/pull/46204)) +- Fix typing performance issue for container blocks. ([46527](https://github.com/WordPress/gutenberg/pull/46527)) + +#### Testing +- E2E: Fix performance tests by making inserter search container waiting optional. ([46268](https://github.com/WordPress/gutenberg/pull/46268)) + +#### Mobile +- Columns mobile block: Avoid returning unstable innerWidths from useSelect. ([46403](https://github.com/WordPress/gutenberg/pull/46403)) + +### Experiments + +#### Block Library +- Navigation List View: Remove empty cell when there is no edit button. ([46439](https://github.com/WordPress/gutenberg/pull/46439)) + +#### Web Fonts +- WP Webfonts: Avoid duplicated font families if the font family name was defined using fallback values. ([46378](https://github.com/WordPress/gutenberg/pull/46378)) + +### Documentation +- Adds clarifications and clears up inaccuracies. ([46283](https://github.com/WordPress/gutenberg/pull/46283)) +- Adds details of how to find the .zip file. ([46305](https://github.com/WordPress/gutenberg/pull/46305)) +- Doc: Fix description and documentation for link color support. ([46405](https://github.com/WordPress/gutenberg/pull/46405)) +- Docs: Add missing useState import in BorderBoxControl documentation. ([42067](https://github.com/WordPress/gutenberg/pull/42067)) +- Docs: Add missing useState import in color picker docs. ([42069](https://github.com/WordPress/gutenberg/pull/42069)) +- Docs: Add missing useState import in confirm dialog docs. ([42071](https://github.com/WordPress/gutenberg/pull/42071)) +- Docs: Adds reminder to use Node.js v14 in Quick Start. ([46216](https://github.com/WordPress/gutenberg/pull/46216)) +- Docs: Fix missing link to `primitives` package. ([46290](https://github.com/WordPress/gutenberg/pull/46290)) +- Docs: Update reference to IE 11. ([46296](https://github.com/WordPress/gutenberg/pull/46296)) + +### Code Quality +- Block Editor: Fix `no-node-access` violations in `BlockPreview`. ([46409](https://github.com/WordPress/gutenberg/pull/46409)) +- Block Editor: Fix `no-node-access` violations in `BlockSelectionClearer`. ([46408](https://github.com/WordPress/gutenberg/pull/46408)) +- Columns mobile edit: Remove unused updateBlockSettings action bind. ([46455](https://github.com/WordPress/gutenberg/pull/46455)) +- ESLint: Fix warning in `getBlockAttribute` documentation. ([46500](https://github.com/WordPress/gutenberg/pull/46500)) +- List View: Use default parameters instead of defaultProps. ([46266](https://github.com/WordPress/gutenberg/pull/46266)) +- Removed: Remove small APIs marked to be removed in WP 6.2. ([46106](https://github.com/WordPress/gutenberg/pull/46106)) +- Site Editor: Remove invalid CSS. ([46288](https://github.com/WordPress/gutenberg/pull/46288)) + +#### Block Library +- Group Block: Remove placeholder leftovers. ([46423](https://github.com/WordPress/gutenberg/pull/46423)) +- Group: Remove unnecessary 'useCallback'. ([46418](https://github.com/WordPress/gutenberg/pull/46418)) +- Navigation Block: Add tests for Nav block uncontrolled blocks dirty state checking. ([46329](https://github.com/WordPress/gutenberg/pull/46329)) +- Navigation Block: Update attribute test for `are-blocks-dirty.js`. ([46355](https://github.com/WordPress/gutenberg/pull/46355)) +- Page List Block: Move shared "convert" description to constant. ([46368](https://github.com/WordPress/gutenberg/pull/46368)) +- Page List Block: Simplify Page List convert to links function API. ([46365](https://github.com/WordPress/gutenberg/pull/46365)) +- Query: Cleanup variation picker component. ([46424](https://github.com/WordPress/gutenberg/pull/46424)) +- RNMobile: Add an inline comment to clarify usage of 'hard' limit vs. unbounded query. ([46245](https://github.com/WordPress/gutenberg/pull/46245)) +- Shared standard Link UI component between Nav Link and Submenu blocks. ([46370](https://github.com/WordPress/gutenberg/pull/46370)) +- Template Parts: Remove unnecessary 'useCallback'. ([46420](https://github.com/WordPress/gutenberg/pull/46420)) + +#### Components +- AlignmentMatrixControl: Refactor to TypeScript. ([46162](https://github.com/WordPress/gutenberg/pull/46162)) +- Also ignore `no-node-access` for some components. ([46501](https://github.com/WordPress/gutenberg/pull/46501)) +- Fix `no-node-access` violations in `FocalPointPicker` tests. ([46312](https://github.com/WordPress/gutenberg/pull/46312)) +- Fix `no-node-access` violations in `Popover`. ([46311](https://github.com/WordPress/gutenberg/pull/46311)) +- Fix `no-node-access` violations in `Theme`. ([46310](https://github.com/WordPress/gutenberg/pull/46310)) +- Fix `no-node-access` violations in `ToolsPanel` tests. ([46313](https://github.com/WordPress/gutenberg/pull/46313)) +- withFilters: Use 'act' from React Testing Library. ([46237](https://github.com/WordPress/gutenberg/pull/46237)) + +#### Data Layer +- Data: Add ability to subscribe to one store, remove __unstableSubscribeStore. ([45513](https://github.com/WordPress/gutenberg/pull/45513)) +- ESLint: Fix warnings in the data package. ([46499](https://github.com/WordPress/gutenberg/pull/46499)) + +#### Global Styles +- Add "custom-css" as an acceptable value in the documentation for gutenberg_get_global_stylesheet. ([46493](https://github.com/WordPress/gutenberg/pull/46493)) +- PaletteEdit: Add changelog. ([46095](https://github.com/WordPress/gutenberg/pull/46095)) + +#### Block Editor +- Inserter: Update mobile tab navigation styles. ([46186](https://github.com/WordPress/gutenberg/pull/46186)) + +#### Layout +- Clarify inline comment about switching to `safecss_filter_attr`. ([46061](https://github.com/WordPress/gutenberg/pull/46061)) + +### Tools + +#### Build Tooling +- Adds Github Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247)) +- Prevent api-fetch and core-data from being imported in the block editor package. ([46302](https://github.com/WordPress/gutenberg/pull/46302)) +- Serialize the map objects properly in the Redux dev tools. ([46282](https://github.com/WordPress/gutenberg/pull/46282)) + +#### Testing +- E2E: Fix flaky Block Switcher tests. ([46406](https://github.com/WordPress/gutenberg/pull/46406)) +- end-to-end tests: Add width and color test to button block. ([46452](https://github.com/WordPress/gutenberg/pull/46452)) + + + + +## Contributors + +The following contributors merged PRs in this release: + +@andrewserong @glendaviesnz + + += 14.8.0-rc.1 = + +## Changelog + +### Enhancements + +#### Block Library +- Add a current-menu-ancestor class to navigation items. ([40778](https://github.com/WordPress/gutenberg/pull/40778)) +- Page List Block: Adds a longdash tree to the parent selector. ([46336](https://github.com/WordPress/gutenberg/pull/46336)) +- Page List Block: Hide page list edit button if no pages are available. ([46331](https://github.com/WordPress/gutenberg/pull/46331)) +- Reusable block: Pluralize the message "Convert to regular blocks" depending on the number of blocks contained. ([45819](https://github.com/WordPress/gutenberg/pull/45819)) +- Add page list to Link UI transforms in Nav block. ([46426](https://github.com/WordPress/gutenberg/pull/46426)) +- Heading Block: Don't rely on the experimental selector anymore. ([46284](https://github.com/WordPress/gutenberg/pull/46284)) +- Media & Text Block: Create undo history when media width is changed. ([46084](https://github.com/WordPress/gutenberg/pull/46084)) +- Navigation block: Add location->primary to fallback nav creation for classic menus. ([45976](https://github.com/WordPress/gutenberg/pull/45976)) +- Navigation block: Update fallback nav creation to the most recently created menu. ([46286](https://github.com/WordPress/gutenberg/pull/46286)) +- Navigation: Add a 'open list view' button. ([46335](https://github.com/WordPress/gutenberg/pull/46335)) +- Navigation: Removes the header from the navigation list view in the experiment. ([46070](https://github.com/WordPress/gutenberg/pull/46070)) +- Page List: Add convert panel to Inspector Controls when within Nav block. ([46352](https://github.com/WordPress/gutenberg/pull/46352)) +- Page List: Prevent users from adding inner blocks to Page List. ([46269](https://github.com/WordPress/gutenberg/pull/46269)) +- Query: Remove color block supports. ([46147](https://github.com/WordPress/gutenberg/pull/46147)) +- Table block: Make `figcaption` styles consistent between editor and front end. ([46172](https://github.com/WordPress/gutenberg/pull/46172)) +- List/quote: Unwrap inner block when pressing Backspace at start. ([45075](https://github.com/WordPress/gutenberg/pull/45075)) + +#### Inspector Controls +- Sidebar Tabs: Refine the use of inspector tabs and disable filters for Nav blocks. ([46346](https://github.com/WordPress/gutenberg/pull/46346)) +- Sidebar Tabs: Use editor settings to override display. ([46321](https://github.com/WordPress/gutenberg/pull/46321)) +- Summary panel: Try improving spacing and grid. ([46267](https://github.com/WordPress/gutenberg/pull/46267)) + +#### Global Styles +- Add Style Book to Global Styles. ([45960](https://github.com/WordPress/gutenberg/pull/45960)) +- Add block preview component in global styles. ([45719](https://github.com/WordPress/gutenberg/pull/45719)) +- Move border from layout to own menu. ([45995](https://github.com/WordPress/gutenberg/pull/45995)) +- Add a css style to theme.json to allow setting of custom css strings. ([46255](https://github.com/WordPress/gutenberg/pull/46255)) +- Expose before filter hook in useSettings for injecting block settings in the editor. ([45089](https://github.com/WordPress/gutenberg/pull/45089)) +- Global styles: Add custom CSS panel to site editor. ([46141](https://github.com/WordPress/gutenberg/pull/46141)) + +#### Site Editor +- Allow adding new templates and template parts directly from the sidebar. ([46458](https://github.com/WordPress/gutenberg/pull/46458)) +- Synchronize the sidebar state in the URL. ([46433](https://github.com/WordPress/gutenberg/pull/46433)) +- Try template drill down on the shell sidebar (browse mode). ([45100](https://github.com/WordPress/gutenberg/pull/45100)) + +#### Block Editor +- Update the synced block hover styles in Inserter. ([46442](https://github.com/WordPress/gutenberg/pull/46442)) +- Add new selector getLastInsertedBlockClientId. ([46531](https://github.com/WordPress/gutenberg/pull/46531)) +- Block editor: Hide fixed contextual toolbar. ([46298](https://github.com/WordPress/gutenberg/pull/46298)) +- Inserter: Pattern title tooltip. ([46419](https://github.com/WordPress/gutenberg/pull/46419)) +- useNestedSettingsUpdate: Prevent unneeded syncing of falsy templateLock values. ([46357](https://github.com/WordPress/gutenberg/pull/46357)) +- Design: Augmented shadows for modals and popovers. ([46228](https://github.com/WordPress/gutenberg/pull/46228)) + +#### Components +- Tabs: Try a simpler tab focus style, alt. ([46276](https://github.com/WordPress/gutenberg/pull/46276)) +- BaseControl: Add convenience hook to generate id-related props. ([46170](https://github.com/WordPress/gutenberg/pull/46170)) +- Dashicon: Refactor to TypeScript. ([45924](https://github.com/WordPress/gutenberg/pull/45924)) +- Lighten borders to gray-600. ([46252](https://github.com/WordPress/gutenberg/pull/46252)) +- Popover: Check positioning by adding and testing is-positioned class. ([46429](https://github.com/WordPress/gutenberg/pull/46429)) + +### Icons +- Icons: Update the border icon. ([46264](https://github.com/WordPress/gutenberg/pull/46264)) + +#### Testing +- Tests: Fix `toBePositionedPopover` matcher message function. ([46239](https://github.com/WordPress/gutenberg/pull/46239)) + +#### Accessibility +- Reorganize the site editor to introduce Browse Mode. ([44770](https://github.com/WordPress/gutenberg/pull/44770)) + +#### Plugin +- Update the Gutenberg plugin to require at least the WP 6.0 version. ([46102](https://github.com/WordPress/gutenberg/pull/46102)) +- PHP: Backport changes from core theme resolver. ([46250](https://github.com/WordPress/gutenberg/pull/46250)) +- Update: Move gutenberg_register_core_block_patterns from 6.1 to 6.2. ([46249](https://github.com/WordPress/gutenberg/pull/46249)) +- Upgrade React packages to v18. ([45235](https://github.com/WordPress/gutenberg/pull/45235)) + +#### Themes +- Empty Theme: Add the `$schema` property in `theme.json` and rename template directories. ([46300](https://github.com/WordPress/gutenberg/pull/46300)) + +#### Mobile +- Mobile: Disable Unsupported Block Editor Tests (Android). ([46542](https://github.com/WordPress/gutenberg/pull/46542)) +- Mobile: Inserter - Remove `.done()` usage. ([46460](https://github.com/WordPress/gutenberg/pull/46460)) +- Mobile: Update Heading block end-to-end test. ([46220](https://github.com/WordPress/gutenberg/pull/46220)) +- Mobile: Updates packages to not use Git HTTPS URLs. ([46422](https://github.com/WordPress/gutenberg/pull/46422)) + +### Bug Fixes + +#### Block Library +- Fix Nav Submenu block Link UI text control. ([46243](https://github.com/WordPress/gutenberg/pull/46243)) +- Fix auto Nav menu creation due to page list inner blocks. ([46223](https://github.com/WordPress/gutenberg/pull/46223)) +- Handle innerContent too when removing innerBlocks. ([46377](https://github.com/WordPress/gutenberg/pull/46377)) +- Image Block: Ensure drag handle matches cursor position when resizing a center aligned image. ([46497](https://github.com/WordPress/gutenberg/pull/46497)) +- Navigation Block: Add social link singular to list of blocks to be allowed. ([46374](https://github.com/WordPress/gutenberg/pull/46374)) +- Navigation Block: Fixes adding a submenu. ([46364](https://github.com/WordPress/gutenberg/pull/46364)) +- Navigation Block: Prevent circular references in navigation block rendering. ([46387](https://github.com/WordPress/gutenberg/pull/46387)) +- Navigation Block: Recursively remove Navigation block’s from appearing inside Navigation block on front of site. ([46279](https://github.com/WordPress/gutenberg/pull/46279)) +- Navigation link: Use stripHTML. ([46317](https://github.com/WordPress/gutenberg/pull/46317)) +- Page List Block: Fix error loading page list parent options. ([46327](https://github.com/WordPress/gutenberg/pull/46327)) +- Query Loop Block: Add migration of colors to v2 deprecation. ([46522](https://github.com/WordPress/gutenberg/pull/46522)) +- Site Logo: Correctly set the image's natural height and width. ([46214](https://github.com/WordPress/gutenberg/pull/46214)) +- Strip markup from link label data in inspector. ([46171](https://github.com/WordPress/gutenberg/pull/46171)) +- Template Parts: Fix modal search stacking context. ([46421](https://github.com/WordPress/gutenberg/pull/46421)) +- Video: Avoid an error when removal is locked. ([46324](https://github.com/WordPress/gutenberg/pull/46324)) +- Layout child fixed size should not be fixed by default and should always have a value set. ([46139](https://github.com/WordPress/gutenberg/pull/46139)) + +#### Blocks +- Paste handler: Remove styles on inline paste. ([46402](https://github.com/WordPress/gutenberg/pull/46402)) +- Improve performance of gutenberg_render_layout_support_flag. ([46074](https://github.com/WordPress/gutenberg/pull/46074)) + +#### Global Styles +- Allow indirect properties when unfiltered_html is not allowed. ([46388](https://github.com/WordPress/gutenberg/pull/46388)) +- Fix Reset to defaults action by moving fills to be within context provider. ([46486](https://github.com/WordPress/gutenberg/pull/46486)) +- Fix duplication of synced block colors in CSS output. ([46297](https://github.com/WordPress/gutenberg/pull/46297)) +- Make style book label font size 11px. ([46341](https://github.com/WordPress/gutenberg/pull/46341)) +- Style Book: Clear Global Styles navigation history when selecting a block. ([46391](https://github.com/WordPress/gutenberg/pull/46391)) +- Global Styles REST API endpoint: Check custom CSS is included before attempting to validate. ([46561](https://github.com/WordPress/gutenberg/pull/46561)) +- Reverts the custom CSS to an experiment while we resolve the handling of unfiltered html capabilities. ([46663](https://github.com/WordPress/gutenberg/pull/46663)) + +#### Block Editor +- Block Editor: Fix content locked patterns. ([46494](https://github.com/WordPress/gutenberg/pull/46494)) +- Block Editor: Fix memoized pattern selector dependant arguments. ([46238](https://github.com/WordPress/gutenberg/pull/46238)) +- Block Editor: Restore draggable chip styles. ([46396](https://github.com/WordPress/gutenberg/pull/46396)) +- Block Editor: Revert deoptimization useNestedSettingsUpdate. ([46350](https://github.com/WordPress/gutenberg/pull/46350)) +- Block Editor: Fix some usages of useSelect that return unstable results. ([46226](https://github.com/WordPress/gutenberg/pull/46226)) +- useInnerBlockTemplateSync: Cancel template sync on innerBlocks change or unmount. ([46307](https://github.com/WordPress/gutenberg/pull/46307)) + +#### Patterns +- Add new pattern categories. ([46144](https://github.com/WordPress/gutenberg/pull/46144)) +- Block Editor: Add initial view mode in `BlockPatternSetup`. ([46399](https://github.com/WordPress/gutenberg/pull/46399)) + +#### Site Editor +- Do not remount iframe. ([46431](https://github.com/WordPress/gutenberg/pull/46431)) +- Fix the top bar 'exit' animation. ([46533](https://github.com/WordPress/gutenberg/pull/46533)) +- Keep edited entity in sync when Editor canvas isn't mounted. ([46524](https://github.com/WordPress/gutenberg/pull/46524)) +- [Site Editor]: Add default white background for themes with no `background color` set. ([46314](https://github.com/WordPress/gutenberg/pull/46314)) + +#### Components +- InputControl: Fix `Flex` wrapper usage. ([46213](https://github.com/WordPress/gutenberg/pull/46213)) +- Modal: Fix unexpected modal closing in IME Composition. ([46453](https://github.com/WordPress/gutenberg/pull/46453)) +- MaybeCategoryPanel: Avoid 403 requests for users with low permissions. ([46349](https://github.com/WordPress/gutenberg/pull/46349)) +- Rich text: Add button to clear unknown format. ([44086](https://github.com/WordPress/gutenberg/pull/44086)) + +#### Document Settings +- Fix template title in `summary` panel and requests for low privileged users. ([46304](https://github.com/WordPress/gutenberg/pull/46304)) +- Permalink: Hide edit field for users without publishing capabilities. ([46361](https://github.com/WordPress/gutenberg/pull/46361)) + +#### Patterns +- Content lock: Make filter hook namespace unique. ([46344](https://github.com/WordPress/gutenberg/pull/46344)) + +#### Layout +- Child Layout controls: Fix help text for height. ([46319](https://github.com/WordPress/gutenberg/pull/46319)) + +#### Widgets Editor +- Shortcuts: Add Ctrl+Y for redo to all editor instances on Windows. ([43392](https://github.com/WordPress/gutenberg/pull/43392)) + +#### Block API +- HTML block: Fix parsing. ([27268](https://github.com/WordPress/gutenberg/pull/27268)) + +#### Mobile +- Social Links mobile test: Wait for URL bottom sheet to appear. ([46308](https://github.com/WordPress/gutenberg/pull/46308)) + +### Performance + +#### Components +- Avoid paint on popover when hovering content. ([46201](https://github.com/WordPress/gutenberg/pull/46201)) +- CircularOption: Avoid paint on circular option hover. ([46197](https://github.com/WordPress/gutenberg/pull/46197)) +- Lodash: Replace `_.isEqual()` with `fastDeepEqual`. ([46200](https://github.com/WordPress/gutenberg/pull/46200)) +- Popover: Avoid paint on popovers when scrolling. ([46187](https://github.com/WordPress/gutenberg/pull/46187)) +- Resizable Box: Avoid paint on resizable-box handles. ([46196](https://github.com/WordPress/gutenberg/pull/46196)) +- ListView: Avoid paint on list view item hover. ([46188](https://github.com/WordPress/gutenberg/pull/46188)) + +#### Code Quality +- Lodash: Refactor `blocks` away from `_.find()`. ([46428](https://github.com/WordPress/gutenberg/pull/46428)) +- Lodash: Refactor `core-data` away from `_.find()`. ([46468](https://github.com/WordPress/gutenberg/pull/46468)) +- Lodash: Refactor `edit-site` away from `_.find()`. ([46539](https://github.com/WordPress/gutenberg/pull/46539)) +- Lodash: Refactor away from `_.orderBy()`. ([45146](https://github.com/WordPress/gutenberg/pull/45146)) +- Lodash: Refactor block library away from `_.find()`. ([46430](https://github.com/WordPress/gutenberg/pull/46430)) +- Remove usage of get_default_block_editor_settings. ([46112](https://github.com/WordPress/gutenberg/pull/46112)) + +#### Post Editor +- Lodash: Refactor editor away from `_.find()`. ([46464](https://github.com/WordPress/gutenberg/pull/46464)) +- Lodash: Refactor post editor away from `_.find()`. ([46432](https://github.com/WordPress/gutenberg/pull/46432)) + +#### Block Editor +- Avoid paint on inserter animation. ([46185](https://github.com/WordPress/gutenberg/pull/46185)) +- Improve inserter search performance. ([46153](https://github.com/WordPress/gutenberg/pull/46153)) +- Block Editor: Refactor the "order" state in the block editor reducer to use a map instead of a plain object. ([46221](https://github.com/WordPress/gutenberg/pull/46221)) +- Block Editor: Refactor the block-editor parents state to use maps instead of objects. ([46225](https://github.com/WordPress/gutenberg/pull/46225)) +- Refactor the block-editor "tree" state to use maps instead of objects. ([46229](https://github.com/WordPress/gutenberg/pull/46229)) +- Refactor the block-editor byClientId redux state to use maps instead of plain objects. ([46204](https://github.com/WordPress/gutenberg/pull/46204)) +- Fix typing performance issue for container blocks. ([46527](https://github.com/WordPress/gutenberg/pull/46527)) + +#### Testing +- E2E: Fix performance tests by making inserter search container waiting optional. ([46268](https://github.com/WordPress/gutenberg/pull/46268)) + +#### Mobile +- Columns mobile block: Avoid returning unstable innerWidths from useSelect. ([46403](https://github.com/WordPress/gutenberg/pull/46403)) + +### Experiments + +#### Block Library +- Navigation List View: Remove empty cell when there is no edit button. ([46439](https://github.com/WordPress/gutenberg/pull/46439)) + +#### Web Fonts +- WP Webfonts: Avoid duplicated font families if the font family name was defined using fallback values. ([46378](https://github.com/WordPress/gutenberg/pull/46378)) + +### Documentation +- Adds clarifications and clears up inaccuracies. ([46283](https://github.com/WordPress/gutenberg/pull/46283)) +- Adds details of how to find the .zip file. ([46305](https://github.com/WordPress/gutenberg/pull/46305)) +- Doc: Fix description and documentation for link color support. ([46405](https://github.com/WordPress/gutenberg/pull/46405)) +- Docs: Add missing useState import in BorderBoxControl documentation. ([42067](https://github.com/WordPress/gutenberg/pull/42067)) +- Docs: Add missing useState import in color picker docs. ([42069](https://github.com/WordPress/gutenberg/pull/42069)) +- Docs: Add missing useState import in confirm dialog docs. ([42071](https://github.com/WordPress/gutenberg/pull/42071)) +- Docs: Adds reminder to use Node.js v14 in Quick Start. ([46216](https://github.com/WordPress/gutenberg/pull/46216)) +- Docs: Fix missing link to `primitives` package. ([46290](https://github.com/WordPress/gutenberg/pull/46290)) +- Docs: Update reference to IE 11. ([46296](https://github.com/WordPress/gutenberg/pull/46296)) + +### Code Quality +- Block Editor: Fix `no-node-access` violations in `BlockPreview`. ([46409](https://github.com/WordPress/gutenberg/pull/46409)) +- Block Editor: Fix `no-node-access` violations in `BlockSelectionClearer`. ([46408](https://github.com/WordPress/gutenberg/pull/46408)) +- Columns mobile edit: Remove unused updateBlockSettings action bind. ([46455](https://github.com/WordPress/gutenberg/pull/46455)) +- ESLint: Fix warning in `getBlockAttribute` documentation. ([46500](https://github.com/WordPress/gutenberg/pull/46500)) +- List View: Use default parameters instead of defaultProps. ([46266](https://github.com/WordPress/gutenberg/pull/46266)) +- Removed: Remove small APIs marked to be removed in WP 6.2. ([46106](https://github.com/WordPress/gutenberg/pull/46106)) +- Site Editor: Remove invalid CSS. ([46288](https://github.com/WordPress/gutenberg/pull/46288)) + +#### Block Library +- Group Block: Remove placeholder leftovers. ([46423](https://github.com/WordPress/gutenberg/pull/46423)) +- Group: Remove unnecessary 'useCallback'. ([46418](https://github.com/WordPress/gutenberg/pull/46418)) +- Navigation Block: Add tests for Nav block uncontrolled blocks dirty state checking. ([46329](https://github.com/WordPress/gutenberg/pull/46329)) +- Navigation Block: Update attribute test for `are-blocks-dirty.js`. ([46355](https://github.com/WordPress/gutenberg/pull/46355)) +- Page List Block: Move shared "convert" description to constant. ([46368](https://github.com/WordPress/gutenberg/pull/46368)) +- Page List Block: Simplify Page List convert to links function API. ([46365](https://github.com/WordPress/gutenberg/pull/46365)) +- Query: Cleanup variation picker component. ([46424](https://github.com/WordPress/gutenberg/pull/46424)) +- RNMobile: Add an inline comment to clarify usage of 'hard' limit vs. unbounded query. ([46245](https://github.com/WordPress/gutenberg/pull/46245)) +- Shared standard Link UI component between Nav Link and Submenu blocks. ([46370](https://github.com/WordPress/gutenberg/pull/46370)) +- Template Parts: Remove unnecessary 'useCallback'. ([46420](https://github.com/WordPress/gutenberg/pull/46420)) + +#### Components +- AlignmentMatrixControl: Refactor to TypeScript. ([46162](https://github.com/WordPress/gutenberg/pull/46162)) +- Also ignore `no-node-access` for some components. ([46501](https://github.com/WordPress/gutenberg/pull/46501)) +- Fix `no-node-access` violations in `FocalPointPicker` tests. ([46312](https://github.com/WordPress/gutenberg/pull/46312)) +- Fix `no-node-access` violations in `Popover`. ([46311](https://github.com/WordPress/gutenberg/pull/46311)) +- Fix `no-node-access` violations in `Theme`. ([46310](https://github.com/WordPress/gutenberg/pull/46310)) +- Fix `no-node-access` violations in `ToolsPanel` tests. ([46313](https://github.com/WordPress/gutenberg/pull/46313)) +- withFilters: Use 'act' from React Testing Library. ([46237](https://github.com/WordPress/gutenberg/pull/46237)) + +#### Data Layer +- Data: Add ability to subscribe to one store, remove __unstableSubscribeStore. ([45513](https://github.com/WordPress/gutenberg/pull/45513)) +- ESLint: Fix warnings in the data package. ([46499](https://github.com/WordPress/gutenberg/pull/46499)) + +#### Global Styles +- Add "custom-css" as an acceptable value in the documentation for gutenberg_get_global_stylesheet. ([46493](https://github.com/WordPress/gutenberg/pull/46493)) +- PaletteEdit: Add changelog. ([46095](https://github.com/WordPress/gutenberg/pull/46095)) + +#### Block Editor +- Inserter: Update mobile tab navigation styles. ([46186](https://github.com/WordPress/gutenberg/pull/46186)) + +#### Layout +- Clarify inline comment about switching to `safecss_filter_attr`. ([46061](https://github.com/WordPress/gutenberg/pull/46061)) + +### Tools + +#### Build Tooling +- Adds Github Action to validate Gradle Wrapper. ([46247](https://github.com/WordPress/gutenberg/pull/46247)) +- Prevent api-fetch and core-data from being imported in the block editor package. ([46302](https://github.com/WordPress/gutenberg/pull/46302)) +- Serialize the map objects properly in the Redux dev tools. ([46282](https://github.com/WordPress/gutenberg/pull/46282)) + +#### Testing +- E2E: Fix flaky Block Switcher tests. ([46406](https://github.com/WordPress/gutenberg/pull/46406)) +- end-to-end tests: Add width and color test to button block. ([46452](https://github.com/WordPress/gutenberg/pull/46452)) + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @corentin-gautier: Avoid paint on popover when hovering content. ([46201](https://github.com/WordPress/gutenberg/pull/46201)) +- @ingeniumed: Expose before filter hook in useSettings for injecting block settings in the editor. ([45089](https://github.com/WordPress/gutenberg/pull/45089)) +- @janusqa: Reusable block: Pluralize the message "Convert to regular blocks" depending on the number of blocks contained. ([45819](https://github.com/WordPress/gutenberg/pull/45819)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @ajlende @andrewserong @aristath @chad1008 @chintu51 @corentin-gautier @derekblank @draganescu @ellatrix @geriux @getdave @glendaviesnz @hideokamoto @ingeniumed @jameskoster @janusqa @jasmussen @jffng @jorgefilipecosta @jsnajdr @madhusudhand @MaggieCabrera @Mamaduka @matiasbenedetto @mburridge @mikachan @mirka @noisysocks @ntsekouras @oandregal @oguzkocer @ramonjd @scruffian @SiobhyB @spacedmonkey @t-hamano @talldan @tellthemachines @tyxla @WunderBart @youknowriad + + += 14.7.3 = + +## Changelog + +### Bug fixes + +- Fix typing performance issue for container blocks. ([46527](https://github.com/WordPress/gutenberg/pull/46527)) + +## Contributors + +The following contributors merged PRs in this release: + +@youknowriad + + += 14.7.2 = + + + +## Changelog + +### Bug Fixes + +- Fix fatal error when using the plugin with PHP 8 and WordPress 6.0 by checking if block_type asset properties are set. ([46488](https://github.com/WordPress/gutenberg/pull/46488)) + + +## First time contributors + +The following PRs were merged by first time contributors: + + + +## Contributors + +The following contributors merged PRs in this release: + +@noahtallen + + += 14.7.1 = + + + +## Changelog + +### Bug Fixes + +#### Layout +- Only pass parentLayout to block edit if not empty. ([46390](https://github.com/WordPress/gutenberg/pull/46390)) + +## Contributors + +The following contributors merged PRs in this release: + +@tellthemachines + + += 14.7.0 = + + + +## Changelog + +### Enhancements + +#### Style Engine +- Style engine: Trim multiple selector strings. ([45873](https://github.com/WordPress/gutenberg/pull/45873)) + +#### Block Library +- Heading Block: Add a wp-block-heading CSS class. ([42122](https://github.com/WordPress/gutenberg/pull/42122)) +- Nav Block: Clarify explanation of how 'Convert to Links' works in Page List block. ([45394](https://github.com/WordPress/gutenberg/pull/45394)) +- Nav Block: Add label field to navigation link and navigation submenu. ([45964](https://github.com/WordPress/gutenberg/pull/45964)) +- Nav Block: Add link URL to the navigation submenu inspector controls. ([45816](https://github.com/WordPress/gutenberg/pull/45816)) +- Nav Block: Fix for navigation anchor links to close modal. ([45829](https://github.com/WordPress/gutenberg/pull/45829)) +- Template Part Block: Colorize template parts and Reusable blocks. ([45473](https://github.com/WordPress/gutenberg/pull/45473)) +- List: Allow pasting pre/code. ([45016](https://github.com/WordPress/gutenberg/pull/45016)) +- Page List: Enable page list to expand in list view. ([45776](https://github.com/WordPress/gutenberg/pull/45776)) +- Page List: Add a starting page for page list block's hierarchy. ([45861](https://github.com/WordPress/gutenberg/pull/45861)) +- Page List Item: Hide edit button. ([46163](https://github.com/WordPress/gutenberg/pull/46163)) +- Site Logo: Apply width to logo container in editor. ([45821](https://github.com/WordPress/gutenberg/pull/45821)) +- Table Block: Support colspan attribute in table HTML, including when pasting. ([45981](https://github.com/WordPress/gutenberg/pull/45981)) + +#### Components +- Add themeable background color. ([45466](https://github.com/WordPress/gutenberg/pull/45466)) +- Autocomplete: Only show UI on user input. ([45904](https://github.com/WordPress/gutenberg/pull/45904)) +- Bump `DateTimePicker` deprecated prop removal version. ([46006](https://github.com/WordPress/gutenberg/pull/46006)) +- ComboboxControl: Add new opt-in prop. ([45796](https://github.com/WordPress/gutenberg/pull/45796)) +- FocalPointPicker: Add new opt-in prop. ([45958](https://github.com/WordPress/gutenberg/pull/45958)) +- Global styles: Add onChange actions to color palette items. ([45681](https://github.com/WordPress/gutenberg/pull/45681)) +- InputControl: Add `help` prop. ([45931](https://github.com/WordPress/gutenberg/pull/45931)) +- RangeControl: Remove margin override and add new opt-in prop. ([45985](https://github.com/WordPress/gutenberg/pull/45985)) +- SearchControl: Remove margin overrides and add new opt-in prop. ([46081](https://github.com/WordPress/gutenberg/pull/46081)) +- Storybook: Opt in to story store v7. ([42486](https://github.com/WordPress/gutenberg/pull/42486)) +- ToggleControl text overflows when it has a long label. ([45962](https://github.com/WordPress/gutenberg/pull/45962)) +- useControlledValue: Let TypeScript infer the return type. ([46164](https://github.com/WordPress/gutenberg/pull/46164)) + +#### Inspector Controls +- Sidebar: Add list view tab for Navigation block et al. ([45483](https://github.com/WordPress/gutenberg/pull/45483)) +- Sidebar: Only render sidebar tabs possessing items to display. ([45991](https://github.com/WordPress/gutenberg/pull/45991)) +- Sidebar: Rename appearance tab to styles. ([46027](https://github.com/WordPress/gutenberg/pull/46027)) +- Sidebar: Split block tools into menu, settings, and appearance tabs. ([45005](https://github.com/WordPress/gutenberg/pull/45005)) + +#### Design Tools +- Min Height: Add height control component with slider. ([45875](https://github.com/WordPress/gutenberg/pull/45875)) +- Spacing: Make visualiser appear on focus. ([46096](https://github.com/WordPress/gutenberg/pull/46096)) + +#### Block Editor +- [Inserter]: Replace text in `Reusable` tab with an icon. ([45851](https://github.com/WordPress/gutenberg/pull/45851)) +- [Inserter]: Update pattern explorer button css. ([45735](https://github.com/WordPress/gutenberg/pull/45735)) +- [Inserter]: Add media tab. ([44918](https://github.com/WordPress/gutenberg/pull/44918)) + +#### Patterns +- [Pattern Directory]: Add categories endpoint. ([45749](https://github.com/WordPress/gutenberg/pull/45749)) +- [Patterns]: Update pattern category descriptions. ([46005](https://github.com/WordPress/gutenberg/pull/46005)) + +#### Nested / Inner Blocks +- Mark applying block templates not persistent. ([45843](https://github.com/WordPress/gutenberg/pull/45843)) + +#### Rich Text +- Create undo level before autocorrect. ([45670](https://github.com/WordPress/gutenberg/pull/45670)) + +#### Layout +- Add Layout controls to children of Flex layout blocks. ([45364](https://github.com/WordPress/gutenberg/pull/45364)) + + +### Bug Fixes + +#### Preferences +- Disable distraction free prefference effects on small viewports. ([45591](https://github.com/WordPress/gutenberg/pull/45591)) + +#### Block Library +- List Block: Fixed a bug that List block attributes were reset in 6.1.1. ([46000](https://github.com/WordPress/gutenberg/pull/46000)) +- Gallery: Use unbound query when fetching image details. ([46143](https://github.com/WordPress/gutenberg/pull/46143)) +- Heading: Add block classname deprecation. ([46138](https://github.com/WordPress/gutenberg/pull/46138)) +- Page List: If no parent page is set, still render all children. ([45967](https://github.com/WordPress/gutenberg/pull/45967)) +- Page List: Render the children correctly in the editor. ([46165](https://github.com/WordPress/gutenberg/pull/46165)) +- Post Author: Avoid errors when the user avatars are disabled. ([45989](https://github.com/WordPress/gutenberg/pull/45989)) +- Nav Block: Navigation menu doesn't appear when hamburger clicked on. ([45773](https://github.com/WordPress/gutenberg/pull/45773)) + +#### Block Editor +- Fix broken Link Control hook. ([46113](https://github.com/WordPress/gutenberg/pull/46113)) +- Fix inserter tab panel content buttons' position. ([45800](https://github.com/WordPress/gutenberg/pull/45800)) +- Block editor: rich text: Return early if __experimentalUndo is not defined. ([46152](https://github.com/WordPress/gutenberg/pull/46152)) + +#### Global Styles +- Global Style Context: Consider global user styles ready if a theme has none. ([46073](https://github.com/WordPress/gutenberg/pull/46073)) +- Merged data should consider origin to return early. ([45969](https://github.com/WordPress/gutenberg/pull/45969)) + +#### Components +- Remove CircleIndicatorWrapper `focus-visible` outline. ([45758](https://github.com/WordPress/gutenberg/pull/45758)) +- `ColorPalette`: Show `Clear` button even when `colors` array is empty. ([46001](https://github.com/WordPress/gutenberg/pull/46001)) + +#### Site Editor +- Fix template list width. ([45888](https://github.com/WordPress/gutenberg/pull/45888)) +- Prevent edit-post from being loaded in edit-site. ([45895](https://github.com/WordPress/gutenberg/pull/45895)) + +#### CSS & Styling +- Fix the editor area height. ([45799](https://github.com/WordPress/gutenberg/pull/45799)) + +#### Full Site Editing +- Ensure post-featured-image block is in_the_loop() for BC with core and plugins, and to fix lazy-loading. ([45534](https://github.com/WordPress/gutenberg/pull/45534)) + +### Accessibility + +- Add "Testing Instructions for Keyboard" to PR template to encourage accessibility testing. ([45957](https://github.com/WordPress/gutenberg/pull/45957)) +- BlockVariationPicker: Remove Unnecessary ARIA Role. ([45916](https://github.com/WordPress/gutenberg/pull/45916)) +- Sidebar Tabs: Set default tab to first available. ([45998](https://github.com/WordPress/gutenberg/pull/45998)) +- `TabPanel`: Support manual tab activation. ([46004](https://github.com/WordPress/gutenberg/pull/46004)) +- - Constrained tabbing: Fix unstable behavior in firefox. ([42653](https://github.com/WordPress/gutenberg/pull/42653)) + +### Performance + +- Work on refactor away from Lodash to reduce build size continued" ([see 13.7](https://make.wordpress.org/core/2022/07/20/whats-new-in-gutenberg-13-7-20-july/)) + +#### Global Styles +- Add `WP_Object_Cache` to the `gutenberg_get_global_settings` method. ([45372](https://github.com/WordPress/gutenberg/pull/45372)) +- Global styles WP_Query. ([46043](https://github.com/WordPress/gutenberg/pull/46043)) +- Ignore cached `wp_theme_has_theme_json` when `WP_DEBUG` is enabled. ([45882](https://github.com/WordPress/gutenberg/pull/45882)) +- Make `theme.json` object caches non persistent. ([46150](https://github.com/WordPress/gutenberg/pull/46150)) +- Remove `test_global_styles_user_cpt_change_invalidates_cached_stylesheet`. ([45993](https://github.com/WordPress/gutenberg/pull/45993)) +- Update `gutenberg_get_global_stylesheet` to use `WP_Object_Cache`. ([45679](https://github.com/WordPress/gutenberg/pull/45679)) +- Update which origins are queried for `gutenberg_get_global_settings`. ([45971](https://github.com/WordPress/gutenberg/pull/45971)) + +#### Post Editor +- useBlockEditorSettings: Return const empty array to avoid rerenders. ([46117](https://github.com/WordPress/gutenberg/pull/46117)) + +#### Block Editor +- Update the attributes reducer to use a map instead of a regular object. ([46146](https://github.com/WordPress/gutenberg/pull/46146)) + + +### Experiments + +#### Block Library +- Nav Block: Add basic edit button UI to Nav block offcanvas editor. ([45815](https://github.com/WordPress/gutenberg/pull/45815)) +- Nav Block: Add submenu menu item to list view. ([45794](https://github.com/WordPress/gutenberg/pull/45794)) +- Nav Block: Alternative: Add inserter to Nav block offcanvas experiment. ([45947](https://github.com/WordPress/gutenberg/pull/45947)) +- Nav Block: Display inserter popover in offcanvas UI. ([46013](https://github.com/WordPress/gutenberg/pull/46013)) +- Nav Block: List View - Stop child item selecting a parent which is already selected. ([45860](https://github.com/WordPress/gutenberg/pull/45860)) +- Nav Block: Add simple back button to inspector controls. ([45852](https://github.com/WordPress/gutenberg/pull/45852)) +- Nav Block: Move color controls to support panel. ([46049](https://github.com/WordPress/gutenberg/pull/46049)) +- Nav Block: Enable easier drag and drop for navigation building. ([45906](https://github.com/WordPress/gutenberg/pull/45906)) +- Nav Block: Hide the create new menu button if the experiment is enabled. ([46019](https://github.com/WordPress/gutenberg/pull/46019)) +- Navigation List view: Fix incorect class. ([46129](https://github.com/WordPress/gutenberg/pull/46129)) +- Navigation List view: Include offcanvas specific styles. ([45963](https://github.com/WordPress/gutenberg/pull/45963)) +- Navigation List view: Scroll horizontally when table overflows. ([45966](https://github.com/WordPress/gutenberg/pull/45966)) + + +### Documentation + +- (docs) Document the special case of shipping point releases when new release branch already exists. ([46083](https://github.com/WordPress/gutenberg/pull/46083)) +- Added InspectorControls import to example. ([45872](https://github.com/WordPress/gutenberg/pull/45872)) +- Fix NavigableRegion README. ([45879](https://github.com/WordPress/gutenberg/pull/45879)) +- Fix link & code markdown. ([45708](https://github.com/WordPress/gutenberg/pull/45708)) +- Navigation: Adds a warning about duplicate code for the future. ([45844](https://github.com/WordPress/gutenberg/pull/45844)) +- Storybook: Add link to component folder on GitHub, retire Storysource. ([45727](https://github.com/WordPress/gutenberg/pull/45727)) +- Style Engine: Add first draft of contributing doc. ([45930](https://github.com/WordPress/gutenberg/pull/45930)) +- Update applying-styles-with-stylesheets.md. ([45925](https://github.com/WordPress/gutenberg/pull/45925)) + +### Code Quality + +#### Components +- Cleanup the BlockPreview component. ([45936](https://github.com/WordPress/gutenberg/pull/45936)) +- Convert the `Snackbar` component to TypeScript. ([45472](https://github.com/WordPress/gutenberg/pull/45472)) +- Fix ESLint violations in `ContextSystemProvider` tests. ([46010](https://github.com/WordPress/gutenberg/pull/46010)) +- Fix ESLint violations in `NoticeList` tests. ([46011](https://github.com/WordPress/gutenberg/pull/46011)) +- Fix `no-node-access` in `Grid` tests. ([45900](https://github.com/WordPress/gutenberg/pull/45900)) +- Fix `no-node-access` in `Sandbox` tests. ([45908](https://github.com/WordPress/gutenberg/pull/45908)) +- Fix `no-node-access` in `Text` tests. ([45898](https://github.com/WordPress/gutenberg/pull/45898)) +- Fix `no-node-access` in `Theme` tests. ([45896](https://github.com/WordPress/gutenberg/pull/45896)) +- Fix `no-node-access` violation in `ControlLabel` tests. ([46007](https://github.com/WordPress/gutenberg/pull/46007)) +- Fix `no-node-access` violations in `Card` tests. ([46158](https://github.com/WordPress/gutenberg/pull/46158)) +- Fix `no-node-access` violations in `Disabled` tests. ([46156](https://github.com/WordPress/gutenberg/pull/46156)) +- Improve `BoxControl` tests. ([45968](https://github.com/WordPress/gutenberg/pull/45968)) +- Improve `Dropdown` tests. ([45911](https://github.com/WordPress/gutenberg/pull/45911)) +- LinkedButton: Remove unnecessary span tag. ([46063](https://github.com/WordPress/gutenberg/pull/46063)) +- TextControl: Restrict `type` prop in TypeScript. ([45433](https://github.com/WordPress/gutenberg/pull/45433)) +- Tooltip: Add readme and unit tests for `shortcut` prop. ([46092](https://github.com/WordPress/gutenberg/pull/46092)) +- `NumberControl`: Refactor styles/tests/stories to TypeScript, replace `fireEvent` with `user-event`. ([45990](https://github.com/WordPress/gutenberg/pull/45990)) +- useBaseField: Convert component to TypeScript. ([45712](https://github.com/WordPress/gutenberg/pull/45712)) +- Small refactoring to the NavigableRegion component. ([45849](https://github.com/WordPress/gutenberg/pull/45849)) + +#### Block Library +- ESLint: Fix minor ESLint warning in `LinkUI`. ([46161](https://github.com/WordPress/gutenberg/pull/46161)) +- Fix ESLint warnings in tests. ([46034](https://github.com/WordPress/gutenberg/pull/46034)) +- Fix invalid attribute markup in core/home-link block. ([46089](https://github.com/WordPress/gutenberg/pull/46089)) +- Link UI: Destructure the props earlier in the component. ([46209](https://github.com/WordPress/gutenberg/pull/46209)) +- Navigation Link UI: Try to align both files. ([46205](https://github.com/WordPress/gutenberg/pull/46205)) +- Navigation Menu Selector: Share the functions needed for the NavigationMenuSelector. ([46053](https://github.com/WordPress/gutenberg/pull/46053)) +- Navigation: Extract components. ([45850](https://github.com/WordPress/gutenberg/pull/45850)) +- Navigation: Reduce duplicate code. ([45779](https://github.com/WordPress/gutenberg/pull/45779)) +- Navigation: Remove unused clientId prop. ([46020](https://github.com/WordPress/gutenberg/pull/46020)) +- Post Featured Image: Only get the post title when rendering alt text. ([45835](https://github.com/WordPress/gutenberg/pull/45835)) +- Reduce prop drilling in Block Card component. ([46052](https://github.com/WordPress/gutenberg/pull/46052)) +- Refactor link creation UI to standalone component/file. ([46031](https://github.com/WordPress/gutenberg/pull/46031)) +- Remove Nav block specific classes from Nav offcanvas Link UI. ([46182](https://github.com/WordPress/gutenberg/pull/46182)) +- Remove WrappedNavigationMenuSelector. ([46056](https://github.com/WordPress/gutenberg/pull/46056)) +- Update offcanvas back button to select parent Nav block and limited to Nav block only. ([46037](https://github.com/WordPress/gutenberg/pull/46037)) +- Don't check if constants set by `wp_initial_constants()` are defined. ([45979](https://github.com/WordPress/gutenberg/pull/45979)) + +#### Block Editor +- LinkControl unit tests: Use user.type to type into search field. ([45802](https://github.com/WordPress/gutenberg/pull/45802)) +- Simplify api for link UI abstraction to use a single prop for the value. ([46189](https://github.com/WordPress/gutenberg/pull/46189)) +- URLInput: Keep the search results label in sync with the results list. ([45806](https://github.com/WordPress/gutenberg/pull/45806)) +- Use @wordpress/escape-html escapeHTML in Link UI in preference to Lodash method. ([46184](https://github.com/WordPress/gutenberg/pull/46184)) + +#### Global Styles +- Cleaner logic in wp_theme_has_theme_json. ([45950](https://github.com/WordPress/gutenberg/pull/45950)) +- Remove usage of wp_get_theme. ([45770](https://github.com/WordPress/gutenberg/pull/45770)) + +#### Post Editor +- Update BlockCard to pass className instead of isSynced prop. ([46021](https://github.com/WordPress/gutenberg/pull/46021)) + +#### Full Site Editing +- Block editor: Separate content styles for the iframe. ([44298](https://github.com/WordPress/gutenberg/pull/44298)) + +### Tools + +#### Build Tooling +- Bump caniuse-lite version. ([46093](https://github.com/WordPress/gutenberg/pull/46093)) + +#### Testing +- Fix Quote block's unwrap end-to-end test. ([46168](https://github.com/WordPress/gutenberg/pull/46168)) +- Remove 'response.deleted' check. ([45992](https://github.com/WordPress/gutenberg/pull/45992)) +- Warning: Fix ESLint warnings in tests. ([46033](https://github.com/WordPress/gutenberg/pull/46033)) +- ESLint: Enable `testing-library/no-container` rule. ([46160](https://github.com/WordPress/gutenberg/pull/46160)) +- Element: Fix `no-node-access` in `createInterpolateElement`. ([45894](https://github.com/WordPress/gutenberg/pull/45894)) +- Block Editor: Fix ESLint warnings in `MediaUpload` tests. ([46035](https://github.com/WordPress/gutenberg/pull/46035)) +- Block Editor: Fix `no-node-access` in `RecursionProvider` tests. ([45902](https://github.com/WordPress/gutenberg/pull/45902)) +- Block Editor: Fix block alignment tests for React 18. ([45937](https://github.com/WordPress/gutenberg/pull/45937)) +- Block Editor: Wait for popover positioning in `MediaReplaceFlow` tests. ([45863](https://github.com/WordPress/gutenberg/pull/45863)) +- Compose: Fix 'no-container' violations in 'useDisabled' tests. ([45797](https://github.com/WordPress/gutenberg/pull/45797)) +- Compose: Fix ESLint violations in `withGlobalEvents` tests. ([46012](https://github.com/WordPress/gutenberg/pull/46012)) + +## First time contributors + +The following PRs were merged by first time contributors: + +- @albarin: Remove 'response.deleted' check. ([45992](https://github.com/WordPress/gutenberg/pull/45992)) +- @artemiomorales: Clarify explanation of how 'Convert to Links' works in Page List block. ([45394](https://github.com/WordPress/gutenberg/pull/45394)) +- @coreyworrell: Fix for navigation anchor links to close modal. ([45829](https://github.com/WordPress/gutenberg/pull/45829)) +- @devanshijoshi9: Components: ToggleControl text overflows when it has a long label. ([45962](https://github.com/WordPress/gutenberg/pull/45962)) +- @flexseth: Added InspectorControls import to example. ([45872](https://github.com/WordPress/gutenberg/pull/45872)) +- @hiyascout: Update applying-styles-with-stylesheets.md. ([45925](https://github.com/WordPress/gutenberg/pull/45925)) +- @marissa-makes: BlockVariationPicker: Remove Unnecessary ARIA Role. ([45916](https://github.com/WordPress/gutenberg/pull/45916)) +- @mpkelly: Support `colspan` attribute in `table` HTML, including when pasting. ([45981](https://github.com/WordPress/gutenberg/pull/45981)) +- @TobiasBg: Fix invalid attribute markup in core/home-link block. ([46089](https://github.com/WordPress/gutenberg/pull/46089)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @adamziel @afercia @ajlende @albarin @alexstine @andrewserong @artemiomorales @brookewp @chad1008 @ciampo @coreyworrell @ddryo @devanshijoshi9 @draganescu @ellatrix @felixarntz @flexseth @fullofcaffeine @geriux @getdave @glendaviesnz @gvgvgvijayan @hiyascout @jsnajdr @kienstra @MaggieCabrera @Mamaduka @marissa-makes @mikachan @mirka @mmtr @mpkelly @ntsekouras @oandregal @ocean90 @oguzkocer @ramonjd @scruffian @SiobhyB @spacedmonkey @stokesman @t-hamano @tellthemachines @TobiasBg @tyxla @walbo @youknowriad + + += 14.6.1 = + +## Changelog + +### Fixes + +#### Global Styles +- Fix the `upgrader_process_complete` hook for `wp_theme_has_theme_json`. ([45881](https://github.com/WordPress/gutenberg/pull/45881)) +- Update `wp_theme_has_theme_json` to use `WP_Object_Cache`. ([45543](https://github.com/WordPress/gutenberg/pull/45543)) + +### Bug Fixes +- Tag Processor: Prevent bugs from pre-PHP8 strspn/strcspn behavior. ([45822](https://github.com/WordPress/gutenberg/pull/45822)) + +## Contributors + +The following contributors merged PRs in this release: + +@oandregal @dmsnell + + + += 14.6.0 = + +## Changelog + +### Enhancements + +#### Block Library + +- Latest posts: Add color support. ([41874](https://github.com/WordPress/gutenberg/pull/41874)) +- Latest posts and latest comments: Add spacing support. ([45110](https://github.com/WordPress/gutenberg/pull/45110)) +- Navigation: Adds a list view. ([45546](https://github.com/WordPress/gutenberg/pull/45546)) +- Navigation: Add a new ManageMenusButton component. ([45782](https://github.com/WordPress/gutenberg/pull/45782)) +- Navigation: Reposition the navigation selector. ([45555](https://github.com/WordPress/gutenberg/pull/45555)) +- Navigation Link: Add the URL field to the Navigation Link inspector controls. ([45751](https://github.com/WordPress/gutenberg/pull/45751)) +- Author: Make the Author selector display all users instead of just 10. ([45640](https://github.com/WordPress/gutenberg/pull/45640)) +- Columns: Add transform to unwrap the contents. ([45666](https://github.com/WordPress/gutenberg/pull/45666)) +- Read More: Add aria-label and screen reader text. ([45490](https://github.com/WordPress/gutenberg/pull/45490)) +- Group: Use a variation picker in the placeholder. ([43496](https://github.com/WordPress/gutenberg/pull/43496)) + +#### Components + +- Use new theming accent color in all components. ([45289](https://github.com/WordPress/gutenberg/pull/45289)) +- CheckboxControl: Replace margin overrides with new opt-in prop. ([45434](https://github.com/WordPress/gutenberg/pull/45434)) +- FocalPointPicker: Update the design of the focal point handle. ([45053](https://github.com/WordPress/gutenberg/pull/45053)) +- FontSizePicker: Update hint text to match the design. ([44966](https://github.com/WordPress/gutenberg/pull/44966)) +- CheckboxControl: Move icons out of labels. ([45535](https://github.com/WordPress/gutenberg/pull/45535)) + +#### Block Editor + +- Converts paragraphs to headings with keyboard shortcuts. ([44681](https://github.com/WordPress/gutenberg/pull/44681)) +- Restore the empty paragraph inserter. ([45542](https://github.com/WordPress/gutenberg/pull/45542)) +- Transform: Select all blocks if the result has more than one block. ([45015](https://github.com/WordPress/gutenberg/pull/45015)) +- Content-only locked patterns: Move "Modify" to the ellipsis menu. ([45391](https://github.com/WordPress/gutenberg/pull/45391)) +- Patterns: Adjust the space in the pattern explorer list. ([45730](https://github.com/WordPress/gutenberg/pull/45730)) +- Update: Lock icon to outline. ([45645](https://github.com/WordPress/gutenberg/pull/45645)) +- Don't use capital case for 'Distraction free' strings. ([45538](https://github.com/WordPress/gutenberg/pull/45538)) +- Replace Justification/Orientation controls with ToggleGroupControl. ([45637](https://github.com/WordPress/gutenberg/pull/45637)) + +#### Site Editor + +- Replace FSE with Site Editor. ([45699](https://github.com/WordPress/gutenberg/pull/45699)) + +#### Design Tools + +- Add a minHeight block support under dimensions. ([45300](https://github.com/WordPress/gutenberg/pull/45300)) +- Hide the block toolbar when the spacing visualizer is showing. ([45131](https://github.com/WordPress/gutenberg/pull/45131)) + +#### Global Styles + +- Elements: Add a text decoration control to link elements. ([45643](https://github.com/WordPress/gutenberg/pull/45643)) +- Global styles: Convert preset font size values to CSS vars. ([44967](https://github.com/WordPress/gutenberg/pull/44967)) +- Fluid typography: Adjust font size min and max rules. ([45536](https://github.com/WordPress/gutenberg/pull/45536)) +- Try generating random color palettes. ([40988](https://github.com/WordPress/gutenberg/pull/40988)) + +#### Plugin + +- Updates tested up to version to 6.1. ([45630](https://github.com/WordPress/gutenberg/pull/45630)) + +#### Patterns + +- Pattern Directory API: Add support for pagination parameters. ([45293](https://github.com/WordPress/gutenberg/pull/45293)) +- Update bundled patterns compat directory. ([45620](https://github.com/WordPress/gutenberg/pull/45620)) + +### Bug Fixes + +#### Block Library + +- Change the order of the pseudo-states in the pseudo-selectors array. ([45559](https://github.com/WordPress/gutenberg/pull/45559)) +- Cover: Avoid content loss when the templateLock value is all or contentOnly. ([45632](https://github.com/WordPress/gutenberg/pull/45632)) +- Fix alignment of create new post link. ([45638](https://github.com/WordPress/gutenberg/pull/45638)) +- Fix navigation appender position to prevent obstructing its items. ([43530](https://github.com/WordPress/gutenberg/pull/43530)) +- Fix: Button block text alignment. ([45663](https://github.com/WordPress/gutenberg/pull/45663)) +- Query Pagination: Fix positioning of the next link in editor when the parent is selected. ([45651](https://github.com/WordPress/gutenberg/pull/45651)) +- Site Logo: Use the correct home URL setting. ([45476](https://github.com/WordPress/gutenberg/pull/45476)) +- Switch background color to text color on the block separator. ([44943](https://github.com/WordPress/gutenberg/pull/44943)) +- Table Block: Apply borders and padding on both front end and editor. ([45069](https://github.com/WordPress/gutenberg/pull/45069)) +- Table block: Fix error in margin value. ([45674](https://github.com/WordPress/gutenberg/pull/45674)) +- Template Part Block: Update block isActive method. ([45672](https://github.com/WordPress/gutenberg/pull/45672)) +- Navigation: Fix overflowing menu name in the navigation selector dropdown. ([45647](https://github.com/WordPress/gutenberg/pull/45647)) + +#### Accessibility + +- Fix focus return when closing the Post publish panel. ([45623](https://github.com/WordPress/gutenberg/pull/45623)) +- Fix navigate regions backwards for macOS Firefox and Safari. ([45019](https://github.com/WordPress/gutenberg/pull/45019)) +- Fix the Save buttons labeling and tooltip. ([43952](https://github.com/WordPress/gutenberg/pull/43952)) +- Fix the navigate regions focus style. ([45369](https://github.com/WordPress/gutenberg/pull/45369)) +- Fix: Contrast checker appears unexpectedly on some blocks. ([45639](https://github.com/WordPress/gutenberg/pull/45639)) +- Fix: Contrast checker does not update properly. ([45686](https://github.com/WordPress/gutenberg/pull/45686)) + +#### Components + +- Autocomplete: Fix unexpected block insertion during IME composition. ([45510](https://github.com/WordPress/gutenberg/pull/45510)) +- Fix ESLint warning for Dashicon. ([45795](https://github.com/WordPress/gutenberg/pull/45795)) +- FormTokenField: Fix duplicate input in IME composition. ([45607](https://github.com/WordPress/gutenberg/pull/45607)) +- Making size prop work for icon components using dash icon strings. ([45593](https://github.com/WordPress/gutenberg/pull/45593)) +- ToolsPanel: Prevent calling deselect when panel remounts. ([45673](https://github.com/WordPress/gutenberg/pull/45673)) +- Color Picker: Prevent all number fields to become 0 when one of them is an empty string. ([45649](https://github.com/WordPress/gutenberg/pull/45649)) +- ToggleGroupControl: Only show the enclosing border when `isBlock`. ([45492](https://github.com/WordPress/gutenberg/pull/45492)) +- Autocomplete: Check key events more strictly in IME composition. ([45626](https://github.com/WordPress/gutenberg/pull/45626)) + +#### CSS & Styling + +- Inherit font from theme on overlay close button. ([45635](https://github.com/WordPress/gutenberg/pull/45635)) +- Navigation: Fix font inheritance when using text menu button. ([45514](https://github.com/WordPress/gutenberg/pull/45514)) +- Remove hover style to button on dark block tools UI. ([45653](https://github.com/WordPress/gutenberg/pull/45653)) +- Remove width from block mover button focus style. ([45665](https://github.com/WordPress/gutenberg/pull/45665)) +- Site editor hover/select: Fix double border. ([45589](https://github.com/WordPress/gutenberg/pull/45589)) +- Remove duplicate output of existing classnames in layout classnames. ([45499](https://github.com/WordPress/gutenberg/pull/45499)) + +#### Post Editor + +- BlockManagerCategory: Fix styles for indeterminate. ([45564](https://github.com/WordPress/gutenberg/pull/45564)) +- Fix: Updated names from List View to Document Overview. ([45524](https://github.com/WordPress/gutenberg/pull/45524)) +- Strip HTML from Post Title when pasting multiline title containing HTML. ([35825](https://github.com/WordPress/gutenberg/pull/35825)) + +#### Site Editor + +- Decode entities in template title and description. ([45716](https://github.com/WordPress/gutenberg/pull/45716)) +- Link to homeUrl from site editor view menu. ([45475](https://github.com/WordPress/gutenberg/pull/45475)) + +#### Block Editor + +- Fix Link UI popover positioning when inspector control input is focused. ([45661](https://github.com/WordPress/gutenberg/pull/45661)) +- Paste: Fix list only paste from Google documentation. ([45498](https://github.com/WordPress/gutenberg/pull/45498)) +- Make Manage Reusable blocks match similar links. ([45641](https://github.com/WordPress/gutenberg/pull/45641))([45689](https://github.com/WordPress/gutenberg/pull/45689)) +- List View: Disable branch expansion when block editing is locked. ([45541](https://github.com/WordPress/gutenberg/pull/45541)) +- Spacing visualizer: Fix display of unexpected visualizer for certain mouse actions. ([45739](https://github.com/WordPress/gutenberg/pull/45739)) + +### Experiments + +- A list view duplicate for use in navigation list view experiment. ([45544](https://github.com/WordPress/gutenberg/pull/45544)) +- Introduce experiment for inspector based navigation editing. ([45515](https://github.com/WordPress/gutenberg/pull/45515)) + +### Documentation + +- Add missing CHANGELOG entry. ([45691](https://github.com/WordPress/gutenberg/pull/45691)) +- Change Title: How to use JavaScript with Gutenberg. ([45323](https://github.com/WordPress/gutenberg/pull/45323)) +- Docs: Update the readme for the integration test fixtures. ([45581](https://github.com/WordPress/gutenberg/pull/45581)) +- Summarize "Available commands" section and refer them it to `scripts` documentation. ([45636](https://github.com/WordPress/gutenberg/pull/45636)) +- Update applying-styles-with-stylesheets.md. ([45604](https://github.com/WordPress/gutenberg/pull/45604)) +- [create-block] Reorganized sections to provide a better learning experience of this package. ([45676](https://github.com/WordPress/gutenberg/pull/45676)) +- Change "block style variations" references to "block style". ([45650](https://github.com/WordPress/gutenberg/pull/45650)) + +### Performance + +- Lodash: Refactor away from `_.reduce()`. ([45460](https://github.com/WordPress/gutenberg/pull/45460)) +- Lodash: Refactor block editor away from `_.reduce()`. ([45455](https://github.com/WordPress/gutenberg/pull/45455)) +- Lodash: Refactor blocks away from `_.reduce()`. ([45457](https://github.com/WordPress/gutenberg/pull/45457)) +- Lodash: Refactor site editor away from `_.reduce()`. ([45459](https://github.com/WordPress/gutenberg/pull/45459)) +- Lodash: Refactor post editor away from `_.reduce()`. ([45458](https://github.com/WordPress/gutenberg/pull/45458)) +- Do not look for block variants, if not supporting block-templates. ([45362](https://github.com/WordPress/gutenberg/pull/45362)) +- List: Disable nested list drop zone so dropping list items works. ([45321](https://github.com/WordPress/gutenberg/pull/45321)) +- Use low-level cache for get_user_data_from_wp_global_styles. ([45634](https://github.com/WordPress/gutenberg/pull/45634)) +- Update: Improve performance of block template object retrieval. ([45646](https://github.com/WordPress/gutenberg/pull/45646)) + +### Code Quality + +#### Block Editor + +- Block Editor: Improve `LinkControl` tests. ([45609](https://github.com/WordPress/gutenberg/pull/45609)) +- Block Editor: Improve `ResponsiveBlockControl` tests. ([45610](https://github.com/WordPress/gutenberg/pull/45610)) +- Block Editor: Improve `ReusableBlocksTab` tests. ([45652](https://github.com/WordPress/gutenberg/pull/45652)) +- LinkControl: Suppress errors on null values. ([45742](https://github.com/WordPress/gutenberg/pull/45742)) +- Simplify ResizableEditor component. ([45578](https://github.com/WordPress/gutenberg/pull/45578)) +- Remove duplicate colon. ([45763](https://github.com/WordPress/gutenberg/pull/45763)) +- Extract the manage menus button to a shared component to reduce duplicate code. ([45769](https://github.com/WordPress/gutenberg/pull/45769)) +- Backport pseudo selector comments from core. ([45619](https://github.com/WordPress/gutenberg/pull/45619)) +- unstableSubscribeStore: Support store descriptors. ([45481](https://github.com/WordPress/gutenberg/pull/45481)) + +#### Components + +- BaseField: Remove unnecessary `.firstChild` from tests. ([45687](https://github.com/WordPress/gutenberg/pull/45687)) +- DateTime: Remove unused types. ([45615](https://github.com/WordPress/gutenberg/pull/45615)) +- Draggable: Convert component to TypeScript. ([45471](https://github.com/WordPress/gutenberg/pull/45471)) +- Fix `no-container` violations in `FormGroup` tests. ([45662](https://github.com/WordPress/gutenberg/pull/45662)) +- Fix `testing-library/no-node-access` in `TreeGrid` tests. ([45554](https://github.com/WordPress/gutenberg/pull/45554)) +- FontSizePicker: Use components instead of helper functions. ([44891](https://github.com/WordPress/gutenberg/pull/44891)) +- Improve tests for `ToggleGroupControl`. ([45627](https://github.com/WordPress/gutenberg/pull/45627)) +- MenuGroup: Convert component to TypeScript. ([45617](https://github.com/WordPress/gutenberg/pull/45617)) +- Popover: Fix exhaustive-deps warning. ([45656](https://github.com/WordPress/gutenberg/pull/45656)) +- Refactor `ItemGroup` to pass `exhaustive-deps`. ([45531](https://github.com/WordPress/gutenberg/pull/45531)) +- Refactor `useFlex` to pass `exhaustive-deps`. ([45528](https://github.com/WordPress/gutenberg/pull/45528)) +- Refactor `withNotices` to pass `exhaustive-deps`. ([45530](https://github.com/WordPress/gutenberg/pull/45530)) +- Refactor`PaletteEditListView` to ignore `exhaustive-deps`. ([45467](https://github.com/WordPress/gutenberg/pull/45467)) +- TabPanel: Fix the `exhaustive-deps` warning. ([45660](https://github.com/WordPress/gutenberg/pull/45660)) +- ToolsPanel: Fix exhaustive-deps hook warning. ([45715](https://github.com/WordPress/gutenberg/pull/45715)) +- Truncate: Remove unnecessary `.firstChild` from tests. ([45694](https://github.com/WordPress/gutenberg/pull/45694)) +- View component: Rename index.js to index.ts. ([45667](https://github.com/WordPress/gutenberg/pull/45667)) +- `ColorPalette`, `BorderBox`, `BorderBoxControl`: Polish and DRY prop types, add default values. ([45463](https://github.com/WordPress/gutenberg/pull/45463)) +- `NavigatorScreen`: Satisfy `exhaustive-deps` eslint rule. ([45648](https://github.com/WordPress/gutenberg/pull/45648)) +- Fix `useCx` story to satisfy `exhaustive-deps` eslint rule. ([45614](https://github.com/WordPress/gutenberg/pull/45614)) +- URLPopover: Use new placement prop instead of legacy position prop. ([44391](https://github.com/WordPress/gutenberg/pull/44391)) +- Tidy and minor refactor of Link UI code. ([37833](https://github.com/WordPress/gutenberg/pull/37833)) + +#### Block Library + +- Avatar: Escape the 'get_author_posts_url()'. ([45427](https://github.com/WordPress/gutenberg/pull/45427)) +- Button: Remove unnecessary 'useCallback'. ([45584](https://github.com/WordPress/gutenberg/pull/45584)) +- Make unwrapping columns slighly more efficient. ([45684](https://github.com/WordPress/gutenberg/pull/45684)) +- Simplfy handling of save of Nav block uncontrolled inner blocks. ([45517](https://github.com/WordPress/gutenberg/pull/45517)) +- Lodash: Refactor block library away from `_.reduce()`. ([45456](https://github.com/WordPress/gutenberg/pull/45456)) + +### Tools + +#### Testing + +- Components: Add `exhaustive-deps` eslint rule. ([41166](https://github.com/WordPress/gutenberg/pull/41166)) +- Fix typos in Paragraph block end-to-end tests. ([45611](https://github.com/WordPress/gutenberg/pull/45611)) +- FontSizePicker: Fix a buggy unit test. ([45529](https://github.com/WordPress/gutenberg/pull/45529)) +- Ignore warnings for `window.wp` in Playwright. ([45598](https://github.com/WordPress/gutenberg/pull/45598)) +- Migrate mentions tests to playwright. ([43064](https://github.com/WordPress/gutenberg/pull/43064)) +- Navigation Toggle unit test: Unmount synchronously to cancel popover positioning. ([45726](https://github.com/WordPress/gutenberg/pull/45726)) +- React Native unit tests: Migrate getByA11yLabel usages. ([45454](https://github.com/WordPress/gutenberg/pull/45454)) +- Unit Tests: Rewrite ReactDOM.render usages to RTL. ([45453](https://github.com/WordPress/gutenberg/pull/45453)) +- E2E: Add site and widget editor supports for ensureSidebarOpened. ([45480](https://github.com/WordPress/gutenberg/pull/45480)) + +#### Build Tooling + +- Include TS and JSX files to testing-library lint. ([45533](https://github.com/WordPress/gutenberg/pull/45533)) +- Remove use of `set-output` in workflows. ([45357](https://github.com/WordPress/gutenberg/pull/45357)) + +#### Triage + +- Configure labels for GHA Dependabot PRs. ([45516](https://github.com/WordPress/gutenberg/pull/45516)) + +## First time contributors + +The following PRs were merged by first time contributors: + +- @edanzer: Template Part Block: Update block isActive method. ([45672](https://github.com/WordPress/gutenberg/pull/45672)) +- @TimBroddin: Fix alignment of create new post link. ([45638](https://github.com/WordPress/gutenberg/pull/45638)) +- @wojtekn: Make Author block selector to display all users instead of just 10. ([45640](https://github.com/WordPress/gutenberg/pull/45640)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @afercia @andrewserong @bph @brookewp @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @Copons @DaisyOlsen @desrosj @dinhtungdu @draganescu @dsas @edanzer @ellatrix @enejb @flootr @getdave @glendaviesnz @hz-tyfoon @jasmussen @javierarce @jffng @jonathanbossenger @jorgefilipecosta @jsnajdr @juanmaguitar @juhi123 @kevin940726 @Mamaduka @matiasbenedetto @mikachan @mirka @mmtr @mtias @ndiego @nielslange @noisysocks @ntsekouras @peterwilsoncc @ramonjd @ryelle @scruffian @spacedmonkey @t-hamano @TimBroddin @tyxla @vcanales @walbo @wojtekn @youknowriad @yuliyan + + + + += 14.5.4 = + +## Changelog + +### Fixes + +#### Global Styles +- Fix the `upgrader_process_complete` hook for `wp_theme_has_theme_json`. ([45881](https://github.com/WordPress/gutenberg/pull/45881)) + +## Contributors + +The following contributors merged PRs in this release: + +@oandregal + + + += 14.5.3 = + + + +## Changelog + +### Performance + +#### Global Styles +- Update `wp_theme_has_theme_json` to use `WP_Object_Cache`. ([45543](https://github.com/WordPress/gutenberg/pull/45543)) + + +## First time contributors + +The following PRs were merged by first time contributors: + + + +## Contributors + +The following contributors merged PRs in this release: + +@oandregal + + += 14.5.2 = + + + +## Changelog + +### Bug Fixes + +- Tag Processor: Prevent bugs from pre-PHP8 strspn/strcspn behavior. ([45822](https://github.com/WordPress/gutenberg/pull/45822)) + +## Contributors + +The following contributors merged PRs in this release: + +@dmsnell + + += 14.6.0-rc.1 = + +## Changelog + +### Enhancements + +#### Block Library +- Add color block support to latest posts. ([41874](https://github.com/WordPress/gutenberg/pull/41874)) +- Adds a list view to the navigation block. ([45546](https://github.com/WordPress/gutenberg/pull/45546)) +- Latest posts and latest comments: Add spacing support. ([45110](https://github.com/WordPress/gutenberg/pull/45110)) +- Navigation Link: Add the URL field to the Navigation Link inspector controls. ([45751](https://github.com/WordPress/gutenberg/pull/45751)) +- Reposition navigation selector. ([45555](https://github.com/WordPress/gutenberg/pull/45555)) +- Make Author block selector to display all users instead of just 10. ([45640](https://github.com/WordPress/gutenberg/pull/45640)) +- Columns: Add transform to unwrap the contents. ([45666](https://github.com/WordPress/gutenberg/pull/45666)) +- Navigation: Add a new ManageMenusButton component. ([45782](https://github.com/WordPress/gutenberg/pull/45782)) +- Read More block: Add aria-label and screen reader text. ([45490](https://github.com/WordPress/gutenberg/pull/45490)) +- Group block: Use a variation picker in the placeholder. ([43496](https://github.com/WordPress/gutenberg/pull/43496)) + +#### Components +- CheckboxControl: Replace margin overrides with new opt-in prop. ([45434](https://github.com/WordPress/gutenberg/pull/45434)) +- FontSizePicker: Update hint text to match the design. ([44966](https://github.com/WordPress/gutenberg/pull/44966)) +- Update the design of the focal point handle. ([45053](https://github.com/WordPress/gutenberg/pull/45053)) +- Use new theming accent color in all components. ([45289](https://github.com/WordPress/gutenberg/pull/45289)) +- CheckboxControl: Move icons out of labels. ([45535](https://github.com/WordPress/gutenberg/pull/45535)) + +#### Block Editor +- Converts paragraphs to headings with keyboard shortcuts. ([44681](https://github.com/WordPress/gutenberg/pull/44681)) +- Restore the empty paragraph inserter. ([45542](https://github.com/WordPress/gutenberg/pull/45542)) +- Transform: Select all blocks if the result has more than one block. ([45015](https://github.com/WordPress/gutenberg/pull/45015)) +- Content-only locked patterns: Move "Modify" to elllipsis menu. ([45391](https://github.com/WordPress/gutenberg/pull/45391)) +- Patterns: Ajust the space in the pattern explorer list. ([45730](https://github.com/WordPress/gutenberg/pull/45730)) +- Update: Lock icon to outline. ([45645](https://github.com/WordPress/gutenberg/pull/45645)) +- Don't use capital case for 'Distraction free' strings. ([45538](https://github.com/WordPress/gutenberg/pull/45538)) +- Replace Justification/Orientation controls with ToggleGroupControl. ([45637](https://github.com/WordPress/gutenberg/pull/45637)) + +#### Site Editor +- Update: Improve performance of block template object retrieval. ([45646](https://github.com/WordPress/gutenberg/pull/45646)) +- Replace FSE with Site Editor. ([45699](https://github.com/WordPress/gutenberg/pull/45699)) + +#### Design Tools +- Add a minHeight block support under dimensions. ([45300](https://github.com/WordPress/gutenberg/pull/45300)) +- Hide block toolbar when spacing visualizer is showing. ([45131](https://github.com/WordPress/gutenberg/pull/45131)) + +#### Global Styles +- Elements: Add a text decoration control to link elements. ([45643](https://github.com/WordPress/gutenberg/pull/45643)) +- Global styles: Convert preset font size values to CSS vars. ([44967](https://github.com/WordPress/gutenberg/pull/44967)) +- Fluid typography: Adjust font size min and max rules. ([45536](https://github.com/WordPress/gutenberg/pull/45536)) +- Try generating random color palettes. ([40988](https://github.com/WordPress/gutenberg/pull/40988)) + + +#### Plugin +- Updates tested up to version to 6.1. ([45630](https://github.com/WordPress/gutenberg/pull/45630)) + + +### Bug Fixes + +#### Block Library +- Change the order of the pseudo-states in the pseudo selectors array. ([45559](https://github.com/WordPress/gutenberg/pull/45559)) +- Cover: Avoid content loss when the templateLock value is all or contentOnly. ([45632](https://github.com/WordPress/gutenberg/pull/45632)) +- Fix alignment of create new post link. ([45638](https://github.com/WordPress/gutenberg/pull/45638)) +- Fix navigation appender position to prevent obstructing its items. ([43530](https://github.com/WordPress/gutenberg/pull/43530)) +- Fix: Button block text alignment. ([45663](https://github.com/WordPress/gutenberg/pull/45663)) +- Query Pagination: Fix positioning of next link in editor when parent is selected. ([45651](https://github.com/WordPress/gutenberg/pull/45651)) +- Site Logo: Use the correct home URL setting. ([45476](https://github.com/WordPress/gutenberg/pull/45476)) +- Switch background color to text color on block separator. ([44943](https://github.com/WordPress/gutenberg/pull/44943)) +- Table Block: Apply borders and padding on both front end and editor. ([45069](https://github.com/WordPress/gutenberg/pull/45069)) +- Table block: Fix error in margin value. ([45674](https://github.com/WordPress/gutenberg/pull/45674)) +- Template Part Block: Update block isActive method. ([45672](https://github.com/WordPress/gutenberg/pull/45672)) +- Navigation: Fix overflowing menu name in the navigation selector dropdown. ([45647](https://github.com/WordPress/gutenberg/pull/45647)) + +#### Accessibility +- Fix focus return when closing the Post publish panel. ([45623](https://github.com/WordPress/gutenberg/pull/45623)) +- Fix navigate regions backwards for macOS Firefox and Safari. ([45019](https://github.com/WordPress/gutenberg/pull/45019)) +- Fix the Save buttons labelling and tooltip. ([43952](https://github.com/WordPress/gutenberg/pull/43952)) +- Fix the navigate regions focus style. ([45369](https://github.com/WordPress/gutenberg/pull/45369)) +- Fix: Contrast checker appears unexpectedly on some blocks. ([45639](https://github.com/WordPress/gutenberg/pull/45639)) +- Fix: Contrast checker does not update properly. ([45686](https://github.com/WordPress/gutenberg/pull/45686)) + +#### Components +- Autocomplete: Fix unexpected block insertion during IME composition. ([45510](https://github.com/WordPress/gutenberg/pull/45510)) +- Fix ESLint warning for Dashicon. ([45795](https://github.com/WordPress/gutenberg/pull/45795)) +- FormTokenField: Fix duplicate input in IME composition. ([45607](https://github.com/WordPress/gutenberg/pull/45607)) +- Making size prop work for icon components using dash icon strings. ([45593](https://github.com/WordPress/gutenberg/pull/45593)) +- ToolsPanel: Prevent calling deselect when panel remounts. ([45673](https://github.com/WordPress/gutenberg/pull/45673)) +- Color Picker: Prevent all number fields to become 0 when one of them is an empty string. ([45649](https://github.com/WordPress/gutenberg/pull/45649)) +- ToggleGroupControl: Only show enclosing border when `isBlock`. ([45492](https://github.com/WordPress/gutenberg/pull/45492)) +- Autocomplete: Check key events more strictly in IME composition. ([45626](https://github.com/WordPress/gutenberg/pull/45626)) + +#### CSS & Styling +- Inherit font from theme on overlay close button. ([45635](https://github.com/WordPress/gutenberg/pull/45635)) +- Navigation: Fix font inheritance when using text menu button. ([45514](https://github.com/WordPress/gutenberg/pull/45514)) +- Remove hover style to button on dark block tools UI. ([45653](https://github.com/WordPress/gutenberg/pull/45653)) +- Remove width from block mover button focus style. ([45665](https://github.com/WordPress/gutenberg/pull/45665)) +- Site editor hover/select: Fix double border. ([45589](https://github.com/WordPress/gutenberg/pull/45589)) +- Remove duplicate output of existing classnames in layout classnames. ([45499](https://github.com/WordPress/gutenberg/pull/45499)) + +#### Post Editor +- BlockManagerCategory: Fix styles for indeterminate. ([45564](https://github.com/WordPress/gutenberg/pull/45564)) +- Fix: Updated names from List View to Document Overview. ([45524](https://github.com/WordPress/gutenberg/pull/45524)) +- Strip HTML from Post Title when pasting multiline title containing HTML. ([35825](https://github.com/WordPress/gutenberg/pull/35825)) + +#### Site Editor +- Decode entities in template title and description. ([45716](https://github.com/WordPress/gutenberg/pull/45716)) +- Link to homeUrl from site editor view menu. ([45475](https://github.com/WordPress/gutenberg/pull/45475)) + +#### Block Editor +- Fix Link UI popover positioning when inspector control input is focused. ([45661](https://github.com/WordPress/gutenberg/pull/45661)) +- Paste: Fix list only paste from Google documentation. ([45498](https://github.com/WordPress/gutenberg/pull/45498)) +- Make Manage Reusable blocks match similar links. ([45641](https://github.com/WordPress/gutenberg/pull/45641))([45689](https://github.com/WordPress/gutenberg/pull/45689)) +- List View: Disable branch expansion when block editing is locked. ([45541](https://github.com/WordPress/gutenberg/pull/45541)) +- Spacing visualizer: Fix display of unexpected visualizer for certain mouse actions. ([45739](https://github.com/WordPress/gutenberg/pull/45739)) + + +### Performance + +- Lodash: Refactor away from `_.reduce()`. ([45460](https://github.com/WordPress/gutenberg/pull/45460)) +- Lodash: Refactor block editor away from `_.reduce()`. ([45455](https://github.com/WordPress/gutenberg/pull/45455)) +- Lodash: Refactor blocks away from `_.reduce()`. ([45457](https://github.com/WordPress/gutenberg/pull/45457)) +- Lodash: Refactor site editor away from `_.reduce()`. ([45459](https://github.com/WordPress/gutenberg/pull/45459)) +- Lodash: Refactor post editor away from `_.reduce()`. ([45458](https://github.com/WordPress/gutenberg/pull/45458)) + +#### Block Library +- Do not look for block variants, if not supporting block-templates. ([45362](https://github.com/WordPress/gutenberg/pull/45362)) +- List: Disable nested list drop zone so dropping list items works. ([45321](https://github.com/WordPress/gutenberg/pull/45321)) + +#### Global Styles +- Use low-level cache for get_user_data_from_wp_global_styles. ([45634](https://github.com/WordPress/gutenberg/pull/45634)) + + +### Experiments + +- Al list view duplicate for use in navigation list view experiment. ([45544](https://github.com/WordPress/gutenberg/pull/45544)) +- Introduce experiment for inspector based navigation editing. ([45515](https://github.com/WordPress/gutenberg/pull/45515)) + + +### Documentation + +- Add missing CHANGELOG entry. ([45691](https://github.com/WordPress/gutenberg/pull/45691)) +- Change Title: How to use JavaScript with Gutenberg. ([45323](https://github.com/WordPress/gutenberg/pull/45323)) +- Docs: Update the readme for the integration test fixtures. ([45581](https://github.com/WordPress/gutenberg/pull/45581)) +- Summarize "Available commands" section and refer them it to `scripts` documentation. ([45636](https://github.com/WordPress/gutenberg/pull/45636)) +- Update applying-styles-with-stylesheets.md. ([45604](https://github.com/WordPress/gutenberg/pull/45604)) +- [create-block] Reorganized sections to provide a better learning experience of this package. ([45676](https://github.com/WordPress/gutenberg/pull/45676)) +- Change "block style variations" references to "block style". ([45650](https://github.com/WordPress/gutenberg/pull/45650)) + + + +### Code Quality + +#### Block Editor +- Block Editor: Improve `LinkControl` tests. ([45609](https://github.com/WordPress/gutenberg/pull/45609)) +- Block Editor: Improve `ResponsiveBlockControl` tests. ([45610](https://github.com/WordPress/gutenberg/pull/45610)) +- Block Editor: Improve `ReusableBlocksTab` tests. ([45652](https://github.com/WordPress/gutenberg/pull/45652)) +- LinkControl: Suppress errors on null values. ([45742](https://github.com/WordPress/gutenberg/pull/45742)) +- Simplify ResizableEditor component. ([45578](https://github.com/WordPress/gutenberg/pull/45578)) +- Remove duplicate colon. ([45763](https://github.com/WordPress/gutenberg/pull/45763)) +- Extract the manage menus button to a shared component to reduce duplicate code. ([45769](https://github.com/WordPress/gutenberg/pull/45769)) +- Backport pseudo selector comments from core. ([45619](https://github.com/WordPress/gutenberg/pull/45619)) +- unstableSubscribeStore: Support store descriptors. ([45481](https://github.com/WordPress/gutenberg/pull/45481)) + + +#### Components +- BaseField: Remove unnecessary `.firstChild` from tests. ([45687](https://github.com/WordPress/gutenberg/pull/45687)) +- DateTime: Remove unused types. ([45615](https://github.com/WordPress/gutenberg/pull/45615)) +- Draggable: Convert component to TypeScript. ([45471](https://github.com/WordPress/gutenberg/pull/45471)) +- Fix `no-container` violations in `FormGroup` tests. ([45662](https://github.com/WordPress/gutenberg/pull/45662)) +- Fix `testing-library/no-node-access` in `TreeGrid` tests. ([45554](https://github.com/WordPress/gutenberg/pull/45554)) +- FontSizePicker: Use components instead of helper functions. ([44891](https://github.com/WordPress/gutenberg/pull/44891)) +- Improve tests for `ToggleGroupControl`. ([45627](https://github.com/WordPress/gutenberg/pull/45627)) +- MenuGroup: Convert component to TypeScript. ([45617](https://github.com/WordPress/gutenberg/pull/45617)) +- Popover: Fix exhaustive-deps warning. ([45656](https://github.com/WordPress/gutenberg/pull/45656)) +- Refactor `ItemGroup` to pass `exhaustive-deps`. ([45531](https://github.com/WordPress/gutenberg/pull/45531)) +- Refactor `useFlex` to pass `exhaustive-deps`. ([45528](https://github.com/WordPress/gutenberg/pull/45528)) +- Refactor `withNotices` to pass `exhaustive-deps`. ([45530](https://github.com/WordPress/gutenberg/pull/45530)) +- Refactor`PaletteEditListView` to ignore `exhaustive-deps`. ([45467](https://github.com/WordPress/gutenberg/pull/45467)) +- TabPanel: Fix the `exhaustive-deps` warning. ([45660](https://github.com/WordPress/gutenberg/pull/45660)) +- ToolsPanel: Fix exhaustive-deps hook warning. ([45715](https://github.com/WordPress/gutenberg/pull/45715)) +- Truncate: Remove unnecessary `.firstChild` from tests. ([45694](https://github.com/WordPress/gutenberg/pull/45694)) +- View component: Rename index.js to index.ts. ([45667](https://github.com/WordPress/gutenberg/pull/45667)) +- `ColorPalette`, `BorderBox`, `BorderBoxControl`: Polish and DRY prop types, add default values. ([45463](https://github.com/WordPress/gutenberg/pull/45463)) +- `NavigatorScreen`: Satisfy `exhaustive-deps` eslint rule. ([45648](https://github.com/WordPress/gutenberg/pull/45648)) +- Fix `useCx` story to satisfy `exhaustive-deps` eslint rule. ([45614](https://github.com/WordPress/gutenberg/pull/45614)) +- URLPopover: Use new placement prop instead of legacy position prop. ([44391](https://github.com/WordPress/gutenberg/pull/44391)) +- Tidy and minor refactor of Link UI code. ([37833](https://github.com/WordPress/gutenberg/pull/37833)) + +#### Block Library +- Avatar: Escape the 'get_author_posts_url()'. ([45427](https://github.com/WordPress/gutenberg/pull/45427)) +- Button: Remove unnecessary 'useCallback'. ([45584](https://github.com/WordPress/gutenberg/pull/45584)) +- Make unwrapping columns slighly more efficient. ([45684](https://github.com/WordPress/gutenberg/pull/45684)) +- Simplfy handling of save of Nav block uncontrolled inner blocks. ([45517](https://github.com/WordPress/gutenberg/pull/45517)) +- Lodash: Refactor block library away from `_.reduce()`. ([45456](https://github.com/WordPress/gutenberg/pull/45456)) + + +### Tools + +#### Testing +- Components: Add `exhaustive-deps` eslint rule. ([41166](https://github.com/WordPress/gutenberg/pull/41166)) +- Fix typos in Paragraph block end-to-end tests. ([45611](https://github.com/WordPress/gutenberg/pull/45611)) +- FontSizePicker: Fix a buggy unit test. ([45529](https://github.com/WordPress/gutenberg/pull/45529)) +- Ignore warnings for `window.wp` in Playwright. ([45598](https://github.com/WordPress/gutenberg/pull/45598)) +- Migrate mentions tests to playwright. ([43064](https://github.com/WordPress/gutenberg/pull/43064)) +- Navigation Toggle unit test: Unmount synchronously to cancel popover positioning. ([45726](https://github.com/WordPress/gutenberg/pull/45726)) +- React Native unit tests: Migrate getByA11yLabel usages. ([45454](https://github.com/WordPress/gutenberg/pull/45454)) +- Unit Tests: Rewrite ReactDOM.render usages to RTL. ([45453](https://github.com/WordPress/gutenberg/pull/45453)) +- E2E: Add site and widget editor supports for ensureSidebarOpened. ([45480](https://github.com/WordPress/gutenberg/pull/45480)) + +#### Build Tooling +- Include TS and JSX files to testing-library lint. ([45533](https://github.com/WordPress/gutenberg/pull/45533)) +- Remove use of `set-output` in workflows. ([45357](https://github.com/WordPress/gutenberg/pull/45357)) + +#### Triage +- Configure labels for GHA Dependabot PRs. ([45516](https://github.com/WordPress/gutenberg/pull/45516)) + +#### Patterns +- Pattern Directory API: Add support for pagination parameters. ([45293](https://github.com/WordPress/gutenberg/pull/45293)) +- Update bundled patterns compat directory. ([45620](https://github.com/WordPress/gutenberg/pull/45620)) + + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @edanzer: Template Part Block: Update block isActive method. ([45672](https://github.com/WordPress/gutenberg/pull/45672)) +- @TimBroddin: Fix alignment of create new post link. ([45638](https://github.com/WordPress/gutenberg/pull/45638)) +- @wojtekn: Make Author block selector to display all users instead of just 10. ([45640](https://github.com/WordPress/gutenberg/pull/45640)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @afercia @andrewserong @bph @brookewp @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @Copons @DaisyOlsen @desrosj @dinhtungdu @draganescu @dsas @edanzer @ellatrix @enejb @flootr @getdave @glendaviesnz @hz-tyfoon @jasmussen @javierarce @jffng @jonathanbossenger @jorgefilipecosta @jsnajdr @juanmaguitar @juhi123 @kevin940726 @Mamaduka @matiasbenedetto @mikachan @mirka @mmtr @mtias @ndiego @nielslange @noisysocks @ntsekouras @peterwilsoncc @ramonjd @ryelle @scruffian @spacedmonkey @t-hamano @TimBroddin @tyxla @vcanales @walbo @wojtekn @youknowriad @yuliyan + + += 14.5.1 = + + + +## Changelog + +### Bug Fixes + +- Fix: Prevent infinite loop in Tag Processor in certain truncated documents (https://github.com/WordPress/gutenberg/pull/45537) + + += 14.5.0 = + +## Changelog + +### Enhancements + +- Add block pattern categories' descriptions to the REST API and update the descriptions. ([45244](https://github.com/WordPress/gutenberg/pull/45244)) +- Create Block: Update templates to use APIs introduced in WP 6.1. ([44185](https://github.com/WordPress/gutenberg/pull/44185)) +- setAvailableMetaBoxesPerLocation: Merge new metaboxes into existing. ([45156](https://github.com/WordPress/gutenberg/pull/45156)) +- Spacing visualizer: Add option to trigger with mousover as well as value change. ([44955](https://github.com/WordPress/gutenberg/pull/44955)) +- Style Engine: Add support for dimensions.minHeight property. ([45334](https://github.com/WordPress/gutenberg/pull/45334)) +- Try: Add layout classnames to inner block wrapper. ([44600](https://github.com/WordPress/gutenberg/pull/44600)) + +#### Block Library + +- Audio, Video: Add toolbar button to add/remove caption. ([45112](https://github.com/WordPress/gutenberg/pull/45112), [45113](https://github.com/WordPress/gutenberg/pull/45113)) +- Comment Template, Post Comment Count, Post Comments Form, Post Comments Link: Add spacing support. ([45101](https://github.com/WordPress/gutenberg/pull/45101), [45150](https://github.com/WordPress/gutenberg/pull/45150), [45091](https://github.com/WordPress/gutenberg/pull/45091), [45184](https://github.com/WordPress/gutenberg/pull/45184)) +- Gallery: Register styles with Style Engine. ([43070](https://github.com/WordPress/gutenberg/pull/43070)) +- Navigation: Return undefined from useEffect. ([45239](https://github.com/WordPress/gutenberg/pull/45239)) +- Social Icons: Add rel attribute. ([45469](https://github.com/WordPress/gutenberg/pull/45469)) +- Video: Update tracks editor icon to text button. ([45245](https://github.com/WordPress/gutenberg/pull/45245)) + +#### Components + +- Block mover button: Do not show focus styles on pointer interactions. ([45126](https://github.com/WordPress/gutenberg/pull/45126)) +- BorderControl, BorderBoxControl, BorderRadiusControl: Update control components to allow 40px height. ([41860](https://github.com/WordPress/gutenberg/pull/41860)) +- BoxControl, Card, ToolsPanel: Remove unnecessary wrappers in stories. ([45305](https://github.com/WordPress/gutenberg/pull/45305)) +- Button: Change the color on the destructive button focus state. ([44427](https://github.com/WordPress/gutenberg/pull/44427)) +- Button: Refactor Storybook to controls and align documentation. ([44105](https://github.com/WordPress/gutenberg/pull/44105)) +- ColorPalette: Convert to TypeScript. ([44632](https://github.com/WordPress/gutenberg/pull/44632)) +- DateTimePicker: Add `__next*` props in Storybook. ([45164](https://github.com/WordPress/gutenberg/pull/45164)) +- FontSizePicker: Update design when `withSlider` is set. ([44598](https://github.com/WordPress/gutenberg/pull/44598)) +- FormFileUpload: Remove unused story file. ([45286](https://github.com/WordPress/gutenberg/pull/45286)) +- NumberControl: Add custom spin buttons. ([45333](https://github.com/WordPress/gutenberg/pull/45333)) +- RadioGroup: Mark as deprecated. ([45389](https://github.com/WordPress/gutenberg/pull/45389)) +- Navigator: Revert the removal of overflow styles from NavigatorScreen. ([45303](https://github.com/WordPress/gutenberg/pull/45303)) +- SelectControl: Add onChange, onBlur, and onFocus to storybook actions. ([45432](https://github.com/WordPress/gutenberg/pull/45432)) +- Storybook: Addon to wrap stories in max-width div. ([45134](https://github.com/WordPress/gutenberg/pull/45134)) +- TextControl: Set Storybook control types on help, label and type. ([45405](https://github.com/WordPress/gutenberg/pull/45405)) +- ToggleGroupControl: Add de-selectable variant. ([45123](https://github.com/WordPress/gutenberg/pull/45123)) +- ToggleGroupControl: Remove invalid props from types. ([45114](https://github.com/WordPress/gutenberg/pull/45114)) + +#### Post Editor + +- Edit Post: Improve distraction-free mode notices. ([45348](https://github.com/WordPress/gutenberg/pull/45348)) +- hasChangedContent: Remove obsolete blocks check. ([45090](https://github.com/WordPress/gutenberg/pull/45090)) +- Move document information and outline to list view panel. ([44788](https://github.com/WordPress/gutenberg/pull/44788)) + +#### Global Styles + +- Add `:visited` pseudo selector to theme.json schema. ([45236](https://github.com/WordPress/gutenberg/pull/45236)) +- Embed, Gallery, Video: Add deprecation for the caption element. ([45166](https://github.com/WordPress/gutenberg/pull/45166), [45173](https://github.com/WordPress/gutenberg/pull/45173), [45169](https://github.com/WordPress/gutenberg/pull/45169)) +- File Block: Add a deprecation for the button element class name. ([45159](https://github.com/WordPress/gutenberg/pull/45159)) +- Table Block: Add a deprecation for the figcaption element class name. ([45161](https://github.com/WordPress/gutenberg/pull/45161)) + +### Bug Fixes + +- Ensure block content is always returned as a string after processing. ([45330](https://github.com/WordPress/gutenberg/pull/45330)) +- Fix distraction free shortcut typo. ([45186](https://github.com/WordPress/gutenberg/pull/45186)) +- Fix resizeable editor scrolling. ([45189](https://github.com/WordPress/gutenberg/pull/45189)) +- Fix handling of nullish comments in the pot-to-PHP script. ([45414](https://github.com/WordPress/gutenberg/pull/45414)) +- Fix image caption supports Voice Control. ([44850](https://github.com/WordPress/gutenberg/pull/44850)) +- Fix PHP warning in pattern categories REST API controller. ([45410](https://github.com/WordPress/gutenberg/pull/45410)) +- Fix Prevent infinite loop in Tag Processor in certain truncated documents. ([45537](https://github.com/WordPress/gutenberg/pull/45537)) +- Hide insertion point when moving out of the canvas. ([45420](https://github.com/WordPress/gutenberg/pull/45420)) +- Metaboxes: Perform hasMetaBoxes check on every save. ([45145](https://github.com/WordPress/gutenberg/pull/45145)) +- Prevent unexpected copying of the post title. ([41284](https://github.com/WordPress/gutenberg/pull/41284)) +- Raw Handling: When pasting bullet characters, convert to astericks for markdown converter. ([45017](https://github.com/WordPress/gutenberg/pull/45017)) +- Web Font: Fix ascent/descent-override property typo. ([45125](https://github.com/WordPress/gutenberg/pull/45125)) + +#### Block Library + +- Button: Reset background-image property for outline button style. ([45234](https://github.com/WordPress/gutenberg/pull/45234)) +- Cover, Search, Spacer: Fix control widths. ([45329](https://github.com/WordPress/gutenberg/pull/45329)) +- Navigation: Fix saving/loading experience of uncontrolled blocks. ([45486](https://github.com/WordPress/gutenberg/pull/45486)) +- Navigation: Add padding to buttons when Submenus Open on click is enabled. ([44605](https://github.com/WordPress/gutenberg/pull/44605)) +- List: Fix migration when the nested list is invalid. ([44822](https://github.com/WordPress/gutenberg/pull/44822)) +- Page List: Allow direct selection of nested Page List block by avoiding dual rendering within block. ([45143](https://github.com/WordPress/gutenberg/pull/45143)) +- Site Tagline: Fix user permission HTTP errors. ([45140](https://github.com/WordPress/gutenberg/pull/45140)) +- Site Title: Avoid 403 errors for users with low permissions. ([45093](https://github.com/WordPress/gutenberg/pull/45093)) + +#### Components + +- AnglePickerControl: Set Storybook label control type to text. ([45122](https://github.com/WordPress/gutenberg/pull/45122)) +- AutocompleteUI: Close popup when click happens outside of the popover. ([44795](https://github.com/WordPress/gutenberg/pull/44795)) +- BorderControl: Await floating-ui state changes when rendering/opening popover to fix unit test failures. ([45241](https://github.com/WordPress/gutenberg/pull/45241)) +- Button component: Fix RTL alignment when containing icon and text. ([44787](https://github.com/WordPress/gutenberg/pull/44787)) +- ColorPalette: Fix transparent checkered background pattern. ([45295](https://github.com/WordPress/gutenberg/pull/45295)) +- ExternalLink: Update to support onClick handler. ([45214](https://github.com/WordPress/gutenberg/pull/45214)) +- InputControl: Allow inline styles to be applied to wrapper instead of inner input. ([45340](https://github.com/WordPress/gutenberg/pull/45340)) +- ItemGroup: Fix RTL text alignment when item is clickable. ([45280](https://github.com/WordPress/gutenberg/pull/45280)) +- Popover: Fix deprecations. ([45195](https://github.com/WordPress/gutenberg/pull/45195)) +- PublishDateTimePicker: Retrieve all future posts in a given month. ([44540](https://github.com/WordPress/gutenberg/pull/44540)) +- SpacingSizesControl: Remove UnitControl inline style use. ([45412](https://github.com/WordPress/gutenberg/pull/45412)) +- TabPanel: Add tests and changelog for onSelect behavior change. ([45211](https://github.com/WordPress/gutenberg/pull/45211)) +- UnitControl: Fix disabled style is overridden by forms.css. ([45250](https://github.com/WordPress/gutenberg/pull/45250)) +- Visual Editor: Fix permission error. ([45262](https://github.com/WordPress/gutenberg/pull/45262)) + +#### Site Editor + +- Fix clipped body background style in the Site Editor. ([45261](https://github.com/WordPress/gutenberg/pull/45261)) +- Only mark the 'Site' menu item active when editing a home template. ([42807](https://github.com/WordPress/gutenberg/pull/42807)) + +### Performance + +- Lodash: Refactor away from using Lodash. ([45311](https://github.com/WordPress/gutenberg/pull/45311), [45306](https://github.com/WordPress/gutenberg/pull/45306), [45335](https://github.com/WordPress/gutenberg/pull/45335), [45338](https://github.com/WordPress/gutenberg/pull/45338), [45310](https://github.com/WordPress/gutenberg/pull/45310), [45098](https://github.com/WordPress/gutenberg/pull/45098), [45282](https://github.com/WordPress/gutenberg/pull/45282), [45316](https://github.com/WordPress/gutenberg/pull/45316), [45342](https://github.com/WordPress/gutenberg/pull/45342), [45307](https://github.com/WordPress/gutenberg/pull/45307), [45312](https://github.com/WordPress/gutenberg/pull/45312), [45337](https://github.com/WordPress/gutenberg/pull/45337), [45367](https://github.com/WordPress/gutenberg/pull/45367), [44980](https://github.com/WordPress/gutenberg/pull/44980), [45281](https://github.com/WordPress/gutenberg/pull/45281)) + +### Documentation + +- Add a readme to the letter spacing component. ([45308](https://github.com/WordPress/gutenberg/pull/45308)) +- Add changelogs for internal refactorings using inert. ([45269](https://github.com/WordPress/gutenberg/pull/45269)) +- Add "Do not use in production" message to content locking experimental API's. ([45291](https://github.com/WordPress/gutenberg/pull/45291)) +- Add Storybook intro. ([45115](https://github.com/WordPress/gutenberg/pull/45115)) +- Code Quality: Fix some misspelled words. ([45222](https://github.com/WordPress/gutenberg/pull/45222)) +- Disabled: Update documentation to clarify the absence of inert polyfill. ([45272](https://github.com/WordPress/gutenberg/pull/45272)) +- Fix incorrect character in code example. ([45355](https://github.com/WordPress/gutenberg/pull/45355)) +- Fix missing anchor link in FAQ URL. ([45232](https://github.com/WordPress/gutenberg/pull/45232)) +- FontSizePicker: Update changelog for #45041. ([45180](https://github.com/WordPress/gutenberg/pull/45180)) +- Updating curation document to include content lock ability. ([44908](https://github.com/WordPress/gutenberg/pull/44908)) +- useAnchorRef: Update deprecation message. ([45302](https://github.com/WordPress/gutenberg/pull/45302)) + +### Code Quality + +- Block Editor: Improve `MediaReplaceFlow` tests. ([45424](https://github.com/WordPress/gutenberg/pull/45424)) +- Block Editor: Refactor align tests to RTL. ([45152](https://github.com/WordPress/gutenberg/pull/45152)) +- Editors: Refactor icon tests to follow `no-container` rule. ([45422](https://github.com/WordPress/gutenberg/pull/45422)) +- Fix indent and quote in dependbot.yml. ([45167](https://github.com/WordPress/gutenberg/pull/45167)) +- Fix PHP 8.1 deprecation for `strncmp()`. ([44829](https://github.com/WordPress/gutenberg/pull/44829)) +- Popover: Use new placement prop instead of legacy position prop. ([44392](https://github.com/WordPress/gutenberg/pull/44392), [44387](https://github.com/WordPress/gutenberg/pull/44387), [44389](https://github.com/WordPress/gutenberg/pull/44389), [44398](https://github.com/WordPress/gutenberg/pull/44398), [44399](https://github.com/WordPress/gutenberg/pull/44399), [44394](https://github.com/WordPress/gutenberg/pull/44394), [44395](https://github.com/WordPress/gutenberg/pull/44395), [44390](https://github.com/WordPress/gutenberg/pull/44390), [44396](https://github.com/WordPress/gutenberg/pull/44396), [44388](https://github.com/WordPress/gutenberg/pull/44388)) +- PostTextEditor test: Wrap `.blur` calls in `act()`. ([45243](https://github.com/WordPress/gutenberg/pull/45243)) +- Replace the MainDashboardButton slot with a setting in the site editor. ([45149](https://github.com/WordPress/gutenberg/pull/45149)) +- Run script loader test. ([45288](https://github.com/WordPress/gutenberg/pull/45288)) +- Site Editor: Move the save view state to the edit site store. ([45200](https://github.com/WordPress/gutenberg/pull/45200)) +- Small follow-ups to the distraction free mode PR. ([45151](https://github.com/WordPress/gutenberg/pull/45151)) +- Tests: Use `container` instead of `container.firstChild` for snapshots. ([45278](https://github.com/WordPress/gutenberg/pull/45278)) +- useFocusOutside: Rewrite hook to TypeScript, rewrite tests to model RTL and user-event. ([45317](https://github.com/WordPress/gutenberg/pull/45317)) +- useFocusableIframe: Refactor to TypeScript. ([45428](https://github.com/WordPress/gutenberg/pull/45428)) + +#### Components + +- Add a popover `variant` prop and refactor popovers to use it, deprecate `isAlternate`. ([45137](https://github.com/WordPress/gutenberg/pull/45137)) +- Add parseQuantityAndUnitFromRawValue tests. ([45260](https://github.com/WordPress/gutenberg/pull/45260)) +- FontSizePicker: Rewrite unit tests to use userEvent and be more comprehensive. ([45298](https://github.com/WordPress/gutenberg/pull/45298)) +- BorderBoxControl: Improve tests. ([45208](https://github.com/WordPress/gutenberg/pull/45208)) +- ContextSystemProvider, useUpdateEffect, SlotFill, Snackbar, TabPanel: Refactor to pass `exhaustive-deps`. ([45044](https://github.com/WordPress/gutenberg/pull/45044), [44403](https://github.com/WordPress/gutenberg/pull/44403), [44934](https://github.com/WordPress/gutenberg/pull/44934), [44935](https://github.com/WordPress/gutenberg/pull/44935)) +- Remove unnecessary `.firstChild` from tests. ([45419](https://github.com/WordPress/gutenberg/pull/45419)) +- Update some React 18 related types. ([45279](https://github.com/WordPress/gutenberg/pull/45279)) + +#### Global Styles + +- Add `wp_theme_has_theme_json` as a public API to know whether a theme has a `theme.json`. ([45168](https://github.com/WordPress/gutenberg/pull/45168)) +- Deprecate `WP_Theme_JSON_Resolver:Theme_has_support()`. ([45380](https://github.com/WordPress/gutenberg/pull/45380)) + +### Tools + +#### Testing + +- Add Playwright Compatibility-classic-editor Test. ([43979](https://github.com/WordPress/gutenberg/pull/43979)) +- Add end-to-end tests for Drag-and-Drop in the inserter. ([44631](https://github.com/WordPress/gutenberg/pull/44631)) +- Cleanup after the writing flow end-to-end tests. ([45119](https://github.com/WordPress/gutenberg/pull/45119)) +- Fix failing PHPUnit tests. ([45265](https://github.com/WordPress/gutenberg/pull/45265)) +- Fix uploading artifacts even when the tests are successful. ([45187](https://github.com/WordPress/gutenberg/pull/45187)) +- Migrate iframe-rendering test case. ([44535](https://github.com/WordPress/gutenberg/pull/44535)) +- Migrate tests to Playwright. ([43963](https://github.com/WordPress/gutenberg/pull/43963), [45267](https://github.com/WordPress/gutenberg/pull/45267), [44916](https://github.com/WordPress/gutenberg/pull/44916), [44507](https://github.com/WordPress/gutenberg/pull/44507), [45393](https://github.com/WordPress/gutenberg/pull/45393), [43964](https://github.com/WordPress/gutenberg/pull/43964), [45202](https://github.com/WordPress/gutenberg/pull/45202)) +- Re-enable skipped Gallery block end-to-end test. ([45266](https://github.com/WordPress/gutenberg/pull/45266)) +- Try fixing Site Title flaky end-to-end tests. ([45160](https://github.com/WordPress/gutenberg/pull/45160)) +- Update Playwright to v1.27. ([45193](https://github.com/WordPress/gutenberg/pull/45193)) + +#### Build Tooling + +- ESLint: Add and enable `eslint-plugin-testing-library`. ([45103](https://github.com/WordPress/gutenberg/pull/45103)) +- ESLint: Exclude Playwright tests from testing library rules. ([45366](https://github.com/WordPress/gutenberg/pull/45366)) +- Fix native Demo editor build error when using Xcode 14 to build to a physical device. ([45120](https://github.com/WordPress/gutenberg/pull/45120)) +- Remove comments from compiled styles. ([43177](https://github.com/WordPress/gutenberg/pull/43177)) +- Upgrade rtlcss to v4.0.0. ([43208](https://github.com/WordPress/gutenberg/pull/43208)) + +## First time contributors + +The following PRs were merged by first time contributors: + +- @alvitazwar: Migrate iframe-rendering test case. ([44535](https://github.com/WordPress/gutenberg/pull/44535)) +- @GeoJunkie: PublishDateTimePicker: Retrieve all future posts in a given month. ([44540](https://github.com/WordPress/gutenberg/pull/44540)) +- @Initsogar: Components: Update ExternalLink to support onClick handler. ([45214](https://github.com/WordPress/gutenberg/pull/45214)) +- @jornp: Button component: Fix RTL alignment when containing icon and text. ([44787](https://github.com/WordPress/gutenberg/pull/44787)) +- @pkorzelius: Character Swap. ([45355](https://github.com/WordPress/gutenberg/pull/45355)) + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @alvitazwar @andrewserong @annezazu @aristath @BE-Webdesign @bph @brookewp @carolinan @chad1008 @ciampo @dcalhoun @dmsnell @ellatrix @fluiddot @GeoJunkie @georgeh @getdave @glendaviesnz @gziolo @Initsogar @jorgefilipecosta @jornp @jsnajdr @kevin940726 @KevinBatdorf @kienstra @Mamaduka @mikachan @mirka @noisysocks @ntsekouras @oandregal @pkorzelius @pooja-muchandikar @ramonjd @SavPhill @scruffian @SiobhyB @Soean @t-hamano @talldan @tellthemachines @tyxla @walbo @youknowriad + + + + += 14.4.0 = + + + +## Changelog + +### Enhancements + +- Add prop to disable block selection clearer in BlockList. ([44517](https://github.com/WordPress/gutenberg/pull/44517)) +- Multi-select: Fix 1px indent. ([44709](https://github.com/WordPress/gutenberg/pull/44709)) +- ServerSideRender: Add new `skipBlockSupportAttributes` prop. ([44491](https://github.com/WordPress/gutenberg/pull/44491)) +- Tag Processor: Add get_updated_html as a non-toString method of stringifying the markup. ([44597](https://github.com/WordPress/gutenberg/pull/44597)) +- Try: Add a small radius to the multi selection style. ([44708](https://github.com/WordPress/gutenberg/pull/44708)) +- Block Locking: Adds content locking to navigation block. ([44739](https://github.com/WordPress/gutenberg/pull/44739)) +- Rich Text: Use fallback icon for highlight format. ([44705](https://github.com/WordPress/gutenberg/pull/44705)) +- Create Block: Allows custom keys to be generated in block.json files and package.json files. ([44649](https://github.com/WordPress/gutenberg/pull/44649)) + +#### Block Library +- Comments: Add spacing support. ([45102](https://github.com/WordPress/gutenberg/pull/45102)) +- Tag Cloud: Add typography supports (except font size). ([43452](https://github.com/WordPress/gutenberg/pull/43452)) +- Image: Add toolbar button to add a caption. ([44965](https://github.com/WordPress/gutenberg/pull/44965)) +- List Item: Adopt typography supports. ([43312](https://github.com/WordPress/gutenberg/pull/43312)) + +#### Components +- BorderBoxControl: Omit unit select when values are mixed. ([44592](https://github.com/WordPress/gutenberg/pull/44592)) +- SuggestionList: Use requestAnimationFrame instead of setTimeout when scrolling selected item into view. ([44573](https://github.com/WordPress/gutenberg/pull/44573)) + + +#### Block Editor +- Introduce distraction free mode. ([41740](https://github.com/WordPress/gutenberg/pull/41740)) +- Redesign the main pattern inserter. ([44028](https://github.com/WordPress/gutenberg/pull/44028)) +- Inserter: Add a more pronounced hover effect. ([44711](https://github.com/WordPress/gutenberg/pull/44711)) + + +#### Design Tools +- SpacingSizesControl: Increase slider's max value to 300. ([44956](https://github.com/WordPress/gutenberg/pull/44956)) +- Style engine: Permit wp custom CSS properties. ([43071](https://github.com/WordPress/gutenberg/pull/43071)) +- Try color theming. ([44668](https://github.com/WordPress/gutenberg/pull/44668)) +- Global Styles: Modify Frame animation of styles grid. ([39717](https://github.com/WordPress/gutenberg/pull/39717)) + + + +### Bug Fixes + + +- Clickable placeholder upload button. ([44817](https://github.com/WordPress/gutenberg/pull/44817)) +- Insertion point showing up unexpectedly. ([44702](https://github.com/WordPress/gutenberg/pull/44702)) +- Overflowing patterns. ([44853](https://github.com/WordPress/gutenberg/pull/44853)) +- Inspector is usable on the top level block even if it is content locked. ([44878](https://github.com/WordPress/gutenberg/pull/44878)) +- Use active variation as the parent block if available. ([44609](https://github.com/WordPress/gutenberg/pull/44609)) +- Placeholder for the navigation link label, to be about the label. ([44733](https://github.com/WordPress/gutenberg/pull/44733)) +- Hide the inbetween inserter consistently as you move the mouse. ([44814](https://github.com/WordPress/gutenberg/pull/44814)) +- Margin visualiser: Apply negative value to margins with calc(). ([44718](https://github.com/WordPress/gutenberg/pull/44718)) +- Placeholder: Fix hover style. ([44701](https://github.com/WordPress/gutenberg/pull/44701)) +- Post editor: Rename view to Preview. ([45074](https://github.com/WordPress/gutenberg/pull/45074)) +- Prevent empty block toolbars from showing empty slots. ([44704](https://github.com/WordPress/gutenberg/pull/44704)) +- Use inert attribute instead of useDisabled. ([44865](https://github.com/WordPress/gutenberg/pull/44865)) +- cleanForSlug: Replace multiple hyphens with a single one. ([44873](https://github.com/WordPress/gutenberg/pull/44873)) +- Block Popover: Fix incorrect positioning of padding and margin visualizers on scroll. ([44998](https://github.com/WordPress/gutenberg/pull/44998)) +- Most used tags: Try fixing label. ([44859](https://github.com/WordPress/gutenberg/pull/44859)) +- Only include theme.css if the theme declares support for wp-block-styles. ([44640](https://github.com/WordPress/gutenberg/pull/44640)) +- Merge inner blocks if wrappers are equal. ([43181](https://github.com/WordPress/gutenberg/pull/43181)) +- Try nested patterns previews with block editor setting. ([44784](https://github.com/WordPress/gutenberg/pull/44784)) +- Design Tools Adjust the custom range steps to match the units chosen. ([44959](https://github.com/WordPress/gutenberg/pull/44959)) +- Global Styles: Invoke zoomed-out view when selecting a style variation. ([44987](https://github.com/WordPress/gutenberg/pull/44987)) +- Plugin: Don't use the custom 'Template Parts' page with WP 6.1 and above. ([45158](https://github.com/WordPress/gutenberg/pull/45158)) + + +#### Block Library +- Avoid querying block templates during installation. ([44584](https://github.com/WordPress/gutenberg/pull/44584)) +- Buttons: Add specificity for the editor. ([44731](https://github.com/WordPress/gutenberg/pull/44731)) +- Embed Block: Add support for Tumblr Dashboard URLs. ([44854](https://github.com/WordPress/gutenberg/pull/44854)) +- Fix list outdents on Enter in quote block. ([44809](https://github.com/WordPress/gutenberg/pull/44809)) +- Fix the cover block focal point picker. ([44991](https://github.com/WordPress/gutenberg/pull/44991)) +- Fix typo for word occurred. ([44914](https://github.com/WordPress/gutenberg/pull/44914)) +- Fix visibility of nested Group block appender. ([45050](https://github.com/WordPress/gutenberg/pull/45050)) +- Fix: Follow discussion settings in the comments block edit. ([44463](https://github.com/WordPress/gutenberg/pull/44463)) +- Group, Row, Stack, Columns. Fix missing border regression. ([44696](https://github.com/WordPress/gutenberg/pull/44696)) +- List Item: Allow Gutenberg to override core block type. ([44911](https://github.com/WordPress/gutenberg/pull/44911)) +- List v2: Selection when creating paragraph from empty list item. ([44864](https://github.com/WordPress/gutenberg/pull/44864)) +- Remove anchor support from the navigation block. ([44721](https://github.com/WordPress/gutenberg/pull/44721)) +- Removes __unstableMaxPages attribute from Page List block (and Nav block). ([44415](https://github.com/WordPress/gutenberg/pull/44415)) +- Site Logo: User permission HTTP errors. ([45104](https://github.com/WordPress/gutenberg/pull/45104)) +- Site logo: Centered state, for upload button. ([44861](https://github.com/WordPress/gutenberg/pull/44861)) +- Media: Cover block text color heuristic for cross origin media. ([44552](https://github.com/WordPress/gutenberg/pull/44552)) +- Icons: Arrow icons being misaligned. ([44666](https://github.com/WordPress/gutenberg/pull/44666)) +- Patterns: Hide list items from content area of content locked blocks. ([44676](https://github.com/WordPress/gutenberg/pull/44676)) +- Templates API: Avoid PHP warning when getting dynamic template data. ([44783](https://github.com/WordPress/gutenberg/pull/44783)) +- Block Settings: Show `move to` on nested blocks when only one root block. ([44827](https://github.com/WordPress/gutenberg/pull/44827)) +- Navigation: Fallback to a classic menu if one is available. ([44173](https://github.com/WordPress/gutenberg/pull/44173)) + +#### Site Editor +- Toggle Navigation Menus Sidebar. ([44860](https://github.com/WordPress/gutenberg/pull/44860)) +- Zoomed out view: Keep list view open when entering mode. ([44781](https://github.com/WordPress/gutenberg/pull/44781)) + + +#### Block Editor +- Cover: Fix erroneous focus style in editor. ([44707](https://github.com/WordPress/gutenberg/pull/44707)) +- Native inner blocks merge where appropriate. ([45048](https://github.com/WordPress/gutenberg/pull/45048)) + + +#### Typography +- Fluid typography: Convert server-side block support values. ([44762](https://github.com/WordPress/gutenberg/pull/44762)) +- Fluid typography: Covert font size number values to pixels. ([44807](https://github.com/WordPress/gutenberg/pull/44807)) +- Fluid typography: Ensure fontsizes are strings or integers. ([44847](https://github.com/WordPress/gutenberg/pull/44847)) +- Font Size Picker Hint: Fallback to font size `slug` if `name` is undefined. ([45041](https://github.com/WordPress/gutenberg/pull/45041)) +- Make custom font sizes appear fluid in the block editor when fluid typography is enabled. ([44765](https://github.com/WordPress/gutenberg/pull/44765)) +- Search block: Ensure font sizes values are converted to fluid in the editor. ([44852](https://github.com/WordPress/gutenberg/pull/44852)) +- Fluid typography: Convert font size inline style attributes to fluid values. ([44764](https://github.com/WordPress/gutenberg/pull/44764)) + +#### Components +- FontSizePicker: Fix header order in RTL languages. ([44590](https://github.com/WordPress/gutenberg/pull/44590)) +- Navigator: Restore focus only once per location. ([44972](https://github.com/WordPress/gutenberg/pull/44972)) +- Spacing Sizes Control: Try improving layout spacing. ([44858](https://github.com/WordPress/gutenberg/pull/44858)) + + +#### Global Styles +- Ensure style card effect doesn't cause scrollbars to appear. ([44823](https://github.com/WordPress/gutenberg/pull/44823)) +- Fluid Typography: Fix bug in global styles where fluid clamp rules were not calculated for custom values. ([44761](https://github.com/WordPress/gutenberg/pull/44761)) + +### Accessibility +- Fix the block toolbar styling when the 'Show button text labels' preference is enabled. ([44779](https://github.com/WordPress/gutenberg/pull/44779)) +- Fluid typography: Add font size constraints. ([44993](https://github.com/WordPress/gutenberg/pull/44993)) + + +### Performance + +- Lodash refactor away ([44892](https://github.com/WordPress/gutenberg/pull/44892), [45014](https://github.com/WordPress/gutenberg/pull/45014), [45010](https://github.com/WordPress/gutenberg/pull/45010), [44875](https://github.com/WordPress/gutenberg/pull/44875), [44901](https://github.com/WordPress/gutenberg/pull/44901), [44874](https://github.com/WordPress/gutenberg/pull/44874), [44894](https://github.com/WordPress/gutenberg/pull/44894)) +- Lodash: Remove completely from `@wordpress/viewport` package. ([44572](https://github.com/WordPress/gutenberg/pull/44572)) +- Remove unnecessary repeated function call. ([44545](https://github.com/WordPress/gutenberg/pull/44545)) +- Block Library, QueryInspectorControls: Avoid rerender of TaxonomyControls on every keystroke. ([44562](https://github.com/WordPress/gutenberg/pull/44562)) + +### Documentation + +- Fix broken link to `01-basic-esnext` example. ([45000](https://github.com/WordPress/gutenberg/pull/45000)) +- Add `ariaLabel` support to block supports reference documentation. ([45006](https://github.com/WordPress/gutenberg/pull/45006)) +- Docs: Fix some typos. ([44713](https://github.com/WordPress/gutenberg/pull/44713)) +- Layout Docs: Fix broken link in table of contents. ([44719](https://github.com/WordPress/gutenberg/pull/44719)) +- Layout: Document the current state of the layout block support. ([42619](https://github.com/WordPress/gutenberg/pull/42619)) +- Make `spacingScale` description more accurate in theme.json schema. ([44794](https://github.com/WordPress/gutenberg/pull/44794)) +- Remove duplicate img tag. ([44936](https://github.com/WordPress/gutenberg/pull/44936)) +- Updating versions in WP in light of 6.0.3 release. ([45052](https://github.com/WordPress/gutenberg/pull/45052)) +- package(prettier-config): Update documentation. ([44620](https://github.com/WordPress/gutenberg/pull/44620)) +- Connect extend Query Loop documentation. ([44699](https://github.com/WordPress/gutenberg/pull/44699)) +- Update Extending the Query Loop block documentation. ([44703](https://github.com/WordPress/gutenberg/pull/44703)) +- Update link to plugin-sidebar example in documentation. ([44790](https://github.com/WordPress/gutenberg/pull/44790)) +- Update versions in WordPress documentation for 6.1. ([44785](https://github.com/WordPress/gutenberg/pull/44785)) +- Update visually hidden documentation to mention stacking context. ([44867](https://github.com/WordPress/gutenberg/pull/44867)) + + + +### Code Quality + +- Fix comment in edit post reducer. ([44978](https://github.com/WordPress/gutenberg/pull/44978)) +- Fix: PHP 8.1 Deprecation messages. ([44828](https://github.com/WordPress/gutenberg/pull/44828)) +- Navigator: Remove overflow styles from NavigatorScreen. ([44973](https://github.com/WordPress/gutenberg/pull/44973)) +- Refactor the document actions component. ([45060](https://github.com/WordPress/gutenberg/pull/45060)) +- Simplify BlockStyles preview by removing the slot. ([44825](https://github.com/WordPress/gutenberg/pull/44825)) +- Update 6.1 CSS filter to match core. ([44962](https://github.com/WordPress/gutenberg/pull/44962)) +- Fluid Typography: Add missing style.css file to test theme. ([44958](https://github.com/WordPress/gutenberg/pull/44958)) +- Site Editor: Dynamic Templates Names and Descriptions: Code parity with wp/6.1. ([44646](https://github.com/WordPress/gutenberg/pull/44646)) +- Fluid Typography: Use wp_ prefixed function. ([44876](https://github.com/WordPress/gutenberg/pull/44876)) +- Remove gutenberg_ prefix for theme_json_get_style_nodes filter. ([44949](https://github.com/WordPress/gutenberg/pull/44949)) +- Update the names of filters for global styles data. ([44940](https://github.com/WordPress/gutenberg/pull/44940)) +- Try: Refresh selection styles. ([44150](https://github.com/WordPress/gutenberg/pull/44150)) +- Design Tools, Archive Block: Prevent spacing styles and additional CSS classes from being printed twice. ([44438](https://github.com/WordPress/gutenberg/pull/44438)) +- Design Tools, Tag Cloud Block: Prevent block support styles and additional CSS classes from being printed twice. ([44439](https://github.com/WordPress/gutenberg/pull/44439)) +- Site Editor: Rename header and sidebar components in edit-site. ([44974](https://github.com/WordPress/gutenberg/pull/44974)) +- Refactor dropzone for unmodified default blocks with `useBlockDropZone` and `InsertionPoint`. ([44647](https://github.com/WordPress/gutenberg/pull/44647)) +- Data: Cleanup `useDispatch` tests. ([44856](https://github.com/WordPress/gutenberg/pull/44856)) + + +#### ESLint +- ESLint: Fix rule violations. ([44927](https://github.com/WordPress/gutenberg/pull/44927), [44896](https://github.com/WordPress/gutenberg/pull/44896), [44895](https://github.com/WordPress/gutenberg/pull/44895), [44926](https://github.com/WordPress/gutenberg/pull/44926), [44939](https://github.com/WordPress/gutenberg/pull/44939), [44930](https://github.com/WordPress/gutenberg/pull/44930), [44902](https://github.com/WordPress/gutenberg/pull/44902), [44928](https://github.com/WordPress/gutenberg/pull/44928), [44925](https://github.com/WordPress/gutenberg/pull/44925), [45061](https://github.com/WordPress/gutenberg/pull/45061), [45067](https://github.com/WordPress/gutenberg/pull/45067), [45097](https://github.com/WordPress/gutenberg/pull/45097), [45064](https://github.com/WordPress/gutenberg/pull/45064), [45068](https://github.com/WordPress/gutenberg/pull/45068), [45062](https://github.com/WordPress/gutenberg/pull/45062), [45096](https://github.com/WordPress/gutenberg/pull/45096), [45106](https://github.com/WordPress/gutenberg/pull/45106), [45018](https://github.com/WordPress/gutenberg/pull/45018)) +- ESLint: Fix a few jsdoc/check-line-alignment warnings. ([44984](https://github.com/WordPress/gutenberg/pull/44984)) +- ESLint: Fix empty `toHaveTextContent`. ([45007](https://github.com/WordPress/gutenberg/pull/45007)) + +#### Refactor tests to RTL +- Data Layer ([44802](https://github.com/WordPress/gutenberg/pull/44802), [44855](https://github.com/WordPress/gutenberg/pull/44855), [45058](https://github.com/WordPress/gutenberg/pull/45058)) +- Block Editor ([44869](https://github.com/WordPress/gutenberg/pull/44869), [44870](https://github.com/WordPress/gutenberg/pull/44870), [44871](https://github.com/WordPress/gutenberg/pull/44871), [45071](https://github.com/WordPress/gutenberg/pull/45071)) +- Components ([45072](https://github.com/WordPress/gutenberg/pull/45072), [45012](https://github.com/WordPress/gutenberg/pull/45012), [44801](https://github.com/WordPress/gutenberg/pull/44801), [44826](https://github.com/WordPress/gutenberg/pull/44826), [44824](https://github.com/WordPress/gutenberg/pull/44824), [44821](https://github.com/WordPress/gutenberg/pull/44821), [44820](https://github.com/WordPress/gutenberg/pull/44820)) +- Post Editor([45011](https://github.com/WordPress/gutenberg/pull/45011), [44835](https://github.com/WordPress/gutenberg/pull/44835), [45066](https://github.com/WordPress/gutenberg/pull/45066), [44923](https://github.com/WordPress/gutenberg/pull/44923), [44872](https://github.com/WordPress/gutenberg/pull/44872)) +- Compose ([44818](https://github.com/WordPress/gutenberg/pull/44818), [44819](https://github.com/WordPress/gutenberg/pull/44819), [44912](https://github.com/WordPress/gutenberg/pull/44912), [45108](https://github.com/WordPress/gutenberg/pull/45108)) +- Viewport ([44766](https://github.com/WordPress/gutenberg/pull/44766), [44769](https://github.com/WordPress/gutenberg/pull/44769)) +- Element ([44804](https://github.com/WordPress/gutenberg/pull/44804)) +- Interface ([44803](https://github.com/WordPress/gutenberg/pull/44803)) + + +#### Components +- Navigator: Refactor Storybook code to TypeScript and controls. ([44979](https://github.com/WordPress/gutenberg/pull/44979)) +- Navigator: Refactor tests to TypeScript and user-event. ([44970](https://github.com/WordPress/gutenberg/pull/44970)) +- Refactor `ToolsPanel` to pass `exhaustive-deps`. ([45028](https://github.com/WordPress/gutenberg/pull/45028)) +- Refactor `Tooltip` tests to always render inline. ([45105](https://github.com/WordPress/gutenberg/pull/45105)) +- Refactor to use `@testing-library/react`. ([44698](https://github.com/WordPress/gutenberg/pull/44698), [44695](https://github.com/WordPress/gutenberg/pull/44695), [44697](https://github.com/WordPress/gutenberg/pull/44697)) +- Refactor `Tooltip` to ignore `exhaustive-deps`. ([45043](https://github.com/WordPress/gutenberg/pull/45043)) +- Modal: Convert component to TypeScript. ([42949](https://github.com/WordPress/gutenberg/pull/42949)) +- Sandbox: Use toString to create observe and resize script string. ([42872](https://github.com/WordPress/gutenberg/pull/42872)) + + + +### Tools + +- Combine stale issue gardening workflows into one. ([44754](https://github.com/WordPress/gutenberg/pull/44754)) +- Ensure stale github actions workflow only runs for particular issue labels. ([44910](https://github.com/WordPress/gutenberg/pull/44910)) +- Configure Dependabot pull requests for GitHub Actions. ([44677](https://github.com/WordPress/gutenberg/pull/44677)) +- Storybook: Add theme switcher tool. ([44715](https://github.com/WordPress/gutenberg/pull/44715)) +- Bug Fix, wp-env: Use case insensitive regex when checking WP version string. ([44887](https://github.com/WordPress/gutenberg/pull/44887)) +- Cherry Pick Script: Restore retrieval of merge_commit_sha. ([44890](https://github.com/WordPress/gutenberg/pull/44890)) + +#### Schemas + +- Fix: Typo in block.json schema default scope values. ([44944](https://github.com/WordPress/gutenberg/pull/44944)) +- Fix: typo in block.json schema. ([44798](https://github.com/WordPress/gutenberg/pull/44798)) +- Fix: theme json schema validation. ([44799](https://github.com/WordPress/gutenberg/pull/44799)) +- Add title property to theme.json schema. ([44797](https://github.com/WordPress/gutenberg/pull/44797)) + +#### Build Tooling +- Add `.eslintcache` to `.gitignore`. ([44938](https://github.com/WordPress/gutenberg/pull/44938)) +- ESLint: Add and enable `eslint-plugin-jest-dom`. ([44983](https://github.com/WordPress/gutenberg/pull/44983)) +- Style Engine: Move PHP unit tests to Gutenberg. ([44722](https://github.com/WordPress/gutenberg/pull/44722)) + +#### Testing +- Add support for React 18 and later to jest-preset-default. ([44680](https://github.com/WordPress/gutenberg/pull/44680)) +- Migrate `nonce.test.js` to Playwright. ([44929](https://github.com/WordPress/gutenberg/pull/44929)) +- end-to-end Tests: Make attributes and innerblocks optional in insertBlock. ([44933](https://github.com/WordPress/gutenberg/pull/44933)) +- Bug Fix, end-to-end tests: Update button selector. ([45087](https://github.com/WordPress/gutenberg/pull/45087)) +- Mobile + - Code block - Migrate from React Test Render to React Native Testing Library. ([44833](https://github.com/WordPress/gutenberg/pull/44833)) + - Tooltip - Migrate from React Test Render to React Native Testing Library. ([44831](https://github.com/WordPress/gutenberg/pull/44831)) + - Update editor initial HTML test for iOS and update Appium. ([44732](https://github.com/WordPress/gutenberg/pull/44732)) + - useResizeObserver - Migrate from React Test Render to React Native Testing Library. ([44832](https://github.com/WordPress/gutenberg/pull/44832)) + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @benridane: Fix list outdents on Enter in quote block. ([44809](https://github.com/WordPress/gutenberg/pull/44809)) +- @jeremylind: FIX: Typo in block.json schema default scope values. ([44944](https://github.com/WordPress/gutenberg/pull/44944)) +- @PooSham: Add support for React 18 and later to jest-preset-default. ([44680](https://github.com/WordPress/gutenberg/pull/44680)) +- @thelovekesh: package(prettier-config): Update documentation. ([44620](https://github.com/WordPress/gutenberg/pull/44620)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @adamziel @afercia @ajlende @alanjacobmathew @amustaque97 @andrewserong @annezazu @BE-Webdesign @benridane @c4rl0sbr4v0 @carolinan @chad1008 @ciampo @costdev @danielbachhuber @dcalhoun @desrosj @dinhtungdu @draganescu @ellatrix @fabiankaegy @fluiddot @geriux @getdave @glendaviesnz @gvgvgvijayan @jasmussen @jeremylind @jorgefilipecosta @joshuatf @jrfnl @jsnajdr @kevin940726 @Mamaduka @mikachan @mirka @mtias @noisysocks @ntsekouras @oandregal @ockham @pento @PooSham @ramonjd @ryanwelcher @sabernhardt @SantosGuillamot @scruffian @Soean @t-hamano @talldan @tellthemachines @thelovekesh @tyxla @walbo @youknowriad + + += 14.3.1 = + + + +## Changelog + +### Code Quality + +#### Block Library +- Add: Missing output escaping on some blocks. ([45045](https://github.com/WordPress/gutenberg/pull/45045)) + + +## First time contributors + +The following PRs were merged by first time contributors: + + + +## Contributors + +The following contributors merged PRs in this release: + +@jorgefilipecosta + + += 14.3.0 = + + +## Changelog + +### Enhancements + +#### Post Editor +- Optimize legacy post content layout. ([44506](https://github.com/WordPress/gutenberg/pull/44506)) +- Remove right border when sidebars are closed. ([44613](https://github.com/WordPress/gutenberg/pull/44613)) + +#### Block Library +- Comment Pagination Numbers: Add background color. ([43902](https://github.com/WordPress/gutenberg/pull/43902)) +- Navigation Submenu: Use `get_queried_object_id` when setting `current-menu-item` classes. ([44474](https://github.com/WordPress/gutenberg/pull/44474)) +- Post Author: Include option to link author archive. ([42670](https://github.com/WordPress/gutenberg/pull/42670)) +- Post Terms: Add spacing support. ([43646](https://github.com/WordPress/gutenberg/pull/43646)) +- Query Loop: Hide instructions for FormTokenField. ([44641](https://github.com/WordPress/gutenberg/pull/44641)) +- Tag Cloud: Remove `strtolower` around taxonomy name. ([16112](https://github.com/WordPress/gutenberg/pull/16112)) +- Video: Update placeholder style. ([44215](https://github.com/WordPress/gutenberg/pull/44215)) + +#### Components +- FontSizePicker: Make control take up full width. ([44559](https://github.com/WordPress/gutenberg/pull/44559)) +- Placeholder: Remove unnecessary background color. ([44497](https://github.com/WordPress/gutenberg/pull/44497)) +- Placeholder: Update placeholder style. ([44190](https://github.com/WordPress/gutenberg/pull/44190)) +- ToggleGroupControl: Fix unselected icon color. ([44575](https://github.com/WordPress/gutenberg/pull/44575)) +- ToolsPanel: Add subheadings and reset text to tools panel menu. ([44260](https://github.com/WordPress/gutenberg/pull/44260)) + +#### Block API +- Blocks: Deprecate non-string descriptions. ([44455](https://github.com/WordPress/gutenberg/pull/44455)) +- Tag Processor: Document and test XSS prevention in set_attribute. ([44447](https://github.com/WordPress/gutenberg/pull/44447)) +- Tag Processor: Throw error when supplied with unacceptable attribute names. ([44431](https://github.com/WordPress/gutenberg/pull/44431)) +- Tag Processor: Use (start,length) values for tracking tag name. ([44479](https://github.com/WordPress/gutenberg/pull/44479)) +- Tag processor: Update 'since' version tags to 6.2.0. ([44432](https://github.com/WordPress/gutenberg/pull/44432)) + +#### Global Styles +- Hide the done button of the Global Style palette editor when there aren't colors to edit. ([44372](https://github.com/WordPress/gutenberg/pull/44372)) +- Use ToolsPanel in Global Styles → Typography. ([44180](https://github.com/WordPress/gutenberg/pull/44180)) + +#### Block Editor +- Allow dropping an image on an empty paragraph block to create an image block. ([42722](https://github.com/WordPress/gutenberg/pull/42722)) +- Writing flow: Implement Alt+Arrow. ([44081](https://github.com/WordPress/gutenberg/pull/44081)) + +#### Site Editor +- Allow drag and drop for blocks and patterns in zoom-out mode. ([44402](https://github.com/WordPress/gutenberg/pull/44402)) + +#### Block Directory +- Use 'tertiary' in missing block warning. ([44368](https://github.com/WordPress/gutenberg/pull/44368)) + + +### New APIs + +#### Block Library +- WP_HTML_Tag_Processor: Inject dynamic data to block HTML markup in PHP. ([42485](https://github.com/WordPress/gutenberg/pull/42485)) + + +### Bug Fixes + +- Add a correct TS signature for useEntityRecords. ([44448](https://github.com/WordPress/gutenberg/pull/44448)) +- BlockDraggable: Change prop name passed to children when dragging is disabled. ([44371](https://github.com/WordPress/gutenberg/pull/44371)) +- Fix Lint warning/errors in cherry-pick script. ([44662](https://github.com/WordPress/gutenberg/pull/44662)) +- Fix: Content blocks with nested blocks always appear as top level. ([44098](https://github.com/WordPress/gutenberg/pull/44098)) +- Hide the Classic block in the Site Editor. ([44554](https://github.com/WordPress/gutenberg/pull/44554)) +- PHP 8.2: Remove deprecated callable in Style Engine value functions. ([44561](https://github.com/WordPress/gutenberg/pull/44561)) +- Persisted preferences: Fix context property of user meta configuration. ([44489](https://github.com/WordPress/gutenberg/pull/44489)) +- Resizable editor: Fix height setting bug. ([44637](https://github.com/WordPress/gutenberg/pull/44637)) +- Style engine: Kebab case preset slugs in the editor. ([44406](https://github.com/WordPress/gutenberg/pull/44406)) +- Add submenu block href only if URL is not empty. ([44337](https://github.com/WordPress/gutenberg/pull/44337)) +- Update Theme JSON `$schema` to allow pseudo selectors on `button` property. ([44303](https://github.com/WordPress/gutenberg/pull/44303)) +- Preserve the generic signature of getEntityRecord and getEntityRecords through currying. ([44453](https://github.com/WordPress/gutenberg/pull/44453)) +- Template editor: Fix crashes due to undefined vars. ([44482](https://github.com/WordPress/gutenberg/pull/44482)) +- Add missing value to CSS font-display descriptor in theme.json. ([44622](https://github.com/WordPress/gutenberg/pull/44622)) +- Rich text: Avoid updating partial selection unnecessarily. ([44330](https://github.com/WordPress/gutenberg/pull/44330)) +- useMergeRefs: Don't call/mutate refs passed if unused. ([44629](https://github.com/WordPress/gutenberg/pull/44629)) + +#### Block Library +- Code Block: Add box-sizing to fix inconsistent layout. ([44580](https://github.com/WordPress/gutenberg/pull/44580)) +- Comment Author: Fix empty links created for the author's name. ([44650](https://github.com/WordPress/gutenberg/pull/44650)) +- Comments: Support nested comments settings in the comments blocks. ([44351](https://github.com/WordPress/gutenberg/pull/44351)) +- Group: Legacy Group inner block wrapper should work with a constrained layout. ([44660](https://github.com/WordPress/gutenberg/pull/44660)) +- Image: Fix rotated image crop area aspect ratio. ([44425](https://github.com/WordPress/gutenberg/pull/44425)) +- Image: Upgrade react-easy-crop to bring in fix for site editor iframe. ([44408](https://github.com/WordPress/gutenberg/pull/44408)) +- Navigation: Fix console error. ([44594](https://github.com/WordPress/gutenberg/pull/44594)) +- Navigation: Fix semitransparent burger icon. ([44525](https://github.com/WordPress/gutenberg/pull/44525)) +- Navigation: Try fixing link color in some TT2 contexts. ([44578](https://github.com/WordPress/gutenberg/pull/44578)) +- Paragraph: Disable drop cap control if text is aligned. ([42326](https://github.com/WordPress/gutenberg/pull/42326)) +- Post Featured Image: Fix borders after addition of overlay feature. ([44286](https://github.com/WordPress/gutenberg/pull/44286)) +- Post Featured Image: Fix application of default border style in editor. ([44520](https://github.com/WordPress/gutenberg/pull/44520)) +- Query Loop: Fix condition for displaying 'parents' control. ([44630](https://github.com/WordPress/gutenberg/pull/44630)) +- Query Loop: Rename Query Loop variations `allowControls` to `allowedControls`. ([44523](https://github.com/WordPress/gutenberg/pull/44523)) +- Quote block: Stop slash inserter popup showing in the citation. ([44634](https://github.com/WordPress/gutenberg/pull/44634)) +- Site Title: Fix link color not being applied in editor #37071. ([44333](https://github.com/WordPress/gutenberg/pull/44333)) +- Template part: Prevent adding block in post editor or inside post template or content blocks. ([44480](https://github.com/WordPress/gutenberg/pull/44480)) +- Video: Don't display placeholder SVG when Video block selected. ([44564](https://github.com/WordPress/gutenberg/pull/44564)) + + +#### Global Styles +- Fix empty color indicator with a custom style. ([44364](https://github.com/WordPress/gutenberg/pull/44364)) +- Re-add styles that were removed for classic themes. ([44334](https://github.com/WordPress/gutenberg/pull/44334)) +- Remove border from Global Styles previews. ([44556](https://github.com/WordPress/gutenberg/pull/44556)) +- Spacing presets: Modify the styling of the input controls when in unlinked mode in order to better differentiate sides. ([44141](https://github.com/WordPress/gutenberg/pull/44141)) +- Style cards: Fix focus style. ([44612](https://github.com/WordPress/gutenberg/pull/44612)) +- Theme.json: Fix some shadow properties not working properly in the site editor. ([44569](https://github.com/WordPress/gutenberg/pull/44569)) +- Use color hex + index as key in the Palette component color indicator. ([44344](https://github.com/WordPress/gutenberg/pull/44344)) + +#### Design Tools +- Fix padding/margin visualizer accuracy. ([44485](https://github.com/WordPress/gutenberg/pull/44485)) +- Fix padding/margin visualizer placement. ([44484](https://github.com/WordPress/gutenberg/pull/44484)) +- Fix spacing property generation in flow layout type. ([44446](https://github.com/WordPress/gutenberg/pull/44446)) + +#### Components +- BorderBoxControl: Ensure the most common unit selection is maintained. ([44565](https://github.com/WordPress/gutenberg/pull/44565)) +- Popover: Fix limitShift logic by adding iframe offset correctly (and a custom shift limiter). ([42950](https://github.com/WordPress/gutenberg/pull/42950)) +- Popover: Refine position-to-placement conversion logic, add tests. ([44377](https://github.com/WordPress/gutenberg/pull/44377)) +- Navigator Screen: Fix bug where focus moved erroneously. ([44239](https://github.com/WordPress/gutenberg/pull/44239)) + +#### Block Editor +- Fix block search for non-Latin characters. ([44652](https://github.com/WordPress/gutenberg/pull/44652)) +- Prevent empty block toolbars from showing empty slots. ([44704](https://github.com/WordPress/gutenberg/pull/44704)) + +#### Widgets Editor +- Add extra guarding against legacy widget preview errors. ([44635](https://github.com/WordPress/gutenberg/pull/44635)) + +#### Themes +- Theme export: Fix broken spacingScale export. ([44555](https://github.com/WordPress/gutenberg/pull/44555)) +- Theme export: Stop slugs being cast to integers when a theme is exported. ([44589](https://github.com/WordPress/gutenberg/pull/44589)) + +#### Accessibility +- TokenInput field: Try alternative approach to fix screen reader focus issue. ([44526](https://github.com/WordPress/gutenberg/pull/44526)) + +#### Patterns +- Fix patterns drag and drop in Safari. ([44366](https://github.com/WordPress/gutenberg/pull/44366)) + +#### Post Editor +- Add layout styles from Post Content block to post editor. ([44258](https://github.com/WordPress/gutenberg/pull/44258)) + + +### Performance + +- Compose: Introduce an in-house `throttle()` utility, deprecate Lodash version. ([44225](https://github.com/WordPress/gutenberg/pull/44225)) +- Improve Slot/Fill performance. ([44642](https://github.com/WordPress/gutenberg/pull/44642)) + + +### Documentation + +- Add documentation for extending the Query Loop block via variations. ([44137](https://github.com/WordPress/gutenberg/pull/44137)) +- Add more details about possible values for block assets in `block.json`. ([44199](https://github.com/WordPress/gutenberg/pull/44199)) +- Add missing import statement for useBlockProps. ([44607](https://github.com/WordPress/gutenberg/pull/44607)) +- Instruct people to keep using `wp-scripts` even when extending webpack. ([44348](https://github.com/WordPress/gutenberg/pull/44348)) +- Style engine: Updating and fleshing out documentation. ([44405](https://github.com/WordPress/gutenberg/pull/44405)) +- Style engine: Update readme. ([44308](https://github.com/WordPress/gutenberg/pull/44308)) +- Add callout for experimental packages. ([44056](https://github.com/WordPress/gutenberg/pull/44056)) +- Expand class-level documentation for `WP_HTML_Tag_Processor`. ([44478](https://github.com/WordPress/gutenberg/pull/44478)) +- Experiments: Add README.md and CHANGELOG.md. ([44457](https://github.com/WordPress/gutenberg/pull/44457)) +- Remove the package name from the sub-menu item for clarity. ([44643](https://github.com/WordPress/gutenberg/pull/44643)) + +### Code Quality + +- Avoid calling get_blocks_metadata in WP_Theme_JSON constructor. ([44658](https://github.com/WordPress/gutenberg/pull/44658)) +- Block Popover: Use placement instead of position; move to useBlockToolbarPopoverProps hook. ([44323](https://github.com/WordPress/gutenberg/pull/44323)) +- CS/QA: Various minor fixes. ([44551](https://github.com/WordPress/gutenberg/pull/44551)) +- CS: Always use parentheses when instantiating objects. ([44550](https://github.com/WordPress/gutenberg/pull/44550)) +- CS: Remove redundant parentheses for include/require statements. ([44544](https://github.com/WordPress/gutenberg/pull/44544)) +- CS: Use pre-increment instead of post-increment. ([44549](https://github.com/WordPress/gutenberg/pull/44549)) +- Fix comment typo in document generation tools. ([44583](https://github.com/WordPress/gutenberg/pull/44583)) +- I18n: Use consistent string: 'Link rel'. ([20162](https://github.com/WordPress/gutenberg/pull/20162)) +- PHP 8.2 | Fix deprecated embedded variables in text strings. ([44538](https://github.com/WordPress/gutenberg/pull/44538)) +- PHP 8.2 | Fix for partially supported callback. ([44537](https://github.com/WordPress/gutenberg/pull/44537)) +- PHPCS: Use PHPCompatibilityWP. ([44542](https://github.com/WordPress/gutenberg/pull/44542)) +- QA: No control structures with empty body. ([44548](https://github.com/WordPress/gutenberg/pull/44548)) +- Script loader: Remove 6.1 wp actions. ([44519](https://github.com/WordPress/gutenberg/pull/44519)) + +#### Components +- Components refactor `Mobile` to ignore `exhaustive-deps`. ([44207](https://github.com/WordPress/gutenberg/pull/44207)) +- Convert FontSizePicker to TypeScript. ([44449](https://github.com/WordPress/gutenberg/pull/44449)) +- FontSizePicker: Replace SCSS with Emotion + components. ([44483](https://github.com/WordPress/gutenberg/pull/44483)) +- RangeControl: Remove unused UseDebouncedHoverInteractionArgs type. ([44411](https://github.com/WordPress/gutenberg/pull/44411)) +- Refactor `Notice` to pass `exhaustive-deps`. ([44157](https://github.com/WordPress/gutenberg/pull/44157)) +- Refactor `ResizableBox` to pass `exhaustive-deps`. ([44370](https://github.com/WordPress/gutenberg/pull/44370)) +- Refactor `Sandbox` to pass `exhaustive-deps`. ([44378](https://github.com/WordPress/gutenberg/pull/44378)) +- Refactor `SearchControl` native files to ignore `exhaustive-deps`. ([44381](https://github.com/WordPress/gutenberg/pull/44381)) + +#### Block Library +- Archive Block: Remove unnecessary spaces from class attributes. ([44440](https://github.com/WordPress/gutenberg/pull/44440)) +- Archive: No need to escape class variable. ([44468](https://github.com/WordPress/gutenberg/pull/44468)) +- Gallery: Remove unnecessary caption state. ([44383](https://github.com/WordPress/gutenberg/pull/44383)) +- Remove unnecessary `view.js` file from navigation-submenu block. ([44570](https://github.com/WordPress/gutenberg/pull/44570)) + +#### Plugin +- CS: All methods must declare visibility. ([44543](https://github.com/WordPress/gutenberg/pull/44543)) +- Move `wp_enqueue_block_view_script` to experiments. ([44414](https://github.com/WordPress/gutenberg/pull/44414)) + +#### Layout +- Backport code quality changes from core to Gutenberg. ([44661](https://github.com/WordPress/gutenberg/pull/44661)) + +#### Parsing +- Block Serialization Default Parser: Bring back `no-more-tokens` type. ([44459](https://github.com/WordPress/gutenberg/pull/44459)) + +#### Global Styles +- Add `blocks` to the list of valid origins for `theme.json`. ([44363](https://github.com/WordPress/gutenberg/pull/44363)) + +#### Lodash +- Lodash: Remove completely from `@wordpress/compose` package. ([44568](https://github.com/WordPress/gutenberg/pull/44568)) +- Lodash: Remove completely from `@wordpress/library-export-default-webpack-plugin` package. ([44571](https://github.com/WordPress/gutenberg/pull/44571)) +- Lodash: Remove completely from `@wordpress/list-reusable-blocks` package. ([44567](https://github.com/WordPress/gutenberg/pull/44567)) +- Lodash: Refactor away from `_.flow()`. ([44500](https://github.com/WordPress/gutenberg/pull/44500)) +- Lodash: Remove completely from `@wordpress/block-directory` package. ([44206](https://github.com/WordPress/gutenberg/pull/44206)) +- Lodash: Remove completely from `@wordpress/rich-text` package. ([44204](https://github.com/WordPress/gutenberg/pull/44204)) + +### Tools + +- Scripts: Use default value for process.env.WP_SRC_DIRECTORY. ([44367](https://github.com/WordPress/gutenberg/pull/44367)) +- Limit access to experimental APIs to WordPress codebase. ([43386](https://github.com/WordPress/gutenberg/pull/43386)) +- Cherry Pick Script: Restore retrieval of merge_commit_sha. ([44890](https://github.com/WordPress/gutenberg/pull/44890)) + +#### Testing +- Autocomplete Component: Add end-to-end tests (take two). ([42905](https://github.com/WordPress/gutenberg/pull/42905)) +- Fix failing quote to reusable block conversion end-to-end test. ([44350](https://github.com/WordPress/gutenberg/pull/44350)) +- Add strict meta schema validation test for block.json. ([44423](https://github.com/WordPress/gutenberg/pull/44423)) +- Migrate iframed block test to Playwright. ([44164](https://github.com/WordPress/gutenberg/pull/44164)) +- Add theme.json schema tests. ([44252](https://github.com/WordPress/gutenberg/pull/44252)) +- Remove enzyme completely. ([44494](https://github.com/WordPress/gutenberg/pull/44494)) +- Fix typo from in writing flow spec. ([44358](https://github.com/WordPress/gutenberg/pull/44358)) +- Fix typo in WP_Navigation_Page_Test. ([44685](https://github.com/WordPress/gutenberg/pull/44685)) +- Popover: Convert unit tests to TypeScript and modern RTL assertions. ([44373](https://github.com/WordPress/gutenberg/pull/44373)) +- Refactor `AlignmentMatrixControl` tests to use `@testing-library/react`. ([44670](https://github.com/WordPress/gutenberg/pull/44670)) +- End-to-end Test Utils: Don't use hardcoded login credentials. ([44331](https://github.com/WordPress/gutenberg/pull/44331)) +- Refactor `PluginPostPublishPanel` tests to use RTL render. ([44667](https://github.com/WordPress/gutenberg/pull/44667)) +- Refactor `AutosaveMonitor` tests to `@testing-library/react`. ([44492](https://github.com/WordPress/gutenberg/pull/44492)) +- Refactor `PostPreviewButton` tests to `@testing-library/react`. ([44470](https://github.com/WordPress/gutenberg/pull/44470)) +- Refactor `BlockSwitcher` tests to `@testing-library/react`. ([44493](https://github.com/WordPress/gutenberg/pull/44493)) +- Refactor `ResponsiveBlockControl` tests to use `@testing-library/react`. ([44669](https://github.com/WordPress/gutenberg/pull/44669)) +- Style engine: Add JS unit tests for outline properties. ([44518](https://github.com/WordPress/gutenberg/pull/44518)) + +#### Build Tooling +- Upgrade Lerna to the latest version. ([44456](https://github.com/WordPress/gutenberg/pull/44456)) +- wp-env: Use case insensitive regex when checking WP version string. ([44887](https://github.com/WordPress/gutenberg/pull/44887)) + + +## First time contributors + +The following PRs were merged by first time contributors: + +- @alecgeatches: Add theme.json schema tests. ([44252](https://github.com/WordPress/gutenberg/pull/44252)) +- @BenoitZugmeyer: Use `get_queried_object_id` when setting `current-menu-item` classes. ([44474](https://github.com/WordPress/gutenberg/pull/44474)) +- @blindingstars: Update Theme JSON `$schema` to allow pseudo selectors on `button` property. ([44303](https://github.com/WordPress/gutenberg/pull/44303)) +- @imanish003: Add missing import statement for useBlockProps. ([44607](https://github.com/WordPress/gutenberg/pull/44607)) +- @loxK: Scripts: Use default value for process.env.WP_SRC_DIRECTORY. ([44367](https://github.com/WordPress/gutenberg/pull/44367)) +- @Lucisu: Fix empty links being created for the author's name comment. ([44650](https://github.com/WordPress/gutenberg/pull/44650)) +- @philwp: Post Author block now includes option to link author archive. ([42670](https://github.com/WordPress/gutenberg/pull/42670)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @adamziel @ajlende @alecgeatches @andrewserong @anton-vlasenko @BE-Webdesign @BenoitZugmeyer @blindingstars @carolinan @chad1008 @ciampo @derekblank @dmsnell @ellatrix @getdave @glendaviesnz @gziolo @imanish003 @inc2734 @jameskoster @jasmussen @javierarce @jorgefilipecosta @jrfnl @kevin940726 @loxK @Lucisu @luisherranz @Mamaduka @michalczaplinski @ndiego @noisysocks @ntsekouras @oandregal @pagelab @philwp @ramonjd @Rink9 @ryanwelcher @SantosGuillamot @scruffian @Soean @sunyatasattva @t-hamano @talldan @tellthemachines @tyxla @vcanales @youknowriad + + + + = 14.2.0 = ## Changelog diff --git a/docs/README.md b/docs/README.md index 1fe569f7356cb..4d5343a76141e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,7 +29,7 @@ The Editor offers rich new value to users with visual, drag-and-drop creation to Whether you want to extend the functionality of the block editor, or create a plugin based on it, [see the developer documentation](/docs/how-to-guides/README.md) to find all the information about the basic concepts you need to get started, the block editor APIs and its architecture. - [Gutenberg Architecture](/docs/explanations/architecture/README.md) -- [Block Styles](/docs/reference-guides/filters/block-filters.md#block-styles) +- [Block Styles](/docs/reference-guides/block-api/block-styles.md) - [Creating Block Patterns](/docs/reference-guides/block-api/block-patterns.md) - [Theming for the Block Editor](/docs/how-to-guides/themes/README.md) - [Block API Reference](/docs/reference-guides/block-api/README.md) diff --git a/docs/contributors/code/react-native/integration-test-guide.md b/docs/contributors/code/react-native/integration-test-guide.md index a73e277da3c62..af810a3a5dff2 100644 --- a/docs/contributors/code/react-native/integration-test-guide.md +++ b/docs/contributors/code/react-native/integration-test-guide.md @@ -90,7 +90,7 @@ const initialHtml = ` `; -const { getByA11yLabel } = initializeEditor( { +const { getByLabelText } = initializeEditor( { initialHtml, } ); ``` @@ -102,7 +102,7 @@ Once the components are rendered, it’s time to query them. An important note a When querying we should follow this priority order: 1. `getByText`: querying by text is the closest flow we can do from the user’s perspective, as text is the visual clue for them to identify elements. -2. `getByA11yLabel`: in some cases, we want to query elements that don’t provide text so in this case we can fallback to the accessibility label. +2. `getByLabelText`: in some cases, we want to query elements that don’t provide text so in this case we can fallback to the accessibility label. 3. `getByTestId`: if none of the previous options fit and/or we don’t have any visual element that we can rely upon, we have to fallback to a specific test id, which can be defined using the `testID` attribute (see [here](https://github.com/WordPress/gutenberg/blob/e5b387b19ffc50555f52ea5f0b415ab846896def/packages/block-editor/src/components/block-types-list/index.native.js#L80) for an example). Here are some examples: @@ -112,7 +112,7 @@ const mediaLibraryButton = getByText( 'WordPress Media Library' ); ``` ```js -const missingBlock = getByA11yLabel( /Unsupported Block\. Row 1/ ); +const missingBlock = getByLabelText( /Unsupported Block\. Row 1/ ); ``` ```js @@ -135,7 +135,7 @@ const mediaLibraryButton = await waitFor( () => ```js const missingBlock = await waitFor( () => - getByA11yLabel( /Unsupported Block\. Row 1/ ) + getByLabelText( /Unsupported Block\. Row 1/ ) ); ``` @@ -155,7 +155,7 @@ It’s also possible to query elements contained in other elements via the `with ```js const missingBlock = await waitFor( () => - getByA11yLabel( /Unsupported Block\. Row 1/ ) + getByLabelText( /Unsupported Block\. Row 1/ ) ); const translatedTableTitle = within( missingBlock ).getByText( 'Tabla' ); ``` @@ -224,7 +224,7 @@ A common way to query a block is by its accessibility label, here is an example: ```js const spacerBlock = await waitFor( () => - getByA11yLabel( /Spacer Block\. Row 1/ ) + getByLabelText( /Spacer Block\. Row 1/ ) ); ``` @@ -236,7 +236,7 @@ Here is an example of how to insert a Paragraph block: ```js // Open the inserter menu -fireEvent.press( await waitFor( () => getByA11yLabel( 'Add block' ) ) ); +fireEvent.press( await waitFor( () => getByLabelText( 'Add block' ) ) ); const blockList = getByTestId( 'InserterUI-Blocks' ); // onScroll event used to force the FlatList to render all items @@ -259,7 +259,7 @@ The block settings can be accessed by tapping the "Open Settings" button after s ```js fireEvent.press( block ); -const settingsButton = await waitFor( () => getByA11yLabel( 'Open Settings' ) ); +const settingsButton = await waitFor( () => getByLabelText( 'Open Settings' ) ); fireEvent.press( settingsButton ); ``` @@ -326,7 +326,7 @@ fireEvent( innerBlockListWrapper, 'layout', { } ); const buttonInnerBlock = await waitFor( () => - within( buttonsBlock ).getByA11yLabel( /Button Block\. Row 1/ ) + within( buttonsBlock ).getByLabelText( /Button Block\. Row 1/ ) ); fireEvent.press( buttonInnerBlock ); ``` diff --git a/docs/contributors/code/release.md b/docs/contributors/code/release.md index 4ce35e189fd70..492813376b2c9 100644 --- a/docs/contributors/code/release.md +++ b/docs/contributors/code/release.md @@ -34,6 +34,10 @@ To release a release candidate (RC) version of the plugin, enter `rc`. To releas This will trigger a GitHub Actions (GHA) workflow that bumps the plugin version, builds the Gutenberg plugin .zip file, creates a release draft, and attaches the plugin .zip file to it. This part of the process typically takes a little under six minutes. You'll see that workflow appear at the top of the list, right under the blue banner. Once it's finished, it'll change its status icon from a yellow dot to a green checkmark. You can follow along in a more detailed view by clicking on the workflow. +#### Publishing the @wordpress packages to NPM + +As part of the release candidate (RC) process, all of the `@wordpress` packages are published to NPM. You may see messaging after the ["Build Gutenberg Plugin Zip" action](https://github.com/WordPress/gutenberg/actions/workflows/build-plugin-zip.yml) action has created the draft release that the ["Publish npm packages"](https://github.com/WordPress/gutenberg/actions/workflows/publish-npm-packages.yml) action requires someone with appropriate permissions to trigger the action. This is not the case as this process is automated and it will automatically run after the release notes are published. + #### View the release draft As soon as the workflow has finished, you'll find the release draft under [https://github.com/WordPress/gutenberg/releases](https://github.com/WordPress/gutenberg/releases). The draft is pre-populated with changelog entries based on previous release candidates for this version, and any changes that have since been cherry-picked to the release branch. Thus, when releasing the first stable version of a series, make sure to delete any RC version headers (that are only there for your information) and to move the more recent changes to the correct section (see below). @@ -150,6 +154,8 @@ The method for point releases is nearly identical to the main Plugin release pro The point release should only contain the _specific commits_ required. To do this you should checkout the previous _minor_ stable (i.e. non-RC) release branch (e.g. `release/12.5`) locally and then cherry pick any commits that you require into that branch. +_IMPORTANT:_ If an RC already exists for a new version, you _need_ to cherry-pick the same commits in the respective release branch, as they will not be included automatically. E.g.: If you're about to release a new point-release for 12.5 and just cherry-picked into `release/12.5`, but 12.6.0-rc.1 is already out, then you need to cherry-pick the same commits into the `release/12.6` branch, or they won't be included in subsequent releases for 12.6! + The cherry-picking process can be automated with the [`npm run cherry-pick` script](/docs/contributors/code/auto-cherry-picking.md). You must also ensure that all PRs being included are assigned to the Github Milestone on which the point release is based. Bear in mind, that when PRs are _merged_ they are automatically assigned a milestone for the next _stable_ release. Therefore you will need to go back through each PR in Github and re-assign the Milestone. diff --git a/docs/contributors/code/scripts.md b/docs/contributors/code/scripts.md index 3b36c8f4be495..b7cabe0130d71 100644 --- a/docs/contributors/code/scripts.md +++ b/docs/contributors/code/scripts.md @@ -31,7 +31,6 @@ The editor includes a number of packages to enable various pieces of functionali | [Is Shallow Equal](/packages/is-shallow-equal/README.md) | wp-is-shallow-equal | A function for performing a shallow comparison between two objects or arrays | | [Keycodes](/packages/keycodes/README.md) | wp-keycodes | Keycodes utilities for WordPress, used to check the key pressed in events like `onKeyDown` | | [List Reusable blocks](/packages/list-reusable-blocks/README.md) | wp-list-reusable-blocks | Package used to add import/export links to the listing page of the reusable blocks | -| [NUX](/packages/nux/README.md) | wp-nux | Components, and wp.data methods useful for onboarding a new user to the WordPress admin interface | | [Plugins](/packages/plugins/README.md) | wp-plugins | Plugins module for WordPress | | [Redux Routine](/packages/redux-routine/README.md) | wp-redux-routine | Redux middleware for generator coroutines | | [Rich Text](/packages/rich-text/README.md) | wp-rich-text | Helper functions to convert HTML or a DOM tree into a rich text value and back | diff --git a/docs/contributors/code/testing-overview.md b/docs/contributors/code/testing-overview.md index fa17909b4cd37..f68469f6a893f 100644 --- a/docs/contributors/code/testing-overview.md +++ b/docs/contributors/code/testing-overview.md @@ -367,13 +367,13 @@ describe( 'SolarSystem', () => { test( 'should render', () => { const { container } = render( ); - expect( container.firstChild ).toMatchSnapshot(); + expect( container ).toMatchSnapshot(); } ); test( 'should contain mars if planets is true', () => { const { container } = render( ); - expect( container.firstChild ).toMatchSnapshot(); + expect( container ).toMatchSnapshot(); expect( screen.getByText( /mars/i ) ).toBeInTheDocument(); } ); } ); @@ -422,7 +422,7 @@ test( 'should contain mars if planets is true', () => { const { container } = render( ); // Snapshot will catch unintended changes - expect( container.firstChild ).toMatchSnapshot(); + expect( container ).toMatchSnapshot(); // This is what we actually expect to find in our test expect( screen.getByText( /mars/i ) ).toBeInTheDocument(); @@ -447,8 +447,8 @@ Similarly, the `toMatchStyleDiffSnapshot` function allows to snapshot only the d test( 'should render margin', () => { const { container: spacer } = render( ); const { container: spacerWithMargin } = render( ); - expect( spacerWithMargin.firstChild ).toMatchStyleDiffSnapshot( - spacer.firstChild + expect( spacerWithMargin ).toMatchStyleDiffSnapshot( + spacer ); } ); ``` diff --git a/docs/contributors/versions-in-wordpress.md b/docs/contributors/versions-in-wordpress.md index 0deeab1170250..cb23c072e8e4e 100644 --- a/docs/contributors/versions-in-wordpress.md +++ b/docs/contributors/versions-in-wordpress.md @@ -6,6 +6,8 @@ If anything looks incorrect here, please bring it up in #core-editor in [WordPre | Gutenberg Versions | WordPress Version | | ------------------ | ----------------- | +| 13.1-14.1 | 6.1 | +| 12.0-13.0 | 6.0.3 | | 12.0-13.0 | 6.0.2 | | 12.0-13.0 | 6.0.1 | | 12.0-13.0 | 6.0 | diff --git a/docs/explanations/architecture/styles.md b/docs/explanations/architecture/styles.md index c9f89cad45f6e..416eef796bec8 100644 --- a/docs/explanations/architecture/styles.md +++ b/docs/explanations/architecture/styles.md @@ -2,19 +2,22 @@ This document introduces the main concepts related to styles that affect the user content in the block editor. It points to the relevant reference guides and tutorials for readers to dig deeper into each one of the ideas presented. It's aimed to block authors and people working in the block editor project. -1. HTML and CSS -2. Block styles - -- From UI controls to HTML markup -- Block Supports API -- Current limits of the Block Supports API - -3. Global styles - -- Gather data -- Consolidate data -- From data to styles -- Current limits of the Global styles API +1. [HTML and CSS](#html-and-css) +2. [Block styles](#block-styles) + - [From UI controls to HTML markup](#from-ui-controls-to-html-markup) + - [Block Supports API](#block-supports-api) + - [Current limitations of the Block Supports API](#current-limitations-of-the-block-supports-api) +3. [Global styles](#global-styles) + - [Gather data](#gather-data) + - [Consolidate data](#consolidate-data) + - [From data to styles](#from-data-to-styles) + - [Current limitations of the Global Styles API](#current-limitations-of-the-global-styles-api) +4. [Layout styles](#layout-styles) + - [Base layout styles](#base-layout-styles) + - [Individual layout styles](#individual-layout-styles) + - [Available layout types](#available-layout-types) + - [Targeting layout or container blocks from themes](#targeting-layout-or-container-blocks-from-themes) + - [Opting out of generated layout styles](#opting-out-of-generated-layout-styles) ### HTML and CSS @@ -479,22 +482,87 @@ In addition to the CSS Custom Properties, all presets but duotone generate CSS c #### Current limitations of the Global Styles API -1. **Setting a different CSS selector for blocks requires server-registration** +##### 1. **Setting a different CSS selector for blocks requires server-registration** By default, the selector assigned to a block is `.wp-block-`. However, blocks can change this should they need. They can provide a CSS selector via the `__experimentalSelector` property in its `block.json`. If blocks do this, they need to be registered in the server using the `block.json`, otherwise, the global styles code doesn't have access to that information and will use the default CSS selector for the block. -2. **Can't target different HTML nodes for different styles** +##### 2. **Can't target different HTML nodes for different styles** Every chunk of styles can only use a single selector. This is particularly relevant if the block is using `__experimentalSkipSerialization` to serialize the different style properties to different nodes other than the wrapper. See "Current limitations of blocks supports" for more. -3. **Only a single property per block** +##### 3. **Only a single property per block** Similarly to block supports, there can be only one instance of any style in use by the block. For example, the block can only have a single font size. See related "Current limitations of block supports". -4. **Only blocks using block supports are shown in the Global Styles UI** +##### 4. **Only blocks using block supports are shown in the Global Styles UI** The global styles UI in the site editor has a screen for per-block styles. The list of blocks is generated dynamically using the block supports from the `block.json` of blocks. If a block wants to be listed there, it needs to use the block supports mechanism. + +### Layout styles + +In addition to styles at the individual block level and in global styles, there is the concept of layout styles that are output for both blocks-based and classic themes. + +The layout block support is an experimental approach for outputting common layout styles that are shared between blocks that are used for creating layouts. Layout styles are useful for providing common styling for any block that is a container for other blocks. Examples of blocks that depend on these layout styles include Group, Row, Columns, Buttons, and Social Icons. + +While the feature is part of WordPress core, it is still flagged as experimental in the sense that the features and output are still undergoing active development. It is therefore not yet a stable feature from the perspective of 3rd party blocks, as the API is likely to change. The feature is enabled in core blocks via the `__experimentalLayout` setting under `supports` in a block's `block.json` file. + +There are two primary places where Layout styles are output: + +#### Base layout styles + +Base layout styles are those styles that are common to all blocks that opt in to a particular layout type. Examples of common base layout styling include setting `display: flex` for blocks that use the Flex layout type (such as Buttons and Social Icons), and providing default max-width for constrained layouts. + +Base layout styles are output from within [the main PHP class](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-theme-json.php) that handles global styles, and form part of the global styles stylesheet. In order to provide support for core blocks in classic themes, these styles are always output, irrespective of whether the theme provides its own `theme.json` file. + +Common layout definitions are stored in [the core `theme.json` file](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/theme.json), but are not intended to be extended or overridden by themes. + +#### Individual layout styles + +When a block that opts in to the experimental layout support is rendered, two things are processed and added to the output via [`layout.php`](https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/block-supports/layout.php): + +- Semantic class names are added to the block markup to indicate which layout settings are in use. For example, `is-layout-flow` is for blocks (such as Group) that use the default/flow layout, and `is-content-justification-right` is added when a user sets a block to use right justification. +- Individual styles are generated for non-default layout values that are set on the individual block being rendered. These styles are attached to the block via a container class name using the form `wp-container-$id` where the `$id` is a [unique number](https://developer.wordpress.org/reference/functions/wp_unique_id/). + +#### Available layout types + +There are currently three layout types in use: + +* Default/Flow: Items are stacked vertically. The parent container block is set to `display: flow` and the spacing between children is handled via vertical margins. +* Constrained: Items are stacked vertically, using the same spacing logic as the Flow layout. Features constrained widths for child content, outputting widths for standard content size and wide size. Defaults to using global `contentSize` and `wideSize` values set in `settings.layout` in the `theme.json`. +* Flex: Items are displayed using a Flexbox layout. Defaults to a horizontal orientation. Spacing between children is handled via the `gap` CSS property. + +For controlling spacing between blocks, and enabling block spacing controls see: [What is blockGap and how can I use it?](https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#what-is-blockgap-and-how-can-i-use-it). + +#### Targeting layout or container blocks from themes + +The layout block support is designed to enable control over layout features from within the block and site editors. Where possible, try to use the features of the blocks to determine particular layout requirements rather than relying upon additional stylesheets. + +For themes that wish to target container blocks in order to add or adjust particular styles, the block's class name is often the best class name to use. Class names such as `wp-block-group` or `wp-block-columns` are usually reliable class names for targeting a particular block. + +For targeting a block that uses a particular layout type, avoid targeting `wp-container-` as container classes may not always be present in the rendered markup. + +##### Semantic class names + +Work is currently underway to expand stable semantic classnames in Layout block support output. The task is being discussed in [this issue](https://github.com/WordPress/gutenberg/issues/38719). + +The current semantic class names that can be output by the Layout block support are: + +* `is-layout-flow`: Blocks that use the Default/Flow layout type. +* `is-layout-constrained`: Blocks that use the Constrained layout type. +* `is-layout-flex`: Blocks that use the Flex layout type. +* `wp-container-$id`: Where `$id` is a semi-random number. A container class that only exists when the block contains non-default Layout values. This class should not be used directly for any CSS targeting as it may or may not be present. +* `is-horizontal`: When a block explicitly sets `orientation` to `horizontal`. +* `is-vertical`: When a block explicitly sets `orientation` to `vertical`. +* `is-content-justification-left`: When a block explicitly sets `justifyContent` to `left`. +* `is-content-justification-center`: When a block explicitly sets `justifyContent` to `center`. +* `is-content-justification-right`: When a block explicitly sets `justifyContent` to `right`. +* `is-content-justification-space-between`: When a block explicitly sets `justifyContent` to `space-between`. +* `is-nowrap`: When a block explicitly sets `flexWrap` to `nowrap`. + +#### Opting out of generated layout styles + +Layout styles output is switched on by default because the styles are required by core structural blocks. However, themes can opt out of generated block layout styles while retaining semantic class name output by using the `disable-layout-styles` block support. Such themes will be responsible for providing all their own layout styles. See [the entry under Theme Support](https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#disabling-base-layout-styles). diff --git a/docs/explanations/faq.md b/docs/explanations/faq.md index b1eb22b330964..08fcc6cbdce52 100644 --- a/docs/explanations/faq.md +++ b/docs/explanations/faq.md @@ -28,7 +28,7 @@ What follows is a set of questions that have come up from the last few years of ### The Development Experience - [How do I make my own block?](#how-do-i-make-my-own-block) -- [Does Gutenberg involve editing posts/pages in the front-end?](#does-gutenberg-involve-editing-postspages-in-the-front-end) +- [Does Gutenberg involve editing posts/pages in the front-end?](#does-gutenberg-involve-editing-posts-pages-in-the-front-end) - [Given Gutenberg is built in JavaScript, how do old meta boxes (PHP) work?](#given-gutenberg-is-built-in-javascript-how-do-old-meta-boxes-php-work) - [How can plugins extend the Gutenberg UI?](#how-can-plugins-extend-the-gutenberg-ui) - [Are Custom Post Types still supported?](#are-custom-post-types-still-supported) @@ -408,9 +408,11 @@ _See:_ [Editor Styles](/docs/how-to-guides/themes/theme-support.md#editor-styles ## What browsers does Gutenberg support? -Gutenberg works in modern browsers, and Internet Explorer 11. +Gutenberg works in modern browsers. -Our [list of supported browsers can be found in the Make WordPress handbook](https://make.wordpress.org/core/handbook/best-practices/browser-support/). By “modern browsers” we generally mean the _current and past two versions_ of each major browser. +The [list of supported browsers can be found in the Make WordPress handbook](https://make.wordpress.org/core/handbook/best-practices/browser-support/). The term “modern browsers” generally refers to the _current and previous two versions_ of each major browser. + +Since WordPress 5.8, Gutenberg no longer supports any version of Internet Explorer. ## Should I be concerned that Gutenberg will make my plugin obsolete? diff --git a/docs/getting-started/create-block/README.md b/docs/getting-started/create-block/README.md index ae56e4b123f0e..05d17f708c920 100644 --- a/docs/getting-started/create-block/README.md +++ b/docs/getting-started/create-block/README.md @@ -18,6 +18,8 @@ From your plugins directory, to create your block run: npx @wordpress/create-block gutenpride --template @wordpress/create-block-tutorial-template ``` +> Remember that you should use Node.js v14. Other versions may result in an error in the terminal. See [Node Development Tools](https://developer.wordpress.org/block-editor/getting-started/devenv/#node-development-tools) for more info. + The [npx command](https://docs.npmjs.com/cli/v8/commands/npx) runs a command from a remote package, in this case our create-block package that will create a new directory called `gutenpride`, installs the necessary files, and builds the block plugin. If you want an interactive mode that prompts you for details, run the command without the `gutenpride` name. You now need to activate the plugin from inside wp-admin plugins page. diff --git a/docs/getting-started/create-block/attributes.md b/docs/getting-started/create-block/attributes.md index 5ec6f60c3d6a4..02a55f380dcee 100644 --- a/docs/getting-started/create-block/attributes.md +++ b/docs/getting-started/create-block/attributes.md @@ -23,7 +23,7 @@ Note: The text portion is equivalent to `innerText` attribute of a DOM element. ## Edit and Save -The **attributes** are passed to the `edit` and `save` functions, along with a **setAttributes** function to set the values. Additional parameters are also passed in to these functions, see [the edit/save documentation](/docs/reference-guides/block-api/block-edit-save.md) for more details. +The **attributes** are passed to both the `edit` and `save` functions. The **setAttributes** function is also passed, but only to the `edit` function. The **setAttributes** function is used to set the values. Additional parameters are also passed in to the `edit` and `save` functions, see [the edit/save documentation](/docs/reference-guides/block-api/block-edit-save.md) for more details. The `attributes` is a JavaScript object containing the values of each attribute, or default values if defined. The `setAttributes` is a function to update an attribute. diff --git a/docs/getting-started/create-block/block-anatomy.md b/docs/getting-started/create-block/block-anatomy.md index 3f43c018cea39..83dbcf1469632 100644 --- a/docs/getting-started/create-block/block-anatomy.md +++ b/docs/getting-started/create-block/block-anatomy.md @@ -29,7 +29,7 @@ registerBlockType( metadata.name, { } ); ``` -The first parameter in the **registerBlockType** function is the block name, this should match exactly to the name registered in the PHP file. +The first parameter in the **registerBlockType** function is the block name, this should match exactly to the `name` property in the `block.json` file. By importing the metadata from `block.json` and referencing the `name` property in the first parameter we ensure that they will match, and continue to match even if the name is subsequently changed in `block.json`. The second parameter to the function is the block object. See the [block registration documentation](/docs/reference-guides/block-api/block-registration.md) for full details. @@ -37,7 +37,7 @@ The last two block object properties are **edit** and **save**, these are the ke The results of the edit function is what the editor will render to the editor page when the block is inserted. -The results of the save function is what the editor will insert into the **post_content** field when the post is saved. The post_content field is the field in the WordPress database used to store the content of the post. +The results of the save function is what the editor will insert into the **post_content** field when the post is saved. The post_content field is the field in the **wp_posts** table in the WordPress database that is used to store the content of the post. Most of the properties are set in the `src/block.json` file. diff --git a/docs/how-to-guides/README.md b/docs/how-to-guides/README.md index 0f50bedf05579..c0a2bd7f1fe6f 100644 --- a/docs/how-to-guides/README.md +++ b/docs/how-to-guides/README.md @@ -14,6 +14,8 @@ It is also possible to modify the behavior of existing blocks or even remove the Learn more in the [Block Filters](/docs/reference-guides/filters/block-filters.md) section. +Specifically for `Query Loop` block, besides the available filters, there are more ways to extend it and create bespoke versions of it. Learn more in the [Extending the Query Loop block](/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md) section. + ## Extending the Editor UI Extending the editor UI can be accomplished with the `registerPlugin` API, allowing you to define all your plugin's UI elements in one place. diff --git a/docs/how-to-guides/block-tutorial/README.md b/docs/how-to-guides/block-tutorial/README.md index b1ff5a19119c2..95aa4182430c0 100644 --- a/docs/how-to-guides/block-tutorial/README.md +++ b/docs/how-to-guides/block-tutorial/README.md @@ -2,7 +2,9 @@ The purpose of this tutorial is to step through the fundamentals of creating a new block type. Beginning with the simplest possible example, each new section will incrementally build upon the last to include more of the common functionality you could expect to need when implementing your own block types. -To follow along with this tutorial, you can [download the accompanying WordPress plugin](https://github.com/WordPress/gutenberg-examples) which includes all of the examples for you to try on your own site. At each step along the way, experiment by modifying the examples with your own ideas, and observe the effects they have on the block's behavior. +To follow along with this tutorial, you can download the [accompanying WordPress plugin](https://github.com/WordPress/gutenberg-examples) which includes all of the examples for you to try on your own site. At each step along the way, experiment by modifying the examples with your own ideas, and observe the effects they have on the block's behavior. + +> To find the latest version of the .zip file go to the repo's [releases page](https://github.com/WordPress/gutenberg-examples/releases) and look in the latest release under 'Assets'. Code snippets are provided in two formats "JSX" and "Plain". JSX refers to JavaScript code that uses JSX syntax which requires a build step. Plain refers to "classic" JavaScript that does not require building. You can change between them using tabs found above each code example. Using JSX, does require you to run [the JavaScript build step](/docs/how-to-guides/javascript/js-build-setup/) to compile your code to a browser compatible format. diff --git a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md index e0ea419b168a8..e668a6ac76238 100644 --- a/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md +++ b/docs/how-to-guides/block-tutorial/applying-styles-with-stylesheets.md @@ -2,7 +2,7 @@ ## Overview -A block typically inserts markup (HTML) into post content that you want to style in someway. This guides walks through a few different ways you can use CSS with the block editor and how to work with styles and stylesheets. +A block typically inserts markup (HTML) into post content that you want to style in some way. This guide walks through a few different ways you can use CSS with the block editor and how to work with styles and stylesheets. ## Before you start @@ -102,7 +102,7 @@ registerBlockType( 'gutenberg-examples/example-02-stylesheets', { The inline style works well for a small amount of CSS to apply. If you have much more than the above you will likely find that it is easier to manage with them in a separate stylesheet file. -The `useBlockProps` hooks includes the classsname for the block automatically, it generates a name for each block using the block's name prefixed with `wp-block-`, replacing the `/` namespace separator with a single `-`. +The `useBlockProps` hooks includes the classname for the block automatically, it generates a name for each block using the block's name prefixed with `wp-block-`, replacing the `/` namespace separator with a single `-`. For example the block name: `gutenberg-examples/example-02-stylesheets` would get the classname: `wp-block-gutenberg-examples-example-02-stylesheets`. It might be a bit long but best to avoid conflicts with other blocks. @@ -160,6 +160,37 @@ registerBlockType( 'gutenberg-examples/example-02-stylesheets', { {% end %} +### Build or add dependency + +In order to include the blockEditor as a dependancy, make sure to run the build step, or update the asset php file. + +{% codetabs %} +{% JSX %} + +Build the scripts and update the asset file which is used to keep track of dependencies and the build version. +```bash +npm run build +``` + +{% Plain %} + +Edit the asset file to include the block-editor dependancy for the scripts. + +```php + + array( + 'wp-blocks', + 'wp-element', + 'wp-block-editor', + 'wp-polyfill' + ), + 'version' => '0.1' + ); +``` + +{% end %} + ### Enqueue stylesheets Like scripts, you can enqueue your block's styles using the `block.json` file. diff --git a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md index 7b5f2cb7fe086..9f5eff3883b6a 100644 --- a/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md +++ b/docs/how-to-guides/block-tutorial/creating-dynamic-blocks.md @@ -221,4 +221,4 @@ registerBlockType( 'gutenberg-examples/example-dynamic', { {% end %} -Note that this code uses the `wp-server-side-render` package but not `wp-data`. Make sure to update the dependencies in the PHP code. You can use wp-scripts to automatically build dependencies (see the [gutenberg-examples repo](https://github.com/WordPress/gutenberg-examples/tree/HEAD/01-basic-esnext) for PHP code setup). +Note that this code uses the `wp-server-side-render` package but not `wp-data`. Make sure to update the dependencies in the PHP code. You can use wp-scripts to automatically build dependencies (see the [gutenberg-examples repo](https://github.com/WordPress/gutenberg-examples/tree/trunk/blocks-jsx/01-basic-esnext) for PHP code setup). diff --git a/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md b/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md index dbe21ff35aa33..cc4d0b1ee0a0d 100644 --- a/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md +++ b/docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md @@ -95,7 +95,7 @@ At this point, your custom variation will be virtually indistinguishable from a Please note that the Query Loop block supports `'block'` as a string in the `scope` property. In theory, that's to allow the variation to be picked up after inserting the block itself. Read more about the Block Variation Picker [here](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-variation-picker/README.md). -However, it is unadvisable to use this currently, this is due to the Query Loop setup with patterns and `scope: [ 'block' ]` variations, all of the selected pattern's attributes will be used except for `postType` and `inherit` query properties, which will likely lead to conflicts and non-functional variations. +However, it is **unadvisable** to use this currently, this is due to the Query Loop setup with patterns and `scope: [ 'block' ]` variations, all of the selected pattern's attributes will be used except for `postType` and `inherit` query properties, which will likely lead to conflicts and non-functional variations. To circumvent this, there two routes, the first one is to add your default `innerBlocks`, like so: @@ -111,7 +111,19 @@ innerBlocks: [ ], ``` -The other would be to register patterns specific to your variation, we can cover that in another guide. +By having `innerBlocks` in your variation you essentially skip the setup phase of Query Loop block with suggested patterns and the block is inserted with these inner blocks as its starting content. + +The other way would be to register patterns specific to your variation, which are going to be suggested in the setup, and replace flows of the block. + +The Query Loop block determines if there is an active variation of itself and if there are specific patterns available for this variation. If there are, these patterns are going to be the only ones suggested to the user, without including the default ones for the original Query Loop block. Otherwise, if there are no such patterns, the default ones are going to be suggested. + +In order for a pattern to be “connected” with a Query Loop variation, you should add the name of your variation prefixed with the Query Loop name (e.g. `core/query/$variation_name`) to the pattern's `blockTypes` property. For more details about registering patterns [see here](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/). + +If you have not provided `innerBlocks` in your variation, there is also a way to suggest “connected” variations when the user selects `Start blank` in the setup phase. This is handled in a similar fashion with “connected” patterns, by checking if there is an active variation of Query Loop and if there are any connected variations to suggest. + +In order for a variation to be connected to another Query Loop variation we need to define the `scope` attribute with `['block']` as value and the `namespace` attribute defined as an array. This array should contain the names(`name` property) of any variations they want to be connected to. + +For example, if we have a Query Loop variation exposed to the inserter(`scope: ['inserter']`) with the name `products`, we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`. If the user selects this variation after having clicked `Start blank`, the namespace attribute will be overridden by the main inserter variation. ### Making Gutenberg recognize your variation @@ -131,9 +143,9 @@ We need a way to tell the editor that this block is indeed your specific variati } ``` -You might have been tempted to only compare the `postType`: in this way, Gutenberg will recognize the block as your variation any time the `postType` matches `book`! That's awesome, but the problem is that now Gutenberg will recognize the block as your specific variation any time the `postType` is set to `book`, which is not what we want: other plugins might want to publish variations based on the `book` post type, or we might just not want the variation to be recognized every time the user sets the type to `book` manually through the editor settings. +You might be tempted to only compare the `postType` so that Gutenberg will recognize the block as your variation any time the `postType` matches `book`. This casts a net too wide, however, as other plugins might want to publish variations based on the `book` post type too, or we might just not want the variation to be recognized every time the user sets the type to `book` manually through the editor settings. -That's why the Query Loop block exposes a special attribute called `namespace`: it really doesn't do anything inside the block implementation, and it's used as an easy way for extenders to recognize and scope their own variation. In addition, `isActive` also accepts just an array of strings with the attributes to compare. Often, `namespace` would be sufficient, so you would use it like so: +That's why the Query Loop block exposes a special attribute called `namespace`. It really doesn't do anything inside the block implementation, and it's used as an easy and consistent way for extenders to recognize and scope their own variation. In addition, `isActive` also accepts just an array of strings with the attributes to compare. Often, `namespace` would be sufficient, so you would use it like so: ```js { @@ -154,16 +166,16 @@ Even with all of this, your custom post type might have unique requirements: it ### Disabling irrelevant or unsupported query controls -Let's say you don't use at all the `sticky` attribute in your books, so that would be totally irrelevant to the customization of your block. In order to not confuse the users as to what a setting might do, and only exposing a clear UX to them, we want this control to be unavailable. Furthermore, let's say that you don't use the `author` field at all, which generally indicates the person who has added that post to the database, instead you use a custom `bookAuthor` field. As such, not only keeping the `author` filter would be confusing, it would outright break your query. +Let's say you don't use at all the `sticky` attribute in your books, so that would be totally irrelevant to the customization of your block. In order to not confuse the users as to what a setting might do, and only exposing a clear UX to them, we want this control to be unavailable. Furthermore, let's say that you don't use the `author` field at all, which generally indicates the person who has added that post to the database, instead you use a custom `bookAuthor` field. As such, not only keeping the `author` filter would be confusing, it would outright “break” your query. -For this reason, the Query Loop block supports a property called `allowedControls` which accepts an array of keys of the controls we want to display on the inspector sidebar. By default, we accept all the controls, but as soon as we provide an array to this property, we want to be specific and specify only the controls which are going to be relevant for us! +For this reason, the Query Loop block variations support a property called `allowedControls`, which accepts an array of keys of the controls we want to display on the inspector sidebar. By default, we accept all the controls, but as soon as we provide an array to this property, we want to specify only the controls which are going to be relevant for us! -As of version 13.9, the following controls are available: +As of Gutenberg version 14.2, the following controls are available: - `inherit` - Shows the toggle switch for allowing the query to be inherited directly from the template. - `postType` - Shows a dropdown of available post types. - `order` - Shows a dropdown to select the order of the query. -- `sticky` - Shows a checkbox to only display sticky posts. +- `sticky` - Shows a dropdown to select how to handle sticky posts. - `taxQuery` - Shows available taxonomies filters for the currently selected post type. - `author` - Shows an input field to filter the query by author. - `search` - Shows an input filed to filter the query by keywords. @@ -177,13 +189,17 @@ In our case, the property would look like this: } ``` -Notice that we have also disabled the `postType` control: when the user selects our variation, why show them a confusing dropdown to change the post type? On top of that it might break the block as we can implement custom controls, as we'll see shortly. +If you want to hide all the above available controls, you can set an empty array as a value of `allowedControls`. + +Notice that we have also disabled the `postType` control. When the user selects our variation, why show them a confusing dropdown to change the post type? On top of that it might break the block as we can implement custom controls, as we'll see shortly. ### Adding additional controls Because our plugin uses custom attributes that we need to query, we want to add our own controls to allow the users to select those instead of the ones we have just disabled from the core inspector controls. We can do this via a [React HOC](https://reactjs.org/docs/higher-order-components.html) hooked into a [block filter](https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/), like so: ```jsx +import { InspectorControls } from '@wordpress/block-editor'; + export const withBookQueryControls = ( BlockEdit ) => ( props ) => { // We only want to add these controls if it is our variation, // so here we can implement a custom logic to check for that, similiar diff --git a/docs/how-to-guides/curating-the-editor-experience.md b/docs/how-to-guides/curating-the-editor-experience.md index 4c7ef0096d051..584e6dc18b8a0 100644 --- a/docs/how-to-guides/curating-the-editor-experience.md +++ b/docs/how-to-guides/curating-the-editor-experience.md @@ -14,10 +14,25 @@ Users have the ability to lock and unlock blocks via the editor. The locking UI Keep in mind that each block you want to lock will need to be individually locked as desired. There is not a way to mass lock blocks currently. -**Lock patterns or templates** +**Apply block locking to patterns or templates** When building patterns or templates, theme authors can use these same UI tools to set the default locked state of blocks. For example, a theme author could lock various pieces of a header. Keep in mind that by default, users with editing access can unlock these blocks. [Here’s an example of a pattern](https://gist.github.com/annezazu/acee30f8b6e8995e1b1a52796e6ef805) with various blocks locked in different ways and here’s more context on [creating a template with locked blocks](https://make.wordpress.org/core/2022/02/09/core-editor-improvement-curated-experiences-with-locking-apis-theme-json/). You can build these patterns in the editor itself, including adding locking options, before following the [documentation to register them](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/). +**Apply content only editing in patterns or templates** + +This functionality was introduced in WordPress 6.1. In contrast to block locking, which disables the ability to move or remove blocks, content only editing is both designed for use at the pattern or template level and hides all design tools, while still allowing for the ability to edit the content of the blocks. This provides a great way to simplify the interface for users and preserve a design. When this option is added, the following changes occur: + +- Non-content child blocks (containers, spacers, columns, etc) are hidden from list view, un-clickable on the canvas, and entirely un-editable. +- The Inspector will display a list of all child 'content' blocks. Clicking a block in this list reveals its settings panel. +- The main List View only shows content blocks, all at the same level regardless of actual nesting. +- Children blocks within the overall content locked container are automatically move / remove locked. +- Additional child blocks cannot be inserted, further preserving the design and layout. +- There is a link in the block toolbar to ‘Modify’ that a user can toggle on/off to have access to the broader design tools. Currently, it's not possibly to programmatically remove this option. + +This option can be applied to Columns, Cover, and Group blocks as well as third-party blocks that have the templateLock attribute in its block.json. To adopt this functionality, you need to use `"templateLock":"contentOnly"`. [Here's an example of a pattern](https://gist.github.com/annezazu/d62acd2514cea558be6cea97fe28ff3c) with this functionality in place. For more information, please [review the relevant documentation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-templates/#locking). + +Note: There is no UI in place to manage content locking and it must be managed at the code level. + **Change permissions to control locking ability** Agencies and plugin authors can offer an even more curated experience by limiting which users have [permission to lock and unlock blocks](https://make.wordpress.org/core/2022/05/05/block-locking-settings-in-wordpress-6-0/). By default, anyone who is an administrator will have access to lock and unlock blocks. diff --git a/docs/how-to-guides/javascript/README.md b/docs/how-to-guides/javascript/README.md index b31b0fa4d9989..4b2d123c8ab13 100644 --- a/docs/how-to-guides/javascript/README.md +++ b/docs/how-to-guides/javascript/README.md @@ -1,6 +1,6 @@ -# Getting Started with JavaScript +# How to use JavaScript with the Block Editor -The purpose of this tutorial is to step through getting started with JavaScript and WordPress, specifically around the new block editor. The Block Editor Handbook contains information on the APIs available for working with this new setup. The goal of this tutorial is to get you comfortable on how to use the API reference and snippets of code found within. +The Block Editor Handbook contains information on the APIs available for working with this new setup. The goal of this tutorial is to get you comfortable using the API reference and snippets of code found within. ### What is JavaScript diff --git a/docs/how-to-guides/javascript/extending-the-block-editor.md b/docs/how-to-guides/javascript/extending-the-block-editor.md index 75442628f83ac..5944b9208407f 100644 --- a/docs/how-to-guides/javascript/extending-the-block-editor.md +++ b/docs/how-to-guides/javascript/extending-the-block-editor.md @@ -1,6 +1,6 @@ # Extending the Block Editor -Let's look at using the [Block Style example](/docs/reference-guides/filters/block-filters.md#block-styles) to extend the editor. This example allows you to add your own custom CSS class name to any core block type. +Let's look at using the [Block Style example](/docs/reference-guides/block-api/block-styles.md) to extend the editor. This example allows you to add your own custom CSS class name to any core block type. Replace the existing `console.log()` code in your `myguten.js` file with: diff --git a/docs/how-to-guides/javascript/versions-and-building.md b/docs/how-to-guides/javascript/versions-and-building.md index dd2f63c946906..257b73c6866f1 100644 --- a/docs/how-to-guides/javascript/versions-and-building.md +++ b/docs/how-to-guides/javascript/versions-and-building.md @@ -5,7 +5,7 @@ The Block Editor Handbook shows JavaScript examples in two syntaxes: JSX and Pla Plain refers to JavaScript code compatible with WordPress's minimum [target for browser support](https://make.wordpress.org/core/handbook/best-practices/browser-support/) without requiring a transpilation step. This step is commonly referred to as a build process. "JSX" doesn't refer to a specific version of JavaScript, but refers to the latest language definition plus -[JSX syntax](https://reactjs.org/docs/introducing-jsx.html), a syntax that blends HTML and JavaScript. JSX makes it easier to read and write markup code, but does require a build step to transpile into code compatible with browers. Webpack and babel are the tools that perform this transpilation step. +[JSX syntax](https://reactjs.org/docs/introducing-jsx.html), a syntax that blends HTML and JavaScript. JSX makes it easier to read and write markup code, but does require a build step to transpile into code compatible with browsers. Webpack and babel are the tools that perform this transpilation step. For simplicity, the JavaScript tutorial uses the Plain definition, without JSX. This code can run straight in your browser and does not require an additional build step. In many cases, it is perfectly fine to follow the same approach for simple plugins or experimenting. As your codebase grows in complexity it might be a good idea to switch to JSX. You will find the majority of code and documentation across the block editor uses JSX. diff --git a/docs/how-to-guides/platform/custom-block-editor/tutorial.md b/docs/how-to-guides/platform/custom-block-editor/tutorial.md index 7c891e6558e30..1e49433da3e65 100644 --- a/docs/how-to-guides/platform/custom-block-editor/tutorial.md +++ b/docs/how-to-guides/platform/custom-block-editor/tutorial.md @@ -122,7 +122,7 @@ function getdave_sbe_render_block_editor() { Here we simply output some basic placeholder HTML. -Note that we've included an `id` attribute `getdave-sbe-block-editor`. Keep a note of that, a we'll be using it shortly. +Note that we've included an `id` attribute `getdave-sbe-block-editor`. Keep a note of that, as we'll be using it shortly. ### Enqueuing JavaScript and CSS diff --git a/docs/how-to-guides/plugin-sidebar-0.md b/docs/how-to-guides/plugin-sidebar-0.md index 7cba7657c20b9..306ef3319a0c1 100644 --- a/docs/how-to-guides/plugin-sidebar-0.md +++ b/docs/how-to-guides/plugin-sidebar-0.md @@ -379,4 +379,4 @@ Functions used in this guide: You now have a custom sidebar that you can use to update `post_meta` content. -A complete example is available, download the [plugin-sidebar example](https://github.com/WordPress/gutenberg-examples/tree/trunk/plugin-sidebar) from the [gutenberg-examples](https://github.com/WordPress/gutenberg-examples) repository. +A complete example is available, download the [plugin-sidebar example](https://github.com/WordPress/gutenberg-examples/tree/trunk/blocks-non-jsx/plugin-sidebar) from the [gutenberg-examples](https://github.com/WordPress/gutenberg-examples) repository. diff --git a/docs/how-to-guides/propagating-updates.md b/docs/how-to-guides/propagating-updates.md index b7d321437634a..15b3da96be8ff 100644 --- a/docs/how-to-guides/propagating-updates.md +++ b/docs/how-to-guides/propagating-updates.md @@ -1,12 +1,12 @@ -# Propagating updates for block types +# Propagating updates for block types -This resource seeks to offer direction for those needing to provide updates to content, whether in a template for a theme, pattern, or a block over an entire site. Since each content type allows or disallows certain kind of synchronization, it's important to know what's possible before creating to make maintenance easier in the future. +This resource seeks to offer direction for those needing to provide updates to content, whether in a template for a theme, pattern, or a block over an entire site. Since each content type allows or disallows certain kind of synchronization, it's important to know what's possible before creating to make maintenance easier in the future. ## Recommendations on managing updates ### Establish early what content you expect to require updates -At a high level, it’s important to recognize that not every piece of content can be updated across the entire site and that the method of creation greatly impacts what’s possible. As a result, it’s critical to spend time ahead of creation determining what you expect to need updates and to put that content in the appropriate format. This will make a huge difference in terms of future maintenance. +At a high level, it’s important to recognize that not every piece of content can be updated across the entire site and that the method of creation greatly impacts what’s possible. As a result, it’s critical to spend time ahead of creation determining what you expect to need updates and to put that content in the appropriate format. This will make a huge difference in terms of future maintenance. ### Embrace theme design at the block level @@ -22,7 +22,7 @@ How to manage block updates depends on the nature of the block itself. If the bl ### Patterns -**For content that you want updated later on, do not use patterns and instead rely on reusable blocks or template parts.** Patterns cannot be updated after you insert one into your site. For context, you can think of Patterns as more like sample/example/starter content. While Patterns exposed in the Inserter might evolve over time, those changes won't be automatically applied to any current useage of the pattern. Once insertered, patterns become completely detached from the original pattern unlike Reusable block or Template Part block. +**For content that you want updated later on, do not use patterns and instead rely on reusable blocks or template parts.** Patterns cannot be updated after you insert one into your site. For context, you can think of Patterns as more like sample/example/starter content. While Patterns exposed in the Inserter might evolve over time, those changes won't be automatically applied to any current useage of the pattern. Once inserted, patterns become completely detached from the original pattern unlike Reusable block or Template Part block. If needed, one potential workaround for patterns with custom styles is to add a class name to the wrapping block for a pattern. For example, the following adds a themeslug-special class to a Group block: @@ -34,7 +34,7 @@ If needed, one potential workaround for patterns with custom styles is to add a ``` -It is not fool-proof because users can modify the class via the editor UI. However, because this setting is under the "Advanced" panel it is likely to stay intact in most instances. This gives theme authors some CSS control for some pattern types, allowing them to update existing uses. However, it does not prevent users from making massive alterations that cannot be updated. +It is not fool-proof because users can modify the class via the editor UI. However, because this setting is under the "Advanced" panel it is likely to stay intact in most instances. This gives theme authors some CSS control for some pattern types, allowing them to update existing uses. However, it does not prevent users from making massive alterations that cannot be updated. ### Reusable blocks @@ -47,7 +47,7 @@ Because block themes allow users to directly edit templates and template parts, - Revert all their changes - Update the templates and template parts in the database -Generally speaking, if a user has made changes to templates then it’s recommended to leave the templates as is, unless agreed upon with the user (ie in an agency setting). +Generally speaking, if a user has made changes to templates then it’s recommended to leave the templates as is, unless agreed upon with the user (ie in an agency setting). One thing to be mindful of when updating templates is inserting references to new or different template parts. For example, the templates/page.html template could insert a parts/header.html part in version 1.0 but change that reference to parts/header-alt.html in version 2.0. Some developers may see this as a "workaround" in instances where users modified the original header.html. However, this is likely to break a user's customized design since the page.html template would no longer reference the correct part unless they also modified and saved the page template. diff --git a/docs/manifest.json b/docs/manifest.json index 52858e982afd1..a06df18c6c44b 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -155,6 +155,12 @@ "markdown_source": "../docs/how-to-guides/block-tutorial/nested-blocks-inner-blocks.md", "parent": "block-tutorial" }, + { + "title": "Extending the Query Loop block", + "slug": "extending-the-query-loop-block", + "markdown_source": "../docs/how-to-guides/block-tutorial/extending-the-query-loop-block.md", + "parent": "block-tutorial" + }, { "title": "Development Platform", "slug": "platform", @@ -228,7 +234,7 @@ "parent": "how-to-guides" }, { - "title": "Getting Started with JavaScript", + "title": "How to use JavaScript with the Block Editor", "slug": "javascript", "markdown_source": "../docs/how-to-guides/javascript/README.md", "parent": "how-to-guides" @@ -306,7 +312,7 @@ "parent": "how-to-guides" }, { - "title": "Propagating updates for block types ", + "title": "Propagating updates for block types", "slug": "propagating-updates", "markdown_source": "../docs/how-to-guides/propagating-updates.md", "parent": "how-to-guides" @@ -1223,6 +1229,12 @@ "markdown_source": "../packages/components/src/textarea-control/README.md", "parent": "components" }, + { + "title": "Theme", + "slug": "theme", + "markdown_source": "../packages/components/src/theme/README.md", + "parent": "components" + }, { "title": "ToggleControl", "slug": "toggle-control", @@ -1482,7 +1494,7 @@ "parent": "packages" }, { - "title": "@wordpress/create-block External Template", + "title": "External Project Templates", "slug": "packages-create-block-external-template", "markdown_source": "../packages/create-block/docs/external-template.md", "parent": "packages-create-block" @@ -1721,12 +1733,6 @@ "markdown_source": "../packages/npm-package-json-lint-config/README.md", "parent": "packages" }, - { - "title": "@wordpress/nux", - "slug": "packages-nux", - "markdown_source": "../packages/nux/README.md", - "parent": "packages" - }, { "title": "@wordpress/plugins", "slug": "packages-plugins", @@ -1961,12 +1967,6 @@ "markdown_source": "../docs/reference-guides/data/data-core-notices.md", "parent": "data" }, - { - "title": "The NUX (New User Experience) Data", - "slug": "data-core-nux", - "markdown_source": "../docs/reference-guides/data/data-core-nux.md", - "parent": "data" - }, { "title": "Preferences", "slug": "data-core-preferences", diff --git a/docs/reference-guides/README.md b/docs/reference-guides/README.md index 33fdd9aa60241..f13c838697f2d 100644 --- a/docs/reference-guides/README.md +++ b/docs/reference-guides/README.md @@ -63,7 +63,6 @@ - [**core/editor**: The Post Editor’s Data](/docs/reference-guides/data/data-core-editor.md) - [**core/keyboard-shortcuts**: The Keyboard Shortcuts Data](/docs/reference-guides/data/data-core-keyboard-shortcuts.md) - [**core/notices**: Notices Data](/docs/reference-guides/data/data-core-notices.md) - - [**core/nux**: The NUX (New User Experience) Data](/docs/reference-guides/data/data-core-nux.md) - [**core/preferences**: Preferences](/docs/reference-guides/data/data-core-preferences.md) - [**core/reusable-blocks**: Reusable blocks](/docs/reference-guides/data/data-core-reusable-blocks.md) - [**core/rich-text**: Rich Text](/docs/reference-guides/data/data-core-rich-text.md) diff --git a/docs/reference-guides/block-api/block-deprecation.md b/docs/reference-guides/block-api/block-deprecation.md index 1bb24694749a0..0314939ee8f64 100644 --- a/docs/reference-guides/block-api/block-deprecation.md +++ b/docs/reference-guides/block-api/block-deprecation.md @@ -234,7 +234,6 @@ E.g: a block wants to migrate a title attribute to a paragraph innerBlock. ```js const { registerBlockType } = wp.blocks; -const { omit } = lodash; registerBlockType( 'gutenberg/block-with-deprecated-version', { // ... block properties go here @@ -254,8 +253,10 @@ registerBlockType( 'gutenberg/block-with-deprecated-version', { }, migrate( attributes, innerBlocks ) { + const { title, ...restAttributes } = attributes; + return [ - omit( attributes, 'title' ), + restAttributes, [ createBlock( 'core/paragraph', { content: attributes.title, @@ -278,8 +279,7 @@ registerBlockType( 'gutenberg/block-with-deprecated-version', { ```js var el = wp.element.createElement, - registerBlockType = wp.blocks.registerBlockType, - omit = lodash.omit; + registerBlockType = wp.blocks.registerBlockType; registerBlockType( 'gutenberg/block-with-deprecated-version', { // ... block properties go here @@ -295,8 +295,10 @@ registerBlockType( 'gutenberg/block-with-deprecated-version', { }, migrate: function ( attributes, innerBlocks ) { + const { title, ...restAttributes } = attributes; + return [ - omit( attributes, 'title' ), + restAttributes, [ createBlock( 'core/paragraph', { content: attributes.title, diff --git a/docs/reference-guides/block-api/block-metadata.md b/docs/reference-guides/block-api/block-metadata.md index 6ce54d8009dd7..d78050d79a9a1 100644 --- a/docs/reference-guides/block-api/block-metadata.md +++ b/docs/reference-guides/block-api/block-metadata.md @@ -13,7 +13,7 @@ Starting in WordPress 5.8 release, we encourage using the `block.json` metadata "category": "text", "parent": [ "core/group" ], "icon": "star", - "description": "Shows warning, error or success notices…", + "description": "Shows warning, error or success notices...", "keywords": [ "alert", "message" ], "version": "1.0.3", "textdomain": "my-plugin", @@ -252,7 +252,7 @@ The `ancestor` property makes a block available inside the specified block types An icon property should be specified to make it easier to identify a block. These can be any of WordPress' Dashicons (slug serving also as a fallback in non-js contexts). -**Note:** It's also possible to override this property on the client-side with the source of the SVG element. In addition, this property can be defined with JavaScript as an object containing background and foreground colors. This colors will appear with the icon when they are applicable e.g.: in the inserter. Custom SVG icons are automatically wrapped in the [wp.primitives.SVG](/packages/packages-primitives) component to add accessibility attributes (aria-hidden, role, and focusable). +**Note:** It's also possible to override this property on the client-side with the source of the SVG element. In addition, this property can be defined with JavaScript as an object containing background and foreground colors. This colors will appear with the icon when they are applicable e.g.: in the inserter. Custom SVG icons are automatically wrapped in the [wp.primitives.SVG](/packages/primitives/README.md) component to add accessibility attributes (aria-hidden, role, and focusable). ### Description @@ -408,7 +408,7 @@ It contains as set of options to control features used in the editor. See the [t Block styles can be used to provide alternative styles to block. It works by adding a class name to the block's wrapper. Using CSS, a theme developer can target the class name for the block style if it is selected. -Plugins and Themes can also register [custom block style](/docs/reference-guides/filters/block-filters.md#block-styles) for existing blocks. +Plugins and Themes can also register [custom block style](/docs/reference-guides/block-api/block-styles.md) for existing blocks. ### Example @@ -646,7 +646,7 @@ return array( Starting in the WordPress 5.8 release, it is possible to instruct WordPress to enqueue scripts and styles for a block type only when rendered on the frontend. It applies to the following asset fields in the `block.json` file: - `script` -- `viewScript` (when the block defines `render_callback` during registration in PHP or a `render` field in its `block.json`, then the script is registered but the block author is responsible for enqueuing it) +- `viewScript` - `style` ## Internationalization diff --git a/docs/reference-guides/block-api/block-patterns.md b/docs/reference-guides/block-api/block-patterns.md index 12fac7b479361..d58e7a2f62d41 100644 --- a/docs/reference-guides/block-api/block-patterns.md +++ b/docs/reference-guides/block-api/block-patterns.md @@ -34,6 +34,7 @@ The properties available for block patterns are: - `viewportWidth` (optional): An integer specifying the intended width of the pattern to allow for a scaled preview of the pattern in the inserter. - `blockTypes` (optional): An array of block types that the pattern is intended to be used with. Each value needs to be the declared block's `name`. - `postTypes` (optional): An array of post types that the pattern is restricted to be used with. The pattern will only be available when editing one of the post types passed on the array, for all the other post types the pattern is not available at all. +- `templateTypes` (optional): An array of template types where the pattern makes sense e.g: '404' if the pattern is for a 404 page, single-post if the pattern is for showing a single post. - `inserter` (optional): By default, all patterns will appear in the inserter. To hide a pattern so that it can only be inserted programmatically, set the `inserter` to `false`. The following code sample registers a block pattern named 'my-plugin/my-awesome-pattern': @@ -113,6 +114,8 @@ _Note:_ `register_block_pattern_category()` should be called from a handler attached to the init hook. +The category will not show under Patterns unless a pattern has been assigned to that category. + ```php function my_plugin_register_my_pattern_categories() { register_block_pattern_category( ... ); diff --git a/docs/reference-guides/block-api/block-registration.md b/docs/reference-guides/block-api/block-registration.md index 5c38bf7f79c36..bae50ac67a0fd 100644 --- a/docs/reference-guides/block-api/block-registration.md +++ b/docs/reference-guides/block-api/block-registration.md @@ -35,7 +35,7 @@ A block requires a few properties to be specified before it can be registered su - **Type:** `String` -This is the display title for your block, which can be translated with our translation functions. The title will display in the Inserter and in other areas of the editor. +This is the display title for your block, which can be translated with our translation functions. The title will display in the Inserter and in other areas of the editor. ```js // Our data object @@ -90,7 +90,7 @@ icon: 'book-alt', icon: , ``` -**Note:** Custom SVG icons are automatically wrapped in the [`wp.primitives.SVG` component](/packages/primitives/src/svg/) to add accessibility attributes (`aria-hidden`, `role`, and `focusable`). +**Note:** Custom SVG icons are automatically wrapped in the [`wp.primitives.SVG` component](/packages/primitives/README.md) to add accessibility attributes (`aria-hidden`, `role`, and `focusable`). An object can also be passed as icon, in this case, icon, as specified above, should be included in the src property. @@ -145,7 +145,7 @@ styles: [ ], ``` -Plugins and Themes can also register [custom block style](/docs/reference-guides/filters/block-filters.md#block-styles) for existing blocks. +Plugins and Themes can also register [custom block style](/docs/reference-guides/block-api/block-styles.md) for existing blocks. #### attributes (optional) @@ -179,7 +179,7 @@ attributes: { - **Type:** `Object` -Example provides structured example data for the block. This data is used to construct a preview for the block to be shown in the Inspector Help Panel when the user mouses over the block. +Example provides structured example data for the block. This data is used to construct a preview for the block to be shown in the Inspector Help Panel when the user mouses over the block and in the Styles panel when the block is selected. The data provided in the example object should match the attributes defined. For example: diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index 53d7088576b18..68afd793231ef 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -105,6 +105,20 @@ supports: { } ``` +## ariaLabel + +- Type: `boolean` +- Default value: `false` + +ARIA-labels let you define an accessible label for elements. This property allows enabling the definition of an aria-label for the block, without exposing a UI field. + +```js +supports: { + // Add the support for aria label. + ariaLabel: true +} +``` + ## className - Type: `boolean` @@ -337,36 +351,25 @@ supports: { Link color presets are sourced from the `editor-color-palette` [theme support](/docs/how-to-guides/themes/theme-support.md#block-color-palettes). -When the block declares support for `color.link`, the attributes definition is extended to include two new attributes: `linkColor` and `style`: - -- `linkColor`: attribute of `string` type with no default assigned. - - When a user chooses from the list of preset link colors, the preset slug is stored in the `linkColor` attribute. - - The block can apply a default preset text color by specifying its own attribute with a default e.g.: - - ```js - attributes: { - linkColor: { - type: 'string', - default: 'some-preset-link-color-slug', - } - } - ``` +When the block declares support for `color.link`, the attributes definition is extended to include the `style` attribute: - `style`: attribute of `object` type with no default assigned. - When a custom link color is selected (i.e. using the custom color picker), the custom color value is stored in the `style.color.link` attribute. + When a link color is selected, the color value is stored in the `style.elements.link.color.text` attribute. - The block can apply a default custom link color by specifying its own attribute with a default e.g.: + The block can apply a default link color by specifying its own attribute with a default e.g.: ```js attributes: { style: { type: 'object', default: { - color: { - link: '#ff0000', + elements: { + link: { + color: { + text: '#ff0000', + } + } } } } @@ -569,7 +572,7 @@ attributes: { } ``` -A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed. +A spacing property may define an array of allowable sides – 'top', 'right', 'bottom', 'left' – that can be configured. When such arbitrary sides are defined, only UI controls for those sides are displayed. Axial sides are defined with the `vertical` and `horizontal` terms, and display a single UI control for each axial pair (for example, `vertical` controls both the top and bottom sides). A spacing property may support arbitrary individual sides **or** axial sides, but not a mix of both. diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index f35a498aaf5ed..d5697b46c9ae3 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -50,8 +50,8 @@ Prompt visitors to take action with a button-style link. ([Source](https://githu - **Name:** core/button - **Category:** design -- **Supports:** align, anchor, color (background, gradients, text), spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~reusable~~ -- **Attributes:** backgroundColor, gradient, linkTarget, placeholder, rel, text, textColor, title, url, width +- **Supports:** anchor, color (background, gradients, text), spacing (padding), typography (fontSize, lineHeight), ~~alignWide~~, ~~align~~, ~~reusable~~ +- **Attributes:** backgroundColor, gradient, linkTarget, placeholder, rel, text, textAlign, textColor, title, url, width ## Buttons @@ -167,7 +167,7 @@ Contains the block elements used to display a comment, like the title, date, aut - **Name:** core/comment-template - **Category:** design -- **Supports:** align, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Comments @@ -176,7 +176,7 @@ An advanced block that allows displaying post comments using different visual co - **Name:** core/comments - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** legacy, tagName ## Comments Pagination @@ -275,7 +275,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute - **Name:** core/group - **Category:** design -- **Supports:** align (full, wide), anchor, ariaLabel, color (background, gradients, link, text), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, ariaLabel, color (background, gradients, link, text), dimensions (minHeight), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** tagName, templateLock ## Heading @@ -284,7 +284,7 @@ Introduce new sections and organize content to help visitors (and search engines - **Name:** core/heading - **Category:** text -- **Supports:** __unstablePasteTextInline, align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** __unstablePasteTextInline, align (full, wide), anchor, className, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** content, level, placeholder, textAlign ## Home Link @@ -320,7 +320,7 @@ Display a list of your most recent comments. ([Source](https://github.com/WordPr - **Name:** core/latest-comments - **Category:** widgets -- **Supports:** align, ~~html~~ +- **Supports:** align, spacing (margin, padding), ~~html~~ - **Attributes:** commentsToShow, displayAvatar, displayDate, displayExcerpt ## Latest Posts @@ -329,7 +329,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress - **Name:** core/latest-posts - **Category:** widgets -- **Supports:** align, typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor ## List @@ -347,7 +347,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text -- **Supports:** ~~className~~ +- **Supports:** typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder ## Login/out @@ -392,8 +392,8 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme -- **Supports:** align (full, wide), anchor, inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, textColor +- **Supports:** align (full, wide), inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ +- **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, templateLock, textColor ## Custom Link @@ -428,8 +428,17 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets -- **Supports:** ~~html~~, ~~reusable~~ -- **Attributes:** __unstableMaxPages +- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Attributes:** isNested, parentPageID + +## Page List Item + +Displays a page inside a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/page-list-item)) + +- **Name:** core/page-list-item +- **Category:** widgets +- **Supports:** ~~html~~, ~~inserter~~, ~~lock~~, ~~reusable~~ +- **Attributes:** hasChildren, id, label, link, title ## Paragraph @@ -491,7 +500,7 @@ Display a post's comments count. ([Source](https://github.com/WordPress/gutenber - **Name:** core/post-comments-count - **Category:** theme -- **Supports:** color (background, gradients, text), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Comments Form @@ -500,7 +509,7 @@ Display a post's comments form. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/post-comments-form - **Category:** theme -- **Supports:** color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Comments Link @@ -509,7 +518,7 @@ Displays the link to the current post comments. ([Source](https://github.com/Wor - **Name:** core/post-comments-link - **Category:** theme -- **Supports:** color (background, link, ~~text~~), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** color (background, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Content @@ -518,7 +527,7 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/ - **Name:** core/post-content - **Category:** theme -- **Supports:** align (full, wide), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), dimensions (minHeight), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** ## Post Date @@ -563,7 +572,7 @@ Contains the block elements used to render a post, like the title, date, feature - **Name:** core/post-template - **Category:** theme -- **Supports:** align, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Post Terms @@ -608,7 +617,7 @@ An advanced block that allows displaying post types based on different query par - **Name:** core/query - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), ~~html~~ +- **Supports:** align (full, wide), ~~html~~ - **Attributes:** displayLayout, namespace, query, queryId, tagName ## No results @@ -753,7 +762,7 @@ Display an icon linking to a social media profile or site. ([Source](https://git - **Name:** core/social-link - **Category:** widgets - **Supports:** ~~html~~, ~~reusable~~ -- **Attributes:** label, service, url +- **Attributes:** label, rel, service, url ## Social Icons @@ -797,7 +806,7 @@ A cloud of your most used tags. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/tag-cloud - **Category:** widgets -- **Supports:** align, spacing (margin, padding), ~~html~~ +- **Supports:** align, spacing (margin, padding), typography (lineHeight), ~~html~~ - **Attributes:** largestFontSize, numberOfTags, showTagCounts, smallestFontSize, taxonomy ## Template Part diff --git a/docs/reference-guides/data/README.md b/docs/reference-guides/data/README.md index 1134c1d5ddd30..5f4d8d92d4bd4 100644 --- a/docs/reference-guides/data/README.md +++ b/docs/reference-guides/data/README.md @@ -12,7 +12,6 @@ - [**core/editor**: The Post Editor’s Data](/docs/reference-guides/data/data-core-editor.md) - [**core/keyboard-shortcuts**: The Keyboard Shortcuts Data](/docs/reference-guides/data/data-core-keyboard-shortcuts.md) - [**core/notices**: Notices Data](/docs/reference-guides/data/data-core-notices.md) -- [**core/nux**: The NUX (New User Experience) Data](/docs/reference-guides/data/data-core-nux.md) - [**core/preferences**: Preferences](/docs/reference-guides/data/data-core-preferences.md) - [**core/reusable-blocks**: Reusable blocks](/docs/reference-guides/data/data-core-reusable-blocks.md) - [**core/rich-text**: Rich Text](/docs/reference-guides/data/data-core-rich-text.md) diff --git a/docs/reference-guides/data/data-core-annotations.md b/docs/reference-guides/data/data-core-annotations.md index f1d1d6918e5c5..da86bf4b0dcf5 100644 --- a/docs/reference-guides/data/data-core-annotations.md +++ b/docs/reference-guides/data/data-core-annotations.md @@ -2,6 +2,10 @@ Namespace: `core/annotations`. +
+This package is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes. +
+ ## Selectors diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md index c0a180f72adf4..0580aa0141b2b 100644 --- a/docs/reference-guides/data/data-core-block-editor.md +++ b/docs/reference-guides/data/data-core-block-editor.md @@ -556,6 +556,18 @@ _Properties_ - _isDisabled_ `boolean`: Whether or not the user should be prevented from inserting this item. - _frecency_ `number`: Heuristic that combines frequency and recency. +### getLastInsertedBlockClientId + +Gets the client id of the last inserted block. + +_Parameters_ + +- _state_ `Object`: Global application state. + +_Returns_ + +- `string|undefined`: Client Id of the last inserted block. + ### getLastMultiSelectedBlockClientId Returns the client ID of the last block in the multi-selection set, or null @@ -801,7 +813,7 @@ _Parameters_ _Returns_ -- `?string`: Block Template Lock +- `string|false`: Block Template Lock ### hasBlockMovingClientId @@ -1191,10 +1203,6 @@ _Parameters_ Action that hides the insertion point. -_Returns_ - -- `Object`: Action object. - ### insertAfterBlock Action that inserts an empty block after a given block. @@ -1514,12 +1522,17 @@ _Parameters_ - _rootClientId_ `?string`: Optional root client ID of block list on which to insert. - _index_ `?number`: Index at which block should be inserted. -- _\_\_unstableOptions_ `Object`: Whether or not to show an inserter button. +- _\_\_unstableOptions_ `?Object`: Additional options. _Returns_ - `Object`: Action object. +_Properties_ + +- _\_\_unstableWithInserter_ `boolean`: Whether or not to show an inserter button. +- _operation_ `WPDropOperation`: The operation to perform when applied, either 'insert' or 'replace' for now. + ### startDraggingBlocks Returns an action object used in signalling that the user has begun to drag blocks. diff --git a/docs/reference-guides/data/data-core-edit-post.md b/docs/reference-guides/data/data-core-edit-post.md index 26337e973bd34..1c082528485c3 100644 --- a/docs/reference-guides/data/data-core-edit-post.md +++ b/docs/reference-guides/data/data-core-edit-post.md @@ -433,8 +433,7 @@ Update a metabox. ### setAvailableMetaBoxesPerLocation -Returns an action object used in signaling -what Meta boxes are available in which location. +Stores info about which Meta boxes are available in which location. _Parameters_ diff --git a/docs/reference-guides/data/data-core-edit-site.md b/docs/reference-guides/data/data-core-edit-site.md index 573d092472521..53fd4d138383a 100644 --- a/docs/reference-guides/data/data-core-edit-site.md +++ b/docs/reference-guides/data/data-core-edit-site.md @@ -20,8 +20,11 @@ _Returns_ ### getCurrentTemplateNavigationPanelSubMenu -Returns the current template or template part's corresponding -navigation panel's sub menu, to be used with `openNavigationPanelToMenu`. +> **Deprecated** + +### getCurrentTemplateTemplateParts + +Returns the template parts and their blocks for the current edited template. _Parameters_ @@ -29,11 +32,13 @@ _Parameters_ _Returns_ -- `string`: The current template or template part's sub menu. +- `Array`: Template parts and their blocks in an array. -### getCurrentTemplateTemplateParts +### getEditedPostContext -Returns the template parts and their blocks for the current edited template. +> **Deprecated** + +Returns the edited post's context object. _Parameters_ @@ -41,7 +46,7 @@ _Parameters_ _Returns_ -- `Array`: Template parts and their blocks in an array. +- `Object`: Page. ### getEditedPostId @@ -81,30 +86,16 @@ _Returns_ ### getHomeTemplateId -Returns the current home template ID. - -_Parameters_ - -- _state_ `Object`: Global application state. - -_Returns_ - -- `number?`: Home template ID. +> **Deprecated** ### getNavigationPanelActiveMenu -Returns the active menu in the navigation panel. - -_Parameters_ - -- _state_ `Object`: Global application state. - -_Returns_ - -- `string`: Active menu. +> **Deprecated** ### getPage +> **Deprecated** + Returns the current page object. _Parameters_ @@ -179,7 +170,11 @@ _Returns_ ### isNavigationOpened -Returns the current opened/closed state of the navigation panel. +> **Deprecated** + +### isSaveViewOpened + +Returns the current opened/closed state of the save panel. _Parameters_ @@ -187,7 +182,7 @@ _Parameters_ _Returns_ -- `boolean`: True if the navigation panel should be open; false if closed. +- `boolean`: True if the save panel should be open; false if closed. @@ -221,11 +216,9 @@ _Parameters_ ### openNavigationPanelToMenu -Opens the navigation panel and sets its active menu at the same time. - -_Parameters_ +> **Deprecated** -- _menu_ `string`: Identifies the menu to open. +Opens the navigation panel and sets its active menu at the same time. ### removeTemplate @@ -245,14 +238,21 @@ _Parameters_ - _options_ `[Object]`: - _options.allowUndo_ `[boolean]`: Whether to allow the user to undo reverting the template. Default true. -### setHomeTemplateId +### setEditedPostContext -Action that sets the home template ID to the template ID of the page resolved -from a given path. +Set's the current block editor context. _Parameters_ -- _homeTemplateId_ `number`: The template ID for the homepage. +- _context_ `Object`: The context object. + +_Returns_ + +- `number`: The resolved template ID for the page route. + +### setHomeTemplateId + +> **Deprecated** ### setIsInserterOpened @@ -278,19 +278,23 @@ _Parameters_ ### setIsNavigationPanelOpened +> **Deprecated** + Sets whether the navigation panel should be open. +### setIsSaveViewOpened + +Sets whether the save view panel should be open. + _Parameters_ -- _isOpen_ `boolean`: If true, opens the nav panel. If false, closes it. It does not toggle the state, but sets it directly. +- _isOpen_ `boolean`: If true, opens the save view. If false, closes it. It does not toggle the state, but sets it directly. ### setNavigationPanelActiveMenu -Action that sets the active navigation panel menu. +> **Deprecated** -_Parameters_ - -- _menu_ `string`: Menu prop of active menu. +Action that sets the active navigation panel menu. _Returns_ diff --git a/docs/reference-guides/data/data-core-nux.md b/docs/reference-guides/data/data-core-nux.md deleted file mode 100644 index 4d2e8a0d98d54..0000000000000 --- a/docs/reference-guides/data/data-core-nux.md +++ /dev/null @@ -1,99 +0,0 @@ -# The NUX (New User Experience) Data - -Namespace: `core/nux`. - -## Selectors - - - -### areTipsEnabled - -Returns whether or not tips are globally enabled. - -_Parameters_ - -- _state_ `Object`: Global application state. - -_Returns_ - -- `boolean`: Whether tips are globally enabled. - -### getAssociatedGuide - -Returns an object describing the guide, if any, that the given tip is a part -of. - -_Parameters_ - -- _state_ `Object`: Global application state. -- _tipId_ `string`: The tip to query. - -_Returns_ - -- `?NUXGuideInfo`: Information about the associated guide. - -### isTipVisible - -Determines whether or not the given tip is showing. Tips are hidden if they -are disabled, have been dismissed, or are not the current tip in any -guide that they have been added to. - -_Parameters_ - -- _state_ `Object`: Global application state. -- _tipId_ `string`: The tip to query. - -_Returns_ - -- `boolean`: Whether or not the given tip is showing. - - - -## Actions - - - -### disableTips - -Returns an action object that, when dispatched, prevents all tips from -showing again. - -_Returns_ - -- `Object`: Action object. - -### dismissTip - -Returns an action object that, when dispatched, dismisses the given tip. A -dismissed tip will not show again. - -_Parameters_ - -- _id_ `string`: The tip to dismiss. - -_Returns_ - -- `Object`: Action object. - -### enableTips - -Returns an action object that, when dispatched, makes all tips show again. - -_Returns_ - -- `Object`: Action object. - -### triggerGuide - -Returns an action object that, when dispatched, presents a guide that takes -the user through a series of tips step by step. - -_Parameters_ - -- _tipIds_ `string[]`: Which tips to show in the guide. - -_Returns_ - -- `Object`: Action object. - - diff --git a/docs/reference-guides/data/data-core-reusable-blocks.md b/docs/reference-guides/data/data-core-reusable-blocks.md index 3eeea29bd1f18..728281d0e48f3 100644 --- a/docs/reference-guides/data/data-core-reusable-blocks.md +++ b/docs/reference-guides/data/data-core-reusable-blocks.md @@ -2,6 +2,9 @@ Namespace: `core/reusable-blocks`. +
+This package is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes. +
## Selectors diff --git a/docs/reference-guides/filters/block-filters.md b/docs/reference-guides/filters/block-filters.md index 823248bb451bd..e41215d67065a 100644 --- a/docs/reference-guides/filters/block-filters.md +++ b/docs/reference-guides/filters/block-filters.md @@ -179,19 +179,18 @@ _Example:_ ```js const { createHigherOrderComponent } = wp.compose; -const { Fragment } = wp.element; const { InspectorControls } = wp.blockEditor; const { PanelBody } = wp.components; const withInspectorControls = createHigherOrderComponent( ( BlockEdit ) => { return ( props ) => { return ( - + <> My custom control - + ); }; }, 'withInspectorControl' ); diff --git a/docs/reference-guides/filters/editor-filters.md b/docs/reference-guides/filters/editor-filters.md index fd5cccb5fe45a..c65612f2083b9 100644 --- a/docs/reference-guides/filters/editor-filters.md +++ b/docs/reference-guides/filters/editor-filters.md @@ -44,7 +44,7 @@ wp.hooks.addFilter( ### `media.crossOrigin` -Used to set or modify the `crossOrigin` attribute for foreign-origin media elements (i.e ``, `