: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
className: 'editor-preview-dropdown__toggle',
showTooltip: !showIconLabels,
__experimentalIsFocusable: disabled
'aria-label': (0,external_wp_i18n_namespaceObject.__)('View options')
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
className: "editor-preview-dropdown",
popoverProps: popoverProps,
toggleProps: toggleProps,
icon: deviceIcons[deviceType.toLowerCase()],
label: (0,external_wp_i18n_namespaceObject.__)('View'),
disableOpenOnArrowDown: disabled,
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => setDeviceType('Desktop'),
icon: deviceType === 'Desktop' && library_check,
children: (0,external_wp_i18n_namespaceObject.__)('Desktop')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => setDeviceType('Tablet'),
icon: deviceType === 'Tablet' && library_check,
children: (0,external_wp_i18n_namespaceObject.__)('Tablet')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => setDeviceType('Mobile'),
icon: deviceType === 'Mobile' && library_check,
children: (0,external_wp_i18n_namespaceObject.__)('Mobile')
}), isTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, {
children: [(0,external_wp_i18n_namespaceObject.__)('View site'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: /* translators: accessibility text */
(0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
}), isViewable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, {
className: "editor-preview-dropdown__button-external",
forceIsAutosaveable: forceIsAutosaveable,
textContent: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Preview in new tab'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/header/index.js
const toolbarVariations = {
distractionFreeDisabled: {
const backButtonVariations = {
distractionFreeDisabled: {
setEntitiesSavedStatesCallback,
const isWideViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large');
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_preferences_namespaceObject.store);
isPublishSidebarOpened: _isPublishSidebarOpened
} = select(external_wp_blockEditor_namespaceObject.store);
isTextEditor: getEditorMode() === 'text',
isPublishSidebarOpened: _isPublishSidebarOpened(),
showIconLabels: getPreference('core', 'showIconLabels'),
hasFixedToolbar: getPreference('core', 'fixedToolbar'),
isNestedEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord,
isZoomedOutView: __unstableGetEditorMode() === 'zoom-out'
const hasTopToolbar = isLargeViewport && hasFixedToolbar;
const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = (0,external_wp_element_namespaceObject.useState)(true);
// The edit-post-header classname is only kept for backward compatibilty
// as some plugins might be relying on its presence.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-header edit-post-header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
variants: backButtonVariations,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button.Slot, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
variants: toolbarVariations,
className: "editor-header__toolbar",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(document_tools, {
disableBlockTools: forceDisableBlockTools || isTextEditor
}), hasTopToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(collapsible_block_toolbar, {
isCollapsed: isBlockToolsCollapsed,
onToggle: setIsBlockToolsCollapsed
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: dist_clsx('editor-header__center', {
'is-collapsed': !isBlockToolsCollapsed && hasTopToolbar
children: !title ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentBar, {}) : title
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, {
variants: toolbarVariations,
className: "editor-header__settings",
children: [!customSaveButton && !isPublishSidebarOpened &&
// This button isn't completely hidden by the publish sidebar.
// We can't hide the whole toolbar when the publish sidebar is open because
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
// We track that DOM node to return focus to the PostPublishButtonOrToggle
// when the publish sidebar has been closed.
(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSavedState, {
forceIsDirty: forceIsDirty
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewDropdown, {
forceIsAutosaveable: forceIsDirty,
disabled: isNestedEntity || isZoomedOutView
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostPreviewButton, {
className: "editor-header__post-preview-button",
forceIsAutosaveable: forceIsDirty
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostViewLink, {}), !customSaveButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_publish_button_or_toggle, {
forceIsDirty: forceIsDirty,
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
}), customSaveButton, (isWideViewport || !showIconLabels) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items.Slot, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})]
/* harmony default export */ const components_header = (Header);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/inserter-sidebar/index.js
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
function InserterSidebar() {
blockSectionRootClientId,
inserterSidebarToggleRef,
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getInserterSidebarToggleRef,
} = unlock(select(store_store));
} = select(external_wp_blockEditor_namespaceObject.store);
} = select(external_wp_preferences_namespaceObject.store);
getActiveComplementaryArea
const getBlockSectionRootClientId = () => {
if (__unstableGetEditorMode() === 'zoom-out') {
} = unlock(getSettings());
if (sectionRootClientId) {
return sectionRootClientId;
return getBlockRootClientId();
inserterSidebarToggleRef: getInserterSidebarToggleRef(),
insertionPoint: getInsertionPoint(),
showMostUsedBlocks: get('core', 'mostUsedBlocks'),
blockSectionRootClientId: getBlockSectionRootClientId(),
sidebarIsOpened: !!(getActiveComplementaryArea('core') || isPublishSidebarOpened())
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
const [inserterDialogRef, inserterDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({
onClose: () => setIsInserterOpened(false),
const libraryRef = (0,external_wp_element_namespaceObject.useRef)();
// When closing the inserter, focus should return to the toggle button.
const closeInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsInserterOpened(false);
inserterSidebarToggleRef.current?.focus();
}, [inserterSidebarToggleRef, setIsInserterOpened]);
const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
}, [closeInserterSidebar]);
const inserterContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-inserter-sidebar__content",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterLibrary, {
showMostUsedBlocks: showMostUsedBlocks,
showInserterHelpPanel: true,
shouldFocusBlock: isMobileViewport,
rootClientId: blockSectionRootClientId !== null && blockSectionRootClientId !== void 0 ? blockSectionRootClientId : insertionPoint.rootClientId,
__experimentalInsertionIndex: insertionPoint.insertionIndex,
__experimentalInitialTab: insertionPoint.tab,
__experimentalInitialCategory: insertionPoint.category,
__experimentalFilterValue: insertionPoint.filterValue,
onPatternCategorySelection: sidebarIsOpened ? () => disableComplementaryArea('core') : undefined,
onClose: closeInserterSidebar
if (window.__experimentalEnableZoomedOutPatternsTab) {
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
onKeyDown: closeOnEscape,
className: "editor-inserter-sidebar",
children: inserterContents
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-inserter-sidebar",
children: inserterContents
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/list-view-outline.js
function ListViewOutline() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-list-view-sidebar__outline",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: (0,external_wp_i18n_namespaceObject.__)('Characters:')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CharacterCount, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: (0,external_wp_i18n_namespaceObject.__)('Words:')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WordCount, {})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: (0,external_wp_i18n_namespaceObject.__)('Time to read:')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TimeToRead, {})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DocumentOutline, {})]
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/list-view-sidebar/index.js
} = unlock(external_wp_components_namespaceObject.privateApis);
function ListViewSidebar() {
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store));
// This hook handles focus when the sidebar first renders.
const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement');
// When closing the list view, focus should return to the toggle button.
const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => {
setIsListViewOpened(false);
getListViewToggleRef().current?.focus();
}, [getListViewToggleRef, setIsListViewOpened]);
const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) {
// Use internal state instead of a ref to make sure that the component
// re-renders when the dropZoneElement updates.
const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null);
// Tracks our current tab.
const [tab, setTab] = (0,external_wp_element_namespaceObject.useState)('list-view');
// This ref refers to the sidebar as a whole.
const sidebarRef = (0,external_wp_element_namespaceObject.useRef)();
// This ref refers to the tab panel.
const tabsRef = (0,external_wp_element_namespaceObject.useRef)();
// This ref refers to the list view application area.
const listViewRef = (0,external_wp_element_namespaceObject.useRef)();
// Must merge the refs together so focus can be handled properly in the next function.
const listViewContainerRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, listViewRef, setDropZoneElement]);
* Callback function to handle list view or outline focus.
* @param {string} currentTab The current tab. Either list view or outline.
function handleSidebarFocus(currentTab) {
const tabPanelFocus = external_wp_dom_namespaceObject.focus.tabbable.find(tabsRef.current)[0];
// List view tab is selected.
if (currentTab === 'list-view') {
// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
const listViewApplicationFocus = external_wp_dom_namespaceObject.focus.tabbable.find(listViewRef.current)[0];
const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
listViewFocusArea.focus();
// Outline tab is selected.
const handleToggleListViewShortcut = (0,external_wp_element_namespaceObject.useCallback)(() => {
// If the sidebar has focus, it is safe to close.
if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
// If the list view or outline does not have focus, focus should be moved to it.
}, [closeListView, tab]);