diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index ca8c706c9f065f..5e00b16e3fff6c 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -315,10 +315,6 @@ _Returns_ Undocumented declaration. -### DimensionControls - -Undocumented declaration. - ### FontSizePicker Undocumented declaration. diff --git a/packages/block-editor/src/components/dimension-controls/README.md b/packages/block-editor/src/components/dimension-controls/README.md deleted file mode 100644 index e86dfa0b09fd73..00000000000000 --- a/packages/block-editor/src/components/dimension-controls/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# DimensionControls - -Dimension controls appear under the dimensions block support panel in post -settings sidebar when a block is being edited. `DimensionControls` allow for -blocks to group their own dimensions related controls along side those provided -via block supports. - -The dimensions panel is built via the `ToolsPanel` component. Block's can also -add their controls to the `ToolsPanel` menu by wrapping them in a -`ToolsPanelItem` component and providing the required callbacks. - -## Usage - -```js -import { DimensionsControls } from '@wordpress/block-editor'; -import { - TextControl, - __experimentalToolsPanelItem as ToolsPanelItem, -} from '@wordpress/components'; - -function MyBlockEdit( props ) { - const { attributes, setAttributes } = props; - - return ( - - !! attributes.myValue } - label={ __( 'My dimension control' ) } - onDeselect={ () => setAttributes( { myValue: undefined } ) } - resetAllFilter={ ( newAttributes ) => ( { - ...newAttributes, - myValue: undefined, - } ) } - isShownByDefault={ true } - > - setAttributes( { myValue: next } ) ) } - /> - - - ); -} -``` diff --git a/packages/block-editor/src/components/dimension-controls/index.js b/packages/block-editor/src/components/dimension-controls/index.js deleted file mode 100644 index 108e5d5db03a63..00000000000000 --- a/packages/block-editor/src/components/dimension-controls/index.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * WordPress dependencies - */ -import { createSlotFill } from '@wordpress/components'; -/** - * Internal dependencies - */ -import useDisplayBlockControls from '../use-display-block-controls'; - -const { Fill, Slot } = createSlotFill( 'DimensionControls' ); - -function DimensionControls( { children } ) { - return useDisplayBlockControls() ? { children } : null; -} - -DimensionControls.Slot = Slot; - -export default DimensionControls; diff --git a/packages/block-editor/src/components/index.js b/packages/block-editor/src/components/index.js index f70ec86c932045..f6fc2b3c7f01da 100644 --- a/packages/block-editor/src/components/index.js +++ b/packages/block-editor/src/components/index.js @@ -41,7 +41,6 @@ export { export { default as ColorPalette } from './color-palette'; export { default as ColorPaletteControl } from './color-palette/control'; export { default as ContrastChecker } from './contrast-checker'; -export { default as DimensionControls } from './dimension-controls'; export { default as __experimentalDuotoneControl } from './duotone-control'; export { default as __experimentalFontAppearanceControl } from './font-appearance-control'; export { default as __experimentalFontFamilyControl } from './font-family';