: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const _postTypeObject = getPostType(postType);
const _resource = _postTypeObject?.rest_base || '';
postTypeObject: _postTypeObject,
cachedCanUserResolvers: getCachedResolvers()?.canUser,
userCanCreatePostType: canUser('create', _resource),
isBlockBasedTheme: getCurrentTheme()?.is_block_theme
const trashPostActionForPostType = useTrashPostAction(resource);
const permanentlyDeletePostActionForPostType = usePermanentlyDeletePostAction(resource);
const renamePostActionForPostType = useRenamePostAction(resource);
const restorePostActionForPostType = useRestorePostAction(resource);
const isTemplateOrTemplatePart = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
const isPattern = postType === PATTERN_POST_TYPE;
const isLoaded = !!postTypeObject;
const supportsRevisions = !!postTypeObject?.supports?.revisions;
const supportsTitle = !!postTypeObject?.supports?.title;
return (0,external_wp_element_namespaceObject.useMemo)(() => {
let actions = [postTypeObject?.viewable && viewPostAction, supportsRevisions && postRevisionsAction, false ? 0 : false, isTemplateOrTemplatePart && userCanCreatePostType && isBlockBasedTheme && duplicateTemplatePartAction, isPattern && userCanCreatePostType && duplicatePatternAction, supportsTitle && renamePostActionForPostType, isPattern && exportPatternAsJSONAction, isTemplateOrTemplatePart ? resetTemplateAction : restorePostActionForPostType, isTemplateOrTemplatePart || isPattern ? deletePostAction : trashPostActionForPostType, !isTemplateOrTemplatePart && permanentlyDeletePostActionForPostType].filter(Boolean);
// Filter actions based on provided context. If not provided
// all actions are returned. We'll have a single entry for getting the actions
// and the consumer should provide the context to filter the actions, if needed.
// Actions should also provide the `context` they support, if it's specific, to
// compare with the provided context to get all the actions.
// Right now the only supported context is `list`.
actions = actions.filter(action => {
return action.context === context;
for (let i = 0; i < actions.length; ++i) {
if (actions[i].callback) {
const existingCallback = actions[i].callback;
callback: (items, _onActionPerformed) => {
existingCallback(items, _items => {
if (_onActionPerformed) {
_onActionPerformed(_items);
onActionPerformed(actions[i].id, _items);
if (actions[i].RenderModal) {
const ExistingRenderModal = actions[i].RenderModal;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExistingRenderModal, {
onActionPerformed: _items => {
if (props.onActionPerformed) {
props.onActionPerformed(_items);
onActionPerformed(actions[i].id, _items);
// We are making this use memo depend on cachedCanUserResolvers as a way to make the component using this hook re-render
// when user capabilities are resolved. This makes sure the isEligible functions of actions dependent on capabilities are re-evaluated.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isTemplateOrTemplatePart, isPattern, postTypeObject?.viewable, permanentlyDeletePostActionForPostType, restorePostActionForPostType, renamePostActionForPostType, trashPostActionForPostType, onActionPerformed, isLoaded, supportsRevisions, supportsTitle, context, userCanCreatePostType, cachedCanUserResolvers]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js
DropdownMenuV2: DropdownMenu,
DropdownMenuGroupV2: DropdownMenuGroup,
DropdownMenuItemV2: DropdownMenuItem,
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
} = unlock(external_wp_components_namespaceObject.privateApis);
const [isActionsMenuOpen, setIsActionsMenuOpen] = (0,external_wp_element_namespaceObject.useState)(false);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const _postType = getCurrentPostType();
item: getEditedEntityRecord('postType', _postType, getCurrentPostId()),
const allActions = usePostActions({
const actions = (0,external_wp_element_namespaceObject.useMemo)(() => {
return allActions.filter(action => {
return !action.isEligible || action.isEligible(item);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenu, {
trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
disabled: !actions.length,
__experimentalIsFocusable: true,
className: "editor-all-actions-button",
onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen),
onOpenChange: setIsActionsMenuOpen,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, {
setIsActionsMenuOpen(false);
// From now on all the functions on this file are copied as from the dataviews packages,
// The editor packages should not be using the dataviews packages directly,
// and the dataviews package should not be using the editor packages directly,
// so duplicating the code here seems like the least bad option.
// Copied as is from packages/dataviews/src/item-actions.js
function DropdownMenuItemTrigger({
const label = typeof action.label === 'string' ? action.label : action.label(items);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItem, {
hideOnClick: !action.RenderModal,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemLabel, {
// Copied as is from packages/dataviews/src/item-actions.js
// With an added onClose prop.
function ActionWithModal({
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const actionTriggerProps = {
onClick: () => setIsModalOpen(true),
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, {
}), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
title: action.modalHeader || action.label,
__experimentalHideHeader: !!hideModalHeader,
overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(action.id)}`,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderModal, {
// Copied as is from packages/dataviews/src/item-actions.js
// With an added onClose prop.
function ActionsDropdownMenuGroup({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuGroup, {
children: actions.map(action => {
if (action.RenderModal) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, {
ActionTrigger: DropdownMenuItemTrigger,
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, {
onClick: () => action.callback([item]),
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
__experimentalGetTemplateInfo
} = select(external_wp_coreData_namespaceObject.store);
const siteSettings = getEditedEntityRecord('root', 'site');
const _type = getCurrentPostType();
const _id = getCurrentPostId();
const _record = getEditedEntityRecord('postType', _type, _id);
const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(_type) && __experimentalGetTemplateInfo(_record);
if (GLOBAL_POST_TYPES.includes(_type)) {
if (PATTERN_POST_TYPE === _type) {
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
const currentSyncStatus = getEditedPostAttribute('meta')?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status');
_isSync = currentSyncStatus !== 'unsynced';
title: _templateInfo?.title || getEditedPostAttribute('title'),
icon: unlock(select(store_store)).getPostIcon(_type, {
isFrontPage: siteSettings?.page_on_front === _id,
isPostsPage: siteSettings?.page_for_posts === _id
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-card-panel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "editor-post-card-panel__header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
className: dist_clsx('editor-post-card-panel__icon', {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, {
className: "editor-post-card-panel__title",
children: [title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : (0,external_wp_i18n_namespaceObject.__)('No Title'), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-card-panel__title-badge",
children: (0,external_wp_i18n_namespaceObject.__)('Front Page')
}), isPostsPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-card-panel__title-badge",
children: (0,external_wp_i18n_namespaceObject.__)('Posts Page')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-content-information/index.js
// Taken from packages/editor/src/components/time-to-read/index.js.
const post_content_information_AVERAGE_READING_RATE = 189;
// This component renders the wordcount and reading time for the post.
function PostContentInformation() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const siteSettings = getEntityRecord('root', 'site');
const postType = getCurrentPostType();
const _id = getCurrentPostId();
const isPostsPage = +_id === siteSettings?.page_for_posts;
const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
postContent: showPostContentInfo && getEditedPostAttribute('content')
* translators: If your word count is based on single characters (e.g. East Asian characters),
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
* Do not translate into your own language.
const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
const wordsCounted = (0,external_wp_element_namespaceObject.useMemo)(() => postContent ? (0,external_wp_wordcount_namespaceObject.count)(postContent, wordCountType) : 0, [postContent, wordCountType]);
const readingTime = Math.round(wordsCounted / post_content_information_AVERAGE_READING_RATE);
const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the number of words in the post.
(0,external_wp_i18n_namespaceObject._n)('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString());
const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: the number of minutes to read the post.
(0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', readingTime), readingTime.toLocaleString());
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-content-information",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */
(0,external_wp_i18n_namespaceObject.__)('%1$s, %2$s read time.'), wordsCountText, minutesText)
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js
* Renders the Post Author Panel component.
* @return {Component} The component to be rendered.
function panel_PostFormat() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _postFormat = getEditedPostAttribute('format');
postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard'
const activeFormat = POST_FORMATS.find(format => format.id === postFormat);
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Format'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
contentClassName: "editor-post-format__dialog",
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Current post format.
(0,external_wp_i18n_namespaceObject.__)('Change format: %s'), activeFormat?.caption),
children: activeFormat?.caption
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-format__dialog-content",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {