Skip to content

Commit

Permalink
deprecate exports of LinkControl sub components
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Dec 10, 2024
1 parent 52ed606 commit ae6170a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { URLInput } from '../';
import LinkControlSearchResults from './search-results';
import { CREATE_TYPE } from './constants';
import useSearchHandler from './use-search-handler';
import deprecated from '@wordpress/deprecated';

// Must be a function as otherwise URLInput will default
// to the fetchLinkSuggestions passed in block editor settings
Expand Down Expand Up @@ -155,4 +156,10 @@ const LinkControlSearchInput = forwardRef(
}
);

export default LinkControlSearchInput;
export default ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchInput', {
since: '6.8',
} );

return <LinkControlSearchInput { ...props } />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
import { safeDecodeURI, filterURLForDisplay, getPath } from '@wordpress/url';
import { pipe } from '@wordpress/compose';
import deprecated from '@wordpress/deprecated';

const ICONS_MAP = {
post: postList,
Expand Down Expand Up @@ -159,4 +160,10 @@ function getVisualTypeName( suggestion ) {
return suggestion.type === 'post_tag' ? 'tag' : suggestion.type;
}

export default LinkControlSearchItem;
export default ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchItem', {
since: '6.8',
} );

return <LinkControlSearchItem { ...props } />;
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import clsx from 'clsx';
import LinkControlSearchCreate from './search-create-button';
import LinkControlSearchItem from './search-item';
import { CREATE_TYPE, LINK_ENTRY_TYPES } from './constants';
import deprecated from '@wordpress/deprecated';

export default function LinkControlSearchResults( {
function LinkControlSearchResults( {
withCreateSuggestion,
currentInputValue,
handleSuggestionClick,
Expand Down Expand Up @@ -121,3 +122,11 @@ export default function LinkControlSearchResults( {
</div>
);
}

export default ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchResults', {
since: '6.8',
} );

return <LinkControlSearchResults { ...props } />;
};

0 comments on commit ae6170a

Please sign in to comment.