Skip to content

Commit 79a3abc

Browse files
committed
Block Editor: Update the WordPress Packages from Gutenberg 5.2.
Updated Packages: - @wordpress/a11y@2.1.0 - @wordpress/annotations@1.1.0 - @wordpress/api-fetch@3.0.0 - @wordpress/autop@2.1.0 - @wordpress/babel-plugin-import-jsx-pragma@2.0.0 - @wordpress/babel-plugin-makepot@3.0.0 - @wordpress/babel-preset-default@4.0.0 - @wordpress/blob@2.2.0 - @wordpress/block-editor@1.0.0 - @wordpress/block-library@2.3.0 - @wordpress/block-serialization-default-parser@3.0.0 - @wordpress/block-serialization-spec-parser@3.0.0 - @wordpress/blocks@6.1.0 - @wordpress/browserslist-config@2.3.0 - @wordpress/components@7.1.0 - @wordpress/compose@3.1.0 - @wordpress/core-data@2.1.0 - @wordpress/custom-templated-path-webpack-plugin@1.2.0 - @wordpress/data@4.3.0 - @wordpress/date@3.1.0 - @wordpress/deprecated@2.1.0 - @wordpress/docgen@1.0.0 - @wordpress/dom-ready@2.1.0 - @wordpress/dom@2.1.0 - @wordpress/e2e-test-utils@1.0.0 - @wordpress/e2e-tests@1.0.0 - @wordpress/edit-post@3.2.0 - @wordpress/editor@9.1.0 - @wordpress/element@2.2.0 - @wordpress/escape-html@1.1.0 - @wordpress/eslint-plugin@2.0.0 - @wordpress/format-library@1.3.0 - @wordpress/hooks@2.1.0 - @wordpress/html-entities@2.1.0 - @wordpress/i18n@3.2.0 - @wordpress/is-shallow-equal@1.2.0 - @wordpress/jest-console@3.0.0 - @wordpress/jest-preset-default@4.0.0 - @wordpress/jest-puppeteer-axe@1.0.0 - @wordpress/keycodes@2.1.0 - @wordpress/library-export-default-webpack-plugin@1.1.0 - @wordpress/list-reusable-blocks@1.2.0 - @wordpress/notices@1.2.0 - @wordpress/npm-package-json-lint-config@1.2.0 - @wordpress/nux@3.1.0 - @wordpress/plugins@2.1.0 - @wordpress/postcss-themes@2.0.0 - @wordpress/priority-queue@1.0.0 - @wordpress/redux-routine@3.1.0 - @wordpress/rich-text@3.1.0 - @wordpress/scripts@3.0.0 - @wordpress/shortcode@2.1.0 - @wordpress/token-list@1.2.0 - @wordpress/url@2.4.0 - @wordpress/viewport@2.2.0 - @wordpress/wordcount@2.1.0 This also includes the update to the scripts dependencies and the new widgets php files. Props iseulde. Fixes #46429. git-svn-id: https://develop.svn.wordpress.org/trunk@44808 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 716eea4 commit 79a3abc

8 files changed

Lines changed: 545 additions & 487 deletions

File tree

package-lock.json

