Skip to content

Commit

Permalink
Merge branch 'trunk' into refactor/table-of-contents-block-settings-p…
Browse files Browse the repository at this point in the history
…anel
  • Loading branch information
Sukhendu2002 authored Dec 20, 2024
2 parents 904da77 + 910c38f commit 3adba16
Show file tree
Hide file tree
Showing 304 changed files with 9,721 additions and 2,787 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/sync-assets-to-plugin-repo.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 9 additions & 18 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -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).
Binary file added assets/banner-1544x500.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/banner-772x250.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-128x128.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-256x256.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions backport-changelog/6.8/7129.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions backport-changelog/6.8/8014.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/8014

* https://github.com/WordPress/gutenberg/pull/66479
3 changes: 3 additions & 0 deletions backport-changelog/6.8/8015.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/8015

* https://github.com/WordPress/gutenberg/pull/68058
1 change: 0 additions & 1 deletion bin/api-docs/gen-components-docs/markdown/props.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ export function generateMarkdownPropsJson( props, { headingLevel = 2 } = {} ) {

return [ { [ `h${ headingLevel }` ]: 'Props' }, ...propsJson ];
}

2 changes: 1 addition & 1 deletion bin/check-licenses.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 12 additions & 7 deletions bin/plugin/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down Expand Up @@ -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 ) );
Expand Down
11 changes: 7 additions & 4 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Changelog ==

= 19.9.0-rc.1 =
= 19.9.0 =

## Changelog

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/devenv/get-started-with-wp-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ wp-env start
Once the script completes, you can access the local environment at: <code>http://localhost:8888</code>. Log into the WordPress dashboard using username `admin` and password `password`.

<div class="callout callout-tip">
Some projects, like Gutenberg, include their own specific <code>wp-env</code> configurations, and the documentation might prompt you to run <code>npm run start wp-env</code> instead.
Some projects, like Gutenberg, include their own specific <code>wp-env</code> configurations, and the documentation might prompt you to run <code>npm run wp-env start</code> instead.
</div>

For more information on controlling the Docker environment, see the [@wordpress/env package](/packages/env/README.md) readme.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ The `wp-scripts` package also facilitates the use of JavaScript modules, allowin

Integrating JavaScript into your WordPress projects without a build process can be the most straightforward approach in specific scenarios. This is particularly true for projects that don't leverage JSX or other advanced JavaScript features requiring compilation.

When you opt out of a build process, you interact directly with WordPress's [JavaScript APIs](/docs/reference-guides/packages/) through the global `wp` object. This means that all the methods and packages provided by WordPress are readily available, but with one caveat: you must manually manage script dependencies. This is done by adding [the handle](/docs/contributors/code/scripts.md) of each corresponding package to the dependency array of your enqueued JavaScript file.
When you opt out of a build process, you interact directly with WordPress's [JavaScript APIs](/docs/reference-guides/packages.md) through the global `wp` object. This means that all the methods and packages provided by WordPress are readily available, but with one caveat: you must manually manage script dependencies. This is done by adding [the handle](/docs/contributors/code/scripts.md) of each corresponding package to the dependency array of your enqueued JavaScript file.

For example, suppose you're creating a script that registers a new block [variation](/docs/reference-guides/block-api/block-variations.md) using the `registerBlockVariation` function from the [`blocks`](/docs/reference-guides/packages/packages-blocks.md) package. You must include `wp-blocks` in your script's dependency array. This guarantees that the `wp.blocks.registerBlockVariation` method is available and defined by the time your script executes.
For example, suppose you're creating a script that registers a new block [variation](/docs/reference-guides/block-api/block-variations.md) using the `registerBlockVariation` function from the [`blocks`](/packages/blocks/README.md) package. You must include `wp-blocks` in your script's dependency array. This guarantees that the `wp.blocks.registerBlockVariation` method is available and defined by the time your script executes.

In the following example, the `wp-blocks` dependency is defined when enqueuing the `variations.js` file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function minimal_block_ca6eda___register_block() {
add_action( 'init', 'minimal_block_ca6eda___register_block' );
```

_See the [full block example](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/minimal-block-ca6eda) of the [code above](https://github.com/WordPress/block-development-examples/blob/trunk/plugins/minimal-block-ca6eda/index.php)_
_See the [full block example](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/minimal-block-ca6eda) of the [code above](https://github.com/WordPress/block-development-examples/blob/trunk/plugins/minimal-block-ca6eda/plugin.php)_

## Registering a block with JavaScript (client-side)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ By default this behavior is disabled until the `directInsert` prop is set to `tr

## Template

Use the template property to define a set of blocks that prefill the InnerBlocks component when inserted. You can set attributes on the blocks to define their use. The example below shows a book review template using InnerBlocks component and setting placeholders values to show the block usage.
Use the template property to define a set of blocks that prefill the InnerBlocks component when it has no existing content.. You can set attributes on the blocks to define their use. The example below shows a book review template using InnerBlocks component and setting placeholders values to show the block usage.


```js
Expand Down
Loading

0 comments on commit 3adba16

Please sign in to comment.