Skip to content

Commit

Permalink
Block Editor: Update the packages with a number of fixes targeted for…
Browse files Browse the repository at this point in the history
… Beta 4.

It includes fixes from these two backport PRs: 

 - WordPress/gutenberg#32992
 - WordPress/gutenberg#32956

Props gziolo, ryelle, ntsekouras, desrosj, jorgefilipecosta.
See #53397


git-svn-id: https://develop.svn.wordpress.org/trunk@51241 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
youknowriad committed Jun 25, 2021
1 parent d9fe7f3 commit 1fdc97e
Show file tree
Hide file tree
Showing 13 changed files with 168 additions and 108 deletions.
164 changes: 82 additions & 82 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,27 @@
"@wordpress/api-fetch": "5.1.1",
"@wordpress/autop": "3.1.1",
"@wordpress/blob": "3.1.1",
"@wordpress/block-directory": "2.1.10",
"@wordpress/block-editor": "6.1.5",
"@wordpress/block-library": "3.2.8",
"@wordpress/block-directory": "2.1.12",
"@wordpress/block-editor": "6.1.7",
"@wordpress/block-library": "3.2.10",
"@wordpress/block-serialization-default-parser": "4.1.1",
"@wordpress/blocks": "9.1.4",
"@wordpress/components": "14.1.4",
"@wordpress/compose": "4.1.2",
"@wordpress/core-data": "3.1.7",
"@wordpress/customize-widgets": "1.0.9",
"@wordpress/core-data": "3.1.8",
"@wordpress/customize-widgets": "1.0.11",
"@wordpress/data": "5.1.2",
"@wordpress/data-controls": "2.1.2",
"@wordpress/date": "4.1.1",
"@wordpress/deprecated": "3.1.1",
"@wordpress/dom": "3.1.1",
"@wordpress/dom-ready": "3.1.1",
"@wordpress/edit-post": "4.1.10",
"@wordpress/edit-widgets": "2.1.10",
"@wordpress/editor": "10.1.8",
"@wordpress/edit-post": "4.1.12",
"@wordpress/edit-widgets": "2.1.12",
"@wordpress/editor": "10.1.10",
"@wordpress/element": "3.1.1",
"@wordpress/escape-html": "2.1.1",
"@wordpress/format-library": "2.1.5",
"@wordpress/format-library": "2.1.7",
"@wordpress/hooks": "3.1.1",
"@wordpress/html-entities": "3.1.1",
"@wordpress/i18n": "4.1.1",
Expand All @@ -119,15 +119,15 @@
"@wordpress/primitives": "2.1.1",
"@wordpress/priority-queue": "2.1.1",
"@wordpress/redux-routine": "4.1.1",
"@wordpress/reusable-blocks": "2.1.8",
"@wordpress/reusable-blocks": "2.1.10",
"@wordpress/rich-text": "4.1.2",
"@wordpress/server-side-render": "2.1.5",
"@wordpress/shortcode": "3.1.1",
"@wordpress/token-list": "2.1.1",
"@wordpress/url": "3.1.1",
"@wordpress/viewport": "3.1.2",
"@wordpress/warning": "2.1.1",
"@wordpress/widgets": "1.1.9",
"@wordpress/widgets": "1.1.11",
"@wordpress/wordcount": "3.1.1",
"backbone": "1.4.0",
"clipboard": "2.0.8",
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/wp-includes/block-patterns/query-grid-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
'content' => '<!-- wp:query {"query":{"perPage":6,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"flex","columns":3}} -->
<div class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"30px","right":"30px","bottom":"30px","left":"30px"}}},"layout":{"inherit":false}} -->
<main class="wp-block-group" style="padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px"><!-- wp:post-title {"isLink":true} /-->
<!-- wp:group {"style":{"spacing":{"padding":{"top":"30px","right":"30px","bottom":"30px","left":"30px"}}},"layout":{"inherit":false}} -->
<div class="wp-block-group" style="padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px"><!-- wp:post-title {"isLink":true} /-->
<!-- wp:post-excerpt {"wordCount":20} /-->
<!-- wp:post-date /--></div>
<!-- /wp:group -->
Expand Down
6 changes: 3 additions & 3 deletions src/wp-includes/block-patterns/query-offset-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
'title' => _x( 'Offset', 'Block pattern title' ),
'blockTypes' => array( 'core/query' ),
'categories' => array( 'query' ),
'content' => '<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"30px","right":"30px","bottom":"30px","left":"30px"}}},"layout":{"inherit":false}} -->
<main class="wp-block-group" style="padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px"><!-- wp:columns -->
'content' => '<!-- wp:group {"style":{"spacing":{"padding":{"top":"30px","right":"30px","bottom":"30px","left":"30px"}}},"layout":{"inherit":false}} -->
<div class="wp-block-group" style="padding-top:30px;padding-right:30px;padding-bottom:30px;padding-left:30px"><!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:query {"query":{"perPage":2,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"exclude","inherit":false},"displayLayout":{"type":"list"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
Expand All @@ -35,6 +35,6 @@
<!-- /wp:post-template --></div>
<!-- /wp:query --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></main>
<!-- /wp:columns --></div>
<!-- /wp:group -->',
);
10 changes: 4 additions & 6 deletions src/wp-includes/blocks/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
*/

/**
* When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-library-file` script.
* When the `core/file` block is rendering, check if we need to enqueue the `'wp-block-file-view` script.
*
* @param array $attributes The block attributes.
* @param array $content The block content.
*
* @return string Returns the block content.
*/
function render_block_core_file( $attributes, $content ) {
if ( ! empty( $attributes['displayPreview'] ) ) {
// Check if it's already enqueued, so we don't add the inline script multiple times.
if ( ! wp_script_is( 'wp-block-library-file' ) ) {
wp_enqueue_script( 'wp-block-library-file', plugins_url( 'file/frontend.js', __FILE__ ) );
}
$should_load_view_script = ! empty( $attributes['displayPreview'] ) && ! wp_script_is( 'wp-block-file-view' );
if ( $should_load_view_script ) {
wp_enqueue_script( 'wp-block-file-view' );
}

return $content;
Expand Down
1 change: 1 addition & 0 deletions src/wp-includes/blocks/file/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"anchor": true,
"align": true
},
"viewScript": "file:./view.min.js",
"editorStyle": "wp-block-file-editor",
"style": "wp-block-file"
}
19 changes: 19 additions & 0 deletions src/wp-includes/blocks/site-logo/editor-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,23 @@
}
.wp-block-site-logo .components-placeholder .components-drop-zone__content-text {
display: none;
}

