Skip to content

Commit a86125d

Browse files
committed
Update @WordPress packages
Update packages to include these bug fixes from Gutenberg: - FSE: Add welcome guide - Update theme styles for the code block - Add feature flag to toggle the new site editor sidebar - Add templates list page for site editor - Cover Block: Fix default background dim - E2E: Add more Cover block tests - Cover Block: Fix regressions - Post Comments Form: ensure typography styles are applied to child elements - Navigation: Fix space-between - Fix background colours in nested submenus. - Fix duplicate custom classnames in navigation submenu block - Fix colour rendering in Navigation overlay - Fix: Add ability to opt out of Core color palette V2 - Change @Package to WordPress in block-library - Make the core color palette opt-in for themes with not theme.json - Remove textdomain from calendar block - Page List block: fix space before href attribute - Try: Let Featured Image block inherit dimensions, look like a placeholder - [Global Styles]: Add block icon next to blocks list - Page List: Use core entities instead of direct apiFetch - Site Editor: Stabilize export endpoint - Fix mobile horizontal scrollbar. - Multi-entity save: Only set site entity to pending if really saving - Add page list to navigation direct insert conditions - Implement "Add New" for templates list in Site Editor - Post Featured Image: Remove withNotices HOC - Fix page list missing button styles when set to open on click. - Make appender fixed position to avoid jumps in the UI - Color UI component: reorder palettes and update names (core by defaults, user by custom) - Remove the Styles link in Site Editor - GlobalStyles sidebar: do not show default palette if theme opts-out - Only render the site editor canvas when the global styles are ready. - Global Styles: rename core origin key to default for presets - Clarify i18n context for PostTemplateActions's "New" label - Revert erroneous native editor package version bumps - Try: Hide the columns inserter in pattern previews. - Fix site editor region navigation - Update navigation sidebar responsiveness - Add _wp_array_set and _wp_to_kebab_case to 5.8 compat - Make user able to change all color palette origins - Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site - Site Editor: Validate the postType query argument - Navigation: Scale submenu icon. - Move the theme editor under tools for FSE themes - Deprecate navigation areas See #54487. git-svn-id: https://develop.svn.wordpress.org/trunk@52232 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4dea8f5 commit a86125d

18 files changed

Lines changed: 676 additions & 513 deletions

package-lock.json

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

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@wordpress/dependency-extraction-webpack-plugin": "3.2.1",
3030
"@wordpress/e2e-test-utils": "5.4.8",
3131
"@wordpress/library-export-default-webpack-plugin": "2.2.0",
32-
"@wordpress/scripts": "19.2.1",
32+
"@wordpress/scripts": "19.2.2",
3333
"autoprefixer": "^9.8.8",
3434
"chalk": "4.1.2",
3535
"check-node-version": "4.1.0",
@@ -82,53 +82,53 @@
8282
"@wordpress/api-fetch": "5.2.6",
8383
"@wordpress/autop": "3.2.3",
8484
"@wordpress/blob": "3.2.2",
85-
"@wordpress/block-directory": "3.0.9",
86-
"@wordpress/block-editor": "8.0.3",
87-
"@wordpress/block-library": "6.0.7",
85+
"@wordpress/block-directory": "3.0.11",
86+
"@wordpress/block-editor": "8.0.5",
87+
"@wordpress/block-library": "6.0.9",
8888
"@wordpress/block-serialization-default-parser": "4.2.3",
8989
"@wordpress/blocks": "11.1.4",
90-
"@wordpress/components": "19.0.3",
90+
"@wordpress/components": "19.0.5",
9191
"@wordpress/compose": "5.0.6",
9292
"@wordpress/core-data": "4.0.7",
93-
"@wordpress/customize-widgets": "2.0.9",
93+
"@wordpress/customize-widgets": "2.0.11",
9494
"@wordpress/data": "6.1.4",
9595
"@wordpress/data-controls": "2.2.7",
9696
"@wordpress/date": "4.2.3",
9797
"@wordpress/deprecated": "3.2.3",
9898
"@wordpress/dom": "3.2.7",
9999
"@wordpress/dom-ready": "3.2.3",
100-
"@wordpress/edit-post": "5.0.9",
101-
"@wordpress/edit-site": "3.0.9",
102-
"@wordpress/edit-widgets": "3.1.4",
103-
"@wordpress/editor": "12.0.6",
100+
"@wordpress/edit-post": "5.0.11",
101+
"@wordpress/edit-site": "3.0.11",
102+
"@wordpress/edit-widgets": "3.1.6",
103+
"@wordpress/editor": "12.0.8",
104104
"@wordpress/element": "4.0.4",
105105
"@wordpress/escape-html": "2.2.3",
106-
"@wordpress/format-library": "3.0.9",
106+
"@wordpress/format-library": "3.0.11",
107107
"@wordpress/hooks": "3.2.2",
108108
"@wordpress/html-entities": "3.2.3",
109109
"@wordpress/i18n": "4.2.4",
110110
"@wordpress/icons": "6.1.1",
111-
"@wordpress/interface": "4.1.5",
111+
"@wordpress/interface": "4.1.7",
112112
"@wordpress/is-shallow-equal": "4.2.1",
113113
"@wordpress/keyboard-shortcuts": "3.0.6",
114114
"@wordpress/keycodes": "3.2.4",
115-
"@wordpress/list-reusable-blocks": "3.0.7",
115+
"@wordpress/list-reusable-blocks": "3.0.9",
116116
"@wordpress/media-utils": "3.0.5",
117117
"@wordpress/notices": "3.2.7",
118-
"@wordpress/nux": "5.0.7",
118+
"@wordpress/nux": "5.0.9",
119119
"@wordpress/plugins": "4.0.6",
120120
"@wordpress/primitives": "3.0.4",
121121
"@wordpress/priority-queue": "2.2.3",
122122
"@wordpress/redux-routine": "4.2.2",
123-
"@wordpress/reusable-blocks": "3.0.9",
123+
"@wordpress/reusable-blocks": "3.0.11",
124124
"@wordpress/rich-text": "5.0.6",
125-
"@wordpress/server-side-render": "3.0.7",
125+
"@wordpress/server-side-render": "3.0.9",
126126
"@wordpress/shortcode": "3.2.3",
127127
"@wordpress/token-list": "2.2.2",
128128
"@wordpress/url": "3.3.1",
129129
"@wordpress/viewport": "4.0.6",
130130
"@wordpress/warning": "2.2.2",
131-
"@wordpress/widgets": "2.0.9",
131+
"@wordpress/widgets": "2.0.11",
132132
"@wordpress/wordcount": "3.2.3",
133133
"backbone": "1.4.0",
134134
"clipboard": "2.0.8",

