: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
getSelectedBlockClientIds,
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlockClientId = selectedBlockClientIds[0];
const blockRootClientId = getBlockRootClientId(selectedBlockClientId);
const parents = getBlockParents(selectedBlockClientId);
const firstParentClientId = parents[parents.length - 1];
const parentBlockName = getBlockName(firstParentClientId);
const parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName);
const _isDefaultEditingMode = getBlockEditingMode(selectedBlockClientId) === 'default';
const _blockName = getBlockName(selectedBlockClientId);
const isValid = selectedBlockClientIds.every(id => isBlockValid(id));
const isVisual = selectedBlockClientIds.every(id => getBlockMode(id) === 'visual');
const _isUsingBindings = selectedBlockClientIds.every(clientId => !!getBlockAttributes(clientId)?.metadata?.bindings);
blockClientId: selectedBlockClientId,
blockClientIds: selectedBlockClientIds,
isDefaultEditingMode: _isDefaultEditingMode,
blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(_blockName),
shouldShowVisualToolbar: isValid && isVisual,
rootClientId: blockRootClientId,
toolbarKey: `${selectedBlockClientId}${firstParentClientId}`,
showParentSelector: parentBlockType && getBlockEditingMode(firstParentClientId) === 'default' && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length === 1 && _isDefaultEditingMode,
isUsingBindings: _isUsingBindings
const toolbarWrapperRef = (0,external_wp_element_namespaceObject.useRef)(null);
// Handles highlighting the current block outline on hover or focus of the
// block type toolbar area.
const nodeRef = (0,external_wp_element_namespaceObject.useRef)();
const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures({
const isLargeViewport = !(0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
const hasBlockToolbar = useHasBlockToolbar();
const isMultiToolbar = blockClientIds.length > 1;
const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType);
// Shifts the toolbar to make room for the parent block selector.
const classes = dist_clsx('block-editor-block-contextual-toolbar', {
'has-parent': showParentSelector
const innerClasses = dist_clsx('block-editor-block-toolbar', {
'is-connected': isUsingBindings
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableToolbar, {
focusEditorOnEscape: true,
/* translators: accessibility text for the block toolbar */,
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block tools')
// The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover.
variant: variant === 'toolbar' ? undefined : variant,
focusOnMount: focusOnMount,
__experimentalInitialIndex: __experimentalInitialIndex,
__experimentalOnIndexChange: __experimentalOnIndexChange
// Resets the index whenever the active block changes so
// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [!isMultiToolbar && isLargeViewport && isDefaultEditingMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockParentSelector, {}), (shouldShowVisualToolbar || isMultiToolbar) && (isDefaultEditingMode || isSynced) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
...showHoveredOrFocusedGestures,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, {
className: "block-editor-block-toolbar__block-controls",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_switcher, {
clientIds: blockClientIds,
disabled: !isDefaultEditingMode,
isUsingBindings: isUsingBindings
}), isDefaultEditingMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [!isMultiToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockToolbar, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_mover, {
clientIds: blockClientIds,
hideDragHandle: hideDragHandle
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Shuffle, {
}), shouldShowVisualToolbar && isMultiToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar, {}), shouldShowVisualToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, {
className: "block-editor-block-toolbar__slot"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, {
className: "block-editor-block-toolbar__slot"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, {
className: "block-editor-block-toolbar__slot"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, {
className: "block-editor-block-toolbar__slot"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, {
className: "block-editor-block-toolbar__slot"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_name_context.Provider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_toolbar_last_item.Slot, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEditVisuallyButton, {
clientIds: blockClientIds
}), isDefaultEditingMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu, {
clientIds: blockClientIds
* Renders the block toolbar.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md
* @param {Object} props Components props.
* @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality.
* @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockToolbar, {
hideDragHandle: hideDragHandle,
__experimentalInitialIndex: undefined,
__experimentalOnIndexChange: undefined
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-toolbar-popover.js
function BlockToolbarPopover({
} = useSelectedBlockToolProps(clientId);
// Stores the active toolbar item index so the block toolbar can return focus
// to it when re-mounting.
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Resets the index whenever the active block changes so this is not
// persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
initialToolbarItemIndexRef.current = undefined;
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isToolbarForced = (0,external_wp_element_namespaceObject.useRef)(false);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
isToolbarForced.current = true;
(0,external_wp_element_namespaceObject.useEffect)(() => {
isToolbarForced.current = false;
const popoverProps = useBlockToolbarPopoverProps({
contentElement: __unstableContentRef?.current,
return !isTyping && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_popover, {
clientId: capturingClientId || clientId,
bottomClientId: lastClientId,
className: dist_clsx('block-editor-block-list__block-popover', {
'is-insertion-point-visible': isInsertionPointVisible
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockToolbar
// If the toolbar is being shown because of being forced
// it should focus the toolbar right after the mount.
focusOnMount: isToolbarForced.current,
__experimentalInitialIndex: initialToolbarItemIndexRef.current,
__experimentalOnIndexChange: index => {
initialToolbarItemIndexRef.current = index;
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/trash.js
const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"
/* harmony default export */ const library_trash = (trash);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-selection-button.js
* Block selection button component, displaying the label of the block. If the block
* descends from a root block, a button is displayed enabling the user to select
* @param {string} props Component props.
* @param {string} props.clientId Client ID of block.
* @return {Component} The component to be rendered.
function BlockSelectionButton({
const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
getPreviousBlockClientId,
} = select(external_wp_blocks_namespaceObject.store);
const index = getBlockIndex(clientId);
const blockType = getBlockType(name);
const orientation = getBlockListSettings(rootClientId)?.orientation;
const match = getActiveBlockVariation(name, attributes);
const isBlockTemplatePart = blockType?.name === 'core/template-part';
let isNextBlockTemplatePart = false;
const nextClientId = getNextBlockClientId();
} = getBlock(nextClientId);
const nextBlockType = getBlockType(nextName);
isNextBlockTemplatePart = nextBlockType?.name === 'core/template-part';
let isPrevBlockTemplatePart = false;
const prevClientId = getPreviousBlockClientId();
} = getBlock(prevClientId);
const prevBlockType = getBlockType(prevName);
isPrevBlockTemplatePart = prevBlockType?.name === 'core/template-part';
blockMovingMode: hasBlockMovingClientId(),
editorMode: __unstableGetEditorMode(),
icon: match?.icon || blockType.icon,
label: (0,external_wp_blocks_namespaceObject.__experimentalGetAccessibleBlockLabel)(blockType, attributes, index + 1, orientation),
canRemove: canRemoveBlock(clientId),
canMove: canMoveBlock(clientId)
}, [clientId, rootClientId]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const ref = (0,external_wp_element_namespaceObject.useRef)();
// Focus the breadcrumb in navigation mode.
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (editorMode === 'navigation') {
(0,external_wp_a11y_namespaceObject.speak)(label);
const blockElement = useBlockElement(clientId);
getClientIdsOfDescendants,
getSelectedBlockClientId,
getMultiSelectedBlocksEndClientId,
getPreviousBlockClientId,
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
function onKeyDown(event) {
const isUp = keyCode === external_wp_keycodes_namespaceObject.UP;
const isDown = keyCode === external_wp_keycodes_namespaceObject.DOWN;
const isLeft = keyCode === external_wp_keycodes_namespaceObject.LEFT;
const isRight = keyCode === external_wp_keycodes_namespaceObject.RIGHT;
const isTab = keyCode === external_wp_keycodes_namespaceObject.TAB;
const isEscape = keyCode === external_wp_keycodes_namespaceObject.ESCAPE;
const isEnter = keyCode === external_wp_keycodes_namespaceObject.ENTER;
const isSpace = keyCode === external_wp_keycodes_namespaceObject.SPACE;
const isShift = event.shiftKey;
if (isEscape && editorMode === 'navigation') {
setNavigationMode(false);
if (keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || keyCode === external_wp_keycodes_namespaceObject.DELETE) {
const selectedBlockClientId = getSelectedBlockClientId();
const selectionEndClientId = getMultiSelectedBlocksEndClientId();
const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
const navigateUp = isTab && isShift || isUp;
const navigateDown = isTab && !isShift || isDown;
// Move out of current nesting level (no effect if at root level).
const navigateOut = isLeft;
// Move into next nesting level (no effect if the current block has no innerBlocks).
const navigateIn = isRight;
focusedBlockUid = selectionBeforeEndClientId;
} else if (navigateDown) {
focusedBlockUid = selectionAfterEndClientId;
} else if (navigateOut) {
var _getBlockRootClientId;
focusedBlockUid = (_getBlockRootClientId = getBlockRootClientId(selectedBlockClientId)) !== null && _getBlockRootClientId !== void 0 ? _getBlockRootClientId : selectedBlockClientId;
var _getClientIdsOfDescen;
focusedBlockUid = (_getClientIdsOfDescen = getClientIdsOfDescendants(selectedBlockClientId)[0]) !== null && _getClientIdsOfDescen !== void 0 ? _getClientIdsOfDescen : selectedBlockClientId;
const startingBlockClientId = hasBlockMovingClientId();
if (isEscape && startingBlockClientId && !event.defaultPrevented) {
setBlockMovingClientId(null);
if ((isEnter || isSpace) && startingBlockClientId) {
const sourceRoot = getBlockRootClientId(startingBlockClientId);
const destRoot = getBlockRootClientId(selectedBlockClientId);
const sourceBlockIndex = getBlockIndex(startingBlockClientId);
let destinationBlockIndex = getBlockIndex(selectedBlockClientId);
if (sourceBlockIndex < destinationBlockIndex && sourceRoot === destRoot) {
destinationBlockIndex -= 1;
moveBlockToPosition(startingBlockClientId, sourceRoot, destRoot, destinationBlockIndex);
selectBlock(startingBlockClientId);
setBlockMovingClientId(null);
// Prevent the block from being moved into itself.
if (startingBlockClientId && selectedBlockClientId === startingBlockClientId && navigateIn) {
if (navigateDown || navigateUp || navigateOut || navigateIn) {
selectBlock(focusedBlockUid);
} else if (isTab && selectedBlockClientId) {
nextTabbable = blockElement;
nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(nextTabbable);
} while (nextTabbable && blockElement.contains(nextTabbable));
nextTabbable = blockElement.ownerDocument.defaultView.frameElement;
nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(nextTabbable);
nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findPrevious(blockElement);
const classNames = dist_clsx('block-editor-block-list__block-selection-button', {
'is-block-moving-mode': !!blockMovingMode
const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag');
const showBlockDraggable = canMove && editorMode === 'navigation' || editorMode === 'zoom-out' && canMove && !isBlockTemplatePart;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
className: "block-editor-block-list__block-selection-button__content",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
}), showBlockDraggable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_draggable, {
children: draggableProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "block-selection-button_drag-handle",
// Should not be able to tab to drag handle as this
// button can only be used with a pointer device.
}), editorMode === 'zoom-out' && !isBlockTemplatePart && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_mover, {