diff --git a/.eslintrc.js b/.eslintrc.js
index d0c22090b93e87..e5f42eea656b90 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -137,6 +137,11 @@ const restrictedSyntax = [
message:
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
},
+ {
+ selector:
+ 'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] > Literal[value=/^toggle\\b/i]',
+ message: "Avoid using the verb 'Toggle' in translatable strings",
+ },
];
/** `no-restricted-syntax` rules for components. */
diff --git a/.github/workflows/sync-assets-to-plugin-repo.yml b/.github/workflows/sync-assets-to-plugin-repo.yml
new file mode 100644
index 00000000000000..c841b3ffc79579
--- /dev/null
+++ b/.github/workflows/sync-assets-to-plugin-repo.yml
@@ -0,0 +1,48 @@
+name: Sync Gutenberg plugin assets to WordPress.org plugin repo
+
+on:
+ push:
+ branches:
+ - trunk
+ paths:
+ - assets/**
+
+jobs:
+ sync-assets:
+ name: Sync assets to WordPress.org plugin repo
+ runs-on: ubuntu-latest
+ environment: wp.org plugin
+ env:
+ PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
+ SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
+ SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
+
+ steps:
+ - name: Check out Gutenberg assets folder from WP.org plugin repo
+ run: |
+ svn checkout "$PLUGIN_REPO_URL/assets" \
+ --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+
+ - name: Delete everything
+ run: find assets -type f -not -path 'assets/.svn/*' -delete
+
+ - name: Checkout assets from current release
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ sparse-checkout: |
+ assets
+ show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
+ path: git
+
+ - name: Copy files from git checkout to svn working copy
+ run: cp -R git/assets/* assets
+
+ - name: Commit the updated assets
+ working-directory: ./assets
+ run: |
+ svn st | awk '/^?/ {print $2}' | xargs -r svn add
+ svn st | awk '/^!/ {print $2}' | xargs -r svn rm
+ svn commit . \
+ -m "Sync assets for commit $GITHUB_SHA" \
+ --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
+ --config-option=servers:global:http-timeout=600
diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml
index e866964e69b2d1..4d2b0a66a7e7d6 100644
--- a/.github/workflows/upload-release-to-plugin-repo.yml
+++ b/.github/workflows/upload-release-to-plugin-repo.yml
@@ -168,7 +168,9 @@ jobs:
steps:
- name: Check out Gutenberg trunk from WP.org plugin repo
- run: svn checkout "$PLUGIN_REPO_URL/trunk" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+ run: |
+ svn checkout "$PLUGIN_REPO_URL/trunk" --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+ svn checkout "$PLUGIN_REPO_URL/tags" --depth=immediates --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
- name: Delete everything
working-directory: ./trunk
@@ -182,7 +184,7 @@ jobs:
unzip gutenberg.zip -d trunk
rm gutenberg.zip
- - name: Replace the stable tag placeholder with the existing stable tag on the SVN repository
+ - name: Replace the stable tag placeholder with the new version
env:
STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V'
run: |
@@ -194,27 +196,16 @@ jobs:
name: changelog trunk
path: trunk
- - name: Commit the content changes
+ - name: Commit the release
working-directory: ./trunk
run: |
svn st | grep '^?' | awk '{print $2}' | xargs -r svn add
svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm
- svn commit -m "Committing version $VERSION" \
+ svn cp . "../tags/$VERSION"
+ svn commit . "../tags/$VERSION" \
+ -m "Releasing version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
- --config-option=servers:global:http-timeout=300
-
- - name: Create the SVN tag
- working-directory: ./trunk
- run: |
- svn copy "$PLUGIN_REPO_URL/trunk" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Tagging version $VERSION" \
- --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
-
- - name: Update the plugin's stable version
- working-directory: ./trunk
- run: |
- sed -i "s/Stable tag: ${STABLE_VERSION_REGEX}/Stable tag: ${VERSION}/g" ./readme.txt
- svn commit -m "Releasing version $VERSION" \
- --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
+ --config-option=servers:global:http-timeout=600
upload-tag:
name: Publish as tag
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 00000000000000..e437ec744d3807
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,7 @@
+## Gutenberg Plugin Assets
+
+The contents of this directory are synced from the [`assets/` directory in the Gutenberg repository on GitHub](https://github.com/WordPress/gutenberg/tree/trunk/assets) to the [`assets/` directory of the Gutenberg WordPress.org plugin repository](https://plugins.trac.wordpress.org/browser/gutenberg/assets). **Any changes committed directly to the plugin repository on WordPress.org will be overwritten.**
+
+The sync is performed by a [GitHub Actions workflow](https://github.com/WordPress/gutenberg/actions/workflows/sync-assets-to-plugin-repo.yml) that is triggered whenever a file in this directory is changed.
+
+Since that workflow requires access to WP.org plugin repository credentials, it needs to be approved manually by a member of the Gutenberg Core team. If you don't have the necessary permissions, please ask someone in [#core-editor](https://wordpress.slack.com/archives/C02QB2JS7).
diff --git a/assets/banner-1544x500.jpg b/assets/banner-1544x500.jpg
new file mode 100644
index 00000000000000..12e7192dd4285e
Binary files /dev/null and b/assets/banner-1544x500.jpg differ
diff --git a/assets/banner-772x250.jpg b/assets/banner-772x250.jpg
new file mode 100644
index 00000000000000..316f7741071cbe
Binary files /dev/null and b/assets/banner-772x250.jpg differ
diff --git a/assets/icon-128x128.jpg b/assets/icon-128x128.jpg
new file mode 100644
index 00000000000000..051af8504a919b
Binary files /dev/null and b/assets/icon-128x128.jpg differ
diff --git a/assets/icon-256x256.jpg b/assets/icon-256x256.jpg
new file mode 100644
index 00000000000000..b7497f61652b7b
Binary files /dev/null and b/assets/icon-256x256.jpg differ
diff --git a/backport-changelog/6.8/7129.md b/backport-changelog/6.8/7129.md
index 90c9168cdc6f8a..301f1abc45d0d7 100644
--- a/backport-changelog/6.8/7129.md
+++ b/backport-changelog/6.8/7129.md
@@ -1,3 +1,4 @@
https://github.com/WordPress/wordpress-develop/pull/7129
* https://github.com/WordPress/gutenberg/pull/62304
+* https://github.com/WordPress/gutenberg/pull/67879
diff --git a/backport-changelog/6.8/8014.md b/backport-changelog/6.8/8014.md
new file mode 100644
index 00000000000000..3ff171d5fb367e
--- /dev/null
+++ b/backport-changelog/6.8/8014.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/8014
+
+* https://github.com/WordPress/gutenberg/pull/66479
diff --git a/backport-changelog/6.8/8015.md b/backport-changelog/6.8/8015.md
new file mode 100644
index 00000000000000..214705518a0e72
--- /dev/null
+++ b/backport-changelog/6.8/8015.md
@@ -0,0 +1,3 @@
+https://github.com/WordPress/wordpress-develop/pull/8015
+
+* https://github.com/WordPress/gutenberg/pull/68058
diff --git a/bin/api-docs/gen-components-docs/markdown/props.mjs b/bin/api-docs/gen-components-docs/markdown/props.mjs
index 9d019c4240f008..aaa73041217528 100644
--- a/bin/api-docs/gen-components-docs/markdown/props.mjs
+++ b/bin/api-docs/gen-components-docs/markdown/props.mjs
@@ -48,4 +48,3 @@ export function generateMarkdownPropsJson( props, { headingLevel = 2 } = {} ) {
return [ { [ `h${ headingLevel }` ]: 'Props' }, ...propsJson ];
}
-
diff --git a/bin/check-licenses.mjs b/bin/check-licenses.mjs
index 458590e696a9fd..b453ebd84cd3a7 100755
--- a/bin/check-licenses.mjs
+++ b/bin/check-licenses.mjs
@@ -10,7 +10,7 @@ import { spawnSync } from 'node:child_process';
*/
import { checkDepsInTree } from '../packages/scripts/utils/license.js';
-const ignored = [ '@ampproject/remapping' ];
+const ignored = [ '@ampproject/remapping', 'webpack' ];
/*
* `wp-scripts check-licenses` uses prod and dev dependencies of the package to scan for dependencies. With npm workspaces, workspace packages (the @wordpress/* packages) are not listed in the main package json and this approach does not work.
diff --git a/bin/plugin/lib/utils.js b/bin/plugin/lib/utils.js
index 4f57269d60c772..f4ef86c96ff081 100644
--- a/bin/plugin/lib/utils.js
+++ b/bin/plugin/lib/utils.js
@@ -2,7 +2,7 @@
* External dependencies
*/
// @ts-ignore
-const inquirer = require( 'inquirer' );
+const { confirm } = require( '@inquirer/prompts' );
const fs = require( 'fs' );
const childProcess = require( 'child_process' );
const { v4: uuid } = require( 'uuid' );
@@ -97,14 +97,19 @@ async function askForConfirmation(
isDefault = true,
abortMessage = 'Aborting.'
) {
- const { isReady } = await inquirer.prompt( [
- {
- type: 'confirm',
- name: 'isReady',
+ let isReady = false;
+ try {
+ isReady = await confirm( {
default: isDefault,
message,
- },
- ] );
+ } );
+ } catch ( error ) {
+ if ( error instanceof Error && error.name === 'ExitPromptError' ) {
+ console.log( 'Cancelled.' );
+ process.exit( 1 );
+ }
+ throw error;
+ }
if ( ! isReady ) {
log( formats.error( '\n' + abortMessage ) );
diff --git a/changelog.txt b/changelog.txt
index 8e7c1d84d7c7da..665265aef64d46 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,6 +1,6 @@
== Changelog ==
-= 19.9.0-rc.1 =
+= 19.9.0 =
## Changelog
@@ -35,8 +35,8 @@
- Navigation: Enable all non-interactive formats. ([67585](https://github.com/WordPress/gutenberg/pull/67585))
- Query block: Move patterns modal to dropdown on block toolbar. ([66993](https://github.com/WordPress/gutenberg/pull/66993))
- Separator block: Allow divs to be used as separators. ([67530](https://github.com/WordPress/gutenberg/pull/67530))
-- [ New Block ] Add Query Total block for displaying total query results or ranges. ([67629](https://github.com/WordPress/gutenberg/pull/67629))
-- [Block Library]: Update the relationship of `No results` block to `ancestor`. ([48348](https://github.com/WordPress/gutenberg/pull/48348))
+- New Block: Add Query Total block for displaying total query results or ranges. ([67629](https://github.com/WordPress/gutenberg/pull/67629))
+- Block Library: Update the relationship of `No results` block to `ancestor`. ([48348](https://github.com/WordPress/gutenberg/pull/48348))
#### DataViews
- Add header to the quick edit when bulk editing. ([67390](https://github.com/WordPress/gutenberg/pull/67390))
@@ -335,6 +335,7 @@
- DataViews build-wp: Don't bundle the date package. ([67612](https://github.com/WordPress/gutenberg/pull/67612))
- Keycodes: Improve tree shaking by annotating exports as pure. ([67615](https://github.com/WordPress/gutenberg/pull/67615))
- Upgrade TypeScript to 5.7 and fix types. ([67461](https://github.com/WordPress/gutenberg/pull/67461))
+- Combine the release steps to ensure that releases are tagged. ([65591](https://github.com/WordPress/gutenberg/pull/65591))
#### Testing
- e2e-test-utils-playwright: Increase timeout of site-editor selector. ([66672](https://github.com/WordPress/gutenberg/pull/66672))
@@ -381,7 +382,9 @@ The following PRs were merged by first-time contributors:
The following contributors merged PRs in this release:
-@aaronrobertshaw @afercia @akasunil @alexflorisca @annezazu @benazeer-ben @ciampo @creador-dev @creativecoder @DAreRodz @dcalhoun @dknauss @draganescu @ellatrix @fabiankaegy @getdave @gigitux @gvgvgvijayan @gziolo @hbhalodia @im3dabasia @imrraaj @jameskoster @jeryj @jorgefilipecosta @jsnajdr @juanfra @louwie17 @Mamaduka @manzoorwanijk @matiasbenedetto @Mayank-Tripathi32 @mcsf @michalczaplinski @miminari @mirka @ntsekouras @oandregal @ockham @prajapatisagar @ramonjd @sabernhardt @SantosGuillamot @sarthaknagoshe2002 @sgomes @shail-mehta @stokesman @subodhr258 @Sukhendu2002 @t-hamano @talldan @tellthemachines @tyxla @viralsampat-multidots @wwdes @yogeshbhutkar @youknowriad
+@aaronrobertshaw @afercia @akasunil @alexflorisca @annezazu @benazeer-ben @ciampo @creador-dev @creativecoder @DAreRodz @dcalhoun @dd32 @dknauss @draganescu @ellatrix @fabiankaegy @getdave @gigitux @gvgvgvijayan @gziolo @hbhalodia @im3dabasia @imrraaj @jameskoster @jeryj @jorgefilipecosta @jsnajdr @juanfra @louwie17 @Mamaduka @manzoorwanijk @matiasbenedetto @Mayank-Tripathi32 @mcsf @michalczaplinski @miminari @mirka @ntsekouras @oandregal @ockham @prajapatisagar @ramonjd @sabernhardt @SantosGuillamot @sarthaknagoshe2002 @sgomes @shail-mehta @stokesman @subodhr258 @Sukhendu2002 @t-hamano @talldan @tellthemachines @tyxla @viralsampat-multidots @wwdes @yogeshbhutkar @youknowriad
+
+
= 19.8.0 =
diff --git a/docs/README.md b/docs/README.md
index 31471a9928b2cf..4fd7d16595e133 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -48,7 +48,7 @@ This handbook should be considered the canonical resource for all things related
## Are you in the right place?
-The Block Editor Handbook is designed for those looking to create and develop for the Block Editor. However, it's important to note that there are multiple other handbooks available within the [Developer Resources](http://developer.wordpress.org/) that you may find beneficial:
+The Block Editor Handbook is designed for those looking to create and develop for the Block Editor. However, it's important to note that there are multiple other handbooks available within the [Developer Resources](https://developer.wordpress.org/) that you may find beneficial:
- [Theme Handbook](https://developer.wordpress.org/themes)
- [Plugin Handbook](https://developer.wordpress.org/plugins)
diff --git a/docs/getting-started/devenv/get-started-with-wp-env.md b/docs/getting-started/devenv/get-started-with-wp-env.md
index 74942ea3ee93bf..a6427deb863b7e 100644
--- a/docs/getting-started/devenv/get-started-with-wp-env.md
+++ b/docs/getting-started/devenv/get-started-with-wp-env.md
@@ -47,7 +47,7 @@ wp-env start
Once the script completes, you can access the local environment at: http://localhost:8888
. Log into the WordPress dashboard using username `admin` and password `password`.
wp-env
configurations, and the documentation might prompt you to run npm run start wp-env
instead.
+ Some projects, like Gutenberg, include their own specific wp-env
configurations, and the documentation might prompt you to run npm run wp-env start
instead.
{ convertDescription }
- -{ convertDescription }
+ +See the WordPress Storybook for more detailed, interactive documentation.
+ +## Props + +### `children` + +Text to display inside the badge. + + - Type: `string` + - Required: Yes + +### `intent` + +Badge variant. + + - Type: `"default" | "info" | "success" | "warning" | "error"` + - Required: No + - Default: `default` diff --git a/packages/components/src/badge/docs-manifest.json b/packages/components/src/badge/docs-manifest.json new file mode 100644 index 00000000000000..3b70c0ef228432 --- /dev/null +++ b/packages/components/src/badge/docs-manifest.json @@ -0,0 +1,5 @@ +{ + "$schema": "../../schemas/docs-manifest.json", + "displayName": "Badge", + "filePath": "./index.tsx" +} diff --git a/packages/components/src/badge/index.tsx b/packages/components/src/badge/index.tsx new file mode 100644 index 00000000000000..8a55f3881215f3 --- /dev/null +++ b/packages/components/src/badge/index.tsx @@ -0,0 +1,66 @@ +/** + * External dependencies + */ +import clsx from 'clsx'; + +/** + * WordPress dependencies + */ +import { info, caution, error, published } from '@wordpress/icons'; + +/** + * Internal dependencies + */ +import type { BadgeProps } from './types'; +import type { WordPressComponentProps } from '../context'; +import Icon from '../icon'; + +function Badge( { + className, + intent = 'default', + children, + ...props +}: WordPressComponentProps< BadgeProps, 'span', false > ) { + /** + * Returns an icon based on the badge context. + * + * @return The corresponding icon for the provided context. + */ + function contextBasedIcon() { + switch ( intent ) { + case 'info': + return info; + case 'success': + return published; + case 'warning': + return caution; + case 'error': + return error; + default: + return null; + } + } + + return ( + + { intent !== 'default' && ( +