Skip to content

Commit

Permalink
Merge branch 'trunk' into font-library/add-heading-and-grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Feb 28, 2024
2 parents 39f19f4 + 0a78bb3 commit 3bf1e7c
Show file tree
Hide file tree
Showing 129 changed files with 2,275 additions and 1,730 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
/packages/block-editor/src/components/rich-text @ellatrix @fluiddot @dcalhoun

# Project Management
/.github
/.github @desrosj
/packages/project-management-automation
/packages/report-flaky-tests @kevin940726

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-changes-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Get changed PHP files
id: changed-files-php
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 # v42.0.2
uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 # v42.0.4
with:
files: |
*.{php}
Expand Down
55 changes: 39 additions & 16 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,52 @@ function getSourceFromFile( filename ) {
*/
function readBlockJSON( filename ) {
const blockjson = require( filename );

const {
name,
category,
supports,
attributes,
parent,
ancestor,
__experimental,
} = blockjson;
const sourcefile = getSourceFromFile( filename );
const supportsList =
blockjson.supports !== undefined
? processObjWithInnerKeys( augmentSupports( blockjson.supports ) )
: [];
const attributes = getTruthyKeys( blockjson.attributes );
const parent = blockjson.parent
? '\n' + `- **Parent:** ${ blockjson.parent.join( ', ' ) }`
: '';
const experimental = blockjson.__experimental
? '\n' + `- **Experimental:** ${ blockjson.__experimental }`
: '';
const blockInfoList = [ `- **Name:** ${ name }` ];

if ( __experimental ) {
blockInfoList.push( `- **Experimental:** ${ __experimental }` );
}
if ( category?.length > 0 ) {
blockInfoList.push( `- **Category:** ${ category }` );
}
if ( parent?.length > 0 ) {
blockInfoList.push( `- **Parent:** ${ parent.join( ', ' ) }` );
}
if ( ancestor?.length > 0 ) {
blockInfoList.push( `- **Ancestor:** ${ ancestor.join( ', ' ) }` );
}
if ( supports ) {
blockInfoList.push(
`- **Supports:** ${ processObjWithInnerKeys(
augmentSupports( supports )
)
.sort()
.join( ', ' ) }`
);
}
const truthyAttributes = getTruthyKeys( attributes );
if ( truthyAttributes.length ) {
blockInfoList.push(
`- **Attributes:** ${ truthyAttributes.sort().join( ', ' ) }`
);
}

return `
## ${ blockjson.title }
${ blockjson.description } ([Source](${ sourcefile }))
- **Name:** ${ blockjson.name }${ experimental }
- **Category:** ${ blockjson.category }${ parent }
- **Supports:** ${ supportsList.sort().join( ', ' ) }
- **Attributes:** ${ attributes.sort().join( ', ' ) }
${ blockInfoList.join( '\n' ) }
`;
}

Expand Down
17 changes: 17 additions & 0 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import readline from 'readline';
import { spawnSync } from 'node:child_process';

const LABEL = process.argv[ 2 ] || 'Backport to WP Beta/RC';
const BACKPORT_COMPLETED_LABEL = 'Backported to WP Core';
const BRANCH = getCurrentBranch();
const GITHUB_CLI_AVAILABLE = spawnSync( 'gh', [ 'auth', 'status' ] )
?.stdout?.toString()
Expand Down Expand Up @@ -334,6 +335,11 @@ function reportSummaryNextSteps( successes, failures ) {
nextSteps.push( 'Push this branch' );
nextSteps.push( 'Go to each of the cherry-picked Pull Requests' );
nextSteps.push( `Remove the ${ LABEL } label` );

if ( LABEL === 'Backport to WP Beta/RC' ) {
nextSteps.push( `Add the "${ BACKPORT_COMPLETED_LABEL }" label` );
}

nextSteps.push( 'Request a backport to wordpress-develop if required' );
nextSteps.push( 'Comment, say that PR just got cherry-picked' );
}
Expand Down Expand Up @@ -363,6 +369,17 @@ function GHcommentAndRemoveLabel( pr ) {
try {
cli( 'gh', [ 'pr', 'comment', number, '--body', comment ] );
cli( 'gh', [ 'pr', 'edit', number, '--remove-label', LABEL ] );

if ( LABEL === 'Backport to WP Beta/RC' ) {
cli( 'gh', [
'pr',
'edit',
number,
'--add-label',
BACKPORT_COMPLETED_LABEL,
] );
}

console.log( `✅ ${ number }: ${ comment }` );
} catch ( e ) {
console.log( `❌ ${ number }. ${ comment } ` );
Expand Down
260 changes: 260 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/contributors/code/react-native/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React Native mobile editor

The Gutenberg repository includes the source for the [React Native](https://facebook.github.io/react-native/) based editor for mobile.
The Gutenberg repository includes the source for the [React Native](https://reactnative.dev/) based editor for mobile.

## Mind the mobile

Expand Down
22 changes: 11 additions & 11 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Prompt visitors to take action with a group of button-style links. ([Source](htt
- **Name:** core/buttons
- **Category:** design
- **Supports:** align (full, wide), anchor, interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), spacing (blockGap, margin), typography (fontSize, lineHeight), ~~html~~
- **Attributes:**

## Calendar

Expand Down Expand Up @@ -116,6 +115,7 @@ This block is deprecated. Please use the Avatar block instead. ([Source](https:/
- **Name:** core/comment-author-avatar
- **Experimental:** fse
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), ~~html~~, ~~inserter~~
- **Attributes:** height, width

Expand All @@ -125,6 +125,7 @@ Displays the name of the author of the comment. ([Source](https://github.com/Wor

- **Name:** core/comment-author-name
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** isLink, linkTarget, textAlign

Expand All @@ -134,6 +135,7 @@ Displays the contents of a comment. ([Source](https://github.com/WordPress/guten

- **Name:** core/comment-content
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, gradients, link, text), spacing (padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** textAlign

Expand All @@ -143,6 +145,7 @@ Displays the date on which the comment was posted. ([Source](https://github.com/

- **Name:** core/comment-date
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** format, isLink

Expand All @@ -152,6 +155,7 @@ Displays a link to edit the comment in the WordPress Dashboard. This link is onl

- **Name:** core/comment-edit-link
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, gradients, link, ~~text~~), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** linkTarget, textAlign

Expand All @@ -161,6 +165,7 @@ Displays a link to reply to a comment. ([Source](https://github.com/WordPress/gu

- **Name:** core/comment-reply-link
- **Category:** theme
- **Ancestor:** core/comment-template
- **Supports:** color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** textAlign

Expand All @@ -172,7 +177,6 @@ Contains the block elements used to display a comment, like the title, date, aut
- **Category:** design
- **Parent:** core/comments
- **Supports:** align, interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Comments

Expand Down Expand Up @@ -211,7 +215,6 @@ Displays a list of page numbers for comments pagination. ([Source](https://githu
- **Category:** theme
- **Parent:** core/comments-pagination
- **Supports:** color (background, gradients, ~~text~~), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Comments Previous Page

Expand All @@ -229,6 +232,7 @@ Displays a title with the number of comments. ([Source](https://github.com/WordP

- **Name:** core/comments-title
- **Category:** theme
- **Ancestor:** core/comments
- **Supports:** align, color (background, gradients, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~anchor~~, ~~html~~
- **Attributes:** level, showCommentsCount, showPostTitle, textAlign

Expand Down Expand Up @@ -275,7 +279,6 @@ Display footnotes added to the page. ([Source](https://github.com/WordPress/gute
- **Name:** core/footnotes
- **Category:** text
- **Supports:** color (background, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~inserter~~, ~~multiple~~, ~~reusable~~
- **Attributes:**

## Form

Expand All @@ -294,6 +297,7 @@ The basic building block for forms. ([Source](https://github.com/WordPress/guten
- **Name:** core/form-input
- **Experimental:** true
- **Category:** common
- **Ancestor:** core/form
- **Supports:** anchor, spacing (margin), ~~reusable~~
- **Attributes:** inlineLabel, label, name, placeholder, required, type, value, visibilityPermissions

Expand All @@ -304,7 +308,7 @@ Provide a notification message after the form has been submitted. ([Source](http
- **Name:** core/form-submission-notification
- **Experimental:** true
- **Category:** common
- **Supports:**
- **Ancestor:** core/form
- **Attributes:** type

## Form Submit Button
Expand All @@ -314,8 +318,7 @@ A submission button for forms. ([Source](https://github.com/WordPress/gutenberg/
- **Name:** core/form-submit-button
- **Experimental:** true
- **Category:** common
- **Supports:**
- **Attributes:**
- **Ancestor:** core/form

## Classic

Expand Down Expand Up @@ -491,7 +494,6 @@ Separate your content into a multi-page experience. ([Source](https://github.com
- **Category:** design
- **Parent:** core/post-content
- **Supports:** interactivity (clientNavigation), ~~className~~, ~~customClassName~~, ~~html~~
- **Attributes:**

## Page List

Expand Down Expand Up @@ -603,7 +605,6 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/
- **Name:** core/post-content
- **Category:** theme
- **Supports:** align (full, wide), color (background, gradients, link, text), dimensions (minHeight), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~
- **Attributes:**

## Date

Expand Down Expand Up @@ -649,7 +650,6 @@ Contains the block elements used to render a post, like the title, date, feature
- **Category:** theme
- **Parent:** core/query
- **Supports:** align (full, wide), color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Post Terms

Expand Down Expand Up @@ -714,14 +714,14 @@ Contains the block elements used to render content when no query results are fou
- **Category:** theme
- **Parent:** core/query
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:**

## Pagination

Displays a paginated navigation to next/previous set of posts, when applicable. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/query-pagination))

- **Name:** core/query-pagination
- **Category:** theme
- **Ancestor:** core/query
- **Supports:** align, color (background, gradients, link, text), interactivity (clientNavigation), layout (default, ~~allowInheriting~~, ~~allowSwitching~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
- **Attributes:** paginationArrow, showLabel

Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ _Parameters_

_Returns_

- `?WPDirectInsertBlock`: The block type to be directly inserted.
- `WPDirectInsertBlock|undefined`: The block type to be directly inserted.

_Type Definition_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Settings related to shadows.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| defaultPresets | boolean | true | |
| defaultPresets | boolean | false | |
| presets | array | | name, shadow, slug |

---
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.3
* Requires PHP: 7.0
* Version: 17.8.0-rc.2
* Version: 17.8.0-rc.4
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
1 change: 1 addition & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ public static function get_element_class_name( $element ) {
array( 'spacing', 'margin' ),
array( 'spacing', 'padding' ),
array( 'typography', 'lineHeight' ),
array( 'shadow', 'defaultPresets' ),
);

/**
Expand Down
18 changes: 10 additions & 8 deletions lib/compat/wordpress-6.5/fonts/fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,32 @@ function gutenberg_create_initial_post_types() {

/**
* Initializes REST routes.
*
* @since 6.5
*/
function gutenberg_create_initial_rest_routes() {
$font_collections_controller = new WP_REST_Font_Collections_Controller();
$font_collections_controller->register_routes();
global $wp_version;

// Runs only if the Font Library is not available in core ( i.e. in core < 6.5-alpha ).
if ( version_compare( $wp_version, '6.5-alpha', '<' ) ) {
$font_collections_controller = new WP_REST_Font_Collections_Controller();
$font_collections_controller->register_routes();
}
}

add_action( 'rest_api_init', 'gutenberg_create_initial_rest_routes' );

/**
* Initializes REST routes and post types.
*
* @since 6.5
*/
function gutenberg_init_font_library() {
global $wp_version;

// Runs only if the Font Library is not available in core ( i.e. in core < 6.5-alpha ).
if ( version_compare( $wp_version, '6.5-alpha', '<' ) ) {
gutenberg_create_initial_post_types();
gutenberg_create_initial_rest_routes();
}
}

add_action( 'rest_api_init', 'gutenberg_init_font_library' );
add_action( 'init', 'gutenberg_init_font_library' );


if ( ! function_exists( 'wp_register_font_collection' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"text": true
},
"shadow": {
"defaultPresets": true,
"defaultPresets": false,
"presets": [
{
"name": "Natural",
Expand Down
4 changes: 2 additions & 2 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": "17.8.0-rc.2",
"version": "17.8.0-rc.4",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down

0 comments on commit 3bf1e7c

Please sign in to comment.