: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* This custom hook uses the ResizeObserver API to listen for resize events.
const [resizeListener, sizes] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
* Indicates if the x/y axis is preferred.
* If set, we will avoid resetting the moveX and moveY values.
* This will allow for the preferred axis values to persist in the label.
const isAxisControlled = !!axis;
* The moveX and moveY values are used to track whether the label should
* display width, height, or width x height.
const [moveX, setMoveX] = (0,external_wp_element_namespaceObject.useState)(false);
const [moveY, setMoveY] = (0,external_wp_element_namespaceObject.useState)(false);
* Cached dimension values to check for width/height updates from the
* sizes property from useResizeAware()
const heightRef = (0,external_wp_element_namespaceObject.useRef)(height);
const widthRef = (0,external_wp_element_namespaceObject.useRef)(width);
* This timeout is used with setMoveX and setMoveY to determine of
* both width and height values have changed at (roughly) the same time.
const moveTimeoutRef = (0,external_wp_element_namespaceObject.useRef)();
const debounceUnsetMoveXY = (0,external_wp_element_namespaceObject.useCallback)(() => {
const unsetMoveXY = () => {
* If axis is controlled, we will avoid resetting the moveX and moveY values.
* This will allow for the preferred axis values to persist in the label.
if (moveTimeoutRef.current) {
window.clearTimeout(moveTimeoutRef.current);
moveTimeoutRef.current = window.setTimeout(unsetMoveXY, fadeTimeout);
}, [fadeTimeout, isAxisControlled]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
* On the initial render of useResizeAware, the height and width values are
* null. They are calculated then set using via an internal useEffect hook.
const isRendered = width !== null || height !== null;
const didWidthChange = width !== widthRef.current;
const didHeightChange = height !== heightRef.current;
if (!didWidthChange && !didHeightChange) {
* After the initial render, the useResizeAware will set the first
* width and height values. We'll sync those values with our
* width and height refs. However, we shouldn't render our Tooltip
* label on this first cycle.
if (width && !widthRef.current && height && !heightRef.current) {
widthRef.current = width;
heightRef.current = height;
* After the first cycle, we can track width and height changes.
widthRef.current = width;
heightRef.current = height;
}, [width, height, onResize, debounceUnsetMoveXY]);
const label = getSizeLabel({
* Gets the resize label based on width and height values (as well as recent changes).
* @param props.axis Only shows the label corresponding to the axis.
* @param props.height Height value.
* @param props.moveX Recent width (x axis) changes.
* @param props.moveY Recent width (y axis) changes.
* @param props.position Adjusts label value.
* @param props.showPx Whether to add `PX` to the label.
* @param props.width Width value.
* @return The rendered label.
position = POSITIONS.bottom,
* We want the label to appear like width x height.
if (position === POSITIONS.corner) {
return `${width} x ${height}`;
* The label will combine both width x height values if both
* values have recently been changed.
* Otherwise, only width or height will be displayed.
* The `PX` unit will be added, if specified by the `showPx` prop.
const labelUnit = showPx ? ' px' : '';
if (axis === 'x' && moveX) {
return `${width}${labelUnit}`;
if (axis === 'y' && moveY) {
return `${height}${labelUnit}`;
return `${width} x ${height}`;
return `${width}${labelUnit}`;
return `${height}${labelUnit}`;
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js
function resize_tooltip_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
const resize_tooltip_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"
const TooltipWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"
const resize_tooltip_styles_Tooltip = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
} : 0)("background:", COLORS.theme.foreground, ";border-radius:2px;box-sizing:border-box;font-family:", font('default.fontFamily'), ";font-size:12px;color:", COLORS.theme.foregroundInverted, ";padding:4px 8px;position:relative;" + ( true ? "" : 0));
// TODO: Resolve need to use &&& to increase specificity
// https://github.com/WordPress/gutenberg/issues/18483
const LabelText = /*#__PURE__*/emotion_styled_base_browser_esm(text_component, true ? {
} : 0)("&&&{color:", COLORS.theme.foregroundInverted, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + ( true ? "" : 0));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/label.js
const CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;
function resize_tooltip_label_Label({
position = POSITIONS.corner,
const showLabel = !!label;
const isBottom = position === POSITIONS.bottom;
const isCorner = position === POSITIONS.corner;
opacity: showLabel ? 1 : undefined,
bottom: CURSOR_OFFSET_TOP * -1,
transform: 'translate(-50%, 0)'
transform: `translate(0, 100%)`
right: (0,external_wp_i18n_namespaceObject.isRTL)() ? undefined : CORNER_OFFSET,
left: (0,external_wp_i18n_namespaceObject.isRTL)() ? CORNER_OFFSET : undefined
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipWrapper, {
className: "components-resizable-tooltip__tooltip-wrapper",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_styles_Tooltip, {
className: "components-resizable-tooltip__tooltip",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LabelText, {
const label_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(resize_tooltip_label_Label);
/* harmony default export */ const resize_tooltip_label = (label_ForwardedComponent);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/resize-tooltip/index.js
const resize_tooltip_noop = () => {};
onResize = resize_tooltip_noop,
position = POSITIONS.bottom,
const classes = dist_clsx('components-resize-tooltip', className);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(resize_tooltip_styles_Root, {
children: [resizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip_label, {
"aria-hidden": props['aria-hidden'],
const resize_tooltip_ForwardedComponent = (0,external_wp_element_namespaceObject.forwardRef)(ResizeTooltip);
/* harmony default export */ const resize_tooltip = (resize_tooltip_ForwardedComponent);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/resizable-box/index.js
const HANDLE_CLASS_NAME = 'components-resizable-box__handle';
const SIDE_HANDLE_CLASS_NAME = 'components-resizable-box__side-handle';
const CORNER_HANDLE_CLASS_NAME = 'components-resizable-box__corner-handle';
top: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, 'components-resizable-box__handle-top'),
right: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, 'components-resizable-box__handle-right'),
bottom: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, 'components-resizable-box__handle-bottom'),
left: dist_clsx(HANDLE_CLASS_NAME, SIDE_HANDLE_CLASS_NAME, 'components-resizable-box__handle-left'),
topLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, 'components-resizable-box__handle-top', 'components-resizable-box__handle-left'),
topRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, 'components-resizable-box__handle-top', 'components-resizable-box__handle-right'),
bottomRight: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-right'),
bottomLeft: dist_clsx(HANDLE_CLASS_NAME, CORNER_HANDLE_CLASS_NAME, 'components-resizable-box__handle-bottom', 'components-resizable-box__handle-left')
// Removes the inline styles in the drag handles.
const HANDLE_STYLES_OVERRIDES = {
top: HANDLE_STYLES_OVERRIDES,
right: HANDLE_STYLES_OVERRIDES,
bottom: HANDLE_STYLES_OVERRIDES,
left: HANDLE_STYLES_OVERRIDES,
topLeft: HANDLE_STYLES_OVERRIDES,
topRight: HANDLE_STYLES_OVERRIDES,
bottomRight: HANDLE_STYLES_OVERRIDES,
bottomLeft: HANDLE_STYLES_OVERRIDES
function UnforwardedResizableBox({
__experimentalShowTooltip: showTooltip = false,
__experimentalTooltipProps: tooltipProps = {},
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Resizable, {
className: dist_clsx('components-resizable-box__container', showHandle && 'has-show-handle', className),
handleClasses: HANDLE_CLASSES,
handleStyles: HANDLE_STYLES,
children: [children, showTooltip && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(resize_tooltip, {
const ResizableBox = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedResizableBox);
/* harmony default export */ const resizable_box = (ResizableBox);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/responsive-wrapper/index.js
* A wrapper component that maintains its aspect ratio when resized.
* import { ResponsiveWrapper } from '@wordpress/components';
* const MyResponsiveWrapper = () => (
* <ResponsiveWrapper naturalWidth={ 2000 } naturalHeight={ 680 }>
* src="https://s.w.org/style/images/about/WordPress-logotype-standard.png"
function ResponsiveWrapper({
if (external_wp_element_namespaceObject.Children.count(children) !== 1) {
const TagName = isInline ? 'span' : 'div';
if (naturalWidth && naturalHeight) {
aspectRatio = `${naturalWidth} / ${naturalHeight}`;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, {
className: "components-responsive-wrapper",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: (0,external_wp_element_namespaceObject.cloneElement)(children, {
className: dist_clsx('components-responsive-wrapper__content', children.props.className),
/* harmony default export */ const responsive_wrapper = (ResponsiveWrapper);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/sandbox/index.js
const observeAndResizeJS = function () {
if (!MutationObserver || !document.body || !window.parent) {
const clientBoundingRect = document.body.getBoundingClientRect();