: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Returns an action object used to open/close the list view.
* @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
* @return {Object} Action object.
function setIsListViewOpened(isOpen) {
type: 'SET_IS_LIST_VIEW_OPENED',
* Returns an action object signalling that the user closed the sidebar.
* @return {Object} Action creator.
const closeGeneralSidebar = () => ({
registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME);
* Action that handles moving a block between widget areas
* @param {string} clientId The clientId of the block to move.
* @param {string} widgetAreaId The id of the widget area to move the block to.
const moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({
const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId);
// Search the top level blocks (widget areas) for the one with the matching
// id attribute. Makes the assumption that all top-level blocks are widget
const widgetAreas = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks();
const destinationWidgetAreaBlock = widgetAreas.find(({
}) => attributes.id === widgetAreaId);
const destinationRootClientId = destinationWidgetAreaBlock.clientId;
// Get the index for moving to the end of the destination widget area.
const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId);
const destinationIndex = destinationInnerBlocksClientIds.length;
// Reveal the widget area, if it's not open.
const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(destinationRootClientId);
if (!isDestinationWidgetAreaOpen) {
dispatch.setIsWidgetAreaOpen(destinationRootClientId, true);
registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition([clientId], sourceRootClientId, destinationRootClientId, destinationIndex);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js
* Creates a "stub" widgets post reflecting all available widget areas. The
* post is meant as a convenient to only exists in runtime and should never be saved. It
* enables a convenient way of editing the widgets by using a regular post editor.
* Fetches all widgets from all widgets aras, converts them into blocks, and hydrates a new post with them.
* @return {Function} An action creator.
const getWidgetAreas = () => async ({
const query = buildWidgetAreasQuery();
const widgetAreas = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
const widgetAreaBlocks = [];
const sortedWidgetAreas = widgetAreas.sort((a, b) => {
if (a.id === 'wp_inactive_widgets') {
if (b.id === 'wp_inactive_widgets') {
for (const widgetArea of sortedWidgetAreas) {
widgetAreaBlocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/widget-area', {
if (!widgetArea.widgets.length) {
// If this widget area has no widgets, it won't get a post setup by
// the getWidgets resolver.
dispatch(persistStubPost(buildWidgetAreaPostId(widgetArea.id), []));
const widgetAreasOpenState = {};
widgetAreaBlocks.forEach((widgetAreaBlock, index) => {
// Defaults to open the first widget area.
widgetAreasOpenState[widgetAreaBlock.clientId] = index === 0;
dispatch(setWidgetAreasOpenState(widgetAreasOpenState));
dispatch(persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks));
* Fetches all widgets from all widgets ares, and groups them by widget area Id.
* @return {Function} An action creator.
const getWidgets = () => async ({
const query = buildWidgetsQuery();
const widgets = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', query);
const groupedBySidebar = {};
for (const widget of widgets) {
const block = transformWidgetToBlock(widget);
groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || [];
groupedBySidebar[widget.sidebar].push(block);
for (const sidebarId in groupedBySidebar) {
if (groupedBySidebar.hasOwnProperty(sidebarId)) {
// Persist the actual post containing the widget block
dispatch(persistStubPost(buildWidgetAreaPostId(sidebarId), groupedBySidebar[sidebarId]));
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js
const EMPTY_INSERTION_POINT = {
insertionIndex: undefined
* Returns all API widgets.
* @return {Object[]} API List of widgets.
const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery());
// Key widgets by their ID.
widgets?.reduce((allWidgets, widget) => ({
* Returns API widget data for a particular widget ID.
* @param {number} id Widget ID.
* @return {Object} API widget data for a particular widget ID.
const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, id) => {
const widgets = select(constants_STORE_NAME).getWidgets();
* Returns all API widget areas.
* @return {Object[]} API List of widget areas.
const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
const query = buildWidgetAreasQuery();
return select(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query);
* Returns widgetArea containing a block identify by given widgetId
* @param {string} widgetId The ID of the widget.
* @return {Object} Containing widget area.
const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, widgetId) => {
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
return widgetAreas.find(widgetArea => {
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id));
const blockWidgetIds = post.blocks.map(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block));
return blockWidgetIds.includes(widgetId);
* Given a child client id, returns the parent widget area block.
* @param {string} clientId The client id of a block in a widget area.
* @return {WPBlock} The widget area block.
const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId) => {
} = select(external_wp_blockEditor_namespaceObject.store);
const blockParents = getBlockParents(clientId);
const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area');
return getBlock(widgetAreaClientId);
* Returns all edited widget area entity records.
* @return {Object[]} List of edited widget area entity records.
const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ids) => {
let widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
widgetAreas = widgetAreas.filter(({
return widgetAreas.filter(({
}) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id))).map(({
}) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id));
* Returns all blocks representing reference widgets.
* @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned.
* @return {Array} List of all blocks representing reference widgets
const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, referenceWidgetName = null) => {
const widgetAreas = select(constants_STORE_NAME).getWidgetAreas();
for (const _widgetArea of widgetAreas) {
const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id));
for (const block of post.blocks) {
if (block.name === 'core/legacy-widget' && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) {
* Returns true if any widget area is currently being saved.
* @return {boolean} True if any widget area is currently being saved. False otherwise.
const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({
for (const id of widgetAreasIds) {
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id);
const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID
for (const id of widgetIds) {
const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id);
* Gets whether the widget area is opened.
* @param {Array} state The open state of the widget areas.
* @param {string} clientId The clientId of the widget area.
* @return {boolean} True if the widget area is open.
const getIsWidgetAreaOpen = (state, clientId) => {
return !!widgetAreasOpenState[clientId];
* Returns true if the inserter is opened.
* @param {Object} state Global application state.
* @return {boolean} Whether the inserter is opened.
function isInserterOpened(state) {
return !!state.blockInserterPanel;
* Get the insertion point for the inserter.
* @param {Object} state Global application state.
* @return {Object} The root client ID and index to insert at.
function __experimentalGetInsertionPoint(state) {
if (typeof state.blockInserterPanel === 'boolean') {
return EMPTY_INSERTION_POINT;
return state.blockInserterPanel;
* Returns true if a block can be inserted into a widget area.
* @param {Array} state The open state of the widget areas.
* @param {string} blockName The name of the block being inserted.
* @return {boolean} True if the block can be inserted in a widget area.
const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, blockName) => {
// Widget areas are always top-level blocks, which getBlocks will return.
const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
// Makes an assumption that a block that can be inserted into one
// widget area can be inserted into any widget area. Uses the first
// widget area for testing whether the block can be inserted.
const [firstWidgetArea] = widgetAreas;
return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(blockName, firstWidgetArea.clientId);
* Returns true if the list view is opened.
* @param {Object} state Global application state.
* @return {boolean} Whether the list view is opened.
function isListViewOpened(state) {
return state.listViewPanel;
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js
function getListViewToggleRef(state) {
return state.listViewToggleRef;
function getInserterSidebarToggleRef(state) {
return state.inserterSidebarToggleRef;
;// CONCATENATED MODULE: external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets');
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/store/index.js
* Block editor data store configuration.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
selectors: store_selectors_namespaceObject,
resolvers: resolvers_namespaceObject,
actions: store_actions_namespaceObject
* Store definition for the edit widgets namespace.
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig);
(0,external_wp_data_namespaceObject.register)(store_store);
// This package uses a few in-memory post types as wrappers for convenience.
// This middleware prevents any network requests related to these types as they are
external_wp_apiFetch_default().use(function (options, next) {
if (options.path?.indexOf('/wp/v2/types/widget-area') === 0) {
return Promise.resolve({});
unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject);
;// CONCATENATED MODULE: external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js
const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
canInsertBlockInWidgetArea
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
// Component won't display for a widget area, so don't run selectors.
if (blockName === 'core/widget-area') {
const selectors = select(store_store);
const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId);
widgetAreas: selectors.getWidgetAreas(),
currentWidgetAreaId: widgetAreaBlock?.attributes?.id,
canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName)
}, [clientId, blockName]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const hasMultipleWidgetAreas = widgetAreas?.length > 1;
const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, {