: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
}), isMoveToWidgetAreaVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_widgets_namespaceObject.MoveToWidgetArea, {
widgetAreas: widgetAreas,
currentWidgetAreaId: currentWidgetAreaId,
onSelect: widgetAreaId => {
moveBlockToWidgetArea(props.clientId, widgetAreaId);
}, 'withMoveToWidgetAreaToolbarItem');
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-widgets/block-edit', withMoveToWidgetAreaToolbarItem);
;// CONCATENATED MODULE: external ["wp","mediaUtils"]
const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js
const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload;
(0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js
/** @typedef {import('@wordpress/element').RefObject} RefObject */
* A React hook to determine if it's dragging within the target element.
* @param {RefObject<HTMLElement>} elementRef The target elementRef object.
* @return {boolean} Is dragging within the target element.
const useIsDraggingWithin = elementRef => {
const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
function handleDragStart(event) {
// Check the first time when the dragging starts.
// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
function handleDragEnd() {
setIsDraggingWithin(false);
function handleDragEnter(event) {
// Check if the current target is inside the item element.
if (elementRef.current.contains(event.target)) {
setIsDraggingWithin(true);
setIsDraggingWithin(false);
// Bind these events to the document to catch all drag events.
// Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.
ownerDocument.addEventListener('dragstart', handleDragStart);
ownerDocument.addEventListener('dragend', handleDragEnd);
ownerDocument.addEventListener('dragenter', handleDragEnter);
ownerDocument.removeEventListener('dragstart', handleDragStart);
ownerDocument.removeEventListener('dragend', handleDragEnd);
ownerDocument.removeEventListener('dragenter', handleDragEnter);
/* harmony default export */ const use_is_dragging_within = (useIsDraggingWithin);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js
function WidgetAreaInnerBlocks({
const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('root', 'postType');
const innerBlocksRef = (0,external_wp_element_namespaceObject.useRef)();
const isDraggingWithinInnerBlocks = use_is_dragging_within(innerBlocksRef);
const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
// Using the experimental hook so that we can control the className of the element.
const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
renderAppender: external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
"data-widget-area-id": id,
className: dist_clsx('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js
/** @typedef {import('@wordpress/element').RefObject} RefObject */
function WidgetAreaEdit({
const isOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getIsWidgetAreaOpen(clientId), [clientId]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const wrapper = (0,external_wp_element_namespaceObject.useRef)();
const setOpen = (0,external_wp_element_namespaceObject.useCallback)(openState => setIsWidgetAreaOpen(clientId, openState), [clientId]);
const isDragging = useIsDragging(wrapper);
const isDraggingWithin = use_is_dragging_within(wrapper);
const [openedWhileDragging, setOpenedWhileDragging] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setOpenedWhileDragging(false);
if (isDraggingWithin && !isOpen) {
setOpenedWhileDragging(true);
} else if (!isDraggingWithin && isOpen && openedWhileDragging) {
}, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
setIsWidgetAreaOpen(clientId, !isOpen);
scrollAfterOpen: !isDragging,
// This is required to ensure LegacyWidget blocks are not
// unmounted when the panel is collapsed. Unmounting legacy
// widgets may have unintended consequences (e.g. TinyMCE
// not being properly reinitialized)
(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableDisclosureContent, {
className: "wp-block-widget-area__panel-body-content",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreaInnerBlocks, {
* A React hook to determine if dragging is active.
* @param {RefObject<HTMLElement>} elementRef The target elementRef object.
* @return {boolean} Is dragging within the entire document.
const useIsDragging = elementRef => {
const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
function handleDragStart() {
function handleDragEnd() {
ownerDocument.addEventListener('dragstart', handleDragStart);
ownerDocument.addEventListener('dragend', handleDragEnd);
ownerDocument.removeEventListener('dragstart', handleDragStart);
ownerDocument.removeEventListener('dragend', handleDragEnd);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js
$schema: "https://schemas.wp.org/trunk/block.json",
name: "core/widget-area",
__experimentalToolbar: false,
__experimentalParentSelector: false,
__experimentalDisableBlockOverlay: true
editorStyle: "wp-block-widget-area-editor",
style: "wp-block-widget-area"
title: (0,external_wp_i18n_namespaceObject.__)('Widget Area'),
description: (0,external_wp_i18n_namespaceObject.__)('A widget area container.'),
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
function ErrorBoundaryWarning({
const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, {
children: (0,external_wp_i18n_namespaceObject.__)('Copy Error')
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, {
className: "edit-widgets-error-boundary",
class ErrorBoundary extends external_wp_element_namespaceObject.Component {
componentDidCatch(error) {
(0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error);
static getDerivedStateFromError(error) {
return this.props.children;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundaryWarning, {
message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'),
;// CONCATENATED MODULE: external ["wp","patterns"]
const external_wp_patterns_namespaceObject = window["wp"]["patterns"];
;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
;// CONCATENATED MODULE: external ["wp","keycodes"]
const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js
function KeyboardShortcuts() {
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/undo', event => {
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/redo', event => {
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/save', event => {
function KeyboardShortcutsRegister() {
// Registering the shortcuts.
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
name: 'core/edit-widgets/undo',
description: (0,external_wp_i18n_namespaceObject.__)('Undo your last changes.'),
name: 'core/edit-widgets/redo',
description: (0,external_wp_i18n_namespaceObject.__)('Redo your last undo.'),
modifier: 'primaryShift',
// Disable on Apple OS because it conflicts with the browser's
// history shortcut. It's a fine alias for both Windows and Linux.
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
// Linux, we keep it as the default for consistency.
aliases: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? [] : [{
name: 'core/edit-widgets/save',
description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'),
name: 'core/edit-widgets/keyboard-shortcuts',
description: (0,external_wp_i18n_namespaceObject.__)('Display these keyboard shortcuts.'),
name: 'core/edit-widgets/next-region',
description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the next part of the editor.'),
name: 'core/edit-widgets/previous-region',
description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous part of the editor.'),
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js
* A react hook that returns the client id of the last widget area to have
* been selected, or to have a selected block within it.
* @return {string} clientId of the widget area last selected.