Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/69029-remove-custom-option-from-font-si…
Browse files Browse the repository at this point in the history
…ze-picker-select
  • Loading branch information
himanshupathak95 committed Feb 12, 2025
2 parents 2118bbd + 0740acc commit 04cd385
Show file tree
Hide file tree
Showing 99 changed files with 861 additions and 368 deletions.
18 changes: 8 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@ version: 2
updates:
# Check for updates to GitHub Actions.
- package-ecosystem: 'github-actions'
directory: '/'
directories:
- '.github/workflows'
- '.github/setup-node'
schedule:
interval: 'daily'
open-pull-requests-limit: 10
labels:
- 'GitHub Actions'
- '[Type] Build Tooling'
ignore:
- dependency-name: 'actions/setup-java'
- dependency-name: 'gradle/*'
- dependency-name: 'reactivecircus/*'
- dependency-name: 'ruby/setup-ruby'
groups:
github-actions:
patterns:
- '*'
exclude-patterns:
- 'actions/setup-java'
- 'gradle/*'
- 'reactivecircus/*'
react-native:
patterns:
- 'actions/setup-java'
- 'gradle/*'
- 'reactivecircus/*'
6 changes: 3 additions & 3 deletions .github/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
using: 'composite'
steps:
- name: Use desired version of Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
Expand All @@ -25,7 +25,7 @@ runs:

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: '**/node_modules'
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
Expand All @@ -36,7 +36,7 @@ runs:
npm ci
shell: bash
- name: Upload npm logs as an artifact on failure
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: failure()
with:
name: npm-logs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
steps:
- name: Install Subversion
run: |
apt-get update -y && apt-get install -y subversion
sudo apt-get update -y && sudo apt-get install -y subversion
- name: Check out Gutenberg trunk from WP.org plugin repo
run: |
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
steps:
- name: Install Subversion
run: |
apt-get update -y && apt-get install -y subversion
sudo apt-get update -y && sudo apt-get install -y subversion
- name: Download and unzip Gutenberg plugin asset into tags folder
env:
Expand Down
3 changes: 3 additions & 0 deletions backport-changelog/6.8/8228.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/8228

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

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

* https://github.com/WordPress/gutenberg/pull/69057
File renamed without changes.
12 changes: 11 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
== Changelog ==

= 20.2.0-rc.1 =
= 20.0.1 =

## Changelog

### Bug Fixes

