: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Find all tabbables within node.
const textInputs = external_wp_dom_namespaceObject.focus.tabbable.find(ref.current).filter(node => (0,external_wp_dom_namespaceObject.isTextField)(node));
// If reversed (e.g. merge via backspace), use the last in the set of
const isReverse = -1 === initialPosition;
const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current;
if (!isInsideRootBlock(ref.current, target)) {
// Check to see if element is focussable before a generic caret insert.
if (!ref.current.getAttribute('contenteditable')) {
const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(ref.current);
// Make sure focusElement is valid, contained in the same block, and a form field.
if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0,external_wp_dom_namespaceObject.isFormElement)(focusElement)) {
(0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse);
}, [initialPosition, clientId]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js
function listener(event) {
if (event.defaultPrevented) {
const action = event.type === 'mouseover' ? 'add' : 'remove';
event.currentTarget.classList[action]('is-hovered');
* Adds `is-hovered` class when the block is hovered and in navigation or
function useIsHovered() {
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
node.addEventListener('mouseout', listener);
node.addEventListener('mouseover', listener);
node.removeEventListener('mouseout', listener);
node.removeEventListener('mouseover', listener);
// Remove class in case it lingers.
node.classList.remove('is-hovered');
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.js
* Selects the block if it receives focus.
* @param {string} clientId Block client ID.
function useFocusHandler(clientId) {
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
* Marks the block as selected when focused and not already
* selected. This specifically handles the case where block does not
* set focus on its own (via `setFocus`), typically if there is no
* focusable input in the block.
* @param {FocusEvent} event Focus event.
function onFocus(event) {
// When the whole editor is editable, let writing flow handle
if (node.parentElement.closest('[contenteditable="true"]')) {
// Check synchronously because a non-selected block might be
// getting data through `useSelect` asynchronously.
if (isBlockSelected(clientId)) {
// Potentially change selection away from rich text.
if (!event.target.isContentEditable) {
selectionChange(clientId);
// If an inner block is focussed, that block is resposible for
// setting the selected block.
if (!isInsideRootBlock(node, event.target)) {
node.addEventListener('focusin', onFocus);
node.removeEventListener('focusin', onFocus);
}, [isBlockSelected, selectBlock]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js
* - Removes the block on BACKSPACE.
* - Inserts a default block on ENTER.
* - Disables dragging of block contents.
* @param {string} clientId Block client ID.
function useEventHandlers({
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
* Interprets keydown event intent to remove or insert after block if
* key event occurs on wrapper node. This can occur when the block has
* no text fields of its own, particularly after initial insertion, to
* allow for easy deletion and continuous writing flow to add additional
* @param {KeyboardEvent} event Keydown event.
function onKeyDown(event) {
if (keyCode !== external_wp_keycodes_namespaceObject.ENTER && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.DELETE) {
if (target !== node || (0,external_wp_dom_namespaceObject.isTextField)(target)) {
if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
insertAfterBlock(clientId);
* Prevents default dragging behavior within a block. To do: we must
* handle this in the future and clean up the drag target.
* @param {DragEvent} event Drag event.
function onDragStart(event) {
node.addEventListener('keydown', onKeyDown);
node.addEventListener('dragstart', onDragStart);
node.removeEventListener('keydown', onKeyDown);
node.removeEventListener('dragstart', onDragStart);
}, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertAfterBlock, removeBlock]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-nav-mode-exit.js
* Allows navigation mode to be exited by clicking in the selected block.
* @param {string} clientId Block client ID.
function useNavModeExit(clientId) {
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
function onMouseDown(event) {
// Don't select a block if it's already handled by a child
if (isNavigationMode() && !event.defaultPrevented) {
// Prevent focus from moving to the block.
// When clicking on a selected block, exit navigation mode.
if (isBlockSelected(clientId)) {
setNavigationMode(false);
node.addEventListener('mousedown', onMouseDown);
node.removeEventListener('mousedown', onMouseDown);
}, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
function useIntersectionObserver() {
const observer = (0,external_wp_element_namespaceObject.useContext)(block_list_IntersectionObserver);
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
observer.unobserve(node);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js
function useScrollIntoView({
const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
if (!defaultView.IntersectionObserver) {
const observer = new defaultView.IntersectionObserver(entries => {
// Once observing starts, we always get an initial
// entry with the intersecting state.
if (!entries[0].isIntersecting) {
behavior: prefersReducedMotion ? 'instant' : 'smooth'
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-flash-editable-blocks/index.js
function useFlashEditableBlocks({
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
const flashEditableBlocks = () => {
getEnabledClientIdsTree(clientId).forEach(({
const block = element.querySelector(`[data-block="${id}"]`);
block.classList.remove('has-editable-outline');
// Force reflow to trigger the animation.
// eslint-disable-next-line no-unused-expressions
block.classList.add('has-editable-outline');
const handleClick = event => {
const shouldFlash = event.target === element || event.target.classList.contains('is-root-container');
if (event.defaultPrevented) {
element.addEventListener('click', handleClick);
return () => element.removeEventListener('click', handleClick);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js
* This hook is used to lightly mark an element as a block element. The element
* should be the outermost element of a block. Call this hook and pass the
* returned props to the element to mark as a block. If you define a ref for the
* element, it is important to pass the ref to this hook, which the hook in turn
* will pass to the component through the props it returns. Optionally, you can
* also pass any other props through this hook, and they will be merged and
* Use of this hook on the outermost element of a block is required if using API >= v2.
* import { useBlockProps } from '@wordpress/block-editor';
* export default function Edit() {
* const blockProps = useBlockProps(
* className: 'my-custom-class',
* backgroundColor: '#eeeeee'
* <div { ...blockProps }>
* @param {Object} props Optional. Props to pass to the element. Must contain
* the ref if one is defined.
* @param {Object} options Options for internal use only.
* @param {boolean} options.__unstableIsHtml
* @return {Object} Props to pass to the element to mark as a block.
function use_block_props_useBlockProps(props = {}, {
isTemporarilyEditingAsBlocks,
} = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext);
// translators: %s: Type of block (i.e. Text, Image etc)
const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle);
const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : '';
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useFocusFirstElement({
}), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({
}), useNavModeExit(clientId), useIsHovered(), useIntersectionObserver(), use_moving_animation({
triggerAnimationOnChange: index,
}), (0,external_wp_compose_namespaceObject.useDisabled)({
}), useFlashEditableBlocks({
isEnabled: name === 'core/block' || templateLock === 'contentOnly'