Editor: Update Packages with the latest bug fixes for 6.5 RC 3

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59949/

Props get_dave, youknowriad.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57851


git-svn-id: http://core.svn.wordpress.org/trunk@57352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2024-03-19 08:07:17 +00:00
parent cc416fc17b
commit 9ed35adffa
10 changed files with 56 additions and 33 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -135,10 +135,10 @@ class WP_Navigation_Block_Renderer {
if ( static::does_block_need_a_list_item_wrapper( $inner_block ) ) {
return '<li class="wp-block-navigation-item">' . $inner_block_content . '</li>';
}
}
return $inner_block_content;
}
}
/**
* Returns the html for the inner blocks of the navigation block.
@ -1464,6 +1464,14 @@ function block_core_navigation_set_ignored_hooked_blocks_metadata( $inner_blocks
* @return stdClass The updated post object.
*/
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
/*
* In this scenario the user has likely tried to create a navigation via the REST API.
* In which case we won't have a post ID to work with and store meta against.
*/
if ( empty( $post->ID ) ) {
return $post;
}
/*
* We run the Block Hooks mechanism to inject the `metadata.ignoredHookedBlocks` attribute into
* all anchor blocks. For the root level, we create a mock Navigation and extract them from there.

View File

@ -24121,14 +24121,15 @@ const heading_settings = {
level
} = attributes;
const customName = attributes?.metadata?.name;
const hasContent = content?.length > 0;
// In the list view, use the block's content as the label.
// If the content is empty, fall back to the default label.
if (context === 'list-view' && (customName || content)) {
return attributes?.metadata?.name || content;
if (context === 'list-view' && (customName || hasContent)) {
return customName || content;
}
if (context === 'accessibility') {
return !content || content.length === 0 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: accessibility text. %s: heading level. */
return !hasContent ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: accessibility text. %s: heading level. */
(0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: accessibility text. 1: heading level. 2: heading content. */
(0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
}
@ -34830,12 +34831,7 @@ function Navigation({
const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)();
const onSelectClassicMenu = async classicMenu => {
const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name, 'draft');
if (navMenu) {
handleUpdateMenu(navMenu.id, {
focusNavigationBlock: true
});
}
return convertClassicMenu(classicMenu.id, classicMenu.name, 'draft');
};
const onSelectNavigationMenu = menuId => {
handleUpdateMenu(menuId);
@ -34862,11 +34858,14 @@ function Navigation({
}
if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) {
showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.'));
handleUpdateMenu(createNavigationMenuPost?.id, {
focusNavigationBlock: true
});
}
if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.'));
}
}, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice]);
}, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice, createNavigationMenuPost?.id, handleUpdateMenu]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!enableContrastChecking) {
return;
@ -35132,16 +35131,14 @@ function Navigation({
}), (0,external_React_namespaceObject.createElement)(manage_menus_button, {
disabled: isManageMenusButtonDisabled,
className: "wp-block-navigation-manage-menus-button"
})), isLoading && (0,external_React_namespaceObject.createElement)(TagName, {
...blockProps
}, (0,external_React_namespaceObject.createElement)("div", {
})), (0,external_React_namespaceObject.createElement)(TagName, {
...blockProps,
"aria-describedby": !isPlaceholder && !isLoading ? accessibleDescriptionId : undefined
}, isLoading && (0,external_React_namespaceObject.createElement)("div", {
className: "wp-block-navigation__loading-indicator-container"
}, (0,external_React_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
className: "wp-block-navigation__loading-indicator"
}))), !isLoading && (0,external_React_namespaceObject.createElement)(TagName, {
...blockProps,
"aria-describedby": !isPlaceholder ? accessibleDescriptionId : undefined
}, (0,external_React_namespaceObject.createElement)(AccessibleMenuDescription, {
})), !isLoading && (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, (0,external_React_namespaceObject.createElement)(AccessibleMenuDescription, {
id: accessibleDescriptionId
}), (0,external_React_namespaceObject.createElement)(ResponsiveWrapper, {
id: clientId,
@ -35158,7 +35155,7 @@ function Navigation({
hasCustomPlaceholder: !!CustomPlaceholder,
templateLock: templateLock,
orientation: orientation
})))));
}))))));
}
/* harmony default export */ const navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
textColor: 'color'
@ -36238,6 +36235,7 @@ function NavigationLinkEdit({
} = getColors(context, !isTopLevelLink);
function onKeyDown(event) {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || (!url || isDraft || isInvalid) && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
event.preventDefault();
setIsLinkOpen(true);
}
}
@ -37064,6 +37062,7 @@ function NavigationSubmenuEdit({
} = getColors(context, parentCount > 0);
function onKeyDown(event) {
if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
event.preventDefault();
setIsLinkOpen(true);
}
}

