diff --git a/.eslintrc.js b/.eslintrc.js index 177f3cf35b8ccf..4385f528f44dbb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -143,9 +143,9 @@ const restrictedSyntax = [ const restrictedSyntaxComponents = [ { selector: - 'JSXOpeningElement[name.name="Button"]:not(:has(JSXAttribute[name.name="__experimentalIsFocusable"])) JSXAttribute[name.name="disabled"]', + 'JSXOpeningElement[name.name="Button"]:not(:has(JSXAttribute[name.name="accessibleWhenDisabled"])) JSXAttribute[name.name="disabled"]', message: - '`disabled` used without the `__experimentalIsFocusable` prop. Disabling a control without maintaining focusability can cause accessibility issues, by hiding their presence from screen reader users, or preventing focus from returning to a trigger element. (Ignore this error if you truly mean to disable.)', + '`disabled` used without the `accessibleWhenDisabled` prop. Disabling a control without maintaining focusability can cause accessibility issues, by hiding their presence from screen reader users, or preventing focus from returning to a trigger element. (Ignore this error if you truly mean to disable.)', }, ]; @@ -277,6 +277,34 @@ module.exports = { ], }, }, + { + // Temporary rules until we're ready to officially deprecate the bottom margins. + files: [ 'packages/*/src/**/*.[tj]s?(x)' ], + excludedFiles: [ + 'packages/components/src/**/@(test|stories)/**', + '**/*.@(native|ios|android).js', + ], + rules: { + 'no-restricted-syntax': [ + 'error', + ...restrictedSyntax, + ...restrictedSyntaxComponents, + ...[ + 'CheckboxControl', + 'ComboboxControl', + 'FocalPointPicker', + 'SearchControl', + 'TextareaControl', + 'TreeSelect', + ].map( ( componentName ) => ( { + selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__nextHasNoMarginBottom"]))`, + message: + componentName + + ' should have the `__nextHasNoMarginBottom` prop to opt-in to the new margin-free styles.', + } ) ), + ], + }, + }, { files: [ // Components package. @@ -397,6 +425,7 @@ module.exports = { 'no-restricted-syntax': [ 'error', ...restrictedSyntax, + ...restrictedSyntaxComponents, { selector: ':matches(Literal[value=/--wp-admin-theme-/],TemplateElement[value.cooked=/--wp-admin-theme-/])', @@ -419,6 +448,26 @@ module.exports = { plugins: [ 'ssr-friendly' ], extends: [ 'plugin:ssr-friendly/recommended' ], }, + { + files: [ 'packages/components/src/**' ], + rules: { + 'no-restricted-imports': [ + 'error', + // The `ariakit` and `framer-motion` APIs are meant to be consumed via + // the `@wordpress/components` package, hence why importing those + // dependencies should be allowed in the components package. + { + paths: restrictedImports.filter( + ( { name } ) => + ! [ + '@ariakit/react', + 'framer-motion', + ].includes( name ) + ), + }, + ], + }, + }, { files: [ 'packages/block-editor/**' ], rules: { diff --git a/.gitattributes b/.gitattributes index 6c72e80a402976..1dc48620d8b67c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -20,3 +20,6 @@ changelog.txt linguist-language=Markdown # Flag docs directory as documentation for GitHub stats. docs/** linguist-documentation + +# TSConfig files use jsonc. +tsconfig*.json linguist-language=jsonc diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c90179f0e80943..e5f958eb9e9d85 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,7 +18,7 @@ /packages/block-library/src/comment-template @michalczaplinski /packages/block-library/src/comments @michalczaplinski /packages/block-library/src/table-of-contents @ZebulanStanphill -/packages/block-library/src/image @artemiomorales @michalczaplinski +/packages/block-library/src/image @artemiomorales # Duotone /lib/block-supports/duotone.php @@ -119,9 +119,9 @@ /packages/plugins @gziolo @adamsilverstein # Rich Text -/packages/format-library @ellatrix @fluiddot @dcalhoun -/packages/rich-text @ellatrix @fluiddot @dcalhoun -/packages/block-editor/src/components/rich-text @ellatrix @fluiddot @dcalhoun +/packages/format-library @ellatrix @dcalhoun +/packages/rich-text @ellatrix @dcalhoun +/packages/block-editor/src/components/rich-text @ellatrix @dcalhoun # Project Management /.github @desrosj diff --git a/.github/ISSUE_TEMPLATE/Bug_report.yml b/.github/ISSUE_TEMPLATE/Bug_report.yml index 1109056e7e5d56..5d7c876ccefca7 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_report.yml @@ -49,25 +49,19 @@ body: validations: required: false - - type: dropdown + - type: checkboxes id: existing attributes: label: Please confirm that you have searched existing issues in the repo. description: You can do this by searching https://github.com/WordPress/gutenberg/issues and making sure the bug is not related to another plugin. - multiple: true options: - - 'Yes' - - 'No' - validations: - required: true + - label: 'Yes' + required: true - - type: dropdown + - type: checkboxes id: plugins attributes: label: Please confirm that you have tested with all plugins deactivated except Gutenberg. - multiple: true options: - - 'Yes' - - 'No' - validations: - required: true + - label: 'Yes' + required: true diff --git a/.github/workflows/check-backport-changelog.yml b/.github/workflows/check-backport-changelog.yml index 355acb37bd14d4..606ca4c91683ce 100644 --- a/.github/workflows/check-backport-changelog.yml +++ b/.github/workflows/check-backport-changelog.yml @@ -18,22 +18,15 @@ on: - '!packages/e2e-tests/**' jobs: check: - name: Check CHANGELOG diff + name: Check for a Core backport changelog entry runs-on: ubuntu-latest + if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }} steps: - - name: 'Get PR commit count' - run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: ${{ env.PR_COMMIT_COUNT }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - - name: 'Fetch relevant history from origin' - run: git fetch origin ${{ github.event.pull_request.base.ref }} - - name: Check CHANGELOG status - if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }} + - name: Check the changelog folder env: PR_NUMBER: ${{ github.event.number }} run: | diff --git a/.github/workflows/cherry-pick-wp-release.yml b/.github/workflows/cherry-pick-wp-release.yml index d1089aa99f6ae5..b43b0cc267314d 100644 --- a/.github/workflows/cherry-pick-wp-release.yml +++ b/.github/workflows/cherry-pick-wp-release.yml @@ -1,8 +1,13 @@ name: Auto Cherry-Pick on: + push: + branches: + - trunk + # We also want to attempt cherry-picking when a PR is labeled after the PR + # is merged. pull_request: - types: [closed, labeled] + types: [labeled] branches: - trunk @@ -14,14 +19,36 @@ concurrency: jobs: cherry-pick: runs-on: ubuntu-latest - if: github.event.pull_request.merged == true + # When in the context of a PR, ensure the PR is merged. + if: github.event.pull_request == null || github.event.pull_request.merged == true steps: - name: Determine if label should trigger cherry-pick id: label-check uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - const labels = context.payload.pull_request.labels.map(label => label.name); + const commit_sha = context.payload.pull_request ? context.payload.pull_request.merge_commit_sha : context.sha; + console.log(`Commit SHA: ${commit_sha}`); + core.exportVariable('commit_sha', commit_sha); + const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({ + owner: context.repo.owner, + repo: context.repo.repo, + commit_sha, + }); + if (prs.data.length === 0) { + console.log(`No PR found for commit ${context.sha}.`); + return; + } + const pr_number = prs.data[0].number; + console.log(`PR: ${pr_number}`); + core.exportVariable('pr_number', pr_number); + + const pr = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: pr_number, + }); + const labels = pr.data.labels.map(label => label.name); console.log(`Labels: ${labels}`); const regex = /^Backport to WP ([0-9]+\.[0-9]+) Beta\/RC$/; let matched = false; @@ -59,19 +86,18 @@ jobs: if: env.cherry_pick == 'true' run: | TARGET_BRANCH="wp/${{ env.version }}" - COMMIT_SHA=$(jq -r '.pull_request.merge_commit_sha' "$GITHUB_EVENT_PATH") + COMMIT_SHA="${{ env.commit_sha }}" echo "Target branch: $TARGET_BRANCH" echo "Commit SHA: $COMMIT_SHA" git checkout $TARGET_BRANCH git cherry-pick $COMMIT_SHA || echo "cherry-pick-failed" > result if [ -f result ] && grep -q "cherry-pick-failed" result; then echo "conflict=true" >> $GITHUB_ENV - echo "commit_sha=$COMMIT_SHA" >> $GITHUB_ENV git cherry-pick --abort else - NEW_COMMIT_SHA=$(git rev-parse HEAD) + CHERRY_PICK_SHA=$(git rev-parse HEAD) echo "conflict=false" >> $GITHUB_ENV - echo "commit_sha=$NEW_COMMIT_SHA" >> $GITHUB_ENV + echo "cherry_pick_sha=$CHERRY_PICK_SHA" >> $GITHUB_ENV git push origin $TARGET_BRANCH fi @@ -80,7 +106,7 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - const prNumber = context.issue.number; + const prNumber = process.env.pr_number; const version = process.env.version; console.log(`prNumber: ${prNumber}`); console.log(`version: ${version}`); @@ -104,17 +130,17 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - const prNumber = context.issue.number; - const commitSha = process.env.commit_sha; + const prNumber = process.env.pr_number; + const cherryPickSha = process.env.cherry_pick_sha; const targetBranch = `wp/${process.env.version}`; console.log(`prNumber: ${prNumber}`); - console.log(`commitSha: ${commitSha}`); + console.log(`cherryPickSha: ${cherryPickSha}`); console.log(`targetBranch: ${targetBranch}`); await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber, - body: `I just cherry-picked this PR to the ${targetBranch} branch to get it included in the next release: ${commitSha}` + body: `I just cherry-picked this PR to the ${targetBranch} branch to get it included in the next release: ${cherryPickSha}` }); - name: Comment on the PR about conflict @@ -122,7 +148,7 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | - const prNumber = context.issue.number; + const prNumber = process.env.pr_number; const commitSha = process.env.commit_sha; const targetBranch = `wp/${process.env.version}`; console.log(`prNumber: ${prNumber}`); diff --git a/.github/workflows/sync-backport-changelog.yml b/.github/workflows/sync-backport-changelog.yml new file mode 100644 index 00000000000000..46465cdaab58ad --- /dev/null +++ b/.github/workflows/sync-backport-changelog.yml @@ -0,0 +1,76 @@ +name: Sync Core Backport Issue + +on: + push: + branches: + - trunk + +jobs: + sync-backport-changelog: + name: Sync Core Backport Issue + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 2 # Fetch the last two commits to compare changes + - name: Check for changes in backport-changelog + run: | + git diff --quiet HEAD^ HEAD -- backport-changelog || echo "changes=true" >> $GITHUB_OUTPUT + - name: Sync Issue + if: env.changes == 'true' + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const labelName = '🤖 Sync Backport Changelog'; + const issues = await github.paginate(github.rest.issues.listForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + labels: [labelName], + state: 'open', + per_page: 1, + }); + + if (issues.length === 0) { + console.log(`No issues found with the "${labelName}" label.`); + return; + } + + const [latestIssue] = issues; + const versionMatch = latestIssue.title.match(/(\d+\.\d+)/); + if (!versionMatch) { + console.log('Could not find a version number in the latest issue title.'); + return; + } + + const version = versionMatch[1]; + console.log(`Latest version: ${version}`); + + const { execSync } = require('child_process'); + const processedChangelog = execSync(`awk '/./ {print ($0 ~ /^[-*]/ ? " " : "- ") $0}' backport-changelog/${version}/*.md`).toString().trim(); + + const startDelimiter = ''; + const endDelimiter = ''; + const autoGeneratedContent = `${startDelimiter}\n${processedChangelog}\n${endDelimiter}`; + + const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`); + let newBody; + + if (regex.test(latestIssue.body)) { + // If delimiters exist, replace the content between them + newBody = latestIssue.body.replace(regex, autoGeneratedContent); + } else { + // If delimiters don't exist, append the new content at the end + newBody = `${latestIssue.body}\n\n${autoGeneratedContent}`; + } + + if (newBody.trim() !== latestIssue.body.trim()) { + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: latestIssue.number, + body: newBody + }); + console.log('Issue description updated successfully.'); + } else { + console.log('Issue description is already up to date.'); + } diff --git a/.wp-env.json b/.wp-env.json index 20d5597e54bbc9..05ea05b2809f9c 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,4 +1,5 @@ { + "$schema": "./schemas/json/wp-env.json", "core": "WordPress/WordPress", "plugins": [ "." ], "themes": [ "./test/emptytheme" ], diff --git a/backport-changelog/6.6/6959.md b/backport-changelog/6.6/6959.md new file mode 100644 index 00000000000000..3232414bc22b11 --- /dev/null +++ b/backport-changelog/6.6/6959.md @@ -0,0 +1,4 @@ +https://github.com/WordPress/wordpress-develop/pull/6959 + +* https://github.com/WordPress/gutenberg/pull/63071 + diff --git a/backport-changelog/6.6/6987.md b/backport-changelog/6.6/6987.md new file mode 100644 index 00000000000000..c3bf36f8f9933d --- /dev/null +++ b/backport-changelog/6.6/6987.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/6987 + +* https://github.com/WordPress/gutenberg/pull/63207 \ No newline at end of file diff --git a/backport-changelog/6.6/6989.md b/backport-changelog/6.6/6989.md new file mode 100644 index 00000000000000..3d236938ff74a5 --- /dev/null +++ b/backport-changelog/6.6/6989.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/6989 + +* https://github.com/WordPress/gutenberg/pull/63172 diff --git a/backport-changelog/6.6/7012.md b/backport-changelog/6.6/7012.md new file mode 100644 index 00000000000000..265f3dad981e44 --- /dev/null +++ b/backport-changelog/6.6/7012.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/7012 + +* https://github.com/WordPress/gutenberg/pull/63403 diff --git a/backport-changelog/6.6/7036.md b/backport-changelog/6.6/7036.md new file mode 100644 index 00000000000000..afc4d16bf011b7 --- /dev/null +++ b/backport-changelog/6.6/7036.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/7036 + +* https://github.com/WordPress/gutenberg/pull/63436 diff --git a/backport-changelog/6.7/6668.md b/backport-changelog/6.7/6668.md new file mode 100644 index 00000000000000..7653dd8d8294ee --- /dev/null +++ b/backport-changelog/6.7/6668.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/6668 + +* https://github.com/WordPress/gutenberg/pull/62092 diff --git a/backport-changelog/6.7/6836.md b/backport-changelog/6.7/6836.md new file mode 100644 index 00000000000000..feaa0f909f1f6f --- /dev/null +++ b/backport-changelog/6.7/6836.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/6836 + +* https://github.com/WordPress/gutenberg/pull/60100 diff --git a/backport-changelog/6.7/6910.md b/backport-changelog/6.7/6910.md new file mode 100644 index 00000000000000..24b59bce87ee60 --- /dev/null +++ b/backport-changelog/6.7/6910.md @@ -0,0 +1,7 @@ +https://github.com/WordPress/wordpress-develop/pull/6910 + +* https://github.com/WordPress/gutenberg/pull/59483 +* https://github.com/WordPress/gutenberg/pull/60652 +* https://github.com/WordPress/gutenberg/pull/62777 +* https://github.com/WordPress/gutenberg/pull/63108 +* https://github.com/WordPress/gutenberg/pull/63464 \ No newline at end of file diff --git a/backport-changelog/6.7/6991.md b/backport-changelog/6.7/6991.md new file mode 100644 index 00000000000000..4d5f1f85ec7686 --- /dev/null +++ b/backport-changelog/6.7/6991.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/6991 + +* https://github.com/WordPress/gutenberg/pull/61382 diff --git a/bin/api-docs/gen-theme-reference.js b/bin/api-docs/gen-theme-reference.mjs similarity index 82% rename from bin/api-docs/gen-theme-reference.js rename to bin/api-docs/gen-theme-reference.mjs index 07a8c2fcc697d4..051f23c3ea997d 100644 --- a/bin/api-docs/gen-theme-reference.js +++ b/bin/api-docs/gen-theme-reference.mjs @@ -7,8 +7,13 @@ /** * External dependencies */ -const path = require( 'path' ); -const fs = require( 'fs' ); +import path from 'path'; +import fs from 'fs'; +import url from 'url'; +import $RefParser from '@apidevtools/json-schema-ref-parser'; + +const __dirname = path.dirname( url.fileURLToPath( import.meta.url ) ); + /** * Path to root project directory. * @@ -58,7 +63,7 @@ const END_TOKEN = ''; */ const TOKEN_PATTERN = new RegExp( START_TOKEN + '[^]*' + END_TOKEN ); -const themejson = require( THEME_JSON_SCHEMA_FILE ); +const themejson = await $RefParser.dereference( THEME_JSON_SCHEMA_FILE ); /** * Convert object keys to an array. @@ -74,42 +79,6 @@ const keys = ( maybeObject ) => { return Object.keys( maybeObject ); }; -/** - * Get definition from ref. - * - * @param {string} ref - * @return {Object} definition - * @throws {Error} If the referenced definition is not found in 'themejson.definitions'. - * - * @example - * getDefinition( '#/definitions/typographyProperties/properties/fontFamily' ) - * // returns themejson.definitions.typographyProperties.properties.fontFamily - */ -const resolveDefinitionRef = ( ref ) => { - const refParts = ref.split( '/' ); - const definition = refParts[ refParts.length - 1 ]; - if ( ! themejson.definitions[ definition ] ) { - throw new Error( `Can't resolve '${ ref }'. Definition not found` ); - } - return themejson.definitions[ definition ]; -}; - -/** - * Get properties from an array. - * - * @param {Object} items - * @return {Object} properties - */ -const getPropertiesFromArray = ( items ) => { - // if its a $ref resolve it - if ( items.$ref ) { - return resolveDefinitionRef( items.$ref ).properties; - } - - // otherwise just return the properties - return items.properties; -}; - /** * Convert settings properties to markup. * @@ -133,9 +102,7 @@ const getSettingsPropertiesMarkup = ( struct ) => { let type = props[ key ].type || ''; let ps = props[ key ].type === 'array' - ? keys( getPropertiesFromArray( props[ key ].items ) ) - .sort() - .join( ', ' ) + ? keys( props[ key ].items.properties ).sort().join( ', ' ) : ''; /* @@ -154,9 +121,7 @@ const getSettingsPropertiesMarkup = ( struct ) => { .map( ( item ) => item?.type === 'object' && item?.properties ? '_{' + - keys( getPropertiesFromArray( item ) ) - .sort() - .join( ', ' ) + + keys( item.properties ).sort().join( ', ' ) + '}_' : '' ) @@ -244,10 +209,6 @@ const formatType = ( prop ) => { 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( ', ' ); diff --git a/changelog.txt b/changelog.txt index 3a00bcf11396fe..8e63d9a2d1f44b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,409 @@ == Changelog == -= 18.7.0-rc.1 = += 18.8.0 = +## Changelog + +### Features + +- DataForm: Implement first prototype using duplicate page action. ([63032](https://github.com/WordPress/gutenberg/pull/63032)) + + +### Enhancements + +#### Components +- BaseControl: Forward ref on VisualLabel. ([63169](https://github.com/WordPress/gutenberg/pull/63169)) +- CustomSelectControlV2: Allow wrapping item hint to new line. ([62848](https://github.com/WordPress/gutenberg/pull/62848)) +- CustomSelectControlV2: Expose legacy wrapper through private APIs. ([62936](https://github.com/WordPress/gutenberg/pull/62936)) +- CustomSelectControl V2: Keep legacy arrow down behavior only for legacy wrapper. ([62919](https://github.com/WordPress/gutenberg/pull/62919)) +- CustomSelectControlV2: Collapse checkmark space when unchecked. ([63229](https://github.com/WordPress/gutenberg/pull/63229)) +- CustomSelectControlV2: Keep item checkmark top aligned. ([63230](https://github.com/WordPress/gutenberg/pull/63230)) +- DateTime: Create TimeInput component and integrate into TimePicker. ([60613](https://github.com/WordPress/gutenberg/pull/60613)) +- FontSizePicker: Use CustomSelectControl V2 legacy adapter. ([63134](https://github.com/WordPress/gutenberg/pull/63134)) +- Tabs: Add vertical indicator animation. ([62879](https://github.com/WordPress/gutenberg/pull/62879)) +- TimeInput: Add `label` prop. ([63106](https://github.com/WordPress/gutenberg/pull/63106)) +- TimePicker: Add `dateOrder` prop to sort day, month, and year. ([62481](https://github.com/WordPress/gutenberg/pull/62481)) +- ToolbarButton: Deprecate `isDisabled` prop and merge with `disabled`. ([63101](https://github.com/WordPress/gutenberg/pull/63101)) +- Tooltip Component: Add custom class name support. ([63157](https://github.com/WordPress/gutenberg/pull/63157)) + +#### Data Views +- Add padding around selected values in author filter. ([63212](https://github.com/WordPress/gutenberg/pull/63212)) +- DataViews filterSortAndPaginate utility: Support sorting by number. ([63187](https://github.com/WordPress/gutenberg/pull/63187)) +- DataViews: Make `view.hiddenFields` optional. ([62876](https://github.com/WordPress/gutenberg/pull/62876)) +- DataViews: Remove Table Cells animation. ([63079](https://github.com/WordPress/gutenberg/pull/63079)) +- DataViews: Replace supportedLayouts prop with defaultLayouts prop instead. ([63287](https://github.com/WordPress/gutenberg/pull/63287)) +- Duplicate modal: Move to 40px components. ([63246](https://github.com/WordPress/gutenberg/pull/63246)) +- Pages: Include avatar in Author field. ([63142](https://github.com/WordPress/gutenberg/pull/63142)) +- Patterns Page: Hide preview column by default. ([63213](https://github.com/WordPress/gutenberg/pull/63213)) +- Posts list powered by DataViews. ([62705](https://github.com/WordPress/gutenberg/pull/62705)) +- Split layout / view options. Use active layout icon for the layout button. ([63205](https://github.com/WordPress/gutenberg/pull/63205)) +- Use status icons in field display. ([63289](https://github.com/WordPress/gutenberg/pull/63289)) + +#### Block Library +- Add example for query block and posts list. ([63286](https://github.com/WordPress/gutenberg/pull/63286)) +- Excerpt block: Add example of the block. ([63010](https://github.com/WordPress/gutenberg/pull/63010)) +- Group: Add block support for shadow. ([63295](https://github.com/WordPress/gutenberg/pull/63295)) +- Login/out block: Add example of the block. ([62937](https://github.com/WordPress/gutenberg/pull/62937)) +- Post content block: Add example of the block. ([62968](https://github.com/WordPress/gutenberg/pull/62968)) +- Post title: Add example of the block. ([62955](https://github.com/WordPress/gutenberg/pull/62955)) +- Table Block: Add toolbar button to add a caption. ([47984](https://github.com/WordPress/gutenberg/pull/47984)) + +#### Block Editor +- Block position controls: Use V2 legacy adapter instead of V1 `CustomSelectControl`. ([63139](https://github.com/WordPress/gutenberg/pull/63139)) +- DateFormatPicker: Use CustomSelectControl V2 legacy adapter. ([63171](https://github.com/WordPress/gutenberg/pull/63171)) +- Fix inspector inner shadow border. ([63245](https://github.com/WordPress/gutenberg/pull/63245)) +- FontAppearanceControl: Use CustomSelectControl V2 legacy adapter. ([63179](https://github.com/WordPress/gutenberg/pull/63179)) +- Inserter: Remove the dialog behaviour. ([63059](https://github.com/WordPress/gutenberg/pull/63059)) +- SpacingInputControl: Use CustomSelectControl V2 legacy adapter. ([63190](https://github.com/WordPress/gutenberg/pull/63190)) + +#### Global Styles +- Background image: Move controls into a popover. ([60151](https://github.com/WordPress/gutenberg/pull/60151)) +- Block background UI controls. ([60100](https://github.com/WordPress/gutenberg/pull/60100)) +- Tweak block background position preview height. ([63225](https://github.com/WordPress/gutenberg/pull/63225)) + +#### Extensibility +- DataViews: Register the deletePost action like any third-party action. ([62913](https://github.com/WordPress/gutenberg/pull/62913)) +- DataViews: Register the export pattern action like any third-party action. ([63046](https://github.com/WordPress/gutenberg/pull/63046)) +- DataViews: Register the reset template and template part action like any third-party action. ([63017](https://github.com/WordPress/gutenberg/pull/63017)) + +#### Design Tools +- Flex dimensions: Rename "Fill" to "Grow". ([62779](https://github.com/WordPress/gutenberg/pull/62779)) +- List Item: Add color support. ([59892](https://github.com/WordPress/gutenberg/pull/59892)) +- Uniform Focal point labels. ([62438](https://github.com/WordPress/gutenberg/pull/62438)) + +#### Font Library +- Font Library Modal: Enhance pagination appearance. ([63210](https://github.com/WordPress/gutenberg/pull/63210)) +- Font Library: Store font subdirectory in post meta. ([63000](https://github.com/WordPress/gutenberg/pull/63000)) +- Move font directory into uploads to match WP 6.5. ([60354](https://github.com/WordPress/gutenberg/pull/60354)) + +#### Layout +- Add justification to block toolbar in addition to sidebar. ([62924](https://github.com/WordPress/gutenberg/pull/62924)) + +#### Site Editor +- Align rename modals. ([62874](https://github.com/WordPress/gutenberg/pull/62874)) + +#### Block API +- block.json: Allow passing filename as `variations` field. ([62092](https://github.com/WordPress/gutenberg/pull/62092)) + +#### Template Editor +- Update: Move template areas into a panel. ([62033](https://github.com/WordPress/gutenberg/pull/62033)) + +#### Block Variations +- Automatically select group variation if there is only one available. ([61871](https://github.com/WordPress/gutenberg/pull/61871)) + +#### Zoom Out +- Add a vertical toolbar for zoom out mode. ([60123](https://github.com/WordPress/gutenberg/pull/60123)) + + +### New APIs + +#### Block API +- Introduce "local" attributes and use it for the image block. ([63076](https://github.com/WordPress/gutenberg/pull/63076)) + + +### Bug Fixes + +- Core Commands: Fix Pages command link. ([63235](https://github.com/WordPress/gutenberg/pull/63235)) +- Docgen: Fix function param for const function expression. ([63034](https://github.com/WordPress/gutenberg/pull/63034)) +- Enable `save draft` button for posts with custom post status. ([63293](https://github.com/WordPress/gutenberg/pull/63293)) +- Ensure device previews extra scrollbar only appears when needed. ([62952](https://github.com/WordPress/gutenberg/pull/62952)) +- Styles specificity: Allow comment form input overrides. ([62960](https://github.com/WordPress/gutenberg/pull/62960)) + +#### Components +- CustomSelectControl V2 legacy adapter: Fix trigger button font size. ([63131](https://github.com/WordPress/gutenberg/pull/63131)) +- CustomSelectControl V2: Fix labelling with a visually hidden label. ([63137](https://github.com/WordPress/gutenberg/pull/63137)) +- CustomSelectControl V2: Fix trigger text alignment in RTL languages. ([62869](https://github.com/WordPress/gutenberg/pull/62869)) +- CustomSelectControl V2: Prevent keyboard event propagation in legacy wrapper. ([62907](https://github.com/WordPress/gutenberg/pull/62907)) +- CustomSelectControlV2: Add root element wrapper. ([62803](https://github.com/WordPress/gutenberg/pull/62803)) +- CustomSelectControlV2: Fix item styles. ([62825](https://github.com/WordPress/gutenberg/pull/62825)) +- CustomSelectControlV2: Fix popover styles. ([62821](https://github.com/WordPress/gutenberg/pull/62821)) +- CustomSelectControlV2: Fix select popover content overflow. ([62844](https://github.com/WordPress/gutenberg/pull/62844)) +- CustomSelectControlV2: Tweak item inline padding based on size. ([62850](https://github.com/WordPress/gutenberg/pull/62850)) +- Editor: Fix duplicate save panels. ([62863](https://github.com/WordPress/gutenberg/pull/62863)) +- Fix UnitControl select disabled state colors. ([62970](https://github.com/WordPress/gutenberg/pull/62970)) +- Fix extra scrollbar when a popover extends past the viewport. ([62894](https://github.com/WordPress/gutenberg/pull/62894)) +- Fix the 'useUpdateEffect' hook in strict mode. ([62974](https://github.com/WordPress/gutenberg/pull/62974)) +- ProgressBar: Fix indeterminate RTL support. ([63129](https://github.com/WordPress/gutenberg/pull/63129)) +- RangeControl: Fix RTL support for custom marks. ([63198](https://github.com/WordPress/gutenberg/pull/63198)) +- SelectControl: Fix disabled styles. ([63266](https://github.com/WordPress/gutenberg/pull/63266)) +- Tabs: Fix "With tab icons" Storybook example. ([63297](https://github.com/WordPress/gutenberg/pull/63297)) +- Tabs: Fix text-align when text wraps in vertical mode. ([63272](https://github.com/WordPress/gutenberg/pull/63272)) +- TimePicker: Fix time zone overflow. ([63209](https://github.com/WordPress/gutenberg/pull/63209)) +- UnitControl: Fix an issue where keyboard shortcuts unintentionally shift focus on Windows OS. ([62988](https://github.com/WordPress/gutenberg/pull/62988)) + +#### Block Library +- Add Aspect ratio control on Image blocks in Grids. ([62891](https://github.com/WordPress/gutenberg/pull/62891)) +- Audio Block: Do not persist blob urls and fix undo. ([63257](https://github.com/WordPress/gutenberg/pull/63257)) +- File block: Do not persist blob urls and fix undo. ([63282](https://github.com/WordPress/gutenberg/pull/63282)) +- Fix Incorrect URL basename logic in EmbedPreview. ([63052](https://github.com/WordPress/gutenberg/pull/63052)) +- Fix: Update "Link Text" label to "Text" on Social Icons block #60966. ([61715](https://github.com/WordPress/gutenberg/pull/61715)) +- List: Maintain nested list on parent item removal. ([62949](https://github.com/WordPress/gutenberg/pull/62949)) +- Navigation: Allow themes to override block library text-decoration rule. ([63406](https://github.com/WordPress/gutenberg/pull/63406)) +- Patterns: Check for edited entity content property when exporting. ([63227](https://github.com/WordPress/gutenberg/pull/63227)) +- Reduce specificity of social link icon specific colors. ([63049](https://github.com/WordPress/gutenberg/pull/63049)) +- Refactor Post Date Relative Time Rendering for Future Dates. ([62979](https://github.com/WordPress/gutenberg/pull/62979)) +- Site Editor: Fix template parts 'Reset' action. ([62951](https://github.com/WordPress/gutenberg/pull/62951)) +- Video Block: Do not persist blob urls and fix undo. ([63238](https://github.com/WordPress/gutenberg/pull/63238)) + +#### Post Editor +- Editor: Do not truncate post excerpt if not editable. ([63314](https://github.com/WordPress/gutenberg/pull/63314)) +- Fix: Background height and padding in non-iframe editor canvas. ([63222](https://github.com/WordPress/gutenberg/pull/63222)) +- Fix: Crash when onActionPerformed is used with callback actions. ([63120](https://github.com/WordPress/gutenberg/pull/63120)) +- Fix: Permanently delete post action does not calls onActionPerformed. ([63121](https://github.com/WordPress/gutenberg/pull/63121)) +- Fix: Triple scrollbars in device previews. ([62940](https://github.com/WordPress/gutenberg/pull/62940)) +- Post editor: Increase specificity of bottom padding. ([63288](https://github.com/WordPress/gutenberg/pull/63288)) +- Actions: Translation should depend on number of items. ([62857](https://github.com/WordPress/gutenberg/pull/62857)) + +#### Data Views +- DataViews list layout: Fix action alignment. ([62971](https://github.com/WordPress/gutenberg/pull/62971)) +- DataViews: Restore preview focus outline in grid layout. ([62991](https://github.com/WordPress/gutenberg/pull/62991)) +- Fix buttonless table header alignment. ([62877](https://github.com/WordPress/gutenberg/pull/62877)) +- Fix typo in string for trashing posts. ([63119](https://github.com/WordPress/gutenberg/pull/63119)) +- Patterns: Avoid mapping template parts objects to patterns. ([62927](https://github.com/WordPress/gutenberg/pull/62927)) + +#### Block Style Variations +- Block supports: Ensure tools panel dropdown are visible on mobile. ([62896](https://github.com/WordPress/gutenberg/pull/62896)) +- Section Styles: Fix error when blocks are deregistered. ([63252](https://github.com/WordPress/gutenberg/pull/63252)) +- Section Styles: Prevent flash of variation styles in post editor. ([63071](https://github.com/WordPress/gutenberg/pull/63071)) +- Section Styles: Resolve ref values in variations data. ([63172](https://github.com/WordPress/gutenberg/pull/63172)) + +#### Layout +- Only hide drop indicator when grid has `isManualPlacement` set. ([63226](https://github.com/WordPress/gutenberg/pull/63226)) +- Remove dotted border from grid dropzone. ([63162](https://github.com/WordPress/gutenberg/pull/63162)) +- Resizing in Auto mode shouldn't add `columnStart` and `rowStart` values. ([63160](https://github.com/WordPress/gutenberg/pull/63160)) +- Fix invalid css for nested fullwidth layouts with zero padding applied. ([63436](https://github.com/WordPress/gutenberg/pull/63436)) + +#### Global Styles +- Elements: Avoid specificity bump for top-level element-only selectors. ([63403](https://github.com/WordPress/gutenberg/pull/63403)) +- Global styles revisions: Ensure that user-defined variation styles CSS is generated. ([62768](https://github.com/WordPress/gutenberg/pull/62768)) +- Root padding styles: Include alignwide in nested has-outer-padding logic. ([63207](https://github.com/WordPress/gutenberg/pull/63207)) +- Remove letter-spacing from typography element preview. ([60322](https://github.com/WordPress/gutenberg/pull/60322)) +- Only add customizer additional CSS to global styles in block themes. ([63331](https://github.com/WordPress/gutenberg/pull/63331)) + +#### Site Editor +- Make SiteHub available for Pages, Patterns, and Templates in mobile viewports. ([63118](https://github.com/WordPress/gutenberg/pull/63118)) +- Patterns and templates cannot be edited from sidebar mobile view. ([63002](https://github.com/WordPress/gutenberg/pull/63002)) +- Site Editor Sidebar: Hide horizontal scrollbar when navigating. ([63194](https://github.com/WordPress/gutenberg/pull/63194)) + +#### Synced Patterns +- Ensure disable overrides button is active for image blocks with captions or links. ([62948](https://github.com/WordPress/gutenberg/pull/62948)) +- Fix second scrollbar when editing patterns in the post editor. ([62909](https://github.com/WordPress/gutenberg/pull/62909)) +- Pattern overrides: Fix aspect ratio not working in image with overrides. ([62828](https://github.com/WordPress/gutenberg/pull/62828)) + +#### Block Editor +- Featured Image Panel: Align text and icons horizontally to avoid clipping. ([62842](https://github.com/WordPress/gutenberg/pull/62842)) +- Zoom Out: Move the hook to the inserter component. ([63315](https://github.com/WordPress/gutenberg/pull/63315)) +- Fix error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460)) + +#### Block bindings +- Disable post meta editing in blocks inside a Query Loop. ([63237](https://github.com/WordPress/gutenberg/pull/63237)) +- Image block: Ensure extenders that rely on media ids in block html are supported by block bindings. ([63013](https://github.com/WordPress/gutenberg/pull/63013)) + +#### Patterns +- Fix: Restrict export pattern action to user patterns. ([63228](https://github.com/WordPress/gutenberg/pull/63228)) + +#### Posts/Tags/Categories Screen +- Constrain `is-fullscreen-mode` admin body class to posts list. ([63166](https://github.com/WordPress/gutenberg/pull/63166)) + +#### Inspector Controls +- Fix button wrapping in the document Inspector. ([63062](https://github.com/WordPress/gutenberg/pull/63062)) + +#### Design Tools +- Duotone: Fix code typo, to ensure Duotone updates correctly in Safari. ([62953](https://github.com/WordPress/gutenberg/pull/62953)) + +#### Commands +- Fix issue of HTML entities rendering in command menu. ([62606](https://github.com/WordPress/gutenberg/pull/62606)) + +#### Typography +- Use available font weights and styles in FontAppearanceControl. ([61915](https://github.com/WordPress/gutenberg/pull/61915)) +- Font Appearance Control: Refactor font appearance fallbacks. ([63215](https://github.com/WordPress/gutenberg/pull/63215)) + + +### Accessibility + +- Allow Escape key to move focus to editor region when in select mode. ([62196](https://github.com/WordPress/gutenberg/pull/62196)) +- Focus Editor Region from Template Footer Click. ([62595](https://github.com/WordPress/gutenberg/pull/62595)) + +#### Components +- Button: Stabilize `__experimentalIsFocusable` prop. ([62282](https://github.com/WordPress/gutenberg/pull/62282)) +- Fix inaccessible disabled `Button`s. ([62306](https://github.com/WordPress/gutenberg/pull/62306)) +- Make Tabs have a fluid height. ([62027](https://github.com/WordPress/gutenberg/pull/62027)) +- ToolbarButton: Always keep focusable when disabled. ([63102](https://github.com/WordPress/gutenberg/pull/63102)) + +#### Global Styles +- Fix unlabeled Remove shadow buttons. ([63197](https://github.com/WordPress/gutenberg/pull/63197)) + +#### Block Library +- Make usage of the settings icon more consistent. ([63020](https://github.com/WordPress/gutenberg/pull/63020)) + +#### Data Views +- Add translation context for 'view options' label. ([63031](https://github.com/WordPress/gutenberg/pull/63031)) +- Fix filter chip contrast. ([62865](https://github.com/WordPress/gutenberg/pull/62865)) + +#### Media +- Update URLPopover role and focus return. ([61313](https://github.com/WordPress/gutenberg/pull/61313)) + + +### Performance + +- Core data: Batch receiveUserPermission. ([63201](https://github.com/WordPress/gutenberg/pull/63201)) +- Perf tests: Make pages test compatible with base branch. ([63204](https://github.com/WordPress/gutenberg/pull/63204)) + +#### Block hooks +- Optimize selectors in the control component. ([63141](https://github.com/WordPress/gutenberg/pull/63141)) + + +### Experiments + +#### Layout +- Allow inserting blocks directly in empty grid cells. ([63108](https://github.com/WordPress/gutenberg/pull/63108)) +- Use `manualPlacement` attribute to set manual grid mode and allow responsive behaviour in both modes. ([62777](https://github.com/WordPress/gutenberg/pull/62777)) + + +### Documentation + +- Add note about postcss-urlrebase package patch. ([63015](https://github.com/WordPress/gutenberg/pull/63015)) +- Add RichText formatting example to the Editor curation documentation. ([63065](https://github.com/WordPress/gutenberg/pull/63065)) +- Block supports: Add documentation for 'splitting'. ([63016](https://github.com/WordPress/gutenberg/pull/63016)) +- Fix typo to be preposition, not verb, in some package comments and documentations. ([62945](https://github.com/WordPress/gutenberg/pull/62945)) +- Fix urls to developer documentation. ([63104](https://github.com/WordPress/gutenberg/pull/63104)) +- Interactivity API: Fix minor typos in code snippets. ([62890](https://github.com/WordPress/gutenberg/pull/62890)), ([63234](https://github.com/WordPress/gutenberg/pull/63234)) +- Interactivity API: Fix variable name in color directive example. ([62912](https://github.com/WordPress/gutenberg/pull/62912)) +- Interactivity API: Include references to more examples from the documentation. ([63025](https://github.com/WordPress/gutenberg/pull/63025)) +- Interactivity API: Recommend kebab-case in data-wp-class. ([62817](https://github.com/WordPress/gutenberg/pull/62817)) +- Remove link to polyfill.io. ([62883](https://github.com/WordPress/gutenberg/pull/62883)) +- Storybook: Fix links for block editor examples. ([63132](https://github.com/WordPress/gutenberg/pull/63132)) +- ToolbarButton: Fix documentation for `accessibleWhenDisabled`. ([63140](https://github.com/WordPress/gutenberg/pull/63140)) +- Update React dev docs rule hook URL. ([62995](https://github.com/WordPress/gutenberg/pull/62995)) + + +### Code Quality + +- Add linguist-documentation attribute to docs/ directory. ([62651](https://github.com/WordPress/gutenberg/pull/62651)) +- Conditionally call focus with getEditorRegion. ([62980](https://github.com/WordPress/gutenberg/pull/62980)) +- Core Data: Remove entity configuration '__experimentalNoFetch' flag checks. ([63303](https://github.com/WordPress/gutenberg/pull/63303)) +- Dependencies: Upgrades and deduplication. ([62657](https://github.com/WordPress/gutenberg/pull/62657)) +- Format Library: Clean up 'Highlight' format components. ([62965](https://github.com/WordPress/gutenberg/pull/62965)) +- Remove postcss-local-keyframes from dependencies. ([63224](https://github.com/WordPress/gutenberg/pull/63224)) +- Upgrade postcss-urlrebase package. ([63075](https://github.com/WordPress/gutenberg/pull/63075)) + +#### Data Views +- DataViews: Fix double check in `isTemplateRemovable`. ([63021](https://github.com/WordPress/gutenberg/pull/63021)) +- DataViews: Remove the AnyItem type. ([62856](https://github.com/WordPress/gutenberg/pull/62856)) +- DataViews: Removing mapping of user patterns to temporary object. ([63042](https://github.com/WordPress/gutenberg/pull/63042)) +- DataViews: Replace hiddenFields configuration with fields property instead. ([63127](https://github.com/WordPress/gutenberg/pull/63127)) +- DataViews: Simplify selection setting. ([62846](https://github.com/WordPress/gutenberg/pull/62846)) + +#### Block Editor +- Remove CSS hack for Internet Explorer 11. ([63220](https://github.com/WordPress/gutenberg/pull/63220)) +- Remove duplicate translator comment. ([62860](https://github.com/WordPress/gutenberg/pull/62860)) + +#### Components +- Allow ariakit and framer motion imports in the components package. ([63123](https://github.com/WordPress/gutenberg/pull/63123)) +- Normalize focusable disabled ToolbarButton usage. ([63130](https://github.com/WordPress/gutenberg/pull/63130)) +- Sidebar: Add a shared component for the inserter and list view. ([62343](https://github.com/WordPress/gutenberg/pull/62343)) +- Tabs: Split animation logic into multiple separate composable utilities. ([62942](https://github.com/WordPress/gutenberg/pull/62942)) + +#### Global Styles +- Global Styles: Allow variations to be filtered by multiple properties. ([62847](https://github.com/WordPress/gutenberg/pull/62847)) +- Global Styles: Simplify code to fetch color and typography variation. ([62827](https://github.com/WordPress/gutenberg/pull/62827)) +- Make a shared component for typography and color preview. ([62829](https://github.com/WordPress/gutenberg/pull/62829)) +- Section Styles: Clean up block style variation filters. ([62858](https://github.com/WordPress/gutenberg/pull/62858)) + +#### Block Library +- Gallery Block: Clean up v1 code. ([63285](https://github.com/WordPress/gutenberg/pull/63285)) + +#### Site Editor +- Clean up unused Table component. ([63283](https://github.com/WordPress/gutenberg/pull/63283)) + +#### Rich Text +- Raw handling: Remove IE11 fallback code. ([63219](https://github.com/WordPress/gutenberg/pull/63219)) + +#### Zoom Out +- Replace deprecated selector. ([63144](https://github.com/WordPress/gutenberg/pull/63144)) + +#### Block bindings +- Add comment about `useSelect` usage in withBlockBindingSupport. ([63005](https://github.com/WordPress/gutenberg/pull/63005)) + +#### HTML API +- Compat: Update HTML API with changes from 6.6. ([63089](https://github.com/WordPress/gutenberg/pull/63089)) + + +### Tools + +- Dependency extraction: Map to `regenerator-runtime` instead of `wp-polyfill`. ([63091](https://github.com/WordPress/gutenberg/pull/63091)) +- Env: Remove version field from docker-compose configuration. ([63099](https://github.com/WordPress/gutenberg/pull/63099)) +- Eslint-plugin: Add method-signature-style TypeScript lint rule. ([62718](https://github.com/WordPress/gutenberg/pull/62718)) +- Scripts: Ensure that typescript-eslint checks for unused vars. ([62925](https://github.com/WordPress/gutenberg/pull/62925)) +- Update new release issue template to remove core editor chat item. ([62864](https://github.com/WordPress/gutenberg/pull/62864)) + +#### Testing +- Automatically sync backport changelog to issue. ([62973](https://github.com/WordPress/gutenberg/pull/62973)) +- Block styles variations E2E: Wait for Save button before editing global styles. ([62915](https://github.com/WordPress/gutenberg/pull/62915)) +- Cherry pick automation: Fix for forks. ([62900](https://github.com/WordPress/gutenberg/pull/62900)) +- Cherry pick workflow: Improve message after conflict. ([62826](https://github.com/WordPress/gutenberg/pull/62826)) +- DataViews: Add performance test for pages. ([63170](https://github.com/WordPress/gutenberg/pull/63170)) +- Fix typo in column block fixture file. ([63007](https://github.com/WordPress/gutenberg/pull/63007)) +- Performance tests: Fix for 6.5. ([62871](https://github.com/WordPress/gutenberg/pull/62871)) +- Performance tests: Restore 6.5-compatible locator. ([63041](https://github.com/WordPress/gutenberg/pull/63041)) +- Re-enable image block cropping test (#62781). ([62854](https://github.com/WordPress/gutenberg/pull/62854)) +- Update method for changing the content in 'editor-modes' end-to-end test. ([62957](https://github.com/WordPress/gutenberg/pull/62957)) +- Update the `project-management-automation`action to use Node.js 20. ([62851](https://github.com/WordPress/gutenberg/pull/62851)) +- Upgrade web-vitals package. ([63019](https://github.com/WordPress/gutenberg/pull/63019)) + +#### Plugin +- Add local version of wp-env schema to .wp-env.json. ([63253](https://github.com/WordPress/gutenberg/pull/63253)) + +#### Build Tooling +- Build: Enable TypeScript skipDefaultLibCheck. ([63056](https://github.com/WordPress/gutenberg/pull/63056)) + + +## First-time contributors + +The following PRs were merged by first-time contributors: + +- @airman5573: Fix variable name in color directive example for Interactivity API. ([62912](https://github.com/WordPress/gutenberg/pull/62912)) +- @aliaghdam: Tooltip Component: Add custom class name support. ([63157](https://github.com/WordPress/gutenberg/pull/63157)) +- @bogiii: DateTime: Create TimeInput component and integrate into TimePicker. ([60613](https://github.com/WordPress/gutenberg/pull/60613)) +- @Chrico: Scripts: Ensure that typescript-eslint checks for unused vars. ([62925](https://github.com/WordPress/gutenberg/pull/62925)) +- @dhananjaykuber: Fix Incorrect URL basename logic in EmbedPreview. ([63052](https://github.com/WordPress/gutenberg/pull/63052)) +- @iamibrahimriaz: Update iapi-about.md. ([63234](https://github.com/WordPress/gutenberg/pull/63234)) +- @iworks: Translation should depend on number of items. ([62857](https://github.com/WordPress/gutenberg/pull/62857)) +- @roygbyte: Fix typo to be preposition, not verb, in some package comments and documentations. ([62945](https://github.com/WordPress/gutenberg/pull/62945)) +- @shreya0204: Add justification to block toolbar in addition to sidebar. ([62924](https://github.com/WordPress/gutenberg/pull/62924)) +- @sejas: Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460)) + + +## Contributors + +The following contributors merged PRs in this release: + +@aaronrobertshaw @afercia @airman5573 @akasunil @aliaghdam @amitraj2203 @bogiii @carolinan @Chrico @ciampo @costasovo @creativecoder @DaniGuardiola @desrosj @dhananjaykuber @dmsnell @ellatrix @fluiddot @geriux @hbhalodia @iamibrahimriaz @iworks @jameskoster @jasmussen @jeryj @jffng @jorgefilipecosta @jsnajdr @juanmaguitar @kevin940726 @luisherranz @MaggieCabrera @Mamaduka @matiasbenedetto @michalczaplinski @mikachan @mirka @ndiego @ntsekouras @oandregal @ockham @peterwilsoncc @ramonjd @richtabor @roygbyte @SantosGuillamot @scruffian @shail-mehta @shreya0204 @sirreal @stokesman @swissspidy @t-hamano @talldan @tellthemachines @tyxla @vipul0425 @westonruter @youknowriad + + + + += 18.7.1 = + + +## Changelog + +### Bug Fixes + +#### Block Library +- Button Block: Add back compat for WP6.4 regarding HTML Tag Processor. ([63082](https://github.com/WordPress/gutenberg/pull/63082)) + + + + +## Contributors + +The following contributors merged PRs in this release: + +@t-hamano + + += 18.7.0 = ## Changelog @@ -190,6 +592,8 @@ The following contributors merged PRs in this release: @aaronrobertshaw @aatanasovdev @afercia @ajlende @akasunil @amitraj2203 @artemiomorales @carolinan @cbravobernal @ciampo @creativecoder @DaniGuardiola @dilipbheda @ellatrix @fullofcaffeine @geriux @graylaurenm @gziolo @itzmekhokan @ivan-ottinger @jameskoster @jorgefilipecosta @juanmaguitar @kevin940726 @luisherranz @MaggieCabrera @matiasbenedetto @michakrapp @mirka @noisysocks @ntsekouras @oandregal @peterwilsoncc @ramonjd @sabernhardt @SantosGuillamot @saulyz @shail-mehta @sirreal @snehapatil2001 @spacedmonkey @stokesman @t-hamano @talldan @tellthemachines @up1512001 @vcanales @vipul0425 @westonruter @youknowriad + + = 18.6.1 = diff --git a/docs/contributors/code/coding-guidelines.md b/docs/contributors/code/coding-guidelines.md index 0365a87e0ae40d..d8a5220c70ca24 100644 --- a/docs/contributors/code/coding-guidelines.md +++ b/docs/contributors/code/coding-guidelines.md @@ -65,7 +65,7 @@ Examples of styles that appear in both the theme and the editor include gallery ## JavaScript -JavaScript in Gutenberg uses modern language features of the [ECMAScript language specification](https://www.ecma-international.org/ecma-262/) as well as the [JSX language syntax extension](https://reactjs.org/docs/introducing-jsx.html). These are enabled through a combination of preset configurations, notably [`@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) which is used as a preset in the project's [Babel](https://babeljs.io/) configuration. +JavaScript in Gutenberg uses modern language features of the [ECMAScript language specification](https://www.ecma-international.org/ecma-262/) as well as the [JSX language syntax extension](https://react.dev/learn/writing-markup-with-jsx). These are enabled through a combination of preset configurations, notably [`@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) which is used as a preset in the project's [Babel](https://babeljs.io/) configuration. While the [staged process](https://tc39.es/process-document/) for introducing a new JavaScript language feature offers an opportunity to use new features before they are considered complete, **the Gutenberg project and the `@wordpress/babel-preset-default` configuration will only target support for proposals which have reached Stage 4 ("Finished")**. @@ -531,7 +531,7 @@ alert( `My name is ${ name }.` ); ### React components -It is preferred to implement all components as [function components](https://reactjs.org/docs/components-and-props.html), using [hooks](https://reactjs.org/docs/hooks-reference.html) to manage component state and lifecycle. With the exception of [error boundaries](https://reactjs.org/docs/error-boundaries.html), you should never encounter a situation where you must use a class component. Note that the [WordPress guidance on Code Refactoring](https://make.wordpress.org/core/handbook/contribute/code-refactoring/) applies here: There needn't be a concentrated effort to update class components in bulk. Instead, consider it as a good refactoring opportunity in combination with some other change. +It is preferred to implement all components as [function components](https://react.dev/learn/your-first-component), using [hooks](https://react.dev/reference/react/hooks) to manage component state and lifecycle. With the exception of [error boundaries](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary), you should never encounter a situation where you must use a class component. Note that the [WordPress guidance on Code Refactoring](https://make.wordpress.org/core/handbook/contribute/code-refactoring/) applies here: There needn't be a concentrated effort to update class components in bulk. Instead, consider it as a good refactoring opportunity in combination with some other change. ## JavaScript documentation using JSDoc @@ -758,7 +758,7 @@ When documenting an example, use the markdown \`\`\` code block to ### Documenting React components -When possible, all components should be implemented as [function components](https://reactjs.org/docs/components-and-props.html#function-and-class-components), using [hooks](https://react.dev/reference/react/hooks) for managing component lifecycle and state. +When possible, all components should be implemented as [function components](https://react.dev/learn/your-first-component), using [hooks](https://react.dev/reference/react/hooks) for managing component lifecycle and state. Documenting a function component should be treated the same as any other function. The primary caveat in documenting a component is being aware that the function typically accepts only a single argument (the "props"), which may include many property members. Use the [dot syntax for parameter properties](https://jsdoc.app/tags-param.html#parameters-with-properties) to document individual prop types. diff --git a/docs/contributors/code/deprecations.md b/docs/contributors/code/deprecations.md index 7463a99b319d5c..51f0165c409da0 100644 --- a/docs/contributors/code/deprecations.md +++ b/docs/contributors/code/deprecations.md @@ -183,7 +183,7 @@ For features included in the Gutenberg plugin, the deprecation policy is intende ## 3.8.0 -- `wp.components.withContext` has been removed. Please use `wp.element.createContext` instead. See: https://reactjs.org/docs/context.html. +- `wp.components.withContext` has been removed. Please use `wp.element.createContext` instead. See: https://react.dev/reference/react/createContext. - `wp.coreBlocks.registerCoreBlocks` has been removed. Please use `wp.blockLibrary.registerCoreBlocks` instead. - `wp.editor.DocumentTitle` component has been removed. - `getDocumentTitle` selector (`core/editor`) has been removed. diff --git a/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md b/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md index 2491d12ce9482f..ce8478f0241319 100644 --- a/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md +++ b/docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md @@ -87,3 +87,21 @@ add_filter( 'block_editor_settings_all', 'example_restrict_code_editor_access', ``` This code prevents all users from accessing the Code Editor. You could also add [capability](https://wordpress.org/documentation/article/roles-and-capabilities/) checks to disable access for specific users. + +## Disable formatting options for RichText blocks + +Blocks that support [RichText](https://developer.wordpress.org/block-editor/reference-guides/richtext/) come with the default formatting options provided by WordPress. + +Formatting options need to be disabled with JavaScript using `unregisterFormatType`. The code below will globally disable the Inline Image, Language, Keyboard Input, Subscript, and Superscript options. + +```js +wp.domReady( () => { + wp.richText.unregisterFormatType( 'core/image' ); + wp.richText.unregisterFormatType( 'core/language' ); + wp.richText.unregisterFormatType( 'core/keyboard' ); + wp.richText.unregisterFormatType( 'core/subscript' ); + wp.richText.unregisterFormatType( 'core/superscript' ); +}); +``` + +This JavaScript should be enqueued much like the block variation example above. \ No newline at end of file diff --git a/docs/how-to-guides/data-basics/2-building-a-list-of-pages.md b/docs/how-to-guides/data-basics/2-building-a-list-of-pages.md index 8a0d172e45f453..955bc1f869ad85 100644 --- a/docs/how-to-guides/data-basics/2-building-a-list-of-pages.md +++ b/docs/how-to-guides/data-basics/2-building-a-list-of-pages.md @@ -172,7 +172,7 @@ Note that instead of using an `input` tag, we took advantage of the [SearchContr ![](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/how-to-guides/data-basics/media/list-of-pages/filter-field.jpg) -The field starts empty, and the contents are stored in the `searchTerm` state value. If you aren’t familiar with the [useState](https://reactjs.org/docs/hooks-state.html) hook, you can learn more in [React’s documentation](https://reactjs.org/docs/hooks-state.html). +The field starts empty, and the contents are stored in the `searchTerm` state value. If you aren’t familiar with the [useState](https://react.dev/reference/react/useState) hook, you can learn more in [React’s documentation](https://react.dev/reference/react/useState). We can now request only the pages matching the `searchTerm`. diff --git a/docs/how-to-guides/metabox.md b/docs/how-to-guides/metabox.md index d16666a060c3c8..da37b8fba3b7c1 100644 --- a/docs/how-to-guides/metabox.md +++ b/docs/how-to-guides/metabox.md @@ -243,7 +243,7 @@ When the meta box area is saving, we display an updating overlay, to prevent use An example save url would look like: -`mysite.com/wp-admin/post.php?post=1&action=edit&meta-box-loader=1` +`example.org/wp-admin/post.php?post=1&action=edit&meta-box-loader=1` This url is automatically passed into React via a `_wpMetaBoxUrl` global variable. diff --git a/docs/how-to-guides/platform/custom-block-editor.md b/docs/how-to-guides/platform/custom-block-editor.md index a7abb00adacec6..e100820ea0e8b6 100644 --- a/docs/how-to-guides/platform/custom-block-editor.md +++ b/docs/how-to-guides/platform/custom-block-editor.md @@ -277,7 +277,7 @@ function Editor( { settings } ) { } ``` -In this process, the core of the editor's layout is being scaffolded, along with a few specialized [context providers](https://reactjs.org/docs/context.html#contextprovider) that make specific functionality available throughout the component hierarchy. +In this process, the core of the editor's layout is being scaffolded, along with a few specialized [context providers](https://react.dev/reference/react/createContext#provider) that make specific functionality available throughout the component hierarchy. Let's examine these in more detail: diff --git a/docs/reference-guides/block-api/block-context.md b/docs/reference-guides/block-api/block-context.md index abc956e5874771..5fdc670fe60403 100644 --- a/docs/reference-guides/block-api/block-context.md +++ b/docs/reference-guides/block-api/block-context.md @@ -4,7 +4,7 @@ Block context is a feature which enables ancestor blocks to provide values which This is especially useful in full-site editing where, for example, the contents of a block may depend on the context of the post in which it is displayed. A blogroll template may show excerpts of many different posts. Using block context, there can still be one single "Post Excerpt" block which displays the contents of the post based on an inherited post ID. -If you are familiar with [React Context](https://reactjs.org/docs/context.html), block context adopts many of the same ideas. In fact, the client-side block editor implementation of block context is a very simple application of React Context. Block context is also supported in server-side `render_callback` implementations, demonstrated in the examples below. +If you are familiar with [React Context](https://react.dev/learn/passing-data-deeply-with-context), block context adopts many of the same ideas. In fact, the client-side block editor implementation of block context is a very simple application of React Context. Block context is also supported in server-side `render_callback` implementations, demonstrated in the examples below. ## Defining block context diff --git a/docs/reference-guides/block-api/block-metadata.md b/docs/reference-guides/block-api/block-metadata.md index 1b0925513b3a8d..d79f1cdb6c56b1 100644 --- a/docs/reference-guides/block-api/block-metadata.md +++ b/docs/reference-guides/block-api/block-metadata.md @@ -427,7 +427,7 @@ See the [Example documentation](/docs/reference-guides/block-api/block-registrat ### Variations -- Type: `object[]` +- Type: `object[]|WPDefinedPath` ([learn more](#wpdefinedpath)) - Optional - Localized: Yes (`title`, `description`, and `keywords` of each variation only) - Property: `variations` @@ -454,6 +454,48 @@ Block Variations is the API that allows a block to have similar versions of it, _Note: In JavaScript you can provide a function for the `isActive` property, and a React element for the `icon`. In the `block.json` file both only support strings_ +Starting with version 6.7, it is possible to specify a PHP file in `block.json` that generates the list of block variations on the server side: + +```json +{ "variations": "file:./variations.php" } +``` + +That PHP file is expected to `return` an array that contains the block variations. Strings found in the variations returned from the PHP file will not be localized automatically; instead, use the `__()` function as usual. + +For example: + +```php + true, + 'name' => 'wordpress', + 'title' => 'WordPress', + 'icon' => 'wordpress', + 'attributes' => array( + 'service' => 'wordpress', + ), + 'isActive' => array( 'service' ) + ), + array( + 'name' => 'mail', + 'title' => __( 'Mail' ), + 'keywords' => array( + __( 'email' ), + __( 'e-mail' ) + ), + 'icon' => 'mail', + 'attributes' => array( + 'service' => 'mail', + ), + 'isActive' => array( 'mail' ) + ), +); + +``` + See [the variations documentation](/docs/reference-guides/block-api/block-variations.md) for more details. ### Block Hooks @@ -745,7 +787,7 @@ $metadata = array( ); ``` -Implementation follows the existing [get_plugin_data](https://codex.wordpress.org/Function_Reference/get_plugin_data) function which parses the plugin contents to retrieve the plugin’s metadata, and it applies translations dynamically. +Implementation follows the existing [get_plugin_data](https://developer.wordpress.org/reference/functions/get_plugin_data) function which parses the plugin contents to retrieve the plugin’s metadata, and it applies translations dynamically. ### JavaScript diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index b327cd0c03a9ee..a15191c19ffb73 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -1110,3 +1110,11 @@ attributes: { } } ``` + +## splitting + +When set to `true`, `Enter` will split the block into two blocks. Note that this +is only meant for simple text blocks such as paragraphs and headings with a +single `RichText` field. RichText in the `edit` function _must_ have an +`identifier` prop that matches the attribute key of the text, so that it updates +the selection correctly and we know where to split. diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 77e466db8e1f9e..0b6e6aa3fd6769 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -24,7 +24,7 @@ Embed a simple audio player. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/audio - **Category:** media - **Supports:** align, anchor, interactivity (clientNavigation), spacing (margin, padding) -- **Attributes:** autoplay, caption, id, loop, preload, src +- **Attributes:** autoplay, blob, caption, id, loop, preload, src ## Avatar @@ -61,7 +61,7 @@ Prompt visitors to take action with a group of button-style links. ([Source](htt - **Name:** core/buttons - **Category:** design - **Allowed Blocks:** core/button -- **Supports:** align (full, wide), anchor, interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, ~~text~~), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ ## Calendar @@ -79,7 +79,7 @@ Display a list of all categories. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/categories - **Category:** widgets - **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** displayAsDropdown, showEmpty, showHierarchy, showOnlyTopLevel, showPostCounts +- **Attributes:** displayAsDropdown, label, showEmpty, showHierarchy, showLabel, showOnlyTopLevel, showPostCounts ## Code @@ -273,7 +273,7 @@ Add a link to a downloadable file. ([Source](https://github.com/WordPress/gutenb - **Name:** core/file - **Category:** media - **Supports:** align, anchor, color (background, gradients, link, ~~text~~), interactivity, spacing (margin, padding) -- **Attributes:** displayPreview, downloadButtonText, fileId, fileName, href, id, previewHeight, showDownloadButton, textLinkHref, textLinkTarget +- **Attributes:** blob, displayPreview, downloadButtonText, fileId, fileName, href, id, previewHeight, showDownloadButton, textLinkHref, textLinkTarget ## Footnotes @@ -350,7 +350,7 @@ Gather blocks in a layout container. ([Source](https://github.com/WordPress/gute - **Name:** core/group - **Category:** design -- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage, backgroundSize), color (background, button, gradients, heading, link, text), dimensions (minHeight), interactivity (clientNavigation), layout (allowSizingOnChildren), position (sticky), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, ariaLabel, background (backgroundImage, backgroundSize), color (background, button, gradients, heading, link, text), dimensions (minHeight), interactivity (clientNavigation), layout (allowSizingOnChildren), position (sticky), shadow, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** allowedBlocks, tagName, templateLock ## Heading @@ -387,8 +387,8 @@ Insert an image to make a visual statement. ([Source](https://github.com/WordPre - **Name:** core/image - **Category:** media -- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow () -- **Attributes:** alt, aspectRatio, caption, height, href, id, lightbox, linkClass, linkDestination, linkTarget, rel, scale, sizeSlug, title, url, width +- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow (), spacing (margin) +- **Attributes:** alt, aspectRatio, blob, caption, height, href, id, lightbox, linkClass, linkDestination, linkTarget, rel, scale, sizeSlug, title, url, width ## Latest Comments @@ -426,7 +426,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Category:** text - **Parent:** core/list - **Allowed Blocks:** core/list -- **Supports:** interactivity (clientNavigation), spacing (margin, padding), splitting, typography (fontSize, lineHeight), ~~className~~ +- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), splitting, typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder ## Login/out @@ -783,7 +783,7 @@ Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Ju - **Name:** core/quote - **Category:** text -- **Supports:** anchor, background (backgroundImage, backgroundSize), color (background, gradients, heading, link, text), dimensions (minHeight), interactivity (clientNavigation), layout (~~allowEditing~~), spacing (blockGap), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, background (backgroundImage, backgroundSize), color (background, gradients, heading, link, text), dimensions (minHeight), interactivity (clientNavigation), layout (~~allowEditing~~), spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** citation, textAlign, value ## Read More @@ -810,7 +810,7 @@ Help visitors find your content. ([Source](https://github.com/WordPress/gutenber - **Name:** core/search - **Category:** widgets -- **Supports:** align (center, left, right), color (background, gradients, text), interactivity, typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (center, left, right), color (background, gradients, text), interactivity, spacing (margin), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** buttonPosition, buttonText, buttonUseIcon, isSearchFieldHidden, label, placeholder, query, showLabel, width, widthUnit ## Separator @@ -958,6 +958,6 @@ Embed a video from your media library or upload a new one. ([Source](https://git - **Name:** core/video - **Category:** media - **Supports:** align, anchor, interactivity (clientNavigation), spacing (margin, padding) -- **Attributes:** autoplay, caption, controls, id, loop, muted, playsInline, poster, preload, src, tracks +- **Attributes:** autoplay, blob, caption, controls, id, loop, muted, playsInline, poster, preload, src, tracks diff --git a/docs/reference-guides/data/data-core.md b/docs/reference-guides/data/data-core.md index 88db705f23f122..0ddd3858c97603 100644 --- a/docs/reference-guides/data/data-core.md +++ b/docs/reference-guides/data/data-core.md @@ -18,7 +18,7 @@ _Parameters_ - _state_ `State`: Data state. - _action_ `string`: Action to check. One of: 'create', 'read', 'update', 'delete'. -- _resource_ `string`: REST resource to check, e.g. 'media' or 'posts'. +- _resource_ `string | EntityResource`: Entity resource to check. Accepts entity object `{ kind: 'root', name: 'media', id: 1 }` or REST base as a string - `media`. - _id_ `EntityRecordKey`: Optional ID of the rest resource to check. _Returns_ @@ -790,7 +790,7 @@ _Parameters_ - _kind_ `string`: Kind of the entity. - _name_ `string`: Name of the entity. - _recordId_ `Object`: ID of the record. -- _options_ `Object`: Saving options. +- _options_ `Object=`: Saving options. ### saveEntityRecord diff --git a/docs/reference-guides/filters/README.md b/docs/reference-guides/filters/README.md index 66cac472ecaa79..676850a5501595 100644 --- a/docs/reference-guides/filters/README.md +++ b/docs/reference-guides/filters/README.md @@ -4,4 +4,4 @@ There are two types of hooks: [Actions](https://developer.wordpress.org/plugins/hooks/actions/) and [Filters](https://developer.wordpress.org/plugins/hooks/filters/). In addition to PHP actions and filters, WordPress also provides a mechanism for registering and executing hooks in JavaScript. This functionality is also available on npm as the [@wordpress/hooks](https://www.npmjs.com/package/@wordpress/hooks) package, for general purpose use. -You can also learn more about both APIs: [PHP](https://codex.wordpress.org/Plugin_API/) and [JavaScript](/packages/hooks/README.md). +You can also learn more about both APIs: [PHP](https://developer.wordpress.org/reference/) and [JavaScript](/packages/hooks/README.md). diff --git a/docs/reference-guides/filters/editor-filters.md b/docs/reference-guides/filters/editor-filters.md index a27a989dbc7884..08d1c5ddb8a33c 100644 --- a/docs/reference-guides/filters/editor-filters.md +++ b/docs/reference-guides/filters/editor-filters.md @@ -226,9 +226,9 @@ function example_filter_block_editor_rest_api_preload_paths_when_post_provided( ## Logging errors -A JavaScript error in a part of the UI shouldn't break the whole app. To solve this problem for users, React library uses the concept of an ["error boundary"](https://reactjs.org/docs/error-boundaries.html). Error boundaries are React components that catch JavaScript errors anywhere in their child component tree and display a fallback UI instead of the component tree that crashed. +A JavaScript error in a part of the UI shouldn't break the whole app. To solve this problem for users, React library uses the concept of an ["error boundary"](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary). Error boundaries are React components that catch JavaScript errors anywhere in their child component tree and display a fallback UI instead of the component tree that crashed. -The `editor.ErrorBoundary.errorLogged` action allows you to hook into the [Error Boundaries](https://reactjs.org/docs/error-boundaries.html) and gives you access to the error object. +The `editor.ErrorBoundary.errorLogged` action allows you to hook into the [Error Boundaries](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary) and gives you access to the error object. You can use this action to get hold of the error object handled by the boundaries. For example, you may want to send them to an external error-tracking tool. Here's an example: diff --git a/docs/reference-guides/interactivity-api/README.md b/docs/reference-guides/interactivity-api/README.md index 85255af785cbb5..9648b0118a5aa1 100644 --- a/docs/reference-guides/interactivity-api/README.md +++ b/docs/reference-guides/interactivity-api/README.md @@ -42,6 +42,21 @@ You can start creating interactions once you set up a block development environm ### Code requirements +#### Add `interactivity` to your project + +Install the Interactivity API to your project with the following command: + +```bash +npm install @wordpress/interactivity --save +``` + +Import the store into your `view.js`. Refer to the [store documentation](https://developer.wordpress.org/block-editor/reference-guides/interactivity-api/api-reference/#the-store) for more information. + +```js +import { store } from '@wordpress/interactivity'; +``` + + #### Add `interactivity` support to `block.json` To indicate that the block [supports](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/) the Interactivity API features, add `"interactivity": true` to the `supports` attribute of the block's `block.json` file. @@ -101,9 +116,12 @@ Here you have some more resources to learn/read more about the Interactivity API - [WordPress 6.5 Dev Note](https://make.wordpress.org/core/2024/03/04/interactivity-api-dev-note/) - [Merge announcement](https://make.wordpress.org/core/2024/02/19/merge-announcement-interactivity-api/) - [Proposal: The Interactivity API – A better developer experience in building interactive blocks](https://make.wordpress.org/core/2023/03/30/proposal-the-interactivity-api-a-better-developer-experience-in-building-interactive-blocks/) -- [Interactivity API Discussions](https://github.com/WordPress/gutenberg/discussions/52882) -- Developer Hours sessions ([Americas](https://www.youtube.com/watch?v=RXNoyP2ZiS8&t=664s) & [APAC/EMEA](https://www.youtube.com/watch?v=6ghbrhyAcvA)) +- [Interactivity API Discussions](https://github.com/WordPress/gutenberg/discussions/52882), especially the [showcase](https://github.com/WordPress/gutenberg/discussions/55642#discussioncomment-9667164) discussions. - [wpmovies.dev](http://wpmovies.dev/) demo and its [wp-movies-demo](https://github.com/WordPress/wp-movies-demo) repo +- Examples using the Interactivity API at [block-development-examples](https://github.com/WordPress/block-development-examples): + - [`interactivity-api-block-833d15`](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/833d15) + - [`interactivity-api-countdown-3cd73e`](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/interactivity-api-countdown-3cd73e) + - [`interactivity-api-quiz-1835fa`](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/interactivity-api-quiz-1835fa)
There's a Tracking Issue opened to ease the coordination of the work related to the Interactivity API Docs: Documentation for the Interactivity API - Tracking Issue #53296 diff --git a/docs/reference-guides/interactivity-api/api-reference.md b/docs/reference-guides/interactivity-api/api-reference.md index acfba8c48af665..0f14906165160c 100644 --- a/docs/reference-guides/interactivity-api/api-reference.md +++ b/docs/reference-guides/interactivity-api/api-reference.md @@ -1054,7 +1054,12 @@ Apart from the store function, there are also some methods that allows the devel #### getContext() -Retrieves the context inherited by the element evaluating a function from the store. The returned value depends on the element and the namespace where the function calling `getContext()` exists. +Retrieves the context inherited by the element evaluating a function from the store. The returned value depends on the element and the namespace where the function calling `getContext()` exists. It can also take an optional namespace argument to retrieve the context of a specific interactive region. + +```js +const context = getContext('namespace'); +``` +- `namespace` (optional): A string that matches the namespace of an interactive region. If not provided, it retrieves the context of the current interactive region. ```php // render.php @@ -1073,6 +1078,11 @@ store( "myPlugin", { const context = getContext(); // Logs "false" console.log('context => ', context.isOpen) + + // With namespace argument. + const myPluginContext = getContext("myPlugin"); + // Logs "false" + console.log('myPlugin isOpen => ', myPluginContext.isOpen); }, }, }); diff --git a/docs/reference-guides/interactivity-api/iapi-about.md b/docs/reference-guides/interactivity-api/iapi-about.md index 887a284be298fb..08689be03aa383 100644 --- a/docs/reference-guides/interactivity-api/iapi-about.md +++ b/docs/reference-guides/interactivity-api/iapi-about.md @@ -130,7 +130,7 @@ store( 'wpmovies', { >