: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const supports_hasTextColorSupport = nameOrType => {
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY);
return colorSupport && colorSupport.text !== false;
* Get block support for color properties.
* @param {string|Object} nameOrType Block name or type object.
* @param {string} feature Color feature to get.
* @return {unknown} The block support.
const getColorSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_COLOR_SUPPORT_KEY, feature]);
* Returns true if the block defines support for custom class name.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasCustomClassNameSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true);
* Returns the block support value for custom class name, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getCustomClassNameSupport = nameOrType => getBlockSupport(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true);
* Returns true if the block defines support for font family.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasFontFamilySupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY);
* Returns the block support value for font family, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getFontFamilySupport = nameOrType => getBlockSupport(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY);
* Returns true if the block defines support for font size.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasFontSizeSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_SIZE_SUPPORT_KEY);
* Returns the block support value for font size, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getFontSizeSupport = nameOrType => getBlockSupport(nameOrType, supports_FONT_SIZE_SUPPORT_KEY);
* Returns true if the block defines support for layout.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const hasLayoutSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, LAYOUT_SUPPORT_KEY);
* Returns the block support value for layout, if defined.
* @param {string|Object} nameOrType Block name or type object.
* @return {unknown} The block support value.
const getLayoutSupport = nameOrType => getBlockSupport(nameOrType, LAYOUT_SUPPORT_KEY);
* Returns true if the block defines support for style.
* @param {string|Object} nameOrType Block name or type object.
* @return {boolean} Whether the block supports the feature.
const supports_hasStyleSupport = nameOrType => supports_styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, key));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-paste-styles/index.js
* Determine if the copied text looks like serialized blocks or not.
* Since plain text will always get parsed into a freeform block,
* we check that if the parsed blocks is anything other than that.
* @param {string} text The copied text.
* @return {boolean} True if the text looks like serialized blocks, false otherwise.
function hasSerializedBlocks(text) {
const blocks = (0,external_wp_blocks_namespaceObject.parse)(text, {
__unstableSkipMigrationLogs: true,
__unstableSkipAutop: true
if (blocks.length === 1 && blocks[0].name === 'core/freeform') {
// It's likely that the text is just plain text and not serialized blocks.
// Parsing error, the text is not serialized blocks.
// (Even though that it technically won't happen)
* Style attributes are attributes being added in `block-editor/src/hooks/*`.
* (Except for some unrelated to style like `anchor` or `settings`.)
* They generally represent the default block supports.
const STYLE_ATTRIBUTES = {
borderColor: nameOrType => supports_hasBorderSupport(nameOrType, 'color'),
backgroundColor: supports_hasBackgroundColorSupport,
textAlign: hasTextAlignSupport,
textColor: supports_hasTextColorSupport,
gradient: supports_hasGradientSupport,
className: hasCustomClassNameSupport,
fontFamily: hasFontFamilySupport,
fontSize: hasFontSizeSupport,
layout: hasLayoutSupport,
style: supports_hasStyleSupport
* Get the "style attributes" from a given block to a target block.
* @param {WPBlock} sourceBlock The source block.
* @param {WPBlock} targetBlock The target block.
* @return {Object} the filtered attributes object.
function getStyleAttributes(sourceBlock, targetBlock) {
return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, [attributeKey, hasSupport]) => {
// Only apply the attribute if both blocks support it.
if (hasSupport(sourceBlock.name) && hasSupport(targetBlock.name)) {
// Override attributes that are not present in the block to their defaults.
attributes[attributeKey] = sourceBlock.attributes[attributeKey];
* Update the target blocks with style attributes recursively.
* @param {WPBlock[]} targetBlocks The target blocks to be updated.
* @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.
* @param {Function} updateBlockAttributes The function to update the attributes.
function recursivelyUpdateBlockAttributes(targetBlocks, sourceBlocks, updateBlockAttributes) {
for (let index = 0; index < Math.min(sourceBlocks.length, targetBlocks.length); index += 1) {
updateBlockAttributes(targetBlocks[index].clientId, getStyleAttributes(sourceBlocks[index], targetBlocks[index]));
recursivelyUpdateBlockAttributes(targetBlocks[index].innerBlocks, sourceBlocks[index].innerBlocks, updateBlockAttributes);
* A hook to return a pasteStyles event function for handling pasting styles to blocks.
* @return {Function} A function to update the styles to the blocks.
function usePasteStyles() {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
return (0,external_wp_element_namespaceObject.useCallback)(async targetBlocks => {
// `http:` sites won't have the clipboard property on navigator.
// (with the exception of localhost.)
if (!window.navigator.clipboard) {
createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'), {
html = await window.navigator.clipboard.readText();
// Possibly the permission is denied.
createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Unable to paste styles. Please allow browser clipboard permissions before continuing.'), {
// Abort if the copied text is empty or doesn't look like serialized blocks.
if (!html || !hasSerializedBlocks(html)) {
createWarningNotice((0,external_wp_i18n_namespaceObject.__)("Unable to paste styles. Block styles couldn't be found within the copied content."), {
const copiedBlocks = (0,external_wp_blocks_namespaceObject.parse)(html);
if (copiedBlocks.length === 1) {
// Apply styles of the block to all the target blocks.
recursivelyUpdateBlockAttributes(targetBlocks, targetBlocks.map(() => copiedBlocks[0]), updateBlockAttributes);
recursivelyUpdateBlockAttributes(targetBlocks, copiedBlocks, updateBlockAttributes);
if (targetBlocks.length === 1) {
const title = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlocks[0].name)?.title;
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: Name of the block being pasted, e.g. "Paragraph".
(0,external_wp_i18n_namespaceObject.__)('Pasted styles to %s.'), title), {
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: The number of the blocks.
(0,external_wp_i18n_namespaceObject.__)('Pasted styles to %d blocks.'), targetBlocks.length), {
}, [registry.batch, updateBlockAttributes, createSuccessNotice, createWarningNotice, createErrorNotice]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js
__experimentalUpdateSelection: updateSelection
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
const blocks = getBlocksByClientId(clientIds);
const rootClientId = getBlockRootClientId(clientIds[0]);
const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId);
const directInsertBlock = rootClientId ? getDirectInsertBlock(rootClientId) : null;
canMove: canMoveBlocks(clientIds),
canRemove: canRemoveBlocks(clientIds),
canInsertBlock: canInsertDefaultBlock || !!directInsertBlock,
canCopyStyles: blocks.every(block => {
return !!block && ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'color') || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'typography'));
canDuplicate: blocks.every(block => {
return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId);
}, [clientIds, getDefaultBlockName]);
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const notifyCopy = useNotifyCopy();
const pasteStyles = usePasteStyles();
return duplicateBlocks(clientIds, updateSelection);
return removeBlocks(clientIds, updateSelection);
insertBeforeBlock(clientIds[0]);
insertAfterBlock(clientIds[clientIds.length - 1]);
selectBlock(clientIds[0]);
setBlockMovingClientId(clientIds[0]);
const groupingBlockName = getGroupingBlockName();
// Activate the `transform` on `core/group` which does the conversion.
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlocksByClientId(clientIds), groupingBlockName);
replaceBlocks(clientIds, newBlocks);
const innerBlocks = getBlocks(clientIds[0]);
if (!innerBlocks.length) {
replaceBlocks(clientIds, innerBlocks);
if (clientIds.length === 1) {
flashBlock(clientIds[0]);
notifyCopy('copy', clientIds);
await pasteStyles(getBlocksByClientId(clientIds));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js
function BlockHTMLConvertButton({
const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlock(clientId), [clientId]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (!block || block.name !== 'core/html') {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
HTML: (0,external_wp_blocks_namespaceObject.getBlockContent)(block)
children: (0,external_wp_i18n_namespaceObject.__)('Convert to Blocks')
/* harmony default export */ const block_html_convert_button = (BlockHTMLConvertButton);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js
Fill: __unstableBlockSettingsMenuFirstItem,
Slot: block_settings_menu_first_item_Slot
} = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockSettingsMenuFirstItem');
__unstableBlockSettingsMenuFirstItem.Slot = block_settings_menu_first_item_Slot;
/* harmony default export */ const block_settings_menu_first_item = (__unstableBlockSettingsMenuFirstItem);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-parent-selector-menu-item.js
function BlockParentSelectorMenuItem({
const isSmallViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
// Allows highlighting the parent block outline when focusing or hovering
// the parent block selector within the child.
const menuItemRef = (0,external_wp_element_namespaceObject.useRef)();
const gesturesProps = useShowHoveredOrFocusedGestures({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
icon: parentBlockType.icon
onClick: () => selectBlock(parentClientId),
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: Name of the block's parent. */
(0,external_wp_i18n_namespaceObject.__)('Select parent block (%s)'), parentBlockType.title)
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js