: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function AllInputControl({
onChange = all_input_control_noop,
onFocus = all_input_control_noop,
var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(AllInputControl, 'box-control-input-all');
const allValue = getAllValue(values, selectedUnits, sides);
const hasValues = isValuesDefined(values);
const isMixed = hasValues && isValuesMixed(values, selectedUnits, sides);
const allPlaceholder = isMixed ? LABELS.mixed : undefined;
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(allValue);
const handleOnFocus = event => {
const onValueChange = next => {
const isNumeric = next !== undefined && !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : undefined;
const nextValues = applyValueToSides(values, nextValue, sides);
const sliderOnChange = next => {
onValueChange(next !== undefined ? [next, parsedUnit].join('') : undefined);
// Set selected unit so it can be used as fallback by unlinked controls
// when individual sides do not have a value containing a unit.
const handleOnUnitChange = unit => {
const newUnits = applyValueToSides(selectedUnits, unit, sides);
setSelectedUnits(newUnits);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(h_stack_component, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledUnitControl, {
__next40pxDefaultSize: __next40pxDefaultSize,
className: "component-box-control__unit-control",
isPressEnterToChange: true,
onUnitChange: handleOnUnitChange,
placeholder: allPlaceholder,
hideLabelFromVision: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: __next40pxDefaultSize,
"aria-controls": inputId,
hideLabelFromVision: true,
onChange: sliderOnChange,
max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/input-controls.js
const input_controls_noop = () => {};
function BoxInputControls({
onChange = input_controls_noop,
onFocus = input_controls_noop,
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxInputControls, 'box-control-input');
const createHandleOnFocus = side => event => {
const handleOnChange = nextValues => {
const handleOnValueChange = (side, next, extra) => {
const isNumeric = next !== undefined && !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : undefined;
nextValues[side] = nextValue;
* Supports changing pair sides. For example, holding the ALT key
* when changing the TOP will also update BOTTOM.
// @ts-expect-error - TODO: event.altKey is only present when the change event was
// triggered by a keyboard event. Should this feature be implemented differently so
// it also works with drag events?
if (extra?.event.altKey) {
nextValues.bottom = nextValue;
nextValues.top = nextValue;
nextValues.right = nextValue;
nextValues.left = nextValue;
handleOnChange(nextValues);
const createHandleOnUnitChange = side => next => {
setSelectedUnits(newUnits);
// Filter sides if custom configuration provided, maintaining default order.
const filteredSides = sides?.length ? ALL_SIDES.filter(side => sides.includes(side)) : ALL_SIDES;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: filteredSides.map(side => {
var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(values[side]);
const computedUnit = values[side] ? parsedUnit : selectedUnits[side];
const inputId = [generatedId, side].join('-');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapper, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedBoxControlIcon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledUnitControl, {
__next40pxDefaultSize: __next40pxDefaultSize,
className: "component-box-control__unit-control",
isPressEnterToChange: true,
value: [parsedQuantity, computedUnit].join(''),
onChange: (nextValue, extra) => handleOnValueChange(side, nextValue, extra),
onUnitChange: createHandleOnUnitChange(side),
onFocus: createHandleOnFocus(side),
hideLabelFromVision: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: __next40pxDefaultSize,
"aria-controls": inputId,
hideLabelFromVision: true,
handleOnValueChange(side, newValue !== undefined ? [newValue, computedUnit].join('') : undefined);
max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
}, `box-control-${side}`);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/axial-input-controls.js
const groupedSides = ['vertical', 'horizontal'];
function AxialInputControls({
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(AxialInputControls, `box-control-input`);
const createHandleOnFocus = side => event => {
const handleOnValueChange = (side, next) => {
const isNumeric = next !== undefined && !isNaN(parseFloat(next));
const nextValue = isNumeric ? next : undefined;
if (side === 'vertical') {
nextValues.top = nextValue;
nextValues.bottom = nextValue;
if (side === 'horizontal') {
nextValues.left = nextValue;
nextValues.right = nextValue;
const createHandleOnUnitChange = side => next => {
if (side === 'vertical') {
if (side === 'horizontal') {
setSelectedUnits(newUnits);
// Filter sides if custom configuration provided, maintaining default order.
const filteredSides = sides?.length ? groupedSides.filter(side => sides.includes(side)) : groupedSides;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: filteredSides.map(side => {
var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(side === 'vertical' ? values.top : values.left);
const selectedUnit = side === 'vertical' ? selectedUnits.top : selectedUnits.left;
const inputId = [generatedId, side].join('-');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapper, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedBoxControlIcon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, {
children: /*#__PURE__*/(0,external_React_.createElement)(StyledUnitControl, {
__next40pxDefaultSize: __next40pxDefaultSize,
className: "component-box-control__unit-control",
isPressEnterToChange: true,
value: [parsedQuantity, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join(''),
onChange: newValue => handleOnValueChange(side, newValue),
onUnitChange: createHandleOnUnitChange(side),
onFocus: createHandleOnFocus(side),
hideLabelFromVision: true,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedRangeControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: __next40pxDefaultSize,
"aria-controls": inputId,
hideLabelFromVision: true,
onChange: newValue => handleOnValueChange(side, newValue !== undefined ? [newValue, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join('') : undefined),
max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/linked-button.js
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tooltip, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, {
className: "component-box-control__linked-button",
icon: isLinked ? library_link : link_off,
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/index.js
const defaultInputProps = {
const box_control_noop = () => {};
function box_control_useUniqueId(idProp) {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BoxControl, 'inspector-box-control');
return idProp || instanceId;
* BoxControl components let users set values for Top, Right, Bottom, and Left.
* This can be used as an input control for values like `padding` or `margin`.
* import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
* import { useState } from '@wordpress/element';
* const Example = () => {
* const [ values, setValues ] = useState( {
* onChange={ ( nextValues ) => setValues( nextValues ) }
__next40pxDefaultSize = false,
inputProps = defaultInputProps,
onChange = box_control_noop,
label = (0,external_wp_i18n_namespaceObject.__)('Box Control'),
resetValues = DEFAULT_VALUES,
const [values, setValues] = use_controlled_state(valuesProp, {
const inputValues = values || DEFAULT_VALUES;
const hasInitialValue = isValuesDefined(valuesProp);
const hasOneSide = sides?.length === 1;
const [isDirty, setIsDirty] = (0,external_wp_element_namespaceObject.useState)(hasInitialValue);
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasInitialValue || !isValuesMixed(inputValues) || hasOneSide);
const [side, setSide] = (0,external_wp_element_namespaceObject.useState)(getInitialSide(isLinked, splitOnAxis));
// Tracking selected units via internal state allows filtering of CSS unit
// only values from being saved while maintaining preexisting unit selection
// behaviour. Filtering CSS only values prevents invalid style values.
const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({
top: parseQuantityAndUnitFromRawValue(valuesProp?.top)[1],
right: parseQuantityAndUnitFromRawValue(valuesProp?.right)[1],
bottom: parseQuantityAndUnitFromRawValue(valuesProp?.bottom)[1],
left: parseQuantityAndUnitFromRawValue(valuesProp?.left)[1]
const id = box_control_useUniqueId(idProp);
const headingId = `${id}-heading`;
const toggleLinked = () => {
setSide(getInitialSide(!isLinked, splitOnAxis));
const handleOnFocus = (_event, {
const handleOnChange = nextValues => {
const handleOnReset = () => {
setSelectedUnits(resetValues);
const inputControlProps = {
onChange: handleOnChange,
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(grid_component, {
templateColumns: "1fr min-content min-content",
"aria-labelledby": headingId,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BaseControl.VisualLabel, {
}), isLinked && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(InputWrapper, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexedBoxControlIcon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AllInputControl, {
}), !hasOneSide && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButtonWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButton, {
}), !isLinked && splitOnAxis && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AxialInputControls, {
}), !isLinked && !splitOnAxis && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControls, {
}), allowReset && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetButton, {
className: "component-box-control__reset-button",