src/wp-admin/menu.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,13 @@
212212
'edit_theme_options',
213213
'site-editor.php',
214214
);
215-
216-
$submenu['themes.php'][7] = array(
217-
__( 'Styles' ),
218-
'edit_theme_options',
219-
'site-editor.php?styles=open',
220-
);
221215
}
222216

223217
// Hide Customize link on block themes unless a plugin or theme is using
224218
// customize_register to add a setting.
225219
if ( ! wp_is_block_template_theme() || has_action( 'customize_register' ) ) {
226220
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
227-
$position = wp_is_block_template_theme() ? 8 : 6;
221+
$position = wp_is_block_template_theme() ? 7 : 6;
228222

229223
$submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
230224
}
@@ -249,17 +243,24 @@
249243

250244
// Add 'Theme Editor' to the bottom of the Appearance menu.
251245
if ( ! is_multisite() ) {
246+
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
252247
add_action( 'admin_menu', '_add_themes_utility_last', 101 );
253248
}
254249
/**
255-
* Adds the 'Theme Editor' link to the bottom of the Appearance menu.
250+
* Adds the 'Theme Editor' link to the bottom of the Appearance or Tools menu.
256251
*
257252
* @access private
258253
* @since 3.0.0
254+
* @since 5.9.0 'Theme Editor' link has moved to the Tools menu when a block theme is active.
259255
*/
260256
function _add_themes_utility_last() {
261-
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook.
262-
add_submenu_page( 'themes.php', __( 'Theme Editor' ), __( 'Theme Editor' ), 'edit_themes', 'theme-editor.php' );
257+
add_submenu_page(
258+
wp_is_block_template_theme() ? 'tools.php' : 'themes.php',
259+
__( 'Theme Editor' ),
260+
__( 'Theme Editor' ),
261+
'edit_themes',
262+
'theme-editor.php'
263+
);
263264
}
264265

265266
$count = '';

src/wp-admin/site-editor.php

Lines changed: 78 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -40,60 +40,89 @@ static function( $classes ) {
4040
);
4141

