: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenamePatternModal, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/pattern-duplicate-modal/index.js
} = unlock(external_wp_patterns_namespaceObject.privateApis);
const pattern_duplicate_modal_modalName = 'editor/pattern-duplicate';
function PatternDuplicateModal() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const _postType = getCurrentPostType();
record: getEditedEntityRecord('postType', _postType, getCurrentPostId()),
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isModalActive(pattern_duplicate_modal_modalName));
if (!isActive || postType !== PATTERN_POST_TYPE) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DuplicatePatternModal, {
onSuccess: () => closeModal(),
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/commands/index.js
function useEditorCommandLoader() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _get, _getPostType$viewable;
} = select(external_wp_preferences_namespaceObject.store);
} = select(external_wp_blockEditor_namespaceObject.store);
} = select(external_wp_coreData_namespaceObject.store);
editorMode: (_get = get('core', 'editorMode')) !== null && _get !== void 0 ? _get : 'visual',
isListViewOpen: isListViewOpened(),
showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
isDistractionFree: get('core', 'distractionFree'),
isFocusMode: get('core', 'focusMode'),
isTopToolbar: get('core', 'fixedToolbar'),
isPreviewMode: getSettings().__unstableIsPreviewMode,
isViewable: (_getPostType$viewable = getPostType(getCurrentPostType())?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false,
isCodeEditingEnabled: getEditorSettings().codeEditingEnabled,
isRichEditingEnabled: getEditorSettings().richEditingEnabled,
isPublishSidebarEnabled: select(store_store).isPublishSidebarEnabled()
getActiveComplementaryArea
} = (0,external_wp_data_namespaceObject.useSelect)(store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
__unstableSaveForPreview,
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
} = (0,external_wp_data_namespaceObject.useSelect)(store_store);
const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
name: 'core/open-shortcut-help',
label: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'),
openModal('editor/keyboard-shortcut-help');
name: 'core/toggle-distraction-free',
label: isDistractionFree ? (0,external_wp_i18n_namespaceObject.__)('Exit Distraction Free') : (0,external_wp_i18n_namespaceObject.__)('Enter Distraction Free'),
name: 'core/open-preferences',
label: (0,external_wp_i18n_namespaceObject.__)('Editor preferences'),
openModal('editor/preferences');
name: 'core/toggle-spotlight-mode',
label: (0,external_wp_i18n_namespaceObject.__)('Toggle spotlight'),
toggle('core', 'focusMode');
createInfoNotice(isFocusMode ? (0,external_wp_i18n_namespaceObject.__)('Spotlight off.') : (0,external_wp_i18n_namespaceObject.__)('Spotlight on.'), {
id: 'core/editor/toggle-spotlight-mode/notice',
label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
toggle('core', 'focusMode');
name: 'core/toggle-list-view',
label: isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('Close List View') : (0,external_wp_i18n_namespaceObject.__)('Open List View'),
setIsListViewOpened(!isListViewOpen);
createInfoNotice(isListViewOpen ? (0,external_wp_i18n_namespaceObject.__)('List View off.') : (0,external_wp_i18n_namespaceObject.__)('List View on.'), {
id: 'core/editor/toggle-list-view/notice',
name: 'core/toggle-top-toolbar',
label: (0,external_wp_i18n_namespaceObject.__)('Toggle top toolbar'),
toggle('core', 'fixedToolbar');
createInfoNotice(isTopToolbar ? (0,external_wp_i18n_namespaceObject.__)('Top toolbar off.') : (0,external_wp_i18n_namespaceObject.__)('Top toolbar on.'), {
id: 'core/editor/toggle-top-toolbar/notice',
label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
toggle('core', 'fixedToolbar');
if (allowSwitchEditorMode) {
name: 'core/toggle-code-editor',
label: editorMode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Open code editor') : (0,external_wp_i18n_namespaceObject.__)('Exit code editor'),
switchEditorMode(editorMode === 'visual' ? 'text' : 'visual');
name: 'core/toggle-breadcrumbs',
label: showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Hide block breadcrumbs') : (0,external_wp_i18n_namespaceObject.__)('Show block breadcrumbs'),
toggle('core', 'showBlockBreadcrumbs');
createInfoNotice(showBlockBreadcrumbs ? (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs hidden.') : (0,external_wp_i18n_namespaceObject.__)('Breadcrumbs visible.'), {
id: 'core/editor/toggle-breadcrumbs/notice',
name: 'core/open-settings-sidebar',
label: (0,external_wp_i18n_namespaceObject.__)('Toggle settings sidebar'),
icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right,
const activeSidebar = getActiveComplementaryArea('core');
if (activeSidebar === 'edit-post/document') {
disableComplementaryArea('core');
enableComplementaryArea('core', 'edit-post/document');
name: 'core/open-block-inspector',
label: (0,external_wp_i18n_namespaceObject.__)('Toggle block inspector'),
const activeSidebar = getActiveComplementaryArea('core');
if (activeSidebar === 'edit-post/block') {
disableComplementaryArea('core');
enableComplementaryArea('core', 'edit-post/block');
name: 'core/toggle-publish-sidebar',
label: isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Disable pre-publish checks') : (0,external_wp_i18n_namespaceObject.__)('Enable pre-publish checks'),
icon: format_list_bullets,
toggle('core', 'isPublishSidebarEnabled');
createInfoNotice(isPublishSidebarEnabled ? (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks disabled.') : (0,external_wp_i18n_namespaceObject.__)('Pre-publish checks enabled.'), {
id: 'core/editor/publish-sidebar/notice',
name: 'core/preview-link',
label: (0,external_wp_i18n_namespaceObject.__)('Preview in a new tab'),
const postId = getCurrentPostId();
const link = await __unstableSaveForPreview();
window.open(link, `wp-preview-${postId}`);
function useEditedEntityContextualCommands() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
postType: getCurrentPostType()
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
if (postType === PATTERN_POST_TYPE) {
name: 'core/rename-pattern',
label: (0,external_wp_i18n_namespaceObject.__)('Rename pattern'),
name: 'core/duplicate-pattern',
label: (0,external_wp_i18n_namespaceObject.__)('Duplicate pattern'),
openModal(pattern_duplicate_modal_modalName);
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: 'core/editor/edit-ui',
hook: useEditorCommandLoader
(0,external_wp_commands_namespaceObject.useCommandLoader)({
name: 'core/editor/contextual-commands',
hook: useEditedEntityContextualCommands,
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-removal-warnings/index.js
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
// Prevent accidental removal of certain blocks, asking the user for confirmation first.
const TEMPLATE_BLOCKS = ['core/post-content', 'core/post-template', 'core/query'];
const BLOCK_REMOVAL_RULES = [{
// The warning is only shown when a user manipulates templates or template parts.
postTypes: ['wp_template', 'wp_template_part'],
callback(removedBlocks) {
const removedTemplateBlocks = removedBlocks.filter(({
}) => TEMPLATE_BLOCKS.includes(name));
if (removedTemplateBlocks.length) {
return (0,external_wp_i18n_namespaceObject._n)('Deleting this block will stop your post or page content from displaying on this template. It is not recommended.', 'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.', removedBlocks.length);
// The warning is only shown when the user edits a pattern.
callback(removedBlocks) {
const removedBlocksWithOverrides = removedBlocks.filter(({
}) => attributes?.metadata?.bindings && Object.values(attributes.metadata.bindings).some(binding => binding.source === 'core/pattern-overrides'));
if (removedBlocksWithOverrides.length) {
return (0,external_wp_i18n_namespaceObject._n)('The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?', 'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?', removedBlocks.length);
function BlockRemovalWarnings() {
const currentPostType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []);
const removalRulesForPostType = (0,external_wp_element_namespaceObject.useMemo)(() => BLOCK_REMOVAL_RULES.filter(rule => rule.postTypes.includes(currentPostType)), [currentPostType]);
// `BlockRemovalWarnings` is rendered in the editor provider, a shared component
// across react native and web. However, `BlockRemovalWarningModal` is web only.
// Check it exists before trying to render it.
if (!BlockRemovalWarningModal) {
if (!removalRulesForPostType) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarningModal, {
rules: removalRulesForPostType
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/start-page-options/index.js
function useStartPatterns() {
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
// and it has no postTypes declared and the current post type is page or if
// the current post type is part of the postTypes declared.
blockPatternsWithPostContentBlockType,
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
const rootClientId = getRenderingMode() === 'post-only' ? '' : getBlocksByName('core/post-content')?.[0];
blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content', rootClientId),
postType: getCurrentPostType()
return (0,external_wp_element_namespaceObject.useMemo)(() => {
// filter patterns without postTypes declared if the current postType is page
// or patterns that declare the current postType in its post type array.
return blockPatternsWithPostContentBlockType.filter(pattern => {
return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);