Skip to content

Commit

Permalink
Editor: Update Packages with the latest bug fixes for 6.5 RC 3
Browse files Browse the repository at this point in the history
It includes all the backports from this Gutenberg PR WordPress/gutenberg#59949

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


git-svn-id: https://core.svn.wordpress.org/trunk@57352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
youknowriad committed Mar 19, 2024
1 parent 39f7b1a commit 6cc8ab8
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions wp-includes/blocks/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ private static function get_markup_for_inner_block( $inner_block ) {
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;
}

return $inner_block_content;
}

/**
Expand Down Expand Up @@ -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.
Expand Down
35 changes: 17 additions & 18 deletions wp-includes/js/dist/block-library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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'
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/block-library.min.js

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions wp-includes/js/dist/edit-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(',')
Expand Down Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/edit-site.min.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions wp-includes/js/dist/interactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/interactivity.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6cc8ab8

Please sign in to comment.