: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const customName = metadata?.name;
const hasPatternOverrides = !!customName && !!metadata?.bindings && Object.values(metadata.bindings).some(binding => binding.source === 'core/pattern-overrides');
function onChange(newName) {
updateBlockAttributes([clientId], {
const blockInformation = useBlockDisplayInformation(clientId);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
"aria-expanded": renamingBlock,
"aria-haspopup": "dialog",
children: (0,external_wp_i18n_namespaceObject.__)('Rename')
}), renamingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRenameModal, {
blockName: customName || '',
originalBlockName: blockInformation?.title,
hasOverridesWarning: hasPatternOverrides,
onClose: () => setRenamingBlock(false),
// If the new value is the block's original name (e.g. `Group`)
// or it is an empty string then assume the intent is to reset
// the value. Therefore reset the metadata.
if (newName === blockInformation?.title || isEmptyString(newName)) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js
} = (0,external_wp_components_namespaceObject.createSlotFill)('BlockSettingsMenuControls');
const BlockSettingsMenuControlsSlot = ({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getSelectedBlockClientIds,
const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds();
selectedBlocks: getBlockNamesByClientId(ids),
isContentOnly: getBlockEditingMode(ids[0]) === 'contentOnly'
} = useBlockLock(selectedClientIds[0]);
} = useBlockRename(selectedBlocks[0]);
const showLockButton = selectedClientIds.length === 1 && canLock && !isContentOnly;
const showRenameButton = selectedClientIds.length === 1 && canRename && !isContentOnly;
// Check if current selection of blocks is Groupable or Ungroupable
// and pass this props down to ConvertToGroupButton.
const convertToGroupButtonProps = useConvertToGroupButtonProps(selectedClientIds);
} = convertToGroupButtonProps;
const showConvertToGroupButton = isGroupable || isUngroupable;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, {
if (!fills?.length > 0 && !showConvertToGroupButton && !showLockButton) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
children: [showConvertToGroupButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToGroupButton, {
...convertToGroupButtonProps,
onClose: fillProps?.onClose
}), showLockButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockMenuItem, {
clientId: selectedClientIds[0]
}), showRenameButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRenameControl, {
clientId: selectedClientIds[0]
}), fills, fillProps?.canMove && !fillProps?.onlyBlock && !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onClick: (0,external_wp_compose_namespaceObject.pipe)(fillProps?.onClose, fillProps?.onMoveTo),
children: (0,external_wp_i18n_namespaceObject.__)('Move to')
}), fillProps?.count === 1 && !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_mode_toggle, {
clientId: fillProps?.firstBlockClientId,
onToggle: fillProps?.onClose
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md
* @param {Object} props Fill props.
* @return {Element} Element.
function BlockSettingsMenuControls({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;
/* harmony default export */ const block_settings_menu_controls = (BlockSettingsMenuControls);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/content-lock-ui.js
// The implementation of content locking is mainly in this file, although the mechanism
// to stop temporarily editing as blocks when an outside block is selected is on component StopEditingAsBlocksOnOutsideSelect
// at block-editor/src/components/block-list/index.js.
// Besides the components on this file and the file referenced above the implementation
// also includes artifacts on the store (actions, reducers, and selector).
function ContentLockControlsPure({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getTemporarilyEditingAsBlocks
} = unlock(select(store));
templateLock: getTemplateLock(clientId),
isLockedByParent: !!getContentLockingParent(clientId),
isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const isContentLocked = !isLockedByParent && templateLock === 'contentOnly';
const stopEditingAsBlockCallback = (0,external_wp_element_namespaceObject.useCallback)(() => {
stopEditingAsBlocks(clientId);
}, [clientId, stopEditingAsBlocks]);
if (!isContentLocked && !isEditingAsBlocks) {
const showStopEditingAsBlocks = isEditingAsBlocks && !isContentLocked;
const showStartEditingAsBlocks = !isEditingAsBlocks && isContentLocked && isSelected;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [showStopEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: stopEditingAsBlockCallback,
children: (0,external_wp_i18n_namespaceObject.__)('Done')
}), showStartEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu_controls, {
}) => selectedClientIds.length === 1 && selectedClientIds[0] === clientId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
modifyContentLockBlock(clientId);
children: (0,external_wp_i18n_namespaceObject.__)('Modify')
/* harmony default export */ const content_lock_ui = ({
edit: ContentLockControlsPure,
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/metadata.js
const META_ATTRIBUTE_NAME = 'metadata';
* Filters registered block settings, extending attributes to include `metadata`.
* see: https://github.com/WordPress/gutenberg/pull/40393/files#r864632012
* @param {Object} blockTypeSettings Original block settings.
* @return {Object} Filtered block settings.
function addMetaAttribute(blockTypeSettings) {
// Allow blocks to specify their own attribute definition with default values if needed.
if (blockTypeSettings?.attributes?.[META_ATTRIBUTE_NAME]?.type) {
return blockTypeSettings;
blockTypeSettings.attributes = {
...blockTypeSettings.attributes,
return blockTypeSettings;
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/metadata/addMetaAttribute', addMetaAttribute);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
const blockDefault = /*#__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: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
/* harmony default export */ const block_default = (blockDefault);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js
if (icon?.src === 'block-default') {
const renderedIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
icon: icon && icon.src ? icon.src : icon,
const style = showColors ? {
backgroundColor: icon && icon.background,
color: icon && icon.foreground
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: dist_clsx('block-editor-block-icon', className, {
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-icon/README.md
/* harmony default export */ const block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/block-hooks.js
const block_hooks_EMPTY_OBJECT = {};
function BlockHooksControlPure({
const blockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockTypes(), []);
// A hooked block added via a filter will not be exposed through a block
// type's `blockHooks` property; however, if the containing layout has been
// modified, it will be present in the anchor block's `ignoredHookedBlocks`
const hookedBlocksForCurrentBlock = (0,external_wp_element_namespaceObject.useMemo)(() => blockTypes?.filter(({
}) => blockHooks && name in blockHooks || ignoredHookedBlocks.includes(blockName)), [blockTypes, name, ignoredHookedBlocks]);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
blockIndex: getBlockIndex(clientId),
innerBlocksLength: getBlocks(clientId)?.length,
rootClientId: getBlockRootClientId(clientId)
const hookedBlockClientIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce((clientIds, block) => {
// If the block doesn't exist anywhere in the block tree,
// we know that we have to set the toggle to disabled.
if (getGlobalBlockCount(block.name) === 0) {
const relativePosition = block?.blockHooks?.[name];
switch (relativePosition) {
// Any of the current block's siblings (with the right block type) qualifies
// as a hooked block (inserted `before` or `after` the current one), as the block
// might've been automatically inserted and then moved around a bit by the user.
candidates = getBlocks(rootClientId);
// Any of the current block's child blocks (with the right block type) qualifies
// as a hooked first or last child block, as the block might've been automatically
// inserted and then moved around a bit by the user.
candidates = getBlocks(clientId);
// If we haven't found a blockHooks field with a relative position for the hooked
// block, it means that it was added by a filter. In this case, we look for the block
// both among the current block's siblings and its children.
candidates = [...getBlocks(rootClientId), ...getBlocks(clientId)];
const hookedBlock = candidates?.find(candidate => candidate.name === block.name);
// If the block exists in the designated location, we consider it hooked
// and show the toggle as enabled.
[block.name]: hookedBlock.clientId
// If no hooked block was found in any of its designated locations,
// we set the toggle to disabled.
if (Object.values(_hookedBlockClientIds).length > 0) {
return _hookedBlockClientIds;
return block_hooks_EMPTY_OBJECT;
}, [hookedBlocksForCurrentBlock, name, clientId, rootClientId]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!hookedBlocksForCurrentBlock.length) {
// Group by block namespace (i.e. prefix before the slash).
const groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce((groups, block) => {
const [namespace] = block.name.split('/');
if (!groups[namespace]) {
groups[namespace].push(block);
const insertBlockIntoDesignatedLocation = (block, relativePosition) => {
switch (relativePosition) {
insertBlock(block, relativePosition === 'after' ? blockIndex + 1 : blockIndex, rootClientId,
// Insert as a child of the current block's parent
// TODO: It'd be great if insertBlock() would accept negative indices for insertion.
relativePosition === 'first_child' ? 0 : innerBlocksLength, clientId,
// Insert as a child of the current block.
// If we do not know the relative position, it is because the block was
// added via a filter. In this case, we default to inserting it after the
insertBlock(block, blockIndex + 1, rootClientId,
// Insert as a child of the current block's parent
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
className: "block-editor-hooks__block-hooks",
title: (0,external_wp_i18n_namespaceObject.__)('Plugins'),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "block-editor-hooks__block-hooks-helptext",
children: (0,external_wp_i18n_namespaceObject.__)('Manage the inclusion of blocks added automatically by plugins.')
}), Object.keys(groupedHookedBlocks).map(vendor => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", {
}), groupedHookedBlocks[vendor].map(block => {
const checked = (block.name in hookedBlockClientIds);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {