diff --git a/packages/block-editor/src/components/grid/grid-item-movers.js b/packages/block-editor/src/components/grid/grid-item-movers.js
index ed8e35c201f7e0..c6c0baadbf6d16 100644
--- a/packages/block-editor/src/components/grid/grid-item-movers.js
+++ b/packages/block-editor/src/components/grid/grid-item-movers.js
@@ -1,10 +1,21 @@
+/**
+ * External dependencies
+ */
+import clsx from 'clsx';
+
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { ToolbarButton } from '@wordpress/components';
-import { arrowLeft, arrowUp, arrowDown, arrowRight } from '@wordpress/icons';
+import { Button, VisuallyHidden } from '@wordpress/components';
+import {
+ chevronLeft,
+ chevronUp,
+ chevronDown,
+ chevronRight,
+} from '@wordpress/icons';
import { useDispatch } from '@wordpress/data';
+import { useInstanceId } from '@wordpress/compose';
/**
* Internal dependencies
@@ -43,50 +54,12 @@ export function GridItemMovers( {
return (
- {
- onChange( {
- rowStart: rowStart - 1,
- } );
- __unstableMarkNextChangeAsNotPersistent();
- moveBlocksToPosition(
- [ blockClientId ],
- gridClientId,
- gridClientId,
- getNumberOfBlocksBeforeCell(
- columnStartNumber,
- rowStartNumber - 1
- )
- );
- } }
- />
- = rowCount }
- onClick={ () => {
- onChange( {
- rowStart: rowStart + 1,
- } );
- __unstableMarkNextChangeAsNotPersistent();
- moveBlocksToPosition(
- [ blockClientId ],
- gridClientId,
- gridClientId,
- getNumberOfBlocksBeforeCell(
- columnStartNumber,
- rowStartNumber + 1
- )
- );
- } }
- />
- {
onChange( {
columnStart: columnStartNumber - 1,
@@ -103,10 +76,58 @@ export function GridItemMovers( {
);
} }
/>
-
+ {
+ onChange( {
+ rowStart: rowStart - 1,
+ } );
+ __unstableMarkNextChangeAsNotPersistent();
+ moveBlocksToPosition(
+ [ blockClientId ],
+ gridClientId,
+ gridClientId,
+ getNumberOfBlocksBeforeCell(
+ columnStartNumber,
+ rowStartNumber - 1
+ )
+ );
+ } }
+ />
+ = rowCount }
+ onClick={ () => {
+ onChange( {
+ rowStart: rowStart + 1,
+ } );
+ __unstableMarkNextChangeAsNotPersistent();
+ moveBlocksToPosition(
+ [ blockClientId ],
+ gridClientId,
+ gridClientId,
+ getNumberOfBlocksBeforeCell(
+ columnStartNumber,
+ rowStartNumber + 1
+ )
+ );
+ } }
+ />
+
+ = columnCount }
+ description={ __( 'Move block right' ) }
+ isDisabled={ columnCount && columnEnd >= columnCount }
onClick={ () => {
onChange( {
columnStart: columnStartNumber + 1,
@@ -126,3 +147,34 @@ export function GridItemMovers( {
);
}
+
+function GridItemMover( {
+ className,
+ icon,
+ label,
+ isDisabled,
+ onClick,
+ description,
+} ) {
+ const instanceId = useInstanceId( GridItemMover );
+ const descriptionId = `block-editor-block-mover-button__description-${ instanceId }`;
+ return (
+ <>
+
+
+ { description }
+
+ >
+ );
+}