From 98adc4bb56ee51ace20f52d1feb4ee51b5288d92 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Tue, 3 Sep 2024 10:45:14 +0100 Subject: [PATCH] Hack in ability to move blocks in contentOnly --- .../src/components/block-toolbar/index.js | 24 +++++++++---------- packages/block-editor/src/store/selectors.js | 5 ++++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/block-editor/src/components/block-toolbar/index.js b/packages/block-editor/src/components/block-toolbar/index.js index 984670762262c9..0f76c27bed16d8 100644 --- a/packages/block-editor/src/components/block-toolbar/index.js +++ b/packages/block-editor/src/components/block-toolbar/index.js @@ -186,18 +186,18 @@ export function PrivateBlockToolbar( { disabled={ ! isDefaultEditingMode } isUsingBindings={ isUsingBindings } /> - { isDefaultEditingMode && ( - <> - { ! isMultiToolbar && ( - - ) } - - + { isDefaultEditingMode && ! isMultiToolbar && ( + + ) } + + { ( isDefaultEditingMode || + isContentOnlyEditingMode ) && ( + ) } diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index 8d4d94bdaa98f7..1f430f97e3b212 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -1767,6 +1767,11 @@ export function canMoveBlock( state, clientId ) { if ( getTemplateLock( state, rootClientId ) === 'all' ) { return false; } + + if ( getBlockEditingMode( state, clientId ) === 'contentOnly' ) { + return true; + } + return getBlockEditingMode( state, rootClientId ) !== 'disabled'; }