From 5619e75e3c972ecaebf204c7faa22220fa2b2b2e Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Fri, 10 Mar 2023 13:13:41 +0000 Subject: [PATCH] no message --- package-lock.json | 3 ++- .../src/components/off-canvas-editor/index.js | 23 ++++++++++--------- .../navigation-menu-content.js | 15 ++++++++---- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b7971a895f459..38bb66df9287d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17071,6 +17071,7 @@ "@wordpress/core-data": "file:packages/core-data", "@wordpress/data": "file:packages/data", "@wordpress/deprecated": "file:packages/deprecated", + "@wordpress/dom": "file:packages/dom", "@wordpress/editor": "file:packages/editor", "@wordpress/element": "file:packages/element", "@wordpress/hooks": "file:packages/hooks", @@ -28529,7 +28530,7 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, "code-point-at": { diff --git a/packages/block-editor/src/components/off-canvas-editor/index.js b/packages/block-editor/src/components/off-canvas-editor/index.js index e5292ea88d4eb1..97b8a4d4a71c51 100644 --- a/packages/block-editor/src/components/off-canvas-editor/index.js +++ b/packages/block-editor/src/components/off-canvas-editor/index.js @@ -54,17 +54,18 @@ export const BLOCK_LIST_ITEM_HEIGHT = 36; /** * Show a hierarchical list of blocks. * - * @param {Object} props Components props. - * @param {string} props.id An HTML element id for the root element of ListView. - * @param {string} props.parentClientId The client id of the parent block. - * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy. - * @param {boolean} props.showBlockMovers Flag to enable block movers - * @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. - * @param {Object} props.LeafMoreMenu Optional more menu substitution. - * @param {string} props.description Optional accessible description for the tree grid component. - * @param {string} props.onSelect Optional callback to be invoked when a block is selected. - * @param {string} props.showAppender Flag to show or hide the block appender. - * @param {Object} ref Forwarded ref + * @param {Object} props Components props. + * @param {string} props.id An HTML element id for the root element of ListView. + * @param {string} props.parentClientId The client id of the parent block. + * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy. + * @param {boolean} props.showBlockMovers Flag to enable block movers + * @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. + * @param {Object} props.LeafMoreMenu Optional more menu substitution. + * @param {string} props.description Optional accessible description for the tree grid component. + * @param {string} props.onSelect Optional callback to be invoked when a block is selected. + * @param {string} props.showAppender Flag to show or hide the block appender. + * @param {Function} props.renderAdditionalBlockUI Function that renders additional block content UI. + * @param {Object} ref Forwarded ref. */ function OffCanvasEditor( { diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js index ed2b9adf18b000..d5ef5984e9fb15 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js @@ -13,7 +13,6 @@ import { createBlock } from '@wordpress/blocks'; import { useCallback, useState } from '@wordpress/element'; import { Popover } from '@wordpress/components'; import { __unstableStripHTML as stripHTML } from '@wordpress/dom'; -import { __ } from '@wordpress/i18n'; /** * Internal dependencies @@ -21,7 +20,7 @@ import { __ } from '@wordpress/i18n'; import { unlock } from '../../private-apis'; import { NavigationMenuLoader } from './loader'; -function renderAdditionalBlockUI( block, onClose ) { +function CustomLinkAdditionalBlockUI( { block, onClose } ) { const { updateBlockAttributes } = useDispatch( blockEditorStore ); const { label, url, opensInNewTab } = block.attributes; const link = { @@ -76,10 +75,16 @@ export default function NavigationMenuContent( { rootClientId, onSelect } ) { customLinkEditPopoverOpenId && block.clientId === customLinkEditPopoverOpenId ) { - return renderAdditionalBlockUI( block, () => { - setIsCustomLinkEditPopoverOpenId( false ); - } ); + return ( + { + setIsCustomLinkEditPopoverOpenId( false ); + } } + /> + ); } + return null; }, [ customLinkEditPopoverOpenId, setIsCustomLinkEditPopoverOpenId ] );