diff --git a/packages/block-library/src/post-featured-image/edit.js b/packages/block-library/src/post-featured-image/edit.js
index 95441a5a55cfd0..05888c41fecf23 100644
--- a/packages/block-library/src/post-featured-image/edit.js
+++ b/packages/block-library/src/post-featured-image/edit.js
@@ -11,11 +11,12 @@ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
import { useSelect, useDispatch } from '@wordpress/data';
import {
ToggleControl,
- PanelBody,
Placeholder,
Button,
Spinner,
TextControl,
+ __experimentalToolsPanel as ToolsPanel,
+ __experimentalToolsPanelItem as ToolsPanelItem,
} from '@wordpress/components';
import {
InspectorControls,
@@ -38,6 +39,7 @@ import { store as noticesStore } from '@wordpress/notices';
import DimensionControls from './dimension-controls';
import OverlayControls from './overlay-controls';
import Overlay from './overlay';
+import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
const ALLOWED_MEDIA_TYPES = [ 'image' ];
@@ -183,6 +185,8 @@ export default function PostFeaturedImageEdit( {
setTemporaryURL();
};
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
+
const controls = blockEditingMode === 'default' && (
<>
@@ -201,9 +205,18 @@ export default function PostFeaturedImageEdit( {
/>
-
- {
+ setAttributes( {
+ isLink: false,
+ linkTarget: '_self',
+ rel: '',
+ } );
+ } }
+ dropdownMenuProps={ dropdownMenuProps }
+ >
+ setAttributes( { isLink: ! isLink } ) }
- checked={ isLink }
- />
+ isShownByDefault
+ hasValue={ () => !! isLink }
+ onDeselect={ () =>
+ setAttributes( {
+ isLink: false,
+ } )
+ }
+ >
+
+ setAttributes( { isLink: ! isLink } )
+ }
+ checked={ isLink }
+ />
+
{ isLink && (
- <>
+ '_self' !== linkTarget }
+ onDeselect={ () =>
+ setAttributes( {
+ linkTarget: '_self',
+ } )
+ }
+ >
+
+ ) }
+ { isLink && (
+ !! rel }
+ onDeselect={ () =>
+ setAttributes( {
+ rel: '',
+ } )
+ }
+ >
- >
+
) }
-
+
>
);