diff --git a/packages/block-editor/src/components/use-block-drop-zone/index.js b/packages/block-editor/src/components/use-block-drop-zone/index.js index 851661e46a9d0..ff4d52aaa493b 100644 --- a/packages/block-editor/src/components/use-block-drop-zone/index.js +++ b/packages/block-editor/src/components/use-block-drop-zone/index.js @@ -274,6 +274,23 @@ export function isDropTargetValid( return areBlocksAllowed && targetMatchesDraggedBlockParents; } +/** + * Checks if the given element is an insertion point. + * + * @param {EventTarget|null} targetToCheck - The element to check. + * @param {Document} ownerDocument - The owner document of the element. + * @return {boolean} True if the element is a insertion point, false otherwise. + */ +function isInsertionPoint( targetToCheck, ownerDocument ) { + const { defaultView } = ownerDocument; + + return !! ( + defaultView && + targetToCheck instanceof defaultView.HTMLElement && + targetToCheck.dataset.isInsertionPoint + ); +} + /** * @typedef {Object} WPBlockDropZoneConfig * @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone. @@ -515,23 +532,6 @@ export default function useBlockDropZone( { 200 ); - /** - * Checks if the given element is an insertion point. - * - * @param {EventTarget|null} targetToCheck - The element to check. - * @param {Document} ownerDocument - The owner document of the element. - * @return {boolean} True if the element is a insertion point, false otherwise. - */ - function isInsertionPoint( targetToCheck, ownerDocument ) { - const { defaultView } = ownerDocument; - - return !! ( - defaultView && - targetToCheck instanceof defaultView.HTMLElement && - targetToCheck.dataset.isInsertionPoint - ); - } - return useDropZone( { dropZoneElement, isDisabled,