.editor-styles-wrapper .site-logo_placeholder {
display: flex;
flex-direction: row;
align-items: flex-start;
border-radius: 2px;
background-color: #fff;
box-shadow: inset 0 0 0 1px #1e1e1e;
padding: 12px;
}
.editor-styles-wrapper .site-logo_placeholder svg {
margin-left: 12px;
}
.editor-styles-wrapper .site-logo_placeholder p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
margin: 0;
line-height: initial;
}
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/site-logo/editor-rtl.min.css

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

19 changes: 19 additions & 0 deletions src/wp-includes/blocks/site-logo/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,23 @@
}
.wp-block-site-logo .components-placeholder .components-drop-zone__content-text {
display: none;
}

.editor-styles-wrapper .site-logo_placeholder {
display: flex;
flex-direction: row;
align-items: flex-start;
border-radius: 2px;
background-color: #fff;
box-shadow: inset 0 0 0 1px #1e1e1e;
padding: 12px;
}
.editor-styles-wrapper .site-logo_placeholder svg {
margin-right: 12px;
}
.editor-styles-wrapper .site-logo_placeholder p {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
margin: 0;
line-height: initial;
}
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/site-logo/editor.min.css

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

1 change: 0 additions & 1 deletion src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,6 @@ public function merge( $incoming ) {
* In those cases, we want to replace the existing with the incoming value, if it exists.
*/
$to_replace = array();
$to_replace[] = array( 'custom' );
$to_replace[] = array( 'spacing', 'units' );
$to_replace[] = array( 'color', 'duotone' );
foreach ( self::VALID_ORIGINS as $origin ) {
Expand Down
24 changes: 24 additions & 0 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,7 @@ public function get_index( $request ) {
$response = new WP_REST_Response( $available );
$response->add_link( 'help', 'https://developer.wordpress.org/rest-api/' );
$this->add_active_theme_link_to_index( $response );
$this->add_site_logo_to_index( $response );

/**
* Filters the REST API root index data.
Expand Down Expand Up @@ -1272,6 +1273,29 @@ protected function add_active_theme_link_to_index( WP_REST_Response $response )
}
}

/**
* Exposes the site logo through the WordPress REST API.
* This is used for fetching this information when user has no rights
* to update settings.
*
* @since 5.8.0
*
* @param WP_REST_Response $response REST API response.
*/
protected function add_site_logo_to_index( WP_REST_Response $response ) {
$site_logo_id = get_theme_mod( 'custom_logo' );
$response->data['site_logo'] = $site_logo_id;
if ( $site_logo_id ) {
$response->add_link(
'https://api.w.org/featuredmedia',
rest_url( 'wp/v2/media/' . $site_logo_id ),
array(
'embeddable' => true,
)
);
}
}

/**
* Retrieves the index for a namespace.
*
Expand Down

0 comments on commit 1fdc97e

Please sign in to comment.