Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/remove-moz-placeholder-opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Feb 25, 2025
2 parents 87c2efb + db71531 commit 6c8e770
Show file tree
Hide file tree
Showing 96 changed files with 1,213 additions and 475 deletions.
1 change: 1 addition & 0 deletions backport-changelog/6.8/8212.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ https://github.com/WordPress/wordpress-develop/pull/8212

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

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

* https://github.com/WordPress/gutenberg/pull/69096
184 changes: 4 additions & 180 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,191 +1,14 @@
== Changelog ==

= 20.3.0-rc.2 =

## Changelog

### Enhancements

- Disable hover animation on preview frame for classic themes. ([68976](https://github.com/WordPress/gutenberg/pull/68976))

#### Block Library
- Added discord in social links. ([68848](https://github.com/WordPress/gutenberg/pull/68848))
- Featured Image block: Use resolution tool component. ([68471](https://github.com/WordPress/gutenberg/pull/68471))
- Query block: Add option to ignore sticky posts behavior. ([69057](https://github.com/WordPress/gutenberg/pull/69057))
- RSS: Border & Spacing support. ([66411](https://github.com/WordPress/gutenberg/pull/66411))

#### Global Styles
- Disable Clear button if there's no shadow. ([69092](https://github.com/WordPress/gutenberg/pull/69092))
- Duotone Settings: Add `reset` button and improve toggle rendering in FiltersPanel. ([68672](https://github.com/WordPress/gutenberg/pull/68672))
- Shadow Panel: Add reset button. ([68981](https://github.com/WordPress/gutenberg/pull/68981))

#### Post Editor
- Editor: Add loading state to the 'PageAttributesParent' component. ([69062](https://github.com/WordPress/gutenberg/pull/69062))
- Editor: Add loading state to the 'PostAuthorCombobox' component. ([68991](https://github.com/WordPress/gutenberg/pull/68991))
- Editor: Display error message when loading current post fails. ([68999](https://github.com/WordPress/gutenberg/pull/68999))

#### Block Editor
- Quick Inserter: Restore pattern search and insertion. ([69028](https://github.com/WordPress/gutenberg/pull/69028))
- Update keyboard shortcuts to use `primaryShift+backspace` for block deletion. ([69074](https://github.com/WordPress/gutenberg/pull/69074))

#### Design Tools
- Archives: Add Color Support. ([68685](https://github.com/WordPress/gutenberg/pull/68685))
- Categories: Add Color Support. ([68686](https://github.com/WordPress/gutenberg/pull/68686))

#### Components
- ComboboxControl: Add an `isLoading` prop to show a loading spinner. ([68990](https://github.com/WordPress/gutenberg/pull/68990))

= 20.0.2 =

### Bug Fixes

- Exclude Iterator helpers from polyfills. ([69070](https://github.com/WordPress/gutenberg/pull/69070))
- Fix Dependabot ignore statements. ([69144](https://github.com/WordPress/gutenberg/pull/69144))

#### Block Editor
- Block popover: Fix scrolling over. ([68075](https://github.com/WordPress/gutenberg/pull/68075))
- Display root appender when default block is disabled. ([68951](https://github.com/WordPress/gutenberg/pull/68951))
- Fix regression for root appender logic. ([68994](https://github.com/WordPress/gutenberg/pull/68994))
- Inserter: Remove block default icon from no results message. ([68693](https://github.com/WordPress/gutenberg/pull/68693))
- Rename `aspect` property to `ratio` to carry the `defaultAspect` in `AspectRatioDropdown`. ([69085](https://github.com/WordPress/gutenberg/pull/69085))
- Writing Flow: Restore early return for no block selection in tab nav hook. ([69079](https://github.com/WordPress/gutenberg/pull/69079))

#### Site Editor
- Edit Site: Fix Fields package private APIs error. ([68964](https://github.com/WordPress/gutenberg/pull/68964))
- Fix: Site Editor should display a 404 message. ([69009](https://github.com/WordPress/gutenberg/pull/69009))
- Use the same editor component for all routes. ([69093](https://github.com/WordPress/gutenberg/pull/69093))
- Fix 'isBlockVisibleInTheInserter' selector helper performance ([68898](https://github.com/WordPress/gutenberg/pull/68898))

#### Global Styles
- Fix: Additional CSS button not working after back navigation. ([68954](https://github.com/WordPress/gutenberg/pull/68954))
- Fix: Missing 'No blocks found.' message for block search in editor. ([69036](https://github.com/WordPress/gutenberg/pull/69036))

#### Block Library
- Query Block: Fix 'parents' argument validation. ([68983](https://github.com/WordPress/gutenberg/pull/68983))
- Social Links: Fix appender size in non-iframe editor. ([68215](https://github.com/WordPress/gutenberg/pull/68215))

#### REST API
- Add support for the 'ignore_sticky_posts' argument. ([68970](https://github.com/WordPress/gutenberg/pull/68970))
- Fix: Prevent Errors in Header Processing and Encode URLs Properly. ([67780](https://github.com/WordPress/gutenberg/pull/67780))

#### Icons
- Fix the background, arrowUpLeft, keyboardReturn and square icons. ([69076](https://github.com/WordPress/gutenberg/pull/69076))

#### Font Library
- Refactor font variant components to use useId for checkbox IDs. ([69050](https://github.com/WordPress/gutenberg/pull/69050))

#### Block Directory
- Remove block icon from InstalledBlocksPrePublishPanel. ([69046](https://github.com/WordPress/gutenberg/pull/69046))

#### DataViews
- Fixed: Empty Pattern Overlap in Pattern Title in Dataviews Table Layout. ([68997](https://github.com/WordPress/gutenberg/pull/68997))

#### Media
- Add optional chain to sizes indexing of media details in edit-site. ([68995](https://github.com/WordPress/gutenberg/pull/68995))

#### CSS & Styling
- Enabled Full height in Additional CSS. ([68993](https://github.com/WordPress/gutenberg/pull/68993))

#### Block hooks
- Fix truncation of post content. ([68926](https://github.com/WordPress/gutenberg/pull/68926))

#### Interactivity API
- iAPI Router: Fix CSS rule order in some constructed style sheets. ([68923](https://github.com/WordPress/gutenberg/pull/68923))
- iAPI Router: Revert "Handle styles assets on region-based navigation" ([69222](https://github.com/WordPress/gutenberg/pull/69222))


### Accessibility

#### Components
- Font Size Picker: Remove Custom option from FontSizePickerSelect dropdown. ([69038](https://github.com/WordPress/gutenberg/pull/69038))

#### Global Styles
- Add missing list role to the list of blocks in the global Styles. ([69027](https://github.com/WordPress/gutenberg/pull/69027))

#### Block API
- Block support: Preserve aria-label value in comment delimiter. ([69002](https://github.com/WordPress/gutenberg/pull/69002))

#### Block Editor
- [Block Editor]: A11y - Add and Update missing reduce-motion mixing. ([68417](https://github.com/WordPress/gutenberg/pull/68417))


### Performance

#### Post Editor
- Editor: Don't use selector shortcuts for the taxonomy queries. ([68998](https://github.com/WordPress/gutenberg/pull/68998))
- Editor: Optimize 'PostAuthorCheck' component data selection. ([69105](https://github.com/WordPress/gutenberg/pull/69105))

#### Style Book
- Improve StyleBook resize responsiveness for Classic Theme. ([68980](https://github.com/WordPress/gutenberg/pull/68980))


### Documentation

- Added Missing Global Documentation. ([69104](https://github.com/WordPress/gutenberg/pull/69104))
- Changed Inline Document Order. ([68992](https://github.com/WordPress/gutenberg/pull/68992))
- wp-env: Add lifecycleScripts to the schema. ([68724](https://github.com/WordPress/gutenberg/pull/68724))


### Code Quality

- Core Data: Add type for term entity. ([69151](https://github.com/WordPress/gutenberg/pull/69151))
- iAPI Router: Add missing changelog entry for #68923. ([68945](https://github.com/WordPress/gutenberg/pull/68945))

#### Block Library
- E2E: Add regression test for spacer block in themes without spacing units. ([68913](https://github.com/WordPress/gutenberg/pull/68913))
- Navigation Link Block: Use stable variable for underline color styling. ([68953](https://github.com/WordPress/gutenberg/pull/68953))
- Regenerate block fixtures. ([68982](https://github.com/WordPress/gutenberg/pull/68982))
- Social Links: Remove redundant reduce-motion mixin. ([69000](https://github.com/WordPress/gutenberg/pull/69000))

#### Site Editor
- Fast follow: Redirections of deprecated site editor URLs. ([68971](https://github.com/WordPress/gutenberg/pull/68971))
- Quality: Remove unused props and styles from SidebarNavigationScreen. ([68972](https://github.com/WordPress/gutenberg/pull/68972))

#### Block Editor
- Inserter: Remove unused no-results-icon styles. ([69018](https://github.com/WordPress/gutenberg/pull/69018))


### Tools

- PR Template: Suggest linking the issue. ([68924](https://github.com/WordPress/gutenberg/pull/68924))
- Relocate changelog file for WP#6910 to 6.9 backports. ([69068](https://github.com/WordPress/gutenberg/pull/69068))

#### Build Tooling
- Fix installing svn during deploys. ([69047](https://github.com/WordPress/gutenberg/pull/69047))
- Remove `react-native` dependabot group. ([69118](https://github.com/WordPress/gutenberg/pull/69118))

#### Testing
- e2e: Fix "add new" selector. ([69111](https://github.com/WordPress/gutenberg/pull/69111))


### Various

- Remove react-native dependabot group - Take 2. ([69122](https://github.com/WordPress/gutenberg/pull/69122))

#### Plugin
- Code Quality: Delete unused function from PHP Sync Issue generation script. ([68947](https://github.com/WordPress/gutenberg/pull/68947))
- npm scripts: Use `node -p` instead of `echo`. ([68946](https://github.com/WordPress/gutenberg/pull/68946))


## First-time contributors

The following PRs were merged by first-time contributors:

- @benazeer-ben: RSS: Border & Spacing support. ([66411](https://github.com/WordPress/gutenberg/pull/66411))
- @grgar: Add optional chain to sizes indexing of media details in edit-site. ([68995](https://github.com/WordPress/gutenberg/pull/68995))
- @Gulamdastgir-Momin: Added discord in social links. ([68848](https://github.com/WordPress/gutenberg/pull/68848))
- @Juzar10: Fix: Prevent Errors in Header Processing and Encode URLs Properly. ([67780](https://github.com/WordPress/gutenberg/pull/67780))
- @singhakanshu00: Disable hover animation on preview frame for classic themes. ([68976](https://github.com/WordPress/gutenberg/pull/68976))
- @srtfisher: wp-env: Add lifecycleScripts to the schema. ([68724](https://github.com/WordPress/gutenberg/pull/68724))


## Contributors

The following contributors merged PRs in this release:

@adamsilverstein @afercia @akasunil @benazeer-ben @carolinan @DAreRodz @desrosj @ellatrix @grgar @Gulamdastgir-Momin @himanshupathak95 @Infinite-Null @joemcgill @Juzar10 @Mamaduka @Mayank-Tripathi32 @ockham @peterwilsoncc @Rishit30G @SainathPoojary @shail-mehta @shimotmk @singhakanshu00 @srtfisher @swissspidy @t-hamano @torounit @yogeshbhutkar


= 20.3.0-rc.1 =

= 20.3.0 =

## Changelog

Expand Down Expand Up @@ -274,6 +97,7 @@ The following contributors merged PRs in this release:

#### Interactivity API
- iAPI Router: Fix CSS rule order in some constructed style sheets. ([68923](https://github.com/WordPress/gutenberg/pull/68923))
- iAPI Router: Revert "Handle styles assets on region-based navigation" ([69222](https://github.com/WordPress/gutenberg/pull/69222))


### Accessibility
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The WordPress project, and Gutenberg in particular, iterates quickly. Staying up

## Additional resources

For more resources on block development and extending the Block Editor, review the additional sections here in the Block Editor Handbook. Further practical examples are also available in the [block-development-examples](https://github.com/wptrainingteam/block-development-examples) GitHub repository.
For more resources on block development and extending the Block Editor, review the additional sections here in the Block Editor Handbook. Further practical examples are also available in the [block-development-examples](https://github.com/WordPress/block-development-examples) GitHub repository.

If you are looking for more educational content, check out [Learn WordPress](https://learn.wordpress.org/), where you can find [tutorials](https://learn.wordpress.org/tutorials/), [courses](https://learn.wordpress.org/courses/), and [online workshops](https://learn.wordpress.org/online-workshops/). Here is a selection of current offerings:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ wp.blocks.registerBlockVariation(

For scripts that need to run in the Block Editor, make sure you use the [`enqueue_block_editor_assets`](https://developer.wordpress.org/reference/hooks/enqueue_block_editor_assets/) hook coupled with the standard [`wp_enqueue_script`](https://developer.wordpress.org/reference/functions/wp_enqueue_script/) function.

Refer to [Enqueueing assets in the Editor](/docs/how-to-guides/enqueueing-assets-in-the-editor.md) for more information. You can also visit the [block-development-example](https://github.com/wptrainingteam/block-theme-examples/blob/master/example-block-variation/functions.php) GitHub repository for more practical examples.
Refer to [Enqueueing assets in the Editor](/docs/how-to-guides/enqueueing-assets-in-the-editor.md) for more information.

<div class="callout callout-tip">
Open your browser's dev tools and try running <code>wp.data.select('core/editor').getBlocks()</code> in the console when editing a post or when using the Site Editor. This command will return all available blocks.
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/plugin-sidebar-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Add the following code to a JavaScript file called `plugin-sidebar.js` and save
} )( window.wp, window.React );
```

For this code to work, those utilities need to be available in the browser, so you must specify `wp-plugins`, `wp-edit-post`, and `react` as dependencies of your script.
For this code to work, those utilities need to be available in the browser, so you must specify `wp-plugins`, `wp-editor`, and `react` as dependencies of your script.

Here is the PHP code to register your script and specify the dependencies:

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/themes/global-settings-and-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ h3 {
{% end %}
##### Element pseudo selectors

Pseudo selectors `:hover`, `:focus`, `:visited`, `:active`, `:link`, `:any-link` are supported by Gutenberg.
Pseudo selectors `:hover`, `:focus`, `:focus-visible`, `:visited`, `:active`, `:link`, `:any-link` are supported by Gutenberg.

```json
"elements": {
Expand Down
38 changes: 38 additions & 0 deletions docs/reference-guides/block-api/block-variations.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,44 @@ wp.blocks.registerBlockVariation( 'core/embed', {
} );
```

## Registering block variations in PHP

Block variations can also be registered from PHP using the `get_block_type_variations` filter hook. This approach is particularly useful when you need to dynamically generate variations based on registered post types, taxonomies, or other WordPress data.

Here's an example of how to register a custom variation for the `core/image` block:

```php
function my_custom_image_variation( $variations, $block_type ) {
// Only modify variations for the image block
if ( 'core/image' !== $block_type->name ) {
return $variations;
}

// Add a custom variation
$variations[] = array(
'name' => 'wide-image',
'title' => __( 'Wide image', 'textdomain' ),
'description' => __( 'A wide image', 'textdomain' ),
'scope' => array( 'inserter' ),
'isDefault' => false,
'attributes' => array(
'align' => 'wide', // Identifies the link type as custom
),
);

return $variations;
}
add_filter( 'get_block_type_variations', 'my_custom_image_variation', 10, 2 );
```

The `get_block_type_variations` filter is called when variations are requested for a block type. It receives two parameters:
- `$variations`: An array of currently registered variations for the block type
- `$block_type`: The full block type object

Note that variations registered through PHP will be merged with any variations registered through JavaScript using `registerBlockVariation()`.

<div class="callout callout-info">Check the <a href="https://developer.wordpress.org/news/2024/03/how-to-register-block-variations-with-php/">How to register block variations with PHP</a> blog post for more info about this</div>

## Removing a block variation

Block variations can also be easily removed. To do so, use `wp.blocks.unregisterBlockVariation()`. This function accepts the name of the block and the `name` of the variation that should be unregistered.
Expand Down
46 changes: 43 additions & 3 deletions docs/reference-guides/interactivity-api/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ const { state } = store( 'myPlugin', {
} );
```

You may want to add multiple such `yield` points in your action if it is doing a lot of work.

As mentioned above with [`wp-on`](#wp-on), [`wp-on-window`](#wp-on-window), and [`wp-on-document`](#wp-on-document), an async action should be used whenever the `async` versions of the aforementioned directives cannot be used due to the action requiring synchronous access to the `event` object. Synchronous access is required whenever the action needs to call `event.preventDefault()`, `event.stopPropagation()`, or `event.stopImmediatePropagation()`. To ensure that the action code does not contribute to a long task, you may manually yield to the main thread after calling the synchronous event API. For example:

```js
Expand All @@ -885,16 +887,17 @@ function splitTask() {

store( 'myPlugin', {
actions: {
handleClick: function* ( event ) {
handleClick: withSyncEvent( function* ( event ) {
event.preventDefault();
yield splitTask();
doTheWork();
},
} ),
},
} );
```

You may want to add multiple such `yield` points in your action if it is doing a lot of work.
You may notice the use of the [`withSyncEvent()`](#withsyncevent) utility function in this example. This is necessary due to an ongoing effort to handle store actions asynchronously by default, unless they require synchronous event access (which this example does due to the call to `event.preventDefault()`). Otherwise a deprecation warning will be triggered, and in a future release the behavior will change accordingly.


#### Side Effects

Expand Down Expand Up @@ -1253,6 +1256,43 @@ store( 'mySliderPlugin', {
} );
```

### withSyncEvent()

Actions that require synchronous access to the `event` object need to use the `withSyncEvent()` function to annotate their handler callback. This is necessary due to an ongoing effort to handle store actions asynchronously by default, unless they require synchronous event access. Therefore, as of Gutenberg 20.4 / WordPress 6.8 all actions that require synchronous event access need to use the `withSyncEvent()` function. Otherwise a deprecation warning will be triggered, and in a future release the behavior will change accordingly.

Only very specific event methods and properties require synchronous access, so it is advised to only use `withSyncEvent()` when necessary. The following event methods and properties require synchronous access:

* `event.currentTarget`
* `event.preventDefault()`
* `event.stopImmediatePropagation()`
* `event.stopPropagation()`

Here is an example, where one action requires synchronous event access while the other actions do not:

```js
// store
import { store, withSyncEvent } from '@wordpress/interactivity';

store( 'myPlugin', {
actions: {
// `event.preventDefault()` requires synchronous event access.
preventNavigation: withSyncEvent( ( event ) => {
event.preventDefault();
} ),

// `event.target` does not require synchronous event access.
logTarget: ( event ) => {
console.log( 'event target => ', event.target );
},

// Not using `event` at all does not require synchronous event access.
logSomething: () => {
console.log( 'something' );
},
},
} );
```

## Server functions

The Interactivity API comes with handy functions that allow you to initialize and reference configuration options on the server. This is necessary to feed the initial data that the Server Directive Processing will use to modify the HTML markup before it's send to the browser. It is also a great way to leverage many of WordPress's APIs, like nonces, AJAX, and translations.
Expand Down
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 20.3.0-rc.2
* Version: 20.3.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
Loading

0 comments on commit 6c8e770

Please sign in to comment.