: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
getUserPatternCategories,
getBlockPatternCategories
} = select(external_wp_coreData_namespaceObject.store);
} = select(external_wp_preferences_namespaceObject.store);
} = select(external_wp_blocks_namespaceObject.store);
} = select(external_wp_blockEditor_namespaceObject.store);
const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
function getSectionRootBlock() {
var _getBlocksByName$find;
if (renderingMode === 'template-locked') {
return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : '';
return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : '';
allowRightClickOverrides: get('core', 'allowRightClickOverrides'),
blockTypes: getBlockTypes(),
canUseUnfilteredHTML: getRawEntityRecord('postType', postType, postId)?._links?.hasOwnProperty('wp:action-unfiltered-html'),
focusMode: get('core', 'focusMode'),
hasFixedToolbar: get('core', 'fixedToolbar') || !isLargeViewport,
hiddenBlockTypes: get('core', 'hiddenBlockTypes'),
isDistractionFree: get('core', 'distractionFree'),
keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'),
hasUploadPermissions: (_canUser = canUser('create', 'media')) !== null && _canUser !== void 0 ? _canUser : true,
userCanCreatePages: canUser('create', 'pages'),
pageOnFront: siteSettings?.page_on_front,
pageForPosts: siteSettings?.page_for_posts,
userPatternCategories: getUserPatternCategories(),
restBlockPatternCategories: getBlockPatternCategories(),
sectionRootClientId: getSectionRootBlock()
}, [postType, postId, isLargeViewport, renderingMode]);
merged: mergedGlobalStyles
} = useGlobalStylesContext();
const globalStylesData = (_mergedGlobalStyles$s = mergedGlobalStyles.styles) !== null && _mergedGlobalStyles$s !== void 0 ? _mergedGlobalStyles$s : DEFAULT_STYLES;
const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
settings.__experimentalBlockPatterns; // WP 5.9
const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 :
settings.__experimentalBlockPatternCategories; // WP 5.9
const blockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatterns || [])].filter(({
return !postTypes || Array.isArray(postTypes) && postTypes.includes(postType);
}), [settingsBlockPatterns, postType]);
const blockPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => [...(settingsBlockPatternCategories || []), ...(restBlockPatternCategories || [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)), [settingsBlockPatternCategories, restBlockPatternCategories]);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
* This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.
* @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.
* @return {Object} the post type object that was created.
const createPageEntity = (0,external_wp_element_namespaceObject.useCallback)(options => {
if (!userCanCreatePages) {
message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Pages.')
return saveEntityRecord('postType', 'page', options);
}, [saveEntityRecord, userCanCreatePages]);
const allowedBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Omit hidden block types if exists and non-empty.
if (hiddenBlockTypes && hiddenBlockTypes.length > 0) {
// Defer to passed setting for `allowedBlockTypes` if provided as
// anything other than `true` (where `true` is equivalent to allow
const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
}) => name) : settings.allowedBlockTypes || [];
return defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
return settings.allowedBlockTypes;
}, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
const forceDisableFocusMode = settings.focusMode === false;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
const blockEditorSettings = {
...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
[globalStylesDataKey]: globalStylesData,
allowRightClickOverrides,
focusMode: focusMode && !forceDisableFocusMode,
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
__experimentalBlockPatterns: blockPatterns,
[selectBlockPatternsKey]: select => {
getBlockPatternsForPostType
} = unlock(select(external_wp_coreData_namespaceObject.store));
const patterns = getBlockPatternsForPostType(postType);
return hasFinishedResolution('getBlockPatterns') ? patterns : undefined;
[reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
__experimentalBlockPatternCategories: blockPatternCategories,
__experimentalUserPatternCategories: userPatternCategories,
__experimentalFetchLinkSuggestions: (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings),
inserterMediaCategories: media_categories,
__experimentalFetchRichUrlData: external_wp_coreData_namespaceObject.__experimentalFetchUrlData,
// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
// This might be better as a generic "canUser" selector.
__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
//Todo: this is only needed for native and should probably be removed.
__experimentalUndo: undo,
// Check whether we want all site editor frames to have outlines
// including the navigation / pattern / parts editors.
outlineMode: postType === 'wp_template',
// Check these two properties: they were not present in the site editor.
__experimentalCreatePageEntity: createPageEntity,
__experimentalUserCanCreatePages: userCanCreatePages,
__experimentalPreferPatternsOnRoot: postType === 'wp_template',
templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
__experimentalSetIsInserterOpened: setIsInserterOpened
lock(blockEditorSettings, {
return blockEditorSettings;
}, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData]);
/* harmony default export */ const use_block_editor_settings = (useBlockEditorSettings);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/disable-non-page-content-blocks.js
const DEFAULT_CONTENT_ONLY_BLOCKS = ['core/post-title', 'core/post-featured-image', 'core/post-content', 'core/template-part'];
* Component that when rendered, makes it so that the site editor allows only
* page content to be edited.
function DisableNonPageContentBlocks() {
const contentOnlyBlocks = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.postContentBlockTypes', DEFAULT_CONTENT_ONLY_BLOCKS);
// Note that there are two separate subscription because the result for each
const contentOnlyIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
return getBlocksByName(contentOnlyBlocks).filter(clientId => getBlockParents(clientId).every(parentClientId => {
const parentBlockName = getBlockName(parentClientId);
// Ignore descendents of the query block.
parentBlockName !== 'core/query' &&
// Enable only the top-most block.
!contentOnlyBlocks.includes(parentBlockName)
const disabledIds = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
return getBlocksByName(['core/template-part']).flatMap(clientId => getBlockOrder(clientId));
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
} = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
setBlockEditingMode('', 'disabled');
for (const clientId of contentOnlyIds) {
setBlockEditingMode(clientId, 'contentOnly');
for (const clientId of disabledIds) {
setBlockEditingMode(clientId, 'disabled');
unsetBlockEditingMode('');
for (const clientId of contentOnlyIds) {
unsetBlockEditingMode(clientId);
for (const clientId of disabledIds) {
unsetBlockEditingMode(clientId);
}, [contentOnlyIds, disabledIds, registry]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/navigation-block-editing-mode.js
* For the Navigation block editor, we need to force the block editor to contentOnly for that block.
* Set block editing mode to contentOnly when entering Navigation focus mode.
* this ensures that non-content controls on the block will be hidden and thus
* the user can focus on editing the Navigation Menu content only.
function NavigationBlockEditingMode() {
// In the navigation block editor,
// the navigation block is the only root block.
const blockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlockOrder()?.[0], []);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
(0,external_wp_element_namespaceObject.useEffect)(() => {
setBlockEditingMode(blockClientId, 'contentOnly');
unsetBlockEditingMode(blockClientId);
}, [blockClientId, unsetBlockEditingMode, setBlockEditingMode]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/use-hide-blocks-from-inserter.js
// These post types are "structural" block lists.
// We should be allowed to use
// the post content and template parts blocks within them.
const POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = ['wp_block', 'wp_template', 'wp_template_part'];
* In some specific contexts,
* the template part and post content blocks need to be hidden.
* @param {string} postType Post Type
* @param {string} mode Rendering mode
function useHideBlocksFromInserter(postType, mode) {
(0,external_wp_element_namespaceObject.useEffect)(() => {
* Prevent adding template part in the editor.
(0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (canInsert, blockType) => {
if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/template-part' && mode === 'post-only') {
* Prevent adding post content block (except in query block) in the editor.
(0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter', (canInsert, blockType, rootClientId, {
getBlockParentsByBlockName
if (!POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(postType) && blockType.name === 'core/post-content') {
return getBlockParentsByBlockName(rootClientId, 'core/query').length > 0;
(0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter');
(0,external_wp_hooks_namespaceObject.removeFilter)('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter');
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard.js
const keyboard = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"
/* harmony default export */ const library_keyboard = (keyboard);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"
/* harmony default export */ const list_view = (listView);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/code.js
const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"
/* harmony default export */ const library_code = (code);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-left.js
const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"
/* harmony default export */ const drawer_left = (drawerLeft);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/drawer-right.js
const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"
/* harmony default export */ const drawer_right = (drawerRight);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-default.js
const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"
/* harmony default export */ const block_default = (blockDefault);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
/* harmony default export */ const format_list_bullets = (formatListBullets);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/external.js
const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
/* harmony default export */ const library_external = (external);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"
/* harmony default export */ const library_pencil = (pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
/* harmony default export */ const edit = (library_pencil);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/pattern-rename-modal/index.js
} = unlock(external_wp_patterns_namespaceObject.privateApis);
const modalName = 'editor/pattern-rename';
function PatternRenameModal() {
} = (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(modalName));
if (!isActive || postType !== PATTERN_POST_TYPE) {