File diff suppressed because one or more lines are too long

View File

@ -26533,6 +26533,9 @@ function formatFontFamily(input) {
* formatFontFaceName(", 'Open Sans', 'Helvetica Neue', sans-serif") => "Open Sans"
*/
function formatFontFaceName(input) {
if (!input) {
return '';
}
let output = input.trim();
if (output.includes(',')) {
output = output.split(',')
@ -26703,7 +26706,7 @@ async function loadFontFaceInBrowser(fontFace, source, addTo = 'all') {
function unloadFontFaceInBrowser(fontFace, removeFrom = 'all') {
const unloadFontFace = fonts => {
fonts.forEach(f => {
if (f.family === formatFontFaceName(fontFace.fontFamily) && f.weight === fontFace.fontWeight && f.style === fontFace.fontStyle) {
if (f.family === formatFontFaceName(fontFace?.fontFamily) && f.weight === fontFace?.fontWeight && f.style === fontFace?.fontStyle) {
fonts.delete(f);
}
});
@ -27126,8 +27129,15 @@ function FontLibraryProvider({
if (sucessfullyInstalledFontFaces?.length > 0 || alreadyInstalledFontFaces?.length > 0) {
fontFamilyToInstall.fontFace = [...sucessfullyInstalledFontFaces, ...alreadyInstalledFontFaces];
fontFamiliesToActivate.push(fontFamilyToInstall);
} else if (isANewFontFamily) {
// If the font family is new, delete it to avoid having font families without font faces.
}
// If it's a system font but was installed successfully, activate it.
if (installedFontFamily && !fontFamilyToInstall?.fontFace?.length) {
fontFamiliesToActivate.push(installedFontFamily);
}
// If the font family is new and is not a system font, delete it to avoid having font families without font faces.
if (isANewFontFamily && fontFamilyToInstall?.fontFace?.length > 0 && sucessfullyInstalledFontFaces?.length === 0) {
await fetchUninstallFontFamily(installedFontFamily.id);
}
installationErrors = installationErrors.concat(unsucessfullyInstalledFontFaces);
@ -27218,9 +27228,9 @@ function FontLibraryProvider({
...fontFamilies,
[font.source]: newFonts
});
const isFaceActivated = isFontActivated(font.slug, face.fontStyle, face.fontWeight, font.source);
const isFaceActivated = isFontActivated(font.slug, face?.fontStyle, face?.fontWeight, font.source);
if (isFaceActivated) {
loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face.src), 'all');
loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face?.src), 'all');
} else {
unloadFontFaceInBrowser(face, 'all');
}

File diff suppressed because one or more lines are too long

View File

@ -265,7 +265,7 @@ function store(namespace, {
storeLocks.set(namespace, lock);
}
const rawStore = {
state: deepsignal_module_g(state),
state: deepsignal_module_g(isObject(state) ? state : {}),
...block
};
const proxiedStore = new Proxy(rawStore, handlers);
@ -496,8 +496,14 @@ const directive = (name, callback, {
// Resolve the path to some property of the store object.
const resolve = (path, namespace) => {
let resolvedStore = stores.get(namespace);
if (typeof resolvedStore === 'undefined') {
resolvedStore = store(namespace, undefined, {
lock: universalUnlock
});
}
let current = {
...stores.get(namespace),
...resolvedStore,
context: getScope().context[namespace]
};
path.split('.').forEach(p => current = current[p]);

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57850';
$wp_version = '6.6-alpha-57851';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.