: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function filterElementBlockSupports(blockSupports, name, element) {
return blockSupports.filter(support => {
if (support === 'fontSize' && element === 'heading') {
// This is only available for links
if (support === 'textDecoration' && !name && element !== 'link') {
// This is only available for heading, button, caption and text
if (support === 'textTransform' && !name && !(['heading', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(element) || element === 'button' || element === 'caption' || element === 'text')) {
// This is only available for heading, button, caption and text
if (support === 'letterSpacing' && !name && !(['heading', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(element) || element === 'button' || element === 'caption' || element === 'text')) {
// Text columns is only available for blocks.
if (support === 'textColumns' && !name) {
* Returns the list of supported styles for a given block name and element.
const getSupportedStyles = (0,external_wp_data_namespaceObject.createSelector)((state, name, element) => {
return filterElementBlockSupports(ROOT_BLOCK_SUPPORTS, name, element);
const blockType = selectors_getBlockType(state, name);
// Check for blockGap support.
// Block spacing support doesn't map directly to a single style property, so needs to be handled separately.
if (blockType?.supports?.spacing?.blockGap) {
supportKeys.push('blockGap');
// check for shadow support
if (blockType?.supports?.shadow) {
supportKeys.push('shadow');
Object.keys(__EXPERIMENTAL_STYLE_PROPERTY).forEach(styleName => {
if (!__EXPERIMENTAL_STYLE_PROPERTY[styleName].support) {
// Opting out means that, for certain support keys like background color,
// blocks have to explicitly set the support value false. If the key is
// unset, we still enable it.
if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].requiresOptOut) {
if (__EXPERIMENTAL_STYLE_PROPERTY[styleName].support[0] in blockType.supports && getValueFromObjectPath(blockType.supports, __EXPERIMENTAL_STYLE_PROPERTY[styleName].support) !== false) {
supportKeys.push(styleName);
if (getValueFromObjectPath(blockType.supports, __EXPERIMENTAL_STYLE_PROPERTY[styleName].support, false)) {
supportKeys.push(styleName);
return filterElementBlockSupports(supportKeys, name, element);
}, (state, name) => [state.blockTypes[name]]);
* Returns the bootstrapped block type metadata for a give block name.
* @param {Object} state Data state.
* @param {string} name Block name.
* @return {Object} Bootstrapped block type metadata for a block.
function getBootstrappedBlockType(state, name) {
return state.bootstrappedBlockTypes[name];
* Returns all the unprocessed (before applying the `registerBlockType` filter)
* block type settings as passed during block registration.
* @param {Object} state Data state.
* @return {Array} Unprocessed block type settings for all blocks.
function getUnprocessedBlockTypes(state) {
return state.unprocessedBlockTypes;
* Returns all the block bindings sources registered.
* @param {Object} state Data state.
* @return {Object} All the registered sources and their properties.
function getAllBlockBindingsSources(state) {
return state.blockBindingsSources;
* Returns a specific block bindings source.
* @param {Object} state Data state.
* @param {string} sourceName Name of the source to get.
* @return {Object} The specific block binding source and its properties.
function getBlockBindingsSource(state, sourceName) {
return state.blockBindingsSources[sourceName];
;// CONCATENATED MODULE: external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
function is_plain_object_isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
function isPlainObject(o) {
if (is_plain_object_isObject(o) === false) return false;
// If has modified constructor
if (ctor === undefined) return true;
// If has modified prototype
if (is_plain_object_isObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
// Most likely a plain Object
// EXTERNAL MODULE: ./node_modules/react-is/index.js
var react_is = __webpack_require__(8529);
;// CONCATENATED MODULE: external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/process-block-type.js
/** @typedef {import('../api/registration').WPBlockType} WPBlockType */
const error = (...args) => window?.console?.error?.(...args);
const warn = (...args) => window?.console?.warn?.(...args);
* Mapping of legacy category slugs to their latest normal values, used to
* accommodate updates of the default set of block categories.
* @type {Record<string,string>}
const LEGACY_CATEGORY_MAPPING = {
* Merge block variations bootstrapped from the server and client.
* When a variation is registered in both places, its properties are merged.
* @param {Array} bootstrappedVariations - A block type variations from the server.
* @param {Array} clientVariations - A block type variations from the client.
* @return {Array} The merged array of block variations.
function mergeBlockVariations(bootstrappedVariations = [], clientVariations = []) {
const result = [...bootstrappedVariations];
clientVariations.forEach(clientVariation => {
const index = result.findIndex(bootstrappedVariation => bootstrappedVariation.name === clientVariation.name);
result.push(clientVariation);
* Takes the unprocessed block type settings, merges them with block type metadata
* and applies all the existing filters for the registered block type.
* Next, it validates all the settings and performs additional processing to the block type definition.
* @param {string} name Block name.
* @param {WPBlockType} blockSettings Unprocessed block type settings.
* @return {WPBlockType | undefined} The block, if it has been processed and can be registered; otherwise `undefined`.
const processBlockType = (name, blockSettings) => ({
const bootstrappedBlockType = select.getBootstrappedBlockType(name);
icon: BLOCK_ICON_DEFAULT,
...bootstrappedBlockType,
variations: mergeBlockVariations(bootstrappedBlockType?.variations, blockSettings?.variations)
const settings = (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.registerBlockType', blockType, name, null);
if (settings.description && typeof settings.description !== 'string') {
external_wp_deprecated_default()('Declaring non-string block descriptions', {
if (settings.deprecated) {
settings.deprecated = settings.deprecated.map(deprecation => Object.fromEntries(Object.entries(
// Only keep valid deprecation keys.
(0,external_wp_hooks_namespaceObject.applyFilters)('blocks.registerBlockType',
// Merge deprecation keys with pre-filter settings
// so that filters that depend on specific keys being
// Omit deprecation keys here so that deprecations
// can opt out of specific keys like "supports".
...omit(blockType, DEPRECATED_ENTRY_KEYS),
}, blockType.name, deprecation)).filter(([key]) => DEPRECATED_ENTRY_KEYS.includes(key))));
if (!isPlainObject(settings)) {
error('Block settings must be a valid object.');
if (typeof settings.save !== 'function') {
error('The "save" property must be a valid function.');
if ('edit' in settings && !(0,react_is.isValidElementType)(settings.edit)) {
error('The "edit" property must be a valid component.');
// Canonicalize legacy categories to equivalent fallback.
if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
if ('category' in settings && !select.getCategories().some(({
}) => slug === settings.category)) {
warn('The block "' + name + '" is registered with an invalid category "' + settings.category + '".');
delete settings.category;
if (!('title' in settings) || settings.title === '') {
error('The block "' + name + '" must have a title.');
if (typeof settings.title !== 'string') {
error('Block titles must be strings.');
settings.icon = normalizeIconObject(settings.icon);
if (!isValidIcon(settings.icon.src)) {
error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional');
;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
/** @typedef {import('../api/registration').WPBlockType} WPBlockType */
/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
* Returns an action object used in signalling that block types have been added.
* Ignored from documentation as the recommended usage for this action through registerBlockType from @wordpress/blocks.
* @param {WPBlockType|WPBlockType[]} blockTypes Object or array of objects representing blocks to added.
* @return {Object} Action object.
function addBlockTypes(blockTypes) {
blockTypes: Array.isArray(blockTypes) ? blockTypes : [blockTypes]
* Signals that all block types should be computed again.
* It uses stored unprocessed block types and all the most recent list of registered filters.
* It addresses the issue where third party block filters get registered after third party blocks. A sample sequence:
* In this scenario some filters would not get applied for all blocks because they are registered too late.
function reapplyBlockTypeFilters() {
const processedBlockTypes = [];
for (const [name, settings] of Object.entries(select.getUnprocessedBlockTypes())) {
const result = dispatch(processBlockType(name, settings));
processedBlockTypes.push(result);
if (!processedBlockTypes.length) {
dispatch.addBlockTypes(processedBlockTypes);
function __experimentalReapplyBlockFilters() {
external_wp_deprecated_default()('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters', {
alternative: 'reapplyBlockFilters'
return reapplyBlockTypeFilters();
* Returns an action object used to remove a registered block type.
* Ignored from documentation as the recommended usage for this action through unregisterBlockType from @wordpress/blocks.
* @param {string|string[]} names Block name or array of block names to be removed.
* @return {Object} Action object.
function removeBlockTypes(names) {
type: 'REMOVE_BLOCK_TYPES',
names: Array.isArray(names) ? names : [names]
* Returns an action object used in signalling that new block styles have been added.
* Ignored from documentation as the recommended usage for this action through registerBlockStyle from @wordpress/blocks.
* @param {string|Array} blockNames Block names to register new styles for.
* @param {Array|Object} styles Block style object or array of block style objects.
* @return {Object} Action object.
function addBlockStyles(blockNames, styles) {
type: 'ADD_BLOCK_STYLES',
styles: Array.isArray(styles) ? styles : [styles],
blockNames: Array.isArray(blockNames) ? blockNames : [blockNames]
* Returns an action object used in signalling that block styles have been removed.
* Ignored from documentation as the recommended usage for this action through unregisterBlockStyle from @wordpress/blocks.
* @param {string} blockName Block name.
* @param {Array|string} styleNames Block style names or array of block style names.
* @return {Object} Action object.
function removeBlockStyles(blockName, styleNames) {
type: 'REMOVE_BLOCK_STYLES',
styleNames: Array.isArray(styleNames) ? styleNames : [styleNames],
* Returns an action object used in signalling that new block variations have been added.
* Ignored from documentation as the recommended usage for this action through registerBlockVariation from @wordpress/blocks.
* @param {string} blockName Block name.
* @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
* @return {Object} Action object.
function addBlockVariations(blockName, variations) {
type: 'ADD_BLOCK_VARIATIONS',
variations: Array.isArray(variations) ? variations : [variations],
* Returns an action object used in signalling that block variations have been removed.
* Ignored from documentation as the recommended usage for this action through unregisterBlockVariation from @wordpress/blocks.
* @param {string} blockName Block name.
* @param {string|string[]} variationNames Block variation names.
* @return {Object} Action object.
function removeBlockVariations(blockName, variationNames) {
type: 'REMOVE_BLOCK_VARIATIONS',
variationNames: Array.isArray(variationNames) ? variationNames : [variationNames],
* Returns an action object used to set the default block name.
* Ignored from documentation as the recommended usage for this action through setDefaultBlockName from @wordpress/blocks.
* @param {string} name Block name.
* @return {Object} Action object.
function actions_setDefaultBlockName(name) {
type: 'SET_DEFAULT_BLOCK_NAME',
* Returns an action object used to set the name of the block used as a fallback