diff --git a/packages/edit-site/src/components/add-new-template/add-custom-template-modal-content.js b/packages/edit-site/src/components/add-new-template/add-custom-template-modal-content.js index 80a20939dec25..643f1e6f81866 100644 --- a/packages/edit-site/src/components/add-new-template/add-custom-template-modal-content.js +++ b/packages/edit-site/src/components/add-new-template/add-custom-template-modal-content.js @@ -9,11 +9,9 @@ import { FlexItem, SearchControl, TextHighlight, + privateApis as componentsPrivateApis, __experimentalText as Text, __experimentalVStack as VStack, - __unstableComposite as Composite, - __unstableUseCompositeState as useCompositeState, - __unstableCompositeItem as CompositeItem, } from '@wordpress/components'; import { useEntityRecords } from '@wordpress/core-data'; import { decodeEntities } from '@wordpress/html-entities'; @@ -21,9 +19,16 @@ import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies */ +import { unlock } from '../../lock-unlock'; import useDebouncedInput from '../../utils/use-debounced-input'; import { mapToIHasNameAndId } from './utils'; +const { + CompositeV2: Composite, + CompositeItemV2: CompositeItem, + useCompositeStoreV2: useCompositeStore, +} = unlock( componentsPrivateApis ); + const EMPTY_ARRAY = []; function SuggestionListItem( { @@ -31,22 +36,23 @@ function SuggestionListItem( { search, onSelect, entityForSuggestions, - composite, } ) { const baseCssClass = 'edit-site-custom-template-modal__suggestions_list__list-item'; return ( - onSelect( - entityForSuggestions.config.getSpecificTemplate( - suggestion - ) - ) + render={ +