: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* If called outside of a block context, the mode is applied to all blocks.
* @param {?BlockEditingMode} mode The editing mode to apply. If undefined, the
* current editing mode is not changed.
* @return {BlockEditingMode} The current editing mode.
function useBlockEditingMode(mode) {
const context = useBlockEditContext();
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const globalBlockEditingMode = (0,external_wp_data_namespaceObject.useSelect)(select =>
// Avoid adding the subscription if not needed!
clientId ? null : select(store).getBlockEditingMode(), [clientId]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setBlockEditingMode(clientId, mode);
unsetBlockEditingMode(clientId);
}, [clientId, mode, setBlockEditingMode, unsetBlockEditingMode]);
return clientId ? context[blockEditingModeKey] : globalBlockEditingMode;
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/align.js
* An array which includes all possible valid alignments,
* used to validate if an alignment is valid or not.
const ALL_ALIGNMENTS = ['left', 'center', 'right', 'wide', 'full'];
* An array which includes all wide alignments.
* In order for this alignments to be valid they need to be supported by the block,
const WIDE_ALIGNMENTS = ['wide', 'full'];
* Returns the valid alignments.
* Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.
* Exported just for testing purposes, not exported outside the module.
* @param {?boolean|string[]} blockAlign Aligns supported by the block.
* @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.
* @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.
* @return {string[]} Valid alignments.
function getValidAlignments(blockAlign, hasWideBlockSupport = true, hasWideEnabled = true) {
if (Array.isArray(blockAlign)) {
validAlignments = ALL_ALIGNMENTS.filter(value => blockAlign.includes(value));
} else if (blockAlign === true) {
// `true` includes all alignments...
validAlignments = [...ALL_ALIGNMENTS];
if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) {
return validAlignments.filter(alignment => !WIDE_ALIGNMENTS.includes(alignment));
* Filters registered block settings, extending attributes to include `align`.
* @param {Object} settings Original block settings.
* @return {Object} Filtered block settings.
function addAttribute(settings) {
var _settings$attributes$;
// Allow blocks to specify their own attribute definition with default values if needed.
if ('type' in ((_settings$attributes$ = settings.attributes?.align) !== null && _settings$attributes$ !== void 0 ? _settings$attributes$ : {})) {
if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'align')) {
// Gracefully handle if settings.attributes is undefined.
// Allow for '' since it is used by the `updateAlignment` function
// in toolbar controls for special cases with defined default values.
enum: [...ALL_ALIGNMENTS, '']
function BlockEditAlignmentToolbarControlsPure({
// Compute the block valid alignments by taking into account,
// if the theme supports wide alignments or not and the layout's
// available alignments. We do that for conditionally rendering
const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'alignWide', true));
const validAlignments = useAvailableAlignments(blockAllowedAlignments).map(({
const blockEditingMode = useBlockEditingMode();
if (!validAlignments.length || blockEditingMode !== 'default') {
const updateAlignment = nextAlign => {
const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
const blockDefaultAlign = blockType?.attributes?.align?.default;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, {
__experimentalShareWithChildBlocks: true,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockAlignmentControl, {
onChange: updateAlignment,
controls: validAlignments
/* harmony default export */ const align = ({
shareWithChildBlocks: true,
edit: BlockEditAlignmentToolbarControlsPure,
addSaveProps: addAssignedAlign,
attributeKeys: ['align'],
return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'align', false);
const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'alignWide', true));
const validAlignments = useAvailableAlignments(blockAllowedAlignments);
if (validAlignments.some(alignment => alignment.name === align)) {
* Override props assigned to save component to inject alignment class name if
* @param {Object} props Additional props applied to save element.
* @param {Object} blockType Block type.
* @param {Object} attributes Block attributes.
* @return {Object} Filtered props applied to save element.
function addAssignedAlign(props, blockType, attributes) {
const blockAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'align');
const hasWideBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'alignWide', true);
// Compute valid alignments without taking into account if
// the theme supports wide alignments or not.
// This way changing themes does not impact the block save.
const isAlignValid = getValidAlignments(blockAlign, hasWideBlockSupport).includes(align);
props.className = dist_clsx(`align${align}`, props.className);
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/align/addAttribute', addAttribute);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/groups.js
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls');
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls');
const InspectorControlsBackground = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBackground');
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder');
const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsColor');
const InspectorControlsFilter = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsFilter');
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions');
const InspectorControlsPosition = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsPosition');
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography');
const InspectorControlsListView = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsListView');
const InspectorControlsStyles = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsStyles');
const InspectorControlsEffects = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsEffects');
default: InspectorControlsDefault,
advanced: InspectorControlsAdvanced,
background: InspectorControlsBackground,
border: InspectorControlsBorder,
color: InspectorControlsColor,
dimensions: InspectorControlsDimensions,
effects: InspectorControlsEffects,
filter: InspectorControlsFilter,
list: InspectorControlsListView,
position: InspectorControlsPosition,
settings: InspectorControlsDefault,
styles: InspectorControlsStyles,
typography: InspectorControlsTypography
/* harmony default export */ const inspector_controls_groups = (groups_groups);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/fill.js
function InspectorControlsFill({
if (__experimentalGroup) {
external_wp_deprecated_default()('`__experimentalGroup` property in `InspectorControlsFill`', {
group = __experimentalGroup;
const context = useBlockEditContext();
const Fill = inspector_controls_groups[group]?.Fill;
true ? external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`) : 0;
if (!context[mayDisplayControlsKey]) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolsPanelInspectorControl, {
resetAllFilter: resetAllFilter
function RegisterResetAll({
} = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (resetAllFilter && registerResetAllFilter && deregisterResetAllFilter) {
registerResetAllFilter(resetAllFilter);
deregisterResetAllFilter(resetAllFilter);
}, [resetAllFilter, registerResetAllFilter, deregisterResetAllFilter]);
function ToolsPanelInspectorControl({
// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,
// that should wrap the fill markup.
// Children passed to InspectorControlsFill will not have
// access to any React Context whose Provider is part of
// the InspectorControlsSlot tree. So we re-create the
// Provider in this subtree.
const innerMarkup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegisterResetAll, {
resetAllFilter: resetAllFilter,
return forwardedContext.reduce((inner, [Provider, props]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
function BlockSupportToolsPanel({
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
getMultiSelectedBlockClientIds,
getSelectedBlockClientId,
} = (0,external_wp_data_namespaceObject.useSelect)(store);
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
const panelId = getSelectedBlockClientId();
const resetAll = (0,external_wp_element_namespaceObject.useCallback)((resetFilters = []) => {
const newAttributes = {};
const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId];
clientIds.forEach(clientId => {
} = getBlockAttributes(clientId);
let newBlockAttributes = {
resetFilters.forEach(resetFilter => {
...resetFilter(newBlockAttributes)
// Enforce a cleaned style object.
style: utils_cleanEmptyObject(newBlockAttributes.style)
newAttributes[clientId] = newBlockAttributes;
updateBlockAttributes(clientIds, newAttributes, true);
}, [getBlockAttributes, getMultiSelectedBlockClientIds, hasMultiSelection, panelId, updateBlockAttributes]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, {
className: `${group}-block-support-panel`,
shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
__experimentalFirstVisibleItemClass: "first",
__experimentalLastVisibleItemClass: "last",
dropdownMenuProps: dropdownMenuProps,
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-slot-container.js
function BlockSupportSlotContainer({
// Add the toolspanel context provider and value to existing fill props
const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext);
const computedFillProps = (0,external_wp_element_namespaceObject.useMemo)(() => {
var _fillProps$forwardedC;
...(fillProps !== null && fillProps !== void 0 ? fillProps : {}),
forwardedContext: [...((_fillProps$forwardedC = fillProps?.forwardedContext) !== null && _fillProps$forwardedC !== void 0 ? _fillProps$forwardedC : []), [external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, {
}, [toolsPanelContext, fillProps]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, {
fillProps: computedFillProps,
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/slot.js
function InspectorControlsSlot({
if (__experimentalGroup) {
external_wp_deprecated_default()('`__experimentalGroup` property in `InspectorControlsSlot`', {
group = __experimentalGroup;
const Slot = inspector_controls_groups[group]?.Slot;
const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(Slot?.__unstableName);
const motionContextValue = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__unstableMotionContext);
const computedFillProps = (0,external_wp_element_namespaceObject.useMemo)(() => {
var _fillProps$forwardedC;
...(fillProps !== null && fillProps !== void 0 ? fillProps : {}),
forwardedContext: [...((_fillProps$forwardedC = fillProps?.forwardedContext) !== null && _fillProps$forwardedC !== void 0 ? _fillProps$forwardedC : []), [external_wp_components_namespaceObject.__unstableMotionContext.Provider, {
value: motionContextValue
}, [motionContextValue, fillProps]);
true ? external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`) : 0;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSupportToolsPanel, {