Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:WordPress/gutenberg into enhanceme…
Browse files Browse the repository at this point in the history
…nt/inline-commenting-refactored-comments-component
  • Loading branch information
akasunil committed Dec 4, 2024
2 parents 989bb45 + cc5a2b7 commit 9306f80
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import clsx from 'clsx';
/**
* WordPress dependencies
*/
import {
memo,
useCallback,
RawHTML,
useContext,
useMemo,
} from '@wordpress/element';
import { memo, RawHTML, useContext, useMemo } from '@wordpress/element';
import {
getBlockType,
getSaveContent,
Expand All @@ -28,7 +22,7 @@ import {
store as blocksStore,
} from '@wordpress/blocks';
import { withFilters } from '@wordpress/components';
import { withDispatch, useDispatch, useSelect } from '@wordpress/data';
import { withDispatch, useSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { safeHTML } from '@wordpress/dom';

Expand Down Expand Up @@ -103,6 +97,7 @@ function BlockListBlock( {
wrapperProps,
setAttributes,
onReplace,
onRemove,
onInsertBlocksAfter,
onMerge,
toggleSelection,
Expand All @@ -113,11 +108,6 @@ function BlockListBlock( {
themeSupportsLayout,
...context
} = useContext( PrivateBlockContext );
const { removeBlock } = useDispatch( blockEditorStore );
const onRemove = useCallback(
() => removeBlock( clientId ),
[ clientId, removeBlock ]
);

const parentLayout = useLayout() || {};

Expand Down Expand Up @@ -537,6 +527,9 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
initialPosition
);
},
onRemove() {
removeBlock( ownProps.clientId );
},
toggleSelection( selectionEnabled ) {
toggleSelection( selectionEnabled );
},
Expand Down

0 comments on commit 9306f80

Please sign in to comment.