: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
children: patterns.map(pattern => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu_BlockPattern, {
function pattern_transformations_menu_BlockPattern({
// TODO check pattern/preview width...
const baseClassName = 'block-editor-block-switcher__preview-patterns-container';
const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(pattern_transformations_menu_BlockPattern, `${baseClassName}-list__item-description`);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: `${baseClassName}-list__list-item`,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(pattern_transformations_menu_CompositeItem, {
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
"aria-label": pattern.title,
"aria-describedby": pattern.description ? descriptionId : undefined,
className: `${baseClassName}-list__item`
onClick: () => onSelect(pattern.transformedBlocks),
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, {
blocks: pattern.transformedBlocks,
viewportWidth: pattern.viewportWidth || 500
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: `${baseClassName}-list__item-title`,
}), !!pattern.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: pattern.description
/* harmony default export */ const pattern_transformations_menu = (PatternTransformationsMenu);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js
function BlockSwitcherDropdownMenuContents({
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
possibleBlockTransformations,
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
__experimentalGetPatternTransformItems
const rootClientId = getBlockRootClientId(Array.isArray(clientIds) ? clientIds[0] : clientIds);
const _blocks = getBlocksByClientId(clientIds);
possibleBlockTransformations: getBlockTransformItems(_blocks, rootClientId),
patterns: __experimentalGetPatternTransformItems(_blocks, rootClientId)
const blockVariationTransformations = useBlockVariationTransforms({
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);
function onBlockVariationTransform(name) {
updateBlockAttributes(blocks[0].clientId, {
...blockVariationTransformations.find(({
}) => variationName === name).attributes
// Pattern transformation through the `Patterns` API.
function onPatternTransform(transformedBlocks) {
replaceBlocks(clientIds, transformedBlocks);
selectForMultipleBlocks(transformedBlocks);
* The `isTemplate` check is a stopgap solution here.
* Ideally, the Transforms API should handle this
* by allowing to exclude blocks from wildcard transformations.
const isSingleBlock = blocks.length === 1;
const isTemplate = isSingleBlock && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]);
const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate;
const hasPossibleBlockVariationTransformations = !!blockVariationTransformations?.length;
const hasPatternTransformation = !!patterns?.length && canRemove;
const hasBlockOrBlockVariationTransforms = hasPossibleBlockTransformations || hasPossibleBlockVariationTransformations;
const hasContents = hasBlockStyles || hasBlockOrBlockVariationTransforms || hasPatternTransformation;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "block-editor-block-switcher__no-transforms",
children: (0,external_wp_i18n_namespaceObject.__)('No transforms.')
const connectedBlockDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject._x)('This block is connected.', 'block toolbar button label and description') : (0,external_wp_i18n_namespaceObject._x)('These blocks are connected.', 'block toolbar button label and description');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "block-editor-block-switcher__container",
children: [hasPatternTransformation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu, {
onSelect: transformedBlocks => {
onPatternTransform(transformedBlocks);
}), hasBlockOrBlockVariationTransforms && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_transformations_menu, {
className: "block-editor-block-switcher__transforms__menugroup",
possibleBlockTransformations: possibleBlockTransformations,
possibleBlockVariationTransformations: blockVariationTransformations,
onSelectVariation: name => {
onBlockVariationTransform(name);
}), hasBlockStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesMenu, {
}), isUsingBindings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
className: "block-editor-block-switcher__binding-indicator",
children: connectedBlockDescription
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blocks_namespaceObject.store);
const _blocks = getBlocksByClientId(clientIds);
if (!_blocks.length || _blocks.some(block => !block)) {
const _isSingleBlockSelected = _blocks.length === 1;
const blockType = getBlockType(firstBlockName);
if (_isSingleBlockSelected) {
const match = getActiveBlockVariation(firstBlockName, getBlockAttributes(clientIds[0]));
// Take into account active block variations.
_icon = match?.icon || blockType.icon;
const isSelectionOfSameType = new Set(_blocks.map(({
// When selection consists of blocks of multiple types, display an
// appropriate icon to communicate the non-uniformity.
_icon = isSelectionOfSameType ? blockType.icon : library_copy;
canRemove: canRemoveBlocks(clientIds),
hasBlockStyles: _isSingleBlockSelected && !!getBlockStyles(firstBlockName)?.length,
isReusable: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isReusableBlock)(_blocks[0]),
isTemplate: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isTemplatePart)(_blocks[0])
const blockTitle = useBlockDisplayTitle({
clientId: clientIds?.[0],
const isSingleBlock = clientIds.length === 1;
const blockSwitcherLabel = isSingleBlock ? blockTitle : (0,external_wp_i18n_namespaceObject.__)('Multiple blocks selected');
const hideDropdown = disabled || !hasBlockStyles && !canRemove;
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: "block-editor-block-switcher__no-switcher-icon",
title: blockSwitcherLabel,
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
}), (isReusable || isTemplate) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-block-switcher__toggle-text",
const blockSwitcherDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject.__)('Change block type or style') : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of blocks. */
(0,external_wp_i18n_namespaceObject._n)('Change type of %d block', 'Change type of %d blocks', clientIds.length), clientIds.length);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, {
children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
className: "block-editor-block-switcher",
label: blockSwitcherLabel,
placement: 'bottom-start',
className: 'block-editor-block-switcher__popover'
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
className: "block-editor-block-switcher__toggle",
}), (isReusable || isTemplate) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "block-editor-block-switcher__toggle-text",
describedBy: blockSwitcherDescription,
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSwitcherDropdownMenuContents, {
hasBlockStyles: hasBlockStyles,
isUsingBindings: isUsingBindings
/* harmony default export */ const block_switcher = (BlockSwitcher);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-toolbar-last-item.js
Fill: __unstableBlockToolbarLastItem,
Slot: block_toolbar_last_item_Slot
} = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockToolbarLastItem');
__unstableBlockToolbarLastItem.Slot = block_toolbar_last_item_Slot;
/* harmony default export */ const block_toolbar_last_item = (__unstableBlockToolbarLastItem);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/supports.js
const ALIGN_SUPPORT_KEY = 'align';
const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
const supports_BORDER_SUPPORT_KEY = '__experimentalBorder';
const supports_COLOR_SUPPORT_KEY = 'color';
const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
const supports_FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
const supports_FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
const supports_LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
* Key within block settings' support array indicating support for font style.
const supports_FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
* Key within block settings' support array indicating support for font weight.
const supports_FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
* Key within block settings' supports array indicating support for text
* align e.g. settings found in `block.json`.
const supports_TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';
* Key within block settings' supports array indicating support for text
* columns e.g. settings found in `block.json`.
const supports_TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
* Key within block settings' supports array indicating support for text
* decorations e.g. settings found in `block.json`.
const supports_TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
* Key within block settings' supports array indicating support for writing mode
* e.g. settings found in `block.json`.
const supports_WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
* Key within block settings' supports array indicating support for text
* transforms e.g. settings found in `block.json`.
const supports_TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
* Key within block settings' supports array indicating support for letter-spacing
* e.g. settings found in `block.json`.
const supports_LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
const LAYOUT_SUPPORT_KEY = 'layout';
const supports_TYPOGRAPHY_SUPPORT_KEYS = [supports_LINE_HEIGHT_SUPPORT_KEY, supports_FONT_SIZE_SUPPORT_KEY, supports_FONT_STYLE_SUPPORT_KEY, supports_FONT_WEIGHT_SUPPORT_KEY, supports_FONT_FAMILY_SUPPORT_KEY, supports_TEXT_ALIGN_SUPPORT_KEY, supports_TEXT_COLUMNS_SUPPORT_KEY, supports_TEXT_DECORATION_SUPPORT_KEY, supports_TEXT_TRANSFORM_SUPPORT_KEY, supports_WRITING_MODE_SUPPORT_KEY, supports_LETTER_SPACING_SUPPORT_KEY];
const EFFECTS_SUPPORT_KEYS = ['shadow'];
const supports_SPACING_SUPPORT_KEY = 'spacing';
const supports_styleSupportKeys = [...EFFECTS_SUPPORT_KEYS, ...supports_TYPOGRAPHY_SUPPORT_KEYS, supports_BORDER_SUPPORT_KEY, supports_COLOR_SUPPORT_KEY, supports_SPACING_SUPPORT_KEY];
* Returns true if the block defines support for align.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasAlignSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, ALIGN_SUPPORT_KEY);
* Returns the block support value for align, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getAlignSupport = nameOrType => getBlockSupport(nameOrType, ALIGN_SUPPORT_KEY);
* Returns true if the block defines support for align wide.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasAlignWideSupport = nameOrType => hasBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
* Returns the block support value for align wide, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getAlignWideSupport = nameOrType => getBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY);
* Determine whether there is block support for border properties.
* @param {string|Object} nameOrType Block name or type object.
* @param {string} feature Border feature to check support for.
* @return {boolean} Whether there is support.
function supports_hasBorderSupport(nameOrType, feature = 'any') {
if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_BORDER_SUPPORT_KEY);
return !!(support?.color || support?.radius || support?.width || support?.style);
return !!support?.[feature];
* Get block support for border properties.
* @param {string|Object} nameOrType Block name or type object.
* @param {string} feature Border feature to get.
* @return {unknown} The block support.
const getBorderSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_BORDER_SUPPORT_KEY, feature]);
* Returns true if the block defines support for color.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const supports_hasColorSupport = nameOrType => {
const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
* Returns true if the block defines support for link color.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const supports_hasLinkColorSupport = nameOrType => {
if (Platform.OS !== 'web') {
const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.link;
* Returns true if the block defines support for gradient color.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const supports_hasGradientSupport = nameOrType => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.gradients;
* Returns true if the block defines support for background color.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const supports_hasBackgroundColorSupport = nameOrType => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.background !== false;
* Returns true if the block defines support for text-align.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasTextAlignSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY);
* Returns the block support value for text-align, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getTextAlignSupport = nameOrType => getBlockSupport(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY);
* Returns true if the block defines support for background color.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.