diff --git a/packages/block-editor/src/components/block-edit/index.js b/packages/block-editor/src/components/block-edit/index.js index 09b92ad2e82462..a16385d694ffc8 100644 --- a/packages/block-editor/src/components/block-edit/index.js +++ b/packages/block-editor/src/components/block-edit/index.js @@ -8,7 +8,7 @@ import { hasBlockSupport } from '@wordpress/blocks'; * Internal dependencies */ import Edit from './edit'; -import { withBlockBindingSupport } from './with-block-bindings-attributes'; +import { withBlockBindingsSupport } from './with-block-bindings-support'; import { BlockEditContextProvider, useBlockEditContext, @@ -20,6 +20,9 @@ import { } from './context'; import { MultipleUsageWarning } from './multiple-usage-warning'; import { PrivateBlockContext } from '../block-list/private-block-context'; +import { canBindBlock } from '../../utils/block-bindings'; + +const BlockEditWithBindings = withBlockBindingsSupport( Edit ); /** * The `useBlockEditContext` hook provides information about the block this hook is being used in. @@ -31,8 +34,6 @@ import { PrivateBlockContext } from '../block-list/private-block-context'; */ export { useBlockEditContext }; -const BlockEditWithBindings = withBlockBindingSupport( Edit ); - export default function BlockEdit( { mayDisplayControls, mayDisplayParentControls, @@ -55,6 +56,7 @@ export default function BlockEdit( { hasBlockSupport( name, 'layout', false ) || hasBlockSupport( name, '__experimentalLayout', false ); const { originalBlockClientId } = useContext( PrivateBlockContext ); + const EditComponent = canBindBlock( name ) ? BlockEditWithBindings : Edit; return ( - + { originalBlockClientId && ( ( props ) => { const registry = useRegistry(); const blockContext = useContext( BlockContext );