4242
$block_editor_context = new WP_Block_Editor_Context();
43-
44-
$active_global_styles_id = WP_Theme_JSON_Resolver::get_user_custom_post_type_id();
45-
$active_theme = wp_get_theme()->get_stylesheet();
46-
$preload_paths = array(
47-
array( '/wp/v2/media', 'OPTIONS' ),
48-
'/',
49-
'/wp/v2/types?context=edit',
50-
'/wp/v2/taxonomies?context=edit',
51-
'/wp/v2/pages?context=edit',
52-
'/wp/v2/categories?context=edit',
53-
'/wp/v2/posts?context=edit',
54-
'/wp/v2/tags?context=edit',
55-
'/wp/v2/templates?context=edit',
56-
'/wp/v2/template-parts?context=edit',
57-
'/wp/v2/settings',
58-
'/wp/v2/themes?context=edit&status=active',
59-
'/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit',
60-
'/wp/v2/global-styles/' . $active_global_styles_id,
61-
'/wp/v2/themes/' . $active_theme . '/global-styles',
62-
'/wp/v2/block-navigation-areas?context=edit',
43+
$custom_settings = array(
44+
'siteUrl' => site_url(),
45+
'postsPerPage' => get_option( 'posts_per_page' ),
46+
'styles' => get_block_editor_theme_styles(),
47+
'defaultTemplateTypes' => get_default_block_template_types(),
48+
'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(),
49+
'__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
50+
'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),
6351
);
52+
$editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context );
53+
54+
if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) {
55+
56+
$post_type = get_post_type_object( $_GET['postType'] );
6457

65-
$areas = get_option( 'wp_navigation_areas', array() );
66-
$active_areas = array_intersect_key( $areas, get_navigation_areas() );
67-
foreach ( $active_areas as $post_id ) {
68-
if ( $post_id ) {
69-
$preload_paths[] = add_query_arg( 'context', 'edit', rest_get_route_for_post( $post_id ) );
58+
if ( ! $post_type ) {
59+
wp_die( __( 'Invalid post type.' ) );
7060
}
71-
}
7261

73-
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
74-
75-
$editor_settings = get_block_editor_settings(
76-
array(
77-
'siteUrl' => site_url(),
78-
'postsPerPage' => get_option( 'posts_per_page' ),
79-
'styles' => get_block_editor_theme_styles(),
80-
'defaultTemplateTypes' => get_default_block_template_types(),
81-
'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(),
82-
'__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
83-
'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),
84-
),
85-
$block_editor_context
86-
);
62+
$preload_paths = array(
63+
'/',
64+
'/wp/v2/types/' . $post_type->name . '?context=edit',
65+
'/wp/v2/types?context=edit',
66+
'/wp/v2/' . $post_type->rest_base . '?context=edit',
67+
);
8768

88-
wp_add_inline_script(
89-
'wp-edit-site',
90-
sprintf(
91-
'wp.domReady( function() {
92-
wp.editSite.initialize( "site-editor", %s );
93-
} );',
94-
wp_json_encode( $editor_settings )
95-
)
96-
);
69+
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
70+
71+
wp_add_inline_script(
72+
'wp-edit-site',
73+
sprintf(
74+
'wp.domReady( function() {
75+
wp.editSite.initializeList( "site-editor", "%s", %s );
76+
} );',
77+
$post_type->name,
78+
wp_json_encode( $editor_settings )
79+
)
80+
);
81+
82+
} else {
83+
84+
$active_global_styles_id = WP_Theme_JSON_Resolver::get_user_custom_post_type_id();
85+
$active_theme = wp_get_theme()->get_stylesheet();
86+
$preload_paths = array(
87+
array( '/wp/v2/media', 'OPTIONS' ),
88+
'/',
89+
'/wp/v2/types?context=edit',
90+
'/wp/v2/taxonomies?context=edit',
91+
'/wp/v2/pages?context=edit',
92+
'/wp/v2/categories?context=edit',
93+
'/wp/v2/posts?context=edit',
94+
'/wp/v2/tags?context=edit',
95+
'/wp/v2/templates?context=edit',
96+
'/wp/v2/template-parts?context=edit',
97+
'/wp/v2/settings',
98+
'/wp/v2/themes?context=edit&status=active',
99+
'/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit',
100+
'/wp/v2/global-styles/' . $active_global_styles_id,
101+
'/wp/v2/themes/' . $active_theme . '/global-styles',
102+
'/wp/v2/block-navigation-areas?context=edit',
103+
);
104+
105+
$areas = get_option( 'wp_navigation_areas', array() );
106+
$active_areas = array_intersect_key( $areas, get_navigation_areas() );
107+
foreach ( $active_areas as $post_id ) {
108+
if ( $post_id ) {
109+
$preload_paths[] = add_query_arg( 'context', 'edit', rest_get_route_for_post( $post_id ) );
110+
}
111+
}
112+
113+
block_editor_rest_api_preload( $preload_paths, $block_editor_context );
114+
115+
wp_add_inline_script(
116+
'wp-edit-site',
117+
sprintf(
118+
'wp.domReady( function() {
119+
wp.editSite.initializeEditor( "site-editor", %s );
120+
} );',
121+
wp_json_encode( $editor_settings )
122+
)
123+
);
124+
125+
}
97126

98127
// Preload server-registered block schemas.
99128
wp_add_inline_script(

0 commit comments

Comments
 (0)