: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const selectedBlockClientIds = getSelectedBlockClientIds();
const selectedBlocks = getBlocksByClientId(selectedBlockClientIds);
// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.
// These nulls will cause fatal errors down the line.
// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.
// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536
if (selectedBlocks.filter(block => !block).length > 0) {
const rootClientId = getBlockRootClientId(selectedBlockClientIds[0]);
clientIds: selectedBlockClientIds,
possibleBlockTransformations: getBlockTransformItems(selectedBlocks, rootClientId),
canRemove: canRemoveBlocks(selectedBlockClientIds),
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]);
function selectForMultipleBlocks(insertedBlocks) {
if (insertedBlocks.length > 1) {
multiSelect(insertedBlocks[0].clientId, insertedBlocks[insertedBlocks.length - 1].clientId);
// Simple block tranformation based on the `Block Transforms` API.
function onBlockTransform(name) {
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name);
replaceBlocks(clientIds, newBlocks);
selectForMultipleBlocks(newBlocks);
* The `isTemplate` check is a stopgap solution here.
* Ideally, the Transforms API should handle this
* by allowing to exclude blocks from wildcard transformations.
const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate;
if (!clientIds || clientIds.length < 1 || !hasPossibleBlockTransformations) {
const commands = possibleBlockTransformations.map(transformation => {
name: 'core/block-editor/transform-to-' + name.replace('/', '-'),
// translators: %s: block title/name.
label: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Transform to %s'), title),
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
const useActionsCommands = () => {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getSelectedBlockClientIds
const selectedBlockClientIds = getSelectedBlockClientIds();
clientIds: selectedBlockClientIds
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!clientIds || clientIds.length < 1) {
const rootClientId = getBlockRootClientId(clientIds[0]);
const canMove = canMoveBlocks(clientIds) && getBlockCount(rootClientId) !== 1;
label: (0,external_wp_i18n_namespaceObject.__)('Move to'),
selectBlock(clientIds[0]);
setBlockMovingClientId(clientIds[0]);
commands: commands.map(command => ({
name: 'core/block-editor/action-' + command.name,
const useQuickActionsCommands = () => {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getSelectedBlockClientIds,
isUngroupable: _isUngroupable,
isGroupable: _isGroupable
const selectedBlockClientIds = getSelectedBlockClientIds();
clientIds: selectedBlockClientIds,
isUngroupable: _isUngroupable(),
isGroupable: _isGroupable()
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const blocks = getBlocksByClientId(clientIds);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const groupingBlockName = getGroupingBlockName();
// Activate the `transform` on `core/group` which does the conversion.
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName);
replaceBlocks(clientIds, newBlocks);
const onUngroup = () => {
const innerBlocks = blocks[0].innerBlocks;
if (!innerBlocks.length) {
replaceBlocks(clientIds, innerBlocks);
if (!clientIds || clientIds.length < 1) {
const rootClientId = getBlockRootClientId(clientIds[0]);
const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId);
const canDuplicate = blocks.every(block => {
return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId);
const canRemove = canRemoveBlocks(clientIds);
label: (0,external_wp_i18n_namespaceObject.__)('Duplicate'),
callback: () => duplicateBlocks(clientIds, true),
if (canInsertDefaultBlock) {
label: (0,external_wp_i18n_namespaceObject.__)('Add before'),
const clientId = Array.isArray(clientIds) ? clientIds[0] : clientId;
insertBeforeBlock(clientId);
label: (0,external_wp_i18n_namespaceObject.__)('Add after'),
const clientId = Array.isArray(clientIds) ? clientIds[clientIds.length - 1] : clientId;
insertAfterBlock(clientId);
label: (0,external_wp_i18n_namespaceObject.__)('Group'),
label: (0,external_wp_i18n_namespaceObject.__)('Ungroup'),
label: (0,external_wp_i18n_namespaceObject.__)('Delete'),
callback: () => removeBlocks(clientIds, true),
commands: commands.map(command => ({
name: 'core/block-editor/action-' + command.name,
const useBlockCommands = () => {
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: 'core/block-editor/blockTransforms',
hook: useTransformCommands
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: 'core/block-editor/blockActions',
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: 'core/block-editor/blockQuickActions',
hook: useQuickActionsCommands,
context: 'block-selection-edit'
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-canvas/index.js
function ExperimentalBlockCanvas({
children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockList, {}),
contentRef: contentRefProp,
const resetTypingRef = useMouseMoveTypingReset();
const clearerRef = useBlockSelectionClearer();
const localRef = (0,external_wp_element_namespaceObject.useRef)();
const contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRefProp, clearerRef, localRef]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockTools, {
__unstableContentRef: localRef,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, {
scope: ".editor-styles-wrapper"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(writing_flow, {
className: "editor-styles-wrapper",
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTools, {
__unstableContentRef: localRef,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(iframe, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, {
* BlockCanvas component is a component used to display the canvas of the block editor.
* What we call the canvas is an iframe containing the block list that you can manipulate.
* The component is also responsible of wiring up all the necessary hooks to enable
* the keyboard navigation across blocks in the editor and inject content styles into the iframe.
* function MyBlockEditor() {
* const [ blocks, updateBlocks ] = useState([]);
* onInput={ updateBlocks }
* onChange={ persistBlocks }
* <BlockCanvas height="400px" />
* @param {Object} props Component props.
* @param {string} props.height Canvas height, defaults to 300px.
* @param {Array} props.styles Content styles to inject into the iframe.
* @param {Element} props.children Content of the canvas, defaults to the BlockList component.
* @return {Element} Block Breadcrumb.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockCanvas, {
/* harmony default export */ const block_canvas = (BlockCanvas);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js
const ColorSelectorSVGIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"
* Color Selector Icon component.
* @param {Object} props Component properties.
* @param {Object} props.style Style object.
* @param {string} props.className Class name for component.
* @return {*} React Icon component.
const ColorSelectorIcon = ({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-library-colors-selector__icon-container",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: `${className} block-library-colors-selector__state-selection`,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorSVGIcon, {})
* Renders the Colors Selector Toolbar with the icon button.
* @param {Object} props Component properties.
* @param {Object} props.TextColor Text color component that wraps icon.
* @param {Object} props.BackgroundColor Background color component that wraps icon.
* @return {*} React toggle button component.
const renderToggleComponent = ({
const openOnArrowDown = event => {
if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
className: "components-toolbar__control block-library-colors-selector__toggle",
label: (0,external_wp_i18n_namespaceObject.__)('Open Colors Selector'),
onKeyDown: openOnArrowDown,
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundColor, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextColor, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorIcon, {})
const BlockColorsStyleSelector = ({
external_wp_deprecated_default()(`wp.blockEditor.BlockColorsStyleSelector`, {
alternative: 'block supports API',
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
placement: 'bottom-start'
className: "block-library-colors-selector",
contentClassName: "block-library-colors-selector__popover",