- iAPI Router: add missing changelog entry for [#68923](https://github.com/WordPress/gutenberg/pull/68945)


= 20.2.0 =

## Changelog

Expand Down Expand Up @@ -143,6 +151,8 @@ The following contributors merged PRs in this release:
@afercia @benazeer-ben @fabiankaegy @himanshupathak95 @im3dabasia @Infinite-Null @justlevine @karthick-murugan @Mamaduka @Mayank-Tripathi32 @SainathPoojary @shail-mehta @shimotmk @Soean @spacedmonkey @stokesman @Sukhendu2002 @t-hamano @yogeshbhutkar




= 20.1.0 =

## Changelog
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.2.0-rc.1
* Version: 20.2.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
32 changes: 32 additions & 0 deletions lib/compat/wordpress-6.8/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,35 @@ function gutenberg_update_ignored_hooked_blocks_postmeta( $post ) {
add_filter( 'rest_pre_insert_page', 'gutenberg_update_ignored_hooked_blocks_postmeta' );
add_filter( 'rest_pre_insert_post', 'gutenberg_update_ignored_hooked_blocks_postmeta' );
add_filter( 'rest_pre_insert_wp_block', 'gutenberg_update_ignored_hooked_blocks_postmeta' );

/**
* Update Query `parents` argument validation for hierarchical post types.
* A zero is a valid parent ID for hierarchical post types. Used to display top-level items.
*
* Add new handler for `sticky` query argument.
*
* @param array $query The query vars.
* @param WP_Block $block Block instance.
* @return array The filtered query vars.
*/
function gutenberg_update_query_vars_from_query_block_6_8( $query, $block ) {
if ( ! empty( $block->context['query']['parents'] ) && is_post_type_hierarchical( $query['post_type'] ) ) {
$query['post_parent__in'] = array_unique( array_map( 'intval', $block->context['query']['parents'] ) );
}

if ( isset( $block->context['query']['sticky'] ) && ! empty( $block->context['query']['sticky'] ) ) {
if ( 'ignore' === $block->context['query']['sticky'] ) {
$sticky = get_option( 'sticky_posts' );

/**
* The core will set `post__not_in` because it asserts that any sticky value other than `only` is `exclude`.
* Let's override that while supporting any `post__not_in` values outside sticky post logic.
*/
$query['post__not_in'] = array_diff( $query['post__not_in'], ! empty( $sticky ) ? $sticky : array() );
$query['ignore_sticky_posts'] = 1;
}
}

return $query;
}
add_filter( 'query_loop_block_query_vars', 'gutenberg_update_query_vars_from_query_block_6_8', 10, 2 );
46 changes: 44 additions & 2 deletions lib/compat/wordpress-6.8/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function gutenberg_add_default_template_part_areas_to_index( WP_REST_Response $r
$response->data['default_template_part_areas'] = get_allowed_block_template_part_areas();
return $response;
}

add_filter( 'rest_index', 'gutenberg_add_default_template_part_areas_to_index' );

/**
Expand All @@ -70,5 +69,48 @@ function gutenberg_add_default_template_types_to_index( WP_REST_Response $respon
$response->data['default_template_types'] = $indexed_template_types;
return $response;
}

add_filter( 'rest_index', 'gutenberg_add_default_template_types_to_index' );

/**
* Adds `ignore_sticky` parameter to the post collection endpoint.
*
* Note: Backports into the wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php file.
*
* @param array $query_params JSON Schema-formatted collection parameters.
* @param WP_Post_Type $post_type Post type object.
* @return array
*/
function gutenberg_modify_post_collection_paramt( $query_params, WP_Post_Type $post_type ) {
if ( 'post' === $post_type->name && ! isset( $query_params['ignore_sticky'] ) ) {
$query_params['ignore_sticky'] = array(
'description' => __( 'Whether to ignore sticky posts or not.' ),
'type' => 'boolean',
'default' => false,
);
}

return $query_params;
}
add_filter( 'rest_post_collection_params', 'gutenberg_modify_post_collection_paramt', 10, 2 );

/**
* Modify posts query based on `ignore_sticky` parameter.
*
* Note: Backports into the wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php file.
*
* @param array $prepared_args Array of arguments for WP_User_Query.
* @param WP_REST_Request $request The REST API request.
* @return array Modified arguments
*/
function gutenberg_modify_post_collection_query( $args, WP_REST_Request $request ) {
/*
* Honor the original REST API `post__in` behavior. Don't prepend sticky posts
* when `post__in` has been specified.
*/
if ( isset( $request['ignore_sticky'] ) && empty( $args['post__in'] ) ) {
$args['ignore_sticky_posts'] = $request['ignore_sticky'];
}

return $args;
}
add_filter( 'rest_post_query', 'gutenberg_modify_post_collection_query', 10, 2 );
2 changes: 2 additions & 0 deletions lib/experimental/navigation-theme-opt-in.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*
* @see https://core.trac.wordpress.org/ticket/50544
*
* @global WP_Customize_Manager $wp_customize
*
* @param int $menu_id ID of the updated menu.
* @param int $menu_item_db_id ID of the new menu item.
* @param array $args An array of arguments used to update/add the menu item.
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "20.2.0-rc.1",
"version": "20.2.0",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
43 changes: 34 additions & 9 deletions packages/api-fetch/src/middlewares/preloading.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,40 @@ function createPreloadingMiddleware( preloadedData ) {
* @return {Promise<any>} Promise with the response.
*/
function prepareResponse( responseData, parse ) {
return Promise.resolve(
parse
? responseData.body
: new window.Response( JSON.stringify( responseData.body ), {
status: 200,
statusText: 'OK',
headers: responseData.headers,
} )
);
if ( parse ) {
return Promise.resolve( responseData.body );
}

try {
return Promise.resolve(
new window.Response( JSON.stringify( responseData.body ), {
status: 200,
statusText: 'OK',
headers: responseData.headers,
} )
);
} catch {
// See: https://github.com/WordPress/gutenberg/issues/67358#issuecomment-2621163926.
Object.entries( responseData.headers ).forEach( ( [ key, value ] ) => {
if ( key.toLowerCase() === 'link' ) {
responseData.headers[ key ] = value.replace(
/<([^>]+)>/,
( /** @type {any} */ _, /** @type {string} */ url ) =>
`<${ encodeURI( url ) }>`
);
}
} );

return Promise.resolve(
parse
? responseData.body
: new window.Response( JSON.stringify( responseData.body ), {
status: 200,
statusText: 'OK',
headers: responseData.headers,
} )
);
}
}

export default createPreloadingMiddleware;
Loading

0 comments on commit 04cd385

Please sign in to comment.