Lines changed: 414 additions & 393 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"author": "The WordPress Contributors",
1414
"license": "GPL-2.0-or-later",
1515
"devDependencies": {
16-
"@wordpress/custom-templated-path-webpack-plugin": "1.1.6",
17-
"@wordpress/library-export-default-webpack-plugin": "1.0.5",
16+
"@wordpress/custom-templated-path-webpack-plugin": "1.2.0",
17+
"@wordpress/library-export-default-webpack-plugin": "1.1.0",
1818
"autoprefixer": "9.4.7",
1919
"check-node-version": "3.2.0",
2020
"copy-webpack-plugin": "^4.6.0",
@@ -54,43 +54,45 @@
5454
},
5555
"dependencies": {
5656
"@babel/polyfill": "7.2.5",
57-
"@wordpress/a11y": "^2.0.2",
58-
"@wordpress/annotations": "1.0.8",
59-
"@wordpress/api-fetch": "^2.2.8",
60-
"@wordpress/autop": "^2.0.2",
61-
"@wordpress/blob": "^2.1.0",
62-
"@wordpress/block-library": "2.2.16",
63-
"@wordpress/block-serialization-default-parser": "^2.0.5",
64-
"@wordpress/blocks": "^6.0.7",
65-
"@wordpress/components": "7.0.8",
66-
"@wordpress/compose": "^3.0.1",
67-
"@wordpress/core-data": "^2.0.17",
68-
"@wordpress/data": "^4.2.1",
69-
"@wordpress/date": "^3.0.1",
70-
"@wordpress/deprecated": "^2.0.5",
71-
"@wordpress/dom": "^2.0.8",
72-
"@wordpress/dom-ready": "^2.0.2",
73-
"@wordpress/edit-post": "3.1.11",
74-
"@wordpress/editor": "9.0.11",
75-
"@wordpress/element": "^2.1.9",
76-
"@wordpress/escape-html": "^1.0.1",
77-
"@wordpress/format-library": "1.2.14",
78-
"@wordpress/hooks": "^2.0.5",
79-
"@wordpress/html-entities": "^2.0.4",
80-
"@wordpress/i18n": "^3.1.1",
81-
"@wordpress/is-shallow-equal": "^1.1.5",
82-
"@wordpress/keycodes": "^2.0.6",
83-
"@wordpress/list-reusable-blocks": "1.1.21",
84-
"@wordpress/notices": "^1.1.3",
85-
"@wordpress/nux": "3.0.9",
86-
"@wordpress/plugins": "^2.0.11",
87-
"@wordpress/redux-routine": "^3.0.4",
88-
"@wordpress/rich-text": "3.0.7",
89-
"@wordpress/shortcode": "^2.0.2",
90-
"@wordpress/token-list": "^1.1.0",
91-
"@wordpress/url": "^2.3.3",
92-
"@wordpress/viewport": "^2.1.1",
93-
"@wordpress/wordcount": "^2.0.3",
57+
"@wordpress/a11y": "^2.1.0",
58+
"@wordpress/annotations": "^1.1.0",
59+
"@wordpress/api-fetch": "^3.0.0",
60+
"@wordpress/autop": "^2.1.0",
61+
"@wordpress/blob": "^2.2.0",
62+
"@wordpress/block-editor": "^1.0.0",
63+
"@wordpress/block-library": "^2.3.0",
64+
"@wordpress/block-serialization-default-parser": "^3.0.0",
65+
"@wordpress/blocks": "^6.1.0",
66+
"@wordpress/components": "^7.1.0",
67+
"@wordpress/compose": "^3.1.0",
68+
"@wordpress/core-data": "^2.1.0",
69+
"@wordpress/data": "^4.3.0",
70+
"@wordpress/date": "^3.1.0",
71+
"@wordpress/deprecated": "^2.1.0",
72+
"@wordpress/dom": "^2.1.0",
73+
"@wordpress/dom-ready": "^2.1.0",
74+
"@wordpress/edit-post": "^3.2.0",
75+
"@wordpress/editor": "^9.1.0",
76+
"@wordpress/element": "^2.2.0",
77+
"@wordpress/escape-html": "^1.1.0",
78+
"@wordpress/format-library": "^1.3.0",
79+
"@wordpress/hooks": "^2.1.0",
80+
"@wordpress/html-entities": "^2.1.0",
81+
"@wordpress/i18n": "^3.2.0",
82+
"@wordpress/is-shallow-equal": "^1.2.0",
83+
"@wordpress/keycodes": "^2.1.0",
84+
"@wordpress/list-reusable-blocks": "^1.2.0",
85+
"@wordpress/notices": "^1.2.0",
86+
"@wordpress/nux": "^3.1.0",
87+
"@wordpress/plugins": "^2.1.0",
88+
"@wordpress/priority-queue": "^1.0.0",
89+
"@wordpress/redux-routine": "^3.1.0",
90+
"@wordpress/rich-text": "^3.1.0",
91+
"@wordpress/shortcode": "^2.1.0",
92+
"@wordpress/token-list": "^1.2.0",
93+
"@wordpress/url": "^2.4.0",
94+
"@wordpress/viewport": "^2.2.0",
95+
"@wordpress/wordcount": "^2.1.0",
9496
"backbone": "1.3.3",
9597
"element-closest": "^2.0.2",
9698
"formdata-polyfill": "3.0.13",

src/wp-admin/edit-form-blocks.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
sprintf( '/wp/v2/types/%s?context=edit', $post_type ),
4949
sprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ),
5050
array( '/wp/v2/media', 'OPTIONS' ),
51+
array( '/wp/v2/blocks', 'OPTIONS' ),
5152
);
5253

5354
/**

src/wp-includes/blocks/latest-comments.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ function render_block_core_latest_comments( $attributes = array() ) {
117117
}
118118

119119
$class = 'wp-block-latest-comments';
120+
if ( ! empty( $attributes['className'] ) ) {
121+
$class .= ' ' . $attributes['className'];
122+
}
120123
if ( isset( $attributes['align'] ) ) {
121124
$class .= " align{$attributes['align']}";
122125
}

src/wp-includes/blocks/latest-posts.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,37 @@
1414
*/
1515
function render_block_core_latest_posts( $attributes ) {
1616
$args = array(
17-
'numberposts' => $attributes['postsToShow'],
18-
'post_status' => 'publish',
19-
'order' => $attributes['order'],
20-
'orderby' => $attributes['orderBy'],
17+
'posts_per_page' => $attributes['postsToShow'],
18+
'post_status' => 'publish',
19+
'order' => $attributes['order'],
20+
'orderby' => $attributes['orderBy'],
21+
'suppress_filters' => false,
2122
);
2223

2324
if ( isset( $attributes['categories'] ) ) {
2425
$args['category'] = $attributes['categories'];
2526
}
2627

27-
$recent_posts = wp_get_recent_posts( $args );
28+
$recent_posts = get_posts( $args );
2829

2930
$list_items_markup = '';
3031

3132
foreach ( $recent_posts as $post ) {
32-
$post_id = $post['ID'];
33-
34-
$title = get_the_title( $post_id );
33+
$title = get_the_title( $post );
3534
if ( ! $title ) {
3635
$title = __( '(Untitled)' );
3736
}
3837
$list_items_markup .= sprintf(
3938
'<li><a href="%1$s">%2$s</a>',
40-
esc_url( get_permalink( $post_id ) ),
41-
esc_html( $title )
39+
esc_url( get_permalink( $post ) ),
40+
$title
4241
);
4342

4443
if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) {
4544
$list_items_markup .= sprintf(
4645
'<time datetime="%1$s" class="wp-block-latest-posts__post-date">%2$s</time>',
47-
esc_attr( get_the_date( 'c', $post_id ) ),
48-
esc_html( get_the_date( '', $post_id ) )
46+
esc_attr( get_the_date( 'c', $post ) ),
47+
esc_html( get_the_date( '', $post ) )
4948
);
5049
}
5150

src/wp-includes/script-loader.php

Lines changed: 65 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -224,47 +224,49 @@ function wp_default_packages_scripts( &$scripts ) {
224224
$suffix = wp_scripts_get_suffix();
225225

226226
$packages_versions = array(
227-
'api-fetch' => '2.2.8',
228-
'a11y' => '2.0.2',
229-
'annotations' => '1.0.8',
230-
'autop' => '2.0.2',
231-
'blob' => '2.1.0',
232-
'block-library' => '2.2.16',
233-
'block-serialization-default-parser' => '2.0.5',
234-
'blocks' => '6.0.6',
235-
'components' => '7.0.8',
236-
'compose' => '3.0.1',
237-
'core-data' => '2.0.17',
238-
'data' => '4.2.1',
239-
'date' => '3.0.1',
240-
'deprecated' => '2.0.5',
241-
'dom' => '2.0.8',
242-
'dom-ready' => '2.0.2',
243-
'edit-post' => '3.1.11',
244-
'editor' => '9.0.11',
245-
'element' => '2.1.9',
246-
'escape-html' => '1.0.1',
247-
'format-library' => '1.2.14',
248-
'hooks' => '2.0.5',
249-
'html-entities' => '2.0.4',
250-
'i18n' => '3.1.1',
251-
'is-shallow-equal' => '1.1.5',
252-
'keycodes' => '2.0.6',
253-
'list-reusable-blocks' => '1.1.21',
254-
'notices' => '1.1.3',
255-
'nux' => '3.0.9',
256-
'plugins' => '2.0.10',
257-
'redux-routine' => '3.0.4',
258-
'rich-text' => '3.0.7',
259-
'shortcode' => '2.0.2',
260-
'token-list' => '1.1.0',
261-
'url' => '2.3.3',
262-
'viewport' => '2.1.1',
263-
'wordcount' => '2.0.3',
227+
'a11y' => '2.1.0',
228+
'annotations' => '1.1.0',
229+
'api-fetch' => '3.0.0',
230+
'autop' => '2.1.0',
231+
'blob' => '2.2.0',
232+
'block-editor' => '1.0.0',
233+
'block-library' => '2.3.0',
234+
'block-serialization-default-parser' => '3.0.0',
235+
'blocks' => '6.1.0',
236+
'components' => '7.1.0',
237+
'compose' => '3.1.0',
238+
'core-data' => '2.1.0',
239+
'data' => '4.3.0',
240+
'date' => '3.1.0',
241+
'deprecated' => '2.1.0',
242+
'dom' => '2.1.0',
243+
'dom-ready' => '2.1.0',
244+
'edit-post' => '3.2.0',
245+
'editor' => '9.1.0',
246+
'element' => '2.2.0',
247+
'escape-html' => '1.1.0',
248+
'format-library' => '1.3.0',
249+
'hooks' => '2.1.0',
250+
'html-entities' => '2.1.0',
251+
'i18n' => '3.2.0',
252+
'is-shallow-equal' => '1.2.0',
253+
'keycodes' => '2.1.0',
254+
'list-reusable-blocks' => '1.2.0',
255+
'notices' => '1.2.0',
256+
'nux' => '3.1.0',
257+
'plugins' => '2.1.0',
258+
'priority-queue' => '1.0.0',
259+
'redux-routine' => '3.1.0',
260+
'rich-text' => '3.1.0',
261+
'shortcode' => '2.1.0',
262+
'token-list' => '1.2.0',
263+
'url' => '2.4.0',
264+
'viewport' => '2.2.0',
265+
'wordcount' => '2.1.0',
264266
);
265267

266268
$packages_dependencies = array(
267-
'api-fetch' => array( 'wp-polyfill', 'wp-hooks', 'wp-i18n', 'wp-url' ),
269+
'api-fetch' => array( 'wp-polyfill', 'wp-i18n', 'wp-url' ),
268270
'a11y' => array( 'wp-dom-ready', 'wp-polyfill' ),
269271
'annotations' => array(
270272
'wp-data',
@@ -296,6 +298,7 @@ function wp_default_packages_scripts( &$scripts ) {
296298
'wp-api-fetch',
297299
'wp-autop',
298300
'wp-blob',
301+
'wp-block-editor',
299302
'wp-blocks',
300303
'wp-components',
301304
'wp-compose',
@@ -313,6 +316,15 @@ function wp_default_packages_scripts( &$scripts ) {
313316
'wp-rich-text',
314317
),
315318
'block-serialization-default-parser' => array(),
319+
'block-editor' => array(
320+
'lodash',
321+
'wp-blocks',
322+
'wp-compose',
323+
'wp-components',
324+
'wp-data',
325+
'wp-element',
326+
'wp-i18n',
327+
),
316328
'components' => array(
317329
'lodash',
318330
'moment',
@@ -336,18 +348,26 @@ function wp_default_packages_scripts( &$scripts ) {
336348
'wp-is-shallow-equal',
337349
'wp-polyfill',
338350
),
339-
'core-data' => array( 'wp-data', 'wp-api-fetch', 'wp-polyfill', 'wp-url', 'lodash' ),
351+
'core-data' => array(
352+
'lodash',
353+
'wp-api-fetch',
354+
'wp-data',
355+
'wp-deprecated',
356+
'wp-polyfill',
357+
'wp-url',
358+
),
340359
'data' => array(
341360
'lodash',
342361
'wp-compose',
343362
'wp-element',
344363
'wp-is-shallow-equal',
345364
'wp-polyfill',
365+
'wp-priority-queue',
346366
'wp-redux-routine',
347367
),
348368
'date' => array( 'moment', 'wp-polyfill' ),
349369
'deprecated' => array( 'wp-polyfill', 'wp-hooks' ),
350-
'dom' => array( 'lodash', 'wp-polyfill', 'wp-tinymce' ),
370+
'dom' => array( 'lodash', 'wp-polyfill' ),
351371
'dom-ready' => array( 'wp-polyfill' ),
352372
'edit-post' => array(
353373
'jquery',
@@ -357,6 +377,7 @@ function wp_default_packages_scripts( &$scripts ) {
357377
'media-views',
358378
'wp-a11y',
359379
'wp-api-fetch',
380+
'wp-block-editor',
360381
'wp-block-library',
361382
'wp-blocks',
362383
'wp-components',
@@ -377,11 +398,11 @@ function wp_default_packages_scripts( &$scripts ) {
377398
'wp-viewport',
378399
),
379400
'editor' => array(
380-
'jquery',
381401
'lodash',
382402
'wp-a11y',
383403
'wp-api-fetch',
384404
'wp-blob',
405+
'wp-block-editor',
385406
'wp-blocks',
386407
'wp-components',
387408
'wp-compose',
@@ -399,7 +420,6 @@ function wp_default_packages_scripts( &$scripts ) {
399420
'wp-notices',
400421
'wp-nux',
401422
'wp-polyfill',
402-
'wp-tinymce',
403423
'wp-token-list',
404424
'wp-url',
405425
'wp-viewport',
@@ -410,7 +430,6 @@ function wp_default_packages_scripts( &$scripts ) {
410430
'escape-html' => array( 'wp-polyfill' ),
411431
'format-library' => array(
412432
'wp-components',
413-
'wp-dom',
414433
'wp-editor',
415434
'wp-element',
416435
'wp-i18n',
@@ -450,6 +469,7 @@ function wp_default_packages_scripts( &$scripts ) {
450469
'lodash',
451470
),
452471
'plugins' => array( 'lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill' ),
472+
'priority-queue' => array(),
453473
'redux-routine' => array( 'wp-polyfill' ),
454474
'rich-text' => array(
455475
'lodash',
@@ -467,6 +487,7 @@ function wp_default_packages_scripts( &$scripts ) {
467487
$package_translations = array(
468488
'api-fetch',
469489
'blocks',
490+
'block-editor',
470491
'block-library',
471492
'components',
472493
'edit-post',
@@ -528,6 +549,7 @@ function wp_default_packages_inline_scripts( &$scripts ) {
528549
' wp.data',
529550
' .use( wp.data.plugins.persistence, { storageKey: storageKey } )',
530551
' .use( wp.data.plugins.controls );',
552+
' wp.data.plugins.persistence.__unstableMigrate( { storageKey: storageKey } );',
531553
'} )();',
532554
)
533555
)

src/wp-settings.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,14 @@
253253
require( ABSPATH . WPINC . '/blocks.php' );
254254
require( ABSPATH . WPINC . '/blocks/archives.php' );
255255
require( ABSPATH . WPINC . '/blocks/block.php' );
256+
require( ABSPATH . WPINC . '/blocks/calendar.php' );
256257
require( ABSPATH . WPINC . '/blocks/categories.php' );
257258
require( ABSPATH . WPINC . '/blocks/latest-comments.php' );
258259
require( ABSPATH . WPINC . '/blocks/latest-posts.php' );
260+
require( ABSPATH . WPINC . '/blocks/rss.php' );
261+
require( ABSPATH . WPINC . '/blocks/search.php' );
259262
require( ABSPATH . WPINC . '/blocks/shortcode.php' );
263+
require( ABSPATH . WPINC . '/blocks/tag-cloud.php' );
260264

261265
$GLOBALS['wp_embed'] = new WP_Embed();
262266

0 commit comments

Comments
 (0)