diff --git a/package-lock.json b/package-lock.json index 557adb678c325..b701d156d510a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55961,6 +55961,7 @@ "@wordpress/icons": "file:../icons", "@wordpress/notices": "file:../notices", "@wordpress/plugins": "file:../plugins", + "@wordpress/private-apis": "file:../private-apis", "@wordpress/url": "file:../url", "change-case": "^4.1.2" }, @@ -69379,6 +69380,7 @@ "@wordpress/icons": "file:../icons", "@wordpress/notices": "file:../notices", "@wordpress/plugins": "file:../plugins", + "@wordpress/private-apis": "file:../private-apis", "@wordpress/url": "file:../url", "change-case": "^4.1.2" } diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json index bc4de667ff7be..99871e4348df4 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -43,6 +43,7 @@ "@wordpress/icons": "file:../icons", "@wordpress/notices": "file:../notices", "@wordpress/plugins": "file:../plugins", + "@wordpress/private-apis": "file:../private-apis", "@wordpress/url": "file:../url", "change-case": "^4.1.2" }, diff --git a/packages/block-directory/src/components/downloadable-block-list-item/index.js b/packages/block-directory/src/components/downloadable-block-list-item/index.js index aed5c99ec89b2..e3a770925551c 100644 --- a/packages/block-directory/src/components/downloadable-block-list-item/index.js +++ b/packages/block-directory/src/components/downloadable-block-list-item/index.js @@ -6,7 +6,7 @@ import { Button, Spinner, VisuallyHidden, - __unstableCompositeItem as CompositeItem, + privateApis as componentsPrivateApis, } from '@wordpress/components'; import { createInterpolateElement } from '@wordpress/element'; import { decodeEntities } from '@wordpress/html-entities'; @@ -20,6 +20,9 @@ import BlockRatings from '../block-ratings'; import DownloadableBlockIcon from '../downloadable-block-icon'; import DownloadableBlockNotice from '../downloadable-block-notice'; import { store as blockDirectoryStore } from '../../store'; +import { unlock } from '../../lock-unlock'; + +const { CompositeItemV2: CompositeItem } = unlock( componentsPrivateApis ); // Return the appropriate block item label, given the block data and status. function getDownloadableBlockLabel( @@ -91,24 +94,28 @@ function DownloadableBlockListItem( { composite, item, onClick } ) { return ( { - event.preventDefault(); - onClick(); - } } - isBusy={ isInstalling } + render={ +