: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
// popoverDimensionsRecomputeCounter is by definition always equal or greater
// than 0. This check is only there to satisfy the correctness of the
// exhaustive-deps rule for the `useMemo` hook.
popoverDimensionsRecomputeCounter < 0 || !selectedElement || bottomClientId && !lastSelectedElement) {
getBoundingClientRect() {
var _lastSelectedBCR$left, _lastSelectedBCR$top, _lastSelectedBCR$righ, _lastSelectedBCR$bott;
const selectedBCR = selectedElement.getBoundingClientRect();
const lastSelectedBCR = lastSelectedElement?.getBoundingClientRect();
// Get the biggest rectangle that encompasses completely the currently
// selected element and the last selected element:
// - for top/left coordinates, use the smaller numbers
// - for the bottom/right coordinates, use the largest numbers
const left = Math.min(selectedBCR.left, (_lastSelectedBCR$left = lastSelectedBCR?.left) !== null && _lastSelectedBCR$left !== void 0 ? _lastSelectedBCR$left : Infinity);
const top = Math.min(selectedBCR.top, (_lastSelectedBCR$top = lastSelectedBCR?.top) !== null && _lastSelectedBCR$top !== void 0 ? _lastSelectedBCR$top : Infinity);
const right = Math.max(selectedBCR.right, (_lastSelectedBCR$righ = lastSelectedBCR.right) !== null && _lastSelectedBCR$righ !== void 0 ? _lastSelectedBCR$righ : -Infinity);
const bottom = Math.max(selectedBCR.bottom, (_lastSelectedBCR$bott = lastSelectedBCR.bottom) !== null && _lastSelectedBCR$bott !== void 0 ? _lastSelectedBCR$bott : -Infinity);
const width = right - left;
const height = bottom - top;
return new window.DOMRect(left, top, width, height);
contextElement: selectedElement
}, [bottomClientId, lastSelectedElement, selectedElement, popoverDimensionsRecomputeCounter]);
if (!selectedElement || bottomClientId && !lastSelectedElement) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
// Render in the old slot if needed for backward compatibility,
// otherwise render in place (not in the default popover slot).
__unstableSlotName: __unstablePopoverSlot,
inline: !__unstablePopoverSlot,
className: dist_clsx('block-editor-block-popover', props.className),
const PrivateBlockPopover = (0,external_wp_element_namespaceObject.forwardRef)(BlockPopover);
const PublicBlockPopover = ({
}, ref) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockPopover, {
bottomClientId: bottomClientId,
__unstableContentRef: undefined,
__unstablePopoverSlot: undefined,
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-popover/README.md
/* harmony default export */ const block_popover = ((0,external_wp_element_namespaceObject.forwardRef)(PublicBlockPopover));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-popover/cover.js
function BlockPopoverCover({
(_bottomClientId = bottomClientId) !== null && _bottomClientId !== void 0 ? _bottomClientId : bottomClientId = clientId;
const selectedElement = useBlockElement(clientId);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockPopover, {
bottomClientId: bottomClientId,
children: selectedElement && clientId === bottomClientId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverContainer, {
selectedElement: selectedElement,
additionalStyles: additionalStyles,
function CoverContainer({
const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetWidth);
const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetHeight);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const observer = new window.ResizeObserver(() => {
setWidth(selectedElement.offsetWidth);
setHeight(selectedElement.offsetHeight);
observer.observe(selectedElement, {
return () => observer.disconnect();
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
}, [width, height, additionalStyles]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
/* harmony default export */ const cover = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPopoverCover));
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/grid-visualizer/utils.js
function getComputedCSS(element, property) {
return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/grid-visualizer/grid-visualizer.js
function GridVisualizer({
const isDistractionFree = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().isDistractionFree, []);
const blockElement = useBlockElement(clientId);
if (isDistractionFree || !blockElement) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, {
className: "block-editor-grid-visualizer",
__unstablePopoverSlot: "block-toolbar",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerGrid, {
blockElement: blockElement
const GridVisualizerGrid = (0,external_wp_element_namespaceObject.forwardRef)(({
const [gridInfo, setGridInfo] = (0,external_wp_element_namespaceObject.useState)(() => getGridInfo(blockElement));
(0,external_wp_element_namespaceObject.useEffect)(() => {
for (const element of [blockElement, ...blockElement.children]) {
const observer = new window.ResizeObserver(() => {
setGridInfo(getGridInfo(blockElement));
observer.observe(element);
observers.push(observer);
for (const observer of observers) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-editor-grid-visualizer__grid",
length: gridInfo.numItems
}, (_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "block-editor-grid-visualizer__item",
boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${gridInfo.currentColor} 20%, #0000)`
function getGridInfo(blockElement) {
const gridTemplateColumns = getComputedCSS(blockElement, 'grid-template-columns');
const gridTemplateRows = getComputedCSS(blockElement, 'grid-template-rows');
const numColumns = gridTemplateColumns.split(' ').length;
const numRows = gridTemplateRows.split(' ').length;
const numItems = numColumns * numRows;
currentColor: getComputedCSS(blockElement, 'color'),
gap: getComputedCSS(blockElement, 'gap'),
padding: getComputedCSS(blockElement, 'padding')
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/grid.js
const RANGE_CONTROL_MAX_VALUES = {
/* harmony default export */ const grid = ({
label: (0,external_wp_i18n_namespaceObject.__)('Grid'),
inspectorControls: function GridLayoutInspectorControls({
allowSizingOnChildren = false
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutTypeControl, {
}), layout?.columnCount ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutColumnsAndRowsControl, {
allowSizingOnChildren: allowSizingOnChildren
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutMinimumWidthControl, {
toolBarControls: function GridLayoutToolbarControls({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizer, {
getLayoutStyle: function getLayoutStyle({
layoutDefinitions = LAYOUT_DEFINITIONS
minimumColumnWidth = '12rem',
// If a block's block.json skips serialization for spacing or spacing.blockGap,
// don't apply the user-defined value to the styles.
const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style?.spacing?.blockGap, '0.5em') : undefined;
rules.push(`grid-template-columns: repeat(${columnCount}, minmax(0, 1fr))`);
rules.push(`grid-template-rows: repeat(${rowCount}, minmax(0, 1fr))`);
} else if (minimumColumnWidth) {
rules.push(`grid-template-columns: repeat(auto-fill, minmax(min(${minimumColumnWidth}, 100%), 1fr))`, 'container-type: inline-size');
// Reason to disable: the extra line breaks added by prettier mess with the unit tests.
// eslint-disable-next-line prettier/prettier
output = `${appendSelectors(selector)} { ${rules.join('; ')}; }`;
// Output blockGap styles based on rules contained in layout definitions in theme.json.
if (hasBlockGapSupport && blockGapValue) {
output += getBlockGapCSS(selector, layoutDefinitions, 'grid', blockGapValue);
// Enables setting minimum width of grid items.
function GridLayoutMinimumWidthControl({
minimumColumnWidth: value = '12rem'
const [quantity, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
const handleSliderChange = next => {
minimumColumnWidth: [next, unit].join('')
// Mostly copied from HeightControl.
const handleUnitChange = newUnit => {
// Attempt to smooth over differences between currentUnit and newUnit.
// This should slightly improve the experience of switching between unit types.
if (['em', 'rem'].includes(newUnit) && unit === 'px') {
// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.
newValue = (quantity / 16).toFixed(2) + newUnit;
} else if (['em', 'rem'].includes(unit) && newUnit === 'px') {
// Convert to pixel value assuming a root size of 16px.
newValue = Math.round(quantity * 16) + newUnit;
minimumColumnWidth: newValue
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
children: (0,external_wp_i18n_namespaceObject.__)('Minimum column width')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, {
size: "__unstable-large",
minimumColumnWidth: newValue
onUnitChange: handleUnitChange,
label: (0,external_wp_i18n_namespaceObject.__)('Minimum column width'),
hideLabelFromVision: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
onChange: handleSliderChange,
max: RANGE_CONTROL_MAX_VALUES[unit] || 600,
label: (0,external_wp_i18n_namespaceObject.__)('Minimum column width'),
hideLabelFromVision: true
// Enables setting number of grid columns
function GridLayoutColumnsAndRowsControl({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {
children: (0,external_wp_i18n_namespaceObject.__)('Columns')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, {
size: "__unstable-large",
* If the input is cleared, avoid switching
* back to "Auto" by setting a value of "1".
const validValue = value !== '' ? value : '1';
label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
hideLabelFromVision: true
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, {
value: parseInt(columnCount, 10) // RangeControl can't deal with strings.
onChange: value => onChange({
label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
hideLabelFromVision: true
}), allowSizingOnChildren && window.__experimentalEnableGridInteractivity && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, {