: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const post_summary_PANEL_NAME = 'post-status';
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
isRemovedPostStatusPanel: isEditorPanelRemoved(post_summary_PANEL_NAME),
postType: getCurrentPostType()
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_section, {
className: "editor-post-summary",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_post_status_info.Slot, {
children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCardPanel, {
actions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostActions, {
onActionPerformed: onActionPerformed
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFeaturedImagePanel, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostExcerptPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostContentInformation, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostLastEditedPanel, {})]
}), !isRemovedPostStatusPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedulePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostURLPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplatePanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostDiscussionPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostLastRevision, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PageAttributesPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSyncStatus, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlogTitle, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostsPerPage, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteDiscussion, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSticky, {})]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateAreas, {}), fills]
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/hooks.js
EXCLUDED_PATTERN_SOURCES,
PATTERN_TYPES: hooks_PATTERN_TYPES
} = unlock(external_wp_patterns_namespaceObject.privateApis);
function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
block.innerBlocks = block.innerBlocks.map(innerBlock => {
return injectThemeAttributeInBlockTemplateContent(innerBlock, currentThemeStylesheet);
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
block.attributes.theme = currentThemeStylesheet;
* Filter all patterns and return only the ones that are compatible with the current template.
* @param {Array} patterns An array of patterns.
* @param {Object} template The current template.
* @return {Array} Array of patterns that are compatible with the current template.
function filterPatterns(patterns, template) {
// Filter out duplicates.
const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name);
// Filter out core/directory patterns not included in theme.json.
const filterOutExcludedPatternSources = pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source);
// Looks for patterns that have the same template type as the current template,
// or have a block type that matches the current template area.
const filterCompatiblePatterns = pattern => pattern.templateTypes?.includes(template.slug) || pattern.blockTypes?.includes('core/template-part/' + template.area);
return patterns.filter((pattern, index, items) => {
return filterOutDuplicatesByName(pattern, index, items) && filterOutExcludedPatternSources(pattern) && filterCompatiblePatterns(pattern);
function preparePatterns(patterns, currentThemeStylesheet) {
return patterns.map(pattern => ({
keywords: pattern.keywords || [],
type: hooks_PATTERN_TYPES.theme,
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content, {
__unstableSkipMigrationLogs: true
}).map(block => injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet))
function useAvailablePatterns(template) {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _settings$__experimen;
const settings = getEditorSettings();
blockPatterns: (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns,
restBlockPatterns: select(external_wp_coreData_namespaceObject.store).getBlockPatterns(),
currentThemeStylesheet: select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const mergedPatterns = [...(blockPatterns || []), ...(restBlockPatterns || [])];
const filteredPatterns = filterPatterns(mergedPatterns, template);
return preparePatterns(filteredPatterns, template, currentThemeStylesheet);
}, [blockPatterns, restBlockPatterns, template, currentThemeStylesheet]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-transform-panel/index.js
function post_transform_panel_TemplatesList({
const shownTemplates = (0,external_wp_compose_namespaceObject.useAsyncList)(availableTemplates);
if (!availableTemplates || availableTemplates?.length === 0) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
label: (0,external_wp_i18n_namespaceObject.__)('Templates'),
blockPatterns: availableTemplates,
shownPatterns: shownTemplates,
onClickPattern: onSelect,
showTitlesAsTooltip: true
function PostTransform() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const type = getCurrentPostType();
const id = getCurrentPostId();
record: getEditedEntityRecord('postType', type, id)
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const availablePatterns = useAvailablePatterns(record);
const onTemplateSelect = async selectedTemplate => {
await editEntityRecord('postType', postType, postId, {
blocks: selectedTemplate.blocks,
content: (0,external_wp_blocks_namespaceObject.serialize)(selectedTemplate.blocks)
if (!availablePatterns?.length) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Design'),
initialOpen: record.type === TEMPLATE_PART_POST_TYPE,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_transform_panel_TemplatesList, {
availableTemplates: availablePatterns,
onSelect: onTemplateSelect
function PostTransformPanel() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
postType: getCurrentPostType()
if (![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransform, {});
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/constants.js
document: 'edit-post/document',
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/header.js
} = unlock(external_wp_components_namespaceObject.privateApis);
const SidebarHeader = (_, ref) => {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
// translators: Default label for the Document sidebar tab, not selected.
documentLabel: getPostTypeLabel() || (0,external_wp_i18n_namespaceObject._x)('Document', 'noun')
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(header_Tabs.TabList, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header_Tabs.Tab, {
// Used for focus management in the SettingsSidebar component.
"data-tab-id": sidebars.document,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header_Tabs.Tab, {
// Used for focus management in the SettingsSidebar component.
"data-tab-id": sidebars.block,
children: (0,external_wp_i18n_namespaceObject.__)('Block')
/* harmony default export */ const sidebar_header = ((0,external_wp_element_namespaceObject.forwardRef)(SidebarHeader));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/template-content-panel/index.js
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
function TemplateContentPanel() {
const clientIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
return getBlocksByName(PAGE_CONTENT_BLOCKS);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: (0,external_wp_i18n_namespaceObject.__)('Content'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/use-auto-switch-editor-sidebars.js
* This listener hook monitors for block selection and triggers the appropriate
function useAutoSwitchEditorSidebars() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
hasBlockSelection: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart()
getActiveComplementaryArea
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const activeGeneralSidebar = getActiveComplementaryArea('core');
const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
const isDistractionFree = getPreference('core', 'distractionFree');
if (!isEditorSidebarOpened || isDistractionFree) {
enableComplementaryArea('core', 'edit-post/block');
enableComplementaryArea('core', 'edit-post/document');
}, [hasBlockSelection, getActiveComplementaryArea, enableComplementaryArea, getPreference]);
/* harmony default export */ const use_auto_switch_editor_sidebars = (useAutoSwitchEditorSidebars);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/sidebar/index.js
} = unlock(external_wp_components_namespaceObject.privateApis);
const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({
const SidebarContent = ({
const tabListRef = (0,external_wp_element_namespaceObject.useRef)(null);
// Because `PluginSidebar` renders a `ComplementaryArea`, we
// need to forward the `Tabs` context so it can be passed through the
const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(sidebar_Tabs.Context);
// This effect addresses a race condition caused by tabbing from the last
// block in the editor into the settings sidebar. Without this effect, the
// selected tab and browser focus can become separated in an unexpected way
// (e.g the "block" tab is focused, but the "post" tab is selected).
(0,external_wp_element_namespaceObject.useEffect)(() => {
const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
const selectedTabElement = tabsElements.find(
// We are purposefully using a custom `data-tab-id` attribute here
// because we don't want rely on any assumptions about `Tabs`
element => element.getAttribute('data-tab-id') === tabName);
const activeElement = selectedTabElement?.ownerDocument.activeElement;
const tabsHasFocus = tabsElements.some(element => {
return activeElement && activeElement.id === element.id;
if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
selectedTabElement?.focus();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PluginSidebar, {
header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.Context.Provider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_header, {
closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings')
// This classname is added so we can apply a corrective negative
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
className: "editor-sidebar__panel",
headerClassName: "editor-sidebar__panel-tabs"
/* translators: button label text should, if possible, be under 16 characters. */,
title: (0,external_wp_i18n_namespaceObject.__)('Settings'),
toggleShortcut: keyboardShortcut,
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.Context.Provider, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(sidebar_Tabs.TabPanel, {
tabId: sidebars.document,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSummary, {
onActionPerformed: onActionPerformed
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(plugin_document_setting_panel.Slot, {}), renderingMode !== 'post-only' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplateContentPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTransformPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_taxonomies_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternOverridesPanel, {}), extraPanels]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(sidebar_Tabs.TabPanel, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {})
use_auto_switch_editor_sidebars();