Skip to content

Commit

Permalink
add deprecated version of all the __experimentalLinkControl components
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Nov 21, 2023
1 parent e95bb8c commit 1111197
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/block-editor/src/components/link-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import useCreatePage from './use-create-page';
import useInternalValue from './use-internal-value';
import { ViewerFill } from './viewer-slot';
import { DEFAULT_LINK_SETTINGS } from './constants';
import deprecated from '@wordpress/deprecated';

/**
* Default properties associated with a link control value.
Expand Down Expand Up @@ -499,4 +500,13 @@ function LinkControl( {
LinkControl.ViewerFill = ViewerFill;
LinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS;

export const DeprecatedExperimentalLinkControl = ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControl', {
since: '6.5',
alternative: 'wp.blockEditor.LinkControl',
} );

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

export default LinkControl;
11 changes: 11 additions & 0 deletions packages/block-editor/src/components/link-control/search-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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 @@ -163,4 +164,14 @@ const LinkControlSearchInput = forwardRef(
}
);

export const DeprecatedExperimentalLinkControlSearchInput = forwardRef(
( props, ref ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchInput', {
since: '6.5',
alternative: 'wp.blockEditor.LinkControlSearchInput',
} );
return <LinkControlSearchInput { ...props } ref={ ref } />;
}
);

export default LinkControlSearchInput;
10 changes: 10 additions & 0 deletions packages/block-editor/src/components/link-control/search-item.js
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 @@ -153,4 +154,13 @@ function getVisualTypeName( suggestion ) {
return suggestion.type === 'post_tag' ? 'tag' : suggestion.type;
}

export const DeprecatedExperimentalLinkControlSearchItem = ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchItem', {
since: '6.5',
alternative: 'wp.blockEditor.LinkControlSearchItem',
} );

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

export default LinkControlSearchItem;
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import classnames from 'classnames';
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( {
instanceId,
Expand Down Expand Up @@ -132,3 +133,11 @@ export default function LinkControlSearchResults( {
</div>
);
}

export const DeprecatedExperimentalLinkControlSearchResults = ( props ) => {
deprecated( 'wp.blockEditor.__experimentalLinkControlSearchResults', {
since: '6.5',
alternative: 'wp.blockEditor.LinkControlSearchResults',
} );
return <LinkControlSearchResults { ...props } />;
};

0 comments on commit 1111197

Please sign in to comment.