Skip to content

Commit

Permalink
Merge trunk and resolve conflict in CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
derekblank committed Jul 27, 2023
2 parents 81abcec + 4404be9 commit 096f33a
Show file tree
Hide file tree
Showing 125 changed files with 2,084 additions and 1,046 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Enforce labels on Pull Request
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
jobs:
type-related-labels:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: '[Type] Accessibility (a11y), [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Security, [Type] WP Core Ticket'
add_comment: true
message: "## ⚠️ Type of PR label error\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}."
exit_type: success
4 changes: 0 additions & 4 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ const LABEL_FEATURE_MAPPING = {
'REST API Interaction': 'REST API',
'New Block': 'Block Library',
'Accessibility (a11y)': 'Accessibility',
'[a11y] Color Contrast': 'Accessibility',
'[a11y] Keyboard & Focus': 'Accessibility',
'[a11y] Labelling': 'Accessibility',
'[a11y] Zooming': 'Accessibility',
'[Package] E2E Tests': 'Testing',
'[Package] E2E Test Utils': 'Testing',
'Automated Testing': 'Testing',
Expand Down
12 changes: 6 additions & 6 deletions bin/plugin/commands/test/fixtures/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5747,13 +5747,13 @@
"description": "/packages/components"
},
{
"id": 1344464662,
"node_id": "MDU6TGFiZWwxMzQ0NDY0NjYy",
"url": "https://api.github.com/repos/WordPress/gutenberg/labels/[a11y]%20Keyboard%20&%20Focus",
"name": "[a11y] Keyboard & Focus",
"color": "efde5d",
"id": 546517042,
"node_id": "MDU6TGFiZWw1NDY1MTcwNDI=",
"url": "https://api.github.com/repos/WordPress/gutenberg/labels/Accessibility%20(a11y)",
"name": "Accessibility (a11y)",
"color": "655104",
"default": false,
"description": ""
"description": "Changes that impact accessibility and need corresponding review (e.g. markup changes)."
}
],
"state": "closed",
Expand Down
99 changes: 43 additions & 56 deletions changelog.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Add a link to a downloadable file. ([Source](https://github.com/WordPress/gutenb

- **Name:** core/footnotes
- **Category:** text
- **Supports:** ~~html~~, ~~multiple~~, ~~reusable~~
- **Supports:** color (background, link, text), ~~html~~, ~~multiple~~, ~~reusable~~
- **Attributes:**

## Classic
Expand Down Expand Up @@ -646,7 +646,7 @@ Add text that respects your spacing and tabs, and also allows styling. ([Source]

- **Name:** core/preformatted
- **Category:** text
- **Supports:** anchor, color (background, gradients, text), typography (fontSize, lineHeight)
- **Supports:** anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight)
- **Attributes:** content

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

_Returns_

- `Object | null`: The current global styles.
- `Array< object > | null`: The current global styles.

### getCurrentUser

Expand Down
10 changes: 10 additions & 0 deletions docs/reference-guides/theme-json-reference/theme-json-living.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ Settings related to typography.
Generate custom CSS custom properties of the form `--wp--custom--{key}--{nested-key}: {value};`. `camelCased` keys are transformed to `kebab-case` as to follow the CSS property naming schema. Keys at different depth levels are separated by `--`, so keys should not include `--` in the name.


---

### behaviors

Settings related to behaviors.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| lightbox | boolean | false | |

---
## Styles

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.1
* Requires PHP: 5.6
* Version: 16.3.0-rc.1
* Version: 16.3.0
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
3 changes: 1 addition & 2 deletions lib/block-supports/behaviors.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function gutenberg_register_behaviors_support( $block_type ) {
* @return string Filtered block content.
*/
function gutenberg_render_behaviors_support_lightbox( $block_content, $block ) {
$experiments = get_option( 'gutenberg-experiments' );
$link_destination = isset( $block['attrs']['linkDestination'] ) ? $block['attrs']['linkDestination'] : 'none';
// Get the lightbox setting from the block attributes.
if ( isset( $block['attrs']['behaviors']['lightbox'] ) ) {
Expand All @@ -63,7 +62,7 @@ function gutenberg_render_behaviors_support_lightbox( $block_content, $block ) {
return $block_content;
}

if ( ! $lightbox_settings || 'none' !== $link_destination || empty( $experiments['gutenberg-interactivity-api-core-blocks'] ) ) {
if ( ! $lightbox_settings || 'none' !== $link_destination ) {
return $block_content;
}

Expand Down
34 changes: 34 additions & 0 deletions lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,40 @@ function gutenberg_reregister_core_block_types() {

add_action( 'init', 'gutenberg_reregister_core_block_types' );

/**
* Adds the defer loading strategy to all registered blocks.
*
* This function would not be part of core merge. Instead, the register_block_script_handle() function would be patched
* as follows.
*
* ```
* --- a/wp-includes/blocks.php
* +++ b/wp-includes/blocks.php
* @ @ -153,7 +153,8 @ @ function register_block_script_handle( $metadata, $field_name, $index = 0 ) {
* $script_handle,
* $script_uri,
* $script_dependencies,
* - isset( $script_asset['version'] ) ? $script_asset['version'] : false
* + isset( $script_asset['version'] ) ? $script_asset['version'] : false,
* + array( 'strategy' => 'defer' )
* );
* if ( ! $result ) {
* return false;
* ```
*
* @see register_block_script_handle()
*/
function gutenberg_defer_block_view_scripts() {
$block_types = WP_Block_Type_Registry::get_instance()->get_all_registered();
foreach ( $block_types as $block_type ) {
foreach ( $block_type->view_script_handles as $view_script_handle ) {
wp_script_add_data( $view_script_handle, 'strategy', 'defer' );
}
}
}

add_action( 'init', 'gutenberg_defer_block_view_scripts', 100 );

/**
* Deregisters the existing core block type and its assets.
*
Expand Down
30 changes: 19 additions & 11 deletions lib/compat/wordpress-6.3/navigation-fallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,42 @@
* Navigation Fallback REST endpoint.
*
* The endpoint may embed the full Navigation Menu object into the
* response as the `self` link. By default the Posts Controller
* will only exposes a limited subset of fields but the editor requires
* additional fields to be available in order to utilise the menu.
* response as the `self` link. By default, the Posts Controller
* will only expose a limited subset of fields but the editor requires
* additional fields to be available in order to utilize the menu.
*
* @param array $schema the schema for the `wp_navigation` post.
* @return array the modified schema.
*/
function gutenberg_add_fields_to_navigation_fallback_embeded_links( $schema ) {
function gutenberg_add_fields_to_navigation_fallback_embedded_links( $schema ) {
// Expose top level fields.
$schema['properties']['status']['context'] = array_merge( $schema['properties']['status']['context'], array( 'embed' ) );
$schema['properties']['content']['context'] = array_merge( $schema['properties']['content']['context'], array( 'embed' ) );

// Expose sub properties of content field.
// These aren't exposed by the posts controller by default, see:
// https://github.com/WordPress/wordpress-develop/blob/5c3c6258e468c67ba00bbd13db29994f1a57a52a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L2425.
/*
* Exposes sub properties of content field.
* These sub properties aren't exposed by the posts controller by default,
* for requests where context is `embed`.
*
* @see WP_REST_Posts_Controller::get_item_schema()
*/
$schema['properties']['content']['properties']['raw']['context'] = array_merge( $schema['properties']['content']['properties']['raw']['context'], array( 'embed' ) );
$schema['properties']['content']['properties']['rendered']['context'] = array_merge( $schema['properties']['content']['properties']['rendered']['context'], array( 'embed' ) );
$schema['properties']['content']['properties']['block_version']['context'] = array_merge( $schema['properties']['content']['properties']['block_version']['context'], array( 'embed' ) );

// Expose sub properties of title field.
// These aren't exposed by the posts controller by default, see:
// https://github.com/WordPress/wordpress-develop/blob/5c3c6258e468c67ba00bbd13db29994f1a57a52a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L2401.
/*
* Exposes sub properties of title field.
* These sub properties aren't exposed by the posts controller by default,
* for requests where context is `embed`.
*
* @see WP_REST_Posts_Controller::get_item_schema()
*/
$schema['properties']['title']['properties']['raw']['context'] = array_merge( $schema['properties']['title']['properties']['raw']['context'], array( 'embed' ) );

return $schema;
}

add_filter(
'rest_wp_navigation_item_schema',
'gutenberg_add_fields_to_navigation_fallback_embeded_links'
'gutenberg_add_fields_to_navigation_fallback_embedded_links'
);
19 changes: 11 additions & 8 deletions lib/compat/wordpress-6.3/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@ function add_modified_wp_template_schema() {
}
add_filter( 'rest_api_init', 'add_modified_wp_template_schema' );

/**
* Registers the block patterns REST API routes.
*/
function gutenberg_register_rest_block_patterns() {
$block_patterns = new Gutenberg_REST_Block_Patterns_Controller_6_3();
$block_patterns->register_routes();
// If the Auto-inserting Blocks experiment is enabled, we load the block patterns
// controller in lib/experimental/rest-api.php instead.
if ( ! gutenberg_is_experiment_enabled( 'gutenberg-auto-inserting-blocks' ) ) {
/**
* Registers the block patterns REST API routes.
*/
function gutenberg_register_rest_block_patterns() {
$block_patterns = new Gutenberg_REST_Block_Patterns_Controller_6_3();
$block_patterns->register_routes();
}
add_action( 'rest_api_init', 'gutenberg_register_rest_block_patterns' );
}
add_action( 'rest_api_init', 'gutenberg_register_rest_block_patterns' );


/**
* Registers the Navigation Fallbacks REST API routes.
Expand Down
Loading

0 comments on commit 096f33a

Please sign in to comment.