: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-widgets-editor__list-view-panel-content",
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, setDropZoneElement]),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
dropZoneElement: dropZoneElement
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/index.js
function SecondarySidebar() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
isInserterOpen: isInserterOpened(),
isListViewOpen: isListViewOpened()
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {});
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/interface.js
const interfaceLabels = {
/* translators: accessibility text for the widgets screen top bar landmark region. */
header: (0,external_wp_i18n_namespaceObject.__)('Widgets top bar'),
/* translators: accessibility text for the widgets screen content landmark region. */
body: (0,external_wp_i18n_namespaceObject.__)('Widgets and blocks'),
/* translators: accessibility text for the widgets screen settings landmark region. */
sidebar: (0,external_wp_i18n_namespaceObject.__)('Widgets settings'),
/* translators: accessibility text for the widgets screen footer landmark region. */
footer: (0,external_wp_i18n_namespaceObject.__)('Widgets footer')
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
const isHugeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('huge', '>=');
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
hasBlockBreadCrumbsEnabled,
} = (0,external_wp_data_namespaceObject.useSelect)(select => ({
hasSidebarEnabled: !!select(store).getActiveComplementaryArea(store_store.name),
isInserterOpened: !!select(store_store).isInserterOpened(),
isListViewOpened: !!select(store_store).isListViewOpened(),
hasBlockBreadCrumbsEnabled: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'showBlockBreadcrumbs'),
previousShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/previous-region'),
nextShortcut: select(external_wp_keyboardShortcuts_namespaceObject.store).getAllShortcutKeyCombinations('core/edit-widgets/next-region')
// Inserter and Sidebars are mutually exclusive
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (hasSidebarEnabled && !isHugeViewport) {
setIsInserterOpened(false);
setIsListViewOpened(false);
}, [hasSidebarEnabled, isHugeViewport]);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if ((isInserterOpened || isListViewOpened) && !isHugeViewport) {
}, [isInserterOpened, isListViewOpened, isHugeViewport]);
const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('List View') : (0,external_wp_i18n_namespaceObject.__)('Block Library');
const hasSecondarySidebar = isListViewOpened || isInserterOpened;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(interface_skeleton, {
secondarySidebar: secondarySidebarLabel
header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, {}),
secondarySidebar: hasSecondarySidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SecondarySidebar, {}),
sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area.Slot, {
scope: "core/edit-widgets"
content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreasBlockEditorContent, {
blockEditorSettings: blockEditorSettings
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-widgets-layout__footer",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, {
rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Widgets')
previous: previousShortcut,
/* harmony default export */ const layout_interface = (Interface);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js
* Warns the user if there are unsaved changes before leaving the editor.
* This is a duplicate of the component implemented in the editor package.
* Duplicated here as edit-widgets doesn't depend on editor.
* @return {Component} The component.
function UnsavedChangesWarning() {
const isDirty = (0,external_wp_data_namespaceObject.useSelect)(select => {
const editedWidgetAreas = getEditedWidgetAreas();
return editedWidgetAreas?.length > 0;
(0,external_wp_element_namespaceObject.useEffect)(() => {
* Warns the user if there are unsaved changes before leaving the editor.
* @param {Event} event `beforeunload` event.
* @return {string | undefined} Warning prompt message, if unsaved changes exist.
const warnIfUnsavedChanges = event => {
event.returnValue = (0,external_wp_i18n_namespaceObject.__)('You have unsaved changes. If you proceed, they will be lost.');
return event.returnValue;
window.addEventListener('beforeunload', warnIfUnsavedChanges);
window.removeEventListener('beforeunload', warnIfUnsavedChanges);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js
function WelcomeGuide() {
var _widgetAreas$filter$l;
const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas({
const isEntirelyBlockWidgets = widgetAreas?.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-')));
const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas?.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, {
className: "edit-widgets-welcome-guide",
contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'),
finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'),
onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'),
image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
className: "edit-widgets-welcome-guide__heading",
children: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets')
}), isEntirelyBlockWidgets ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "edit-widgets-welcome-guide__text",
children: (0,external_wp_i18n_namespaceObject.sprintf)(
// Translators: %s: Number of block areas in the current theme.
(0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas)
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "edit-widgets-welcome-guide__text",
children: (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
className: "edit-widgets-welcome-guide__text",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
children: (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?')
}), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/'),
children: (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.')
image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
className: "edit-widgets-welcome-guide__heading",
children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "edit-widgets-welcome-guide__text",
children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')
image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
className: "edit-widgets-welcome-guide__heading",
children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "edit-widgets-welcome-guide__text",
children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
className: "edit-widgets-welcome-guide__inserter-icon",
alt: (0,external_wp_i18n_namespaceObject.__)('inserter'),
src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
className: "edit-widgets-welcome-guide__heading",
children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
className: "edit-widgets-welcome-guide__text",
children: [(0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'),
children: (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.")
function WelcomeGuideImage({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", {
className: "edit-widgets-welcome-guide__image",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", {
media: "(prefers-reduced-motion: reduce)"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
function onPluginAreaError(name) {
createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */
(0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WidgetAreasBlockEditorProvider, {
blockEditorSettings: blockEditorSettings,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout_interface, {
blockEditorSettings: blockEditorSettings
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, {
onError: onPluginAreaError
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {})]
/* harmony default export */ const layout = (Layout);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-widgets/build-module/index.js
const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])];
* Initializes the block editor in the widgets screen.
* @param {string} id ID of the root element to render the screen in.
* @param {Object} settings Block editor settings.
function initializeEditor(id, settings) {
const target = document.getElementById(id);
const root = (0,external_wp_element_namespaceObject.createRoot)(target);
const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(block => {
return !(disabledBlocks.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site') || block.name.startsWith('core/navigation'));
(0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-widgets', {
showBlockBreadcrumbs: true,
(0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters();
(0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks);
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)();
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetVariations)(settings);
registerBlock(widget_area_namespaceObject);
(0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)();
settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings);
// As we are unregistering `core/freeform` to avoid the Classic block, we must
// replace it with something as the default freeform content handler. Failure to
// do this will result in errors in the default block parser.
// see: https://github.com/WordPress/gutenberg/issues/33097
(0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)('core/html');
root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, {
blockEditorSettings: settings
* Compatibility export under the old `initialize` name.
const initialize = initializeEditor;
function reinitializeEditor() {
external_wp_deprecated_default()('wp.editWidgets.reinitializeEditor', {
* Function to register an individual block.
* @param {Object} block The block to be registered.
const registerBlock = block => {
(0,external_wp_blocks_namespaceObject.unstable__bootstrapServerSideBlockDefinitions)({
(0,external_wp_blocks_namespaceObject.registerBlockType)(name, settings);
(window.wp = window.wp || {}).editWidgets = __webpack_exports__;