Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: editor.js
resource,
[26000] Fix | Delete
cachedCanUserResolvers,
[26001] Fix | Delete
userCanCreatePostType,
[26002] Fix | Delete
isBlockBasedTheme
[26003] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[26004] Fix | Delete
const {
[26005] Fix | Delete
getPostType,
[26006] Fix | Delete
getCachedResolvers,
[26007] Fix | Delete
canUser,
[26008] Fix | Delete
getCurrentTheme
[26009] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[26010] Fix | Delete
const _postTypeObject = getPostType(postType);
[26011] Fix | Delete
const _resource = _postTypeObject?.rest_base || '';
[26012] Fix | Delete
return {
[26013] Fix | Delete
postTypeObject: _postTypeObject,
[26014] Fix | Delete
resource: _resource,
[26015] Fix | Delete
cachedCanUserResolvers: getCachedResolvers()?.canUser,
[26016] Fix | Delete
userCanCreatePostType: canUser('create', _resource),
[26017] Fix | Delete
isBlockBasedTheme: getCurrentTheme()?.is_block_theme
[26018] Fix | Delete
};
[26019] Fix | Delete
}, [postType]);
[26020] Fix | Delete
const trashPostActionForPostType = useTrashPostAction(resource);
[26021] Fix | Delete
const permanentlyDeletePostActionForPostType = usePermanentlyDeletePostAction(resource);
[26022] Fix | Delete
const renamePostActionForPostType = useRenamePostAction(resource);
[26023] Fix | Delete
const restorePostActionForPostType = useRestorePostAction(resource);
[26024] Fix | Delete
const isTemplateOrTemplatePart = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
[26025] Fix | Delete
const isPattern = postType === PATTERN_POST_TYPE;
[26026] Fix | Delete
const isLoaded = !!postTypeObject;
[26027] Fix | Delete
const supportsRevisions = !!postTypeObject?.supports?.revisions;
[26028] Fix | Delete
const supportsTitle = !!postTypeObject?.supports?.title;
[26029] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => {
[26030] Fix | Delete
if (!isLoaded) {
[26031] Fix | Delete
return [];
[26032] Fix | Delete
}
[26033] Fix | Delete
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);
[26034] Fix | Delete
// Filter actions based on provided context. If not provided
[26035] Fix | Delete
// all actions are returned. We'll have a single entry for getting the actions
[26036] Fix | Delete
// and the consumer should provide the context to filter the actions, if needed.
[26037] Fix | Delete
// Actions should also provide the `context` they support, if it's specific, to
[26038] Fix | Delete
// compare with the provided context to get all the actions.
[26039] Fix | Delete
// Right now the only supported context is `list`.
[26040] Fix | Delete
actions = actions.filter(action => {
[26041] Fix | Delete
if (!action.context) {
[26042] Fix | Delete
return true;
[26043] Fix | Delete
}
[26044] Fix | Delete
return action.context === context;
[26045] Fix | Delete
});
[26046] Fix | Delete
if (onActionPerformed) {
[26047] Fix | Delete
for (let i = 0; i < actions.length; ++i) {
[26048] Fix | Delete
if (actions[i].callback) {
[26049] Fix | Delete
const existingCallback = actions[i].callback;
[26050] Fix | Delete
actions[i] = {
[26051] Fix | Delete
...actions[i],
[26052] Fix | Delete
callback: (items, _onActionPerformed) => {
[26053] Fix | Delete
existingCallback(items, _items => {
[26054] Fix | Delete
if (_onActionPerformed) {
[26055] Fix | Delete
_onActionPerformed(_items);
[26056] Fix | Delete
}
[26057] Fix | Delete
onActionPerformed(actions[i].id, _items);
[26058] Fix | Delete
});
[26059] Fix | Delete
}
[26060] Fix | Delete
};
[26061] Fix | Delete
}
[26062] Fix | Delete
if (actions[i].RenderModal) {
[26063] Fix | Delete
const ExistingRenderModal = actions[i].RenderModal;
[26064] Fix | Delete
actions[i] = {
[26065] Fix | Delete
...actions[i],
[26066] Fix | Delete
RenderModal: props => {
[26067] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExistingRenderModal, {
[26068] Fix | Delete
...props,
[26069] Fix | Delete
onActionPerformed: _items => {
[26070] Fix | Delete
if (props.onActionPerformed) {
[26071] Fix | Delete
props.onActionPerformed(_items);
[26072] Fix | Delete
}
[26073] Fix | Delete
onActionPerformed(actions[i].id, _items);
[26074] Fix | Delete
}
[26075] Fix | Delete
});
[26076] Fix | Delete
}
[26077] Fix | Delete
};
[26078] Fix | Delete
}
[26079] Fix | Delete
}
[26080] Fix | Delete
}
[26081] Fix | Delete
return actions;
[26082] Fix | Delete
// We are making this use memo depend on cachedCanUserResolvers as a way to make the component using this hook re-render
[26083] Fix | Delete
// when user capabilities are resolved. This makes sure the isEligible functions of actions dependent on capabilities are re-evaluated.
[26084] Fix | Delete
// eslint-disable-next-line react-hooks/exhaustive-deps
[26085] Fix | Delete
}, [isTemplateOrTemplatePart, isPattern, postTypeObject?.viewable, permanentlyDeletePostActionForPostType, restorePostActionForPostType, renamePostActionForPostType, trashPostActionForPostType, onActionPerformed, isLoaded, supportsRevisions, supportsTitle, context, userCanCreatePostType, cachedCanUserResolvers]);
[26086] Fix | Delete
}
[26087] Fix | Delete
[26088] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-actions/index.js
[26089] Fix | Delete
/**
[26090] Fix | Delete
* WordPress dependencies
[26091] Fix | Delete
*/
[26092] Fix | Delete
[26093] Fix | Delete
[26094] Fix | Delete
[26095] Fix | Delete
[26096] Fix | Delete
[26097] Fix | Delete
[26098] Fix | Delete
[26099] Fix | Delete
/**
[26100] Fix | Delete
* Internal dependencies
[26101] Fix | Delete
*/
[26102] Fix | Delete
[26103] Fix | Delete
[26104] Fix | Delete
[26105] Fix | Delete
[26106] Fix | Delete
[26107] Fix | Delete
[26108] Fix | Delete
const {
[26109] Fix | Delete
DropdownMenuV2: DropdownMenu,
[26110] Fix | Delete
DropdownMenuGroupV2: DropdownMenuGroup,
[26111] Fix | Delete
DropdownMenuItemV2: DropdownMenuItem,
[26112] Fix | Delete
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
[26113] Fix | Delete
kebabCase
[26114] Fix | Delete
} = unlock(external_wp_components_namespaceObject.privateApis);
[26115] Fix | Delete
function PostActions({
[26116] Fix | Delete
onActionPerformed,
[26117] Fix | Delete
buttonProps
[26118] Fix | Delete
}) {
[26119] Fix | Delete
const [isActionsMenuOpen, setIsActionsMenuOpen] = (0,external_wp_element_namespaceObject.useState)(false);
[26120] Fix | Delete
const {
[26121] Fix | Delete
item,
[26122] Fix | Delete
postType
[26123] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[26124] Fix | Delete
const {
[26125] Fix | Delete
getCurrentPostType,
[26126] Fix | Delete
getCurrentPostId
[26127] Fix | Delete
} = select(store_store);
[26128] Fix | Delete
const {
[26129] Fix | Delete
getEditedEntityRecord
[26130] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[26131] Fix | Delete
const _postType = getCurrentPostType();
[26132] Fix | Delete
return {
[26133] Fix | Delete
item: getEditedEntityRecord('postType', _postType, getCurrentPostId()),
[26134] Fix | Delete
postType: _postType
[26135] Fix | Delete
};
[26136] Fix | Delete
}, []);
[26137] Fix | Delete
const allActions = usePostActions({
[26138] Fix | Delete
postType,
[26139] Fix | Delete
onActionPerformed
[26140] Fix | Delete
});
[26141] Fix | Delete
const actions = (0,external_wp_element_namespaceObject.useMemo)(() => {
[26142] Fix | Delete
return allActions.filter(action => {
[26143] Fix | Delete
return !action.isEligible || action.isEligible(item);
[26144] Fix | Delete
});
[26145] Fix | Delete
}, [allActions, item]);
[26146] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenu, {
[26147] Fix | Delete
open: isActionsMenuOpen,
[26148] Fix | Delete
trigger: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[26149] Fix | Delete
size: "small",
[26150] Fix | Delete
icon: more_vertical,
[26151] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
[26152] Fix | Delete
disabled: !actions.length,
[26153] Fix | Delete
__experimentalIsFocusable: true,
[26154] Fix | Delete
className: "editor-all-actions-button",
[26155] Fix | Delete
onClick: () => setIsActionsMenuOpen(!isActionsMenuOpen),
[26156] Fix | Delete
...buttonProps
[26157] Fix | Delete
}),
[26158] Fix | Delete
onOpenChange: setIsActionsMenuOpen,
[26159] Fix | Delete
placement: "bottom-end",
[26160] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionsDropdownMenuGroup, {
[26161] Fix | Delete
actions: actions,
[26162] Fix | Delete
item: item,
[26163] Fix | Delete
onClose: () => {
[26164] Fix | Delete
setIsActionsMenuOpen(false);
[26165] Fix | Delete
}
[26166] Fix | Delete
})
[26167] Fix | Delete
});
[26168] Fix | Delete
}
[26169] Fix | Delete
[26170] Fix | Delete
// From now on all the functions on this file are copied as from the dataviews packages,
[26171] Fix | Delete
// The editor packages should not be using the dataviews packages directly,
[26172] Fix | Delete
// and the dataviews package should not be using the editor packages directly,
[26173] Fix | Delete
// so duplicating the code here seems like the least bad option.
[26174] Fix | Delete
[26175] Fix | Delete
// Copied as is from packages/dataviews/src/item-actions.js
[26176] Fix | Delete
function DropdownMenuItemTrigger({
[26177] Fix | Delete
action,
[26178] Fix | Delete
onClick,
[26179] Fix | Delete
items
[26180] Fix | Delete
}) {
[26181] Fix | Delete
const label = typeof action.label === 'string' ? action.label : action.label(items);
[26182] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItem, {
[26183] Fix | Delete
onClick: onClick,
[26184] Fix | Delete
hideOnClick: !action.RenderModal,
[26185] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemLabel, {
[26186] Fix | Delete
children: label
[26187] Fix | Delete
})
[26188] Fix | Delete
});
[26189] Fix | Delete
}
[26190] Fix | Delete
[26191] Fix | Delete
// Copied as is from packages/dataviews/src/item-actions.js
[26192] Fix | Delete
// With an added onClose prop.
[26193] Fix | Delete
function ActionWithModal({
[26194] Fix | Delete
action,
[26195] Fix | Delete
item,
[26196] Fix | Delete
ActionTrigger,
[26197] Fix | Delete
onClose
[26198] Fix | Delete
}) {
[26199] Fix | Delete
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
[26200] Fix | Delete
const actionTriggerProps = {
[26201] Fix | Delete
action,
[26202] Fix | Delete
onClick: () => setIsModalOpen(true),
[26203] Fix | Delete
items: [item]
[26204] Fix | Delete
};
[26205] Fix | Delete
const {
[26206] Fix | Delete
RenderModal,
[26207] Fix | Delete
hideModalHeader
[26208] Fix | Delete
} = action;
[26209] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[26210] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionTrigger, {
[26211] Fix | Delete
...actionTriggerProps
[26212] Fix | Delete
}), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[26213] Fix | Delete
title: action.modalHeader || action.label,
[26214] Fix | Delete
__experimentalHideHeader: !!hideModalHeader,
[26215] Fix | Delete
onRequestClose: () => {
[26216] Fix | Delete
setIsModalOpen(false);
[26217] Fix | Delete
},
[26218] Fix | Delete
overlayClassName: `editor-action-modal editor-action-modal__${kebabCase(action.id)}`,
[26219] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderModal, {
[26220] Fix | Delete
items: [item],
[26221] Fix | Delete
closeModal: () => {
[26222] Fix | Delete
setIsModalOpen(false);
[26223] Fix | Delete
onClose();
[26224] Fix | Delete
}
[26225] Fix | Delete
})
[26226] Fix | Delete
})]
[26227] Fix | Delete
});
[26228] Fix | Delete
}
[26229] Fix | Delete
[26230] Fix | Delete
// Copied as is from packages/dataviews/src/item-actions.js
[26231] Fix | Delete
// With an added onClose prop.
[26232] Fix | Delete
function ActionsDropdownMenuGroup({
[26233] Fix | Delete
actions,
[26234] Fix | Delete
item,
[26235] Fix | Delete
onClose
[26236] Fix | Delete
}) {
[26237] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuGroup, {
[26238] Fix | Delete
children: actions.map(action => {
[26239] Fix | Delete
if (action.RenderModal) {
[26240] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ActionWithModal, {
[26241] Fix | Delete
action: action,
[26242] Fix | Delete
item: item,
[26243] Fix | Delete
ActionTrigger: DropdownMenuItemTrigger,
[26244] Fix | Delete
onClose: onClose
[26245] Fix | Delete
}, action.id);
[26246] Fix | Delete
}
[26247] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropdownMenuItemTrigger, {
[26248] Fix | Delete
action: action,
[26249] Fix | Delete
onClick: () => action.callback([item]),
[26250] Fix | Delete
items: [item]
[26251] Fix | Delete
}, action.id);
[26252] Fix | Delete
})
[26253] Fix | Delete
});
[26254] Fix | Delete
}
[26255] Fix | Delete
[26256] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-card-panel/index.js
[26257] Fix | Delete
/**
[26258] Fix | Delete
* External dependencies
[26259] Fix | Delete
*/
[26260] Fix | Delete
[26261] Fix | Delete
/**
[26262] Fix | Delete
* WordPress dependencies
[26263] Fix | Delete
*/
[26264] Fix | Delete
[26265] Fix | Delete
[26266] Fix | Delete
[26267] Fix | Delete
[26268] Fix | Delete
[26269] Fix | Delete
[26270] Fix | Delete
/**
[26271] Fix | Delete
* Internal dependencies
[26272] Fix | Delete
*/
[26273] Fix | Delete
[26274] Fix | Delete
[26275] Fix | Delete
[26276] Fix | Delete
[26277] Fix | Delete
[26278] Fix | Delete
function PostCardPanel({
[26279] Fix | Delete
actions
[26280] Fix | Delete
}) {
[26281] Fix | Delete
const {
[26282] Fix | Delete
isFrontPage,
[26283] Fix | Delete
isPostsPage,
[26284] Fix | Delete
title,
[26285] Fix | Delete
icon,
[26286] Fix | Delete
isSync
[26287] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[26288] Fix | Delete
const {
[26289] Fix | Delete
getEditedPostAttribute,
[26290] Fix | Delete
getCurrentPostType,
[26291] Fix | Delete
getCurrentPostId,
[26292] Fix | Delete
__experimentalGetTemplateInfo
[26293] Fix | Delete
} = select(store_store);
[26294] Fix | Delete
const {
[26295] Fix | Delete
getEditedEntityRecord
[26296] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[26297] Fix | Delete
const siteSettings = getEditedEntityRecord('root', 'site');
[26298] Fix | Delete
const _type = getCurrentPostType();
[26299] Fix | Delete
const _id = getCurrentPostId();
[26300] Fix | Delete
const _record = getEditedEntityRecord('postType', _type, _id);
[26301] Fix | Delete
const _templateInfo = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(_type) && __experimentalGetTemplateInfo(_record);
[26302] Fix | Delete
let _isSync = false;
[26303] Fix | Delete
if (GLOBAL_POST_TYPES.includes(_type)) {
[26304] Fix | Delete
if (PATTERN_POST_TYPE === _type) {
[26305] Fix | Delete
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
[26306] Fix | Delete
const currentSyncStatus = getEditedPostAttribute('meta')?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status');
[26307] Fix | Delete
_isSync = currentSyncStatus !== 'unsynced';
[26308] Fix | Delete
} else {
[26309] Fix | Delete
_isSync = true;
[26310] Fix | Delete
}
[26311] Fix | Delete
}
[26312] Fix | Delete
return {
[26313] Fix | Delete
title: _templateInfo?.title || getEditedPostAttribute('title'),
[26314] Fix | Delete
icon: unlock(select(store_store)).getPostIcon(_type, {
[26315] Fix | Delete
area: _record?.area
[26316] Fix | Delete
}),
[26317] Fix | Delete
isSync: _isSync,
[26318] Fix | Delete
isFrontPage: siteSettings?.page_on_front === _id,
[26319] Fix | Delete
isPostsPage: siteSettings?.page_for_posts === _id
[26320] Fix | Delete
};
[26321] Fix | Delete
}, []);
[26322] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[26323] Fix | Delete
className: "editor-post-card-panel",
[26324] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[26325] Fix | Delete
spacing: 2,
[26326] Fix | Delete
className: "editor-post-card-panel__header",
[26327] Fix | Delete
align: "flex-start",
[26328] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
[26329] Fix | Delete
className: dist_clsx('editor-post-card-panel__icon', {
[26330] Fix | Delete
'is-sync': isSync
[26331] Fix | Delete
}),
[26332] Fix | Delete
icon: icon
[26333] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalText, {
[26334] Fix | Delete
numberOfLines: 2,
[26335] Fix | Delete
truncate: true,
[26336] Fix | Delete
className: "editor-post-card-panel__title",
[26337] Fix | Delete
weight: 500,
[26338] Fix | Delete
as: "h2",
[26339] Fix | Delete
lineHeight: "20px",
[26340] Fix | Delete
children: [title ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) : (0,external_wp_i18n_namespaceObject.__)('No Title'), isFrontPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[26341] Fix | Delete
className: "editor-post-card-panel__title-badge",
[26342] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Front Page')
[26343] Fix | Delete
}), isPostsPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[26344] Fix | Delete
className: "editor-post-card-panel__title-badge",
[26345] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Posts Page')
[26346] Fix | Delete
})]
[26347] Fix | Delete
}), actions]
[26348] Fix | Delete
})
[26349] Fix | Delete
});
[26350] Fix | Delete
}
[26351] Fix | Delete
[26352] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-content-information/index.js
[26353] Fix | Delete
/**
[26354] Fix | Delete
* WordPress dependencies
[26355] Fix | Delete
*/
[26356] Fix | Delete
[26357] Fix | Delete
[26358] Fix | Delete
[26359] Fix | Delete
[26360] Fix | Delete
[26361] Fix | Delete
[26362] Fix | Delete
[26363] Fix | Delete
/**
[26364] Fix | Delete
* Internal dependencies
[26365] Fix | Delete
*/
[26366] Fix | Delete
[26367] Fix | Delete
[26368] Fix | Delete
[26369] Fix | Delete
// Taken from packages/editor/src/components/time-to-read/index.js.
[26370] Fix | Delete
[26371] Fix | Delete
const post_content_information_AVERAGE_READING_RATE = 189;
[26372] Fix | Delete
[26373] Fix | Delete
// This component renders the wordcount and reading time for the post.
[26374] Fix | Delete
function PostContentInformation() {
[26375] Fix | Delete
const {
[26376] Fix | Delete
postContent
[26377] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[26378] Fix | Delete
const {
[26379] Fix | Delete
getEditedPostAttribute,
[26380] Fix | Delete
getCurrentPostType,
[26381] Fix | Delete
getCurrentPostId
[26382] Fix | Delete
} = select(store_store);
[26383] Fix | Delete
const {
[26384] Fix | Delete
getEntityRecord
[26385] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[26386] Fix | Delete
const siteSettings = getEntityRecord('root', 'site');
[26387] Fix | Delete
const postType = getCurrentPostType();
[26388] Fix | Delete
const _id = getCurrentPostId();
[26389] Fix | Delete
const isPostsPage = +_id === siteSettings?.page_for_posts;
[26390] Fix | Delete
const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
[26391] Fix | Delete
return {
[26392] Fix | Delete
postContent: showPostContentInfo && getEditedPostAttribute('content')
[26393] Fix | Delete
};
[26394] Fix | Delete
}, []);
[26395] Fix | Delete
[26396] Fix | Delete
/*
[26397] Fix | Delete
* translators: If your word count is based on single characters (e.g. East Asian characters),
[26398] Fix | Delete
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
[26399] Fix | Delete
* Do not translate into your own language.
[26400] Fix | Delete
*/
[26401] Fix | Delete
const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!');
[26402] Fix | Delete
const wordsCounted = (0,external_wp_element_namespaceObject.useMemo)(() => postContent ? (0,external_wp_wordcount_namespaceObject.count)(postContent, wordCountType) : 0, [postContent, wordCountType]);
[26403] Fix | Delete
if (!wordsCounted) {
[26404] Fix | Delete
return null;
[26405] Fix | Delete
}
[26406] Fix | Delete
const readingTime = Math.round(wordsCounted / post_content_information_AVERAGE_READING_RATE);
[26407] Fix | Delete
const wordsCountText = (0,external_wp_i18n_namespaceObject.sprintf)(
[26408] Fix | Delete
// translators: %s: the number of words in the post.
[26409] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString());
[26410] Fix | Delete
const minutesText = readingTime <= 1 ? (0,external_wp_i18n_namespaceObject.__)('1 minute') : (0,external_wp_i18n_namespaceObject.sprintf)(
[26411] Fix | Delete
// translators: %s: the number of minutes to read the post.
[26412] Fix | Delete
(0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', readingTime), readingTime.toLocaleString());
[26413] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[26414] Fix | Delete
className: "editor-post-content-information",
[26415] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[26416] Fix | Delete
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.) */
[26417] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('%1$s, %2$s read time.'), wordsCountText, minutesText)
[26418] Fix | Delete
})
[26419] Fix | Delete
});
[26420] Fix | Delete
}
[26421] Fix | Delete
[26422] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/panel.js
[26423] Fix | Delete
/**
[26424] Fix | Delete
* WordPress dependencies
[26425] Fix | Delete
*/
[26426] Fix | Delete
[26427] Fix | Delete
[26428] Fix | Delete
[26429] Fix | Delete
[26430] Fix | Delete
[26431] Fix | Delete
[26432] Fix | Delete
/**
[26433] Fix | Delete
* Internal dependencies
[26434] Fix | Delete
*/
[26435] Fix | Delete
[26436] Fix | Delete
[26437] Fix | Delete
[26438] Fix | Delete
[26439] Fix | Delete
[26440] Fix | Delete
/**
[26441] Fix | Delete
* Renders the Post Author Panel component.
[26442] Fix | Delete
*
[26443] Fix | Delete
* @return {Component} The component to be rendered.
[26444] Fix | Delete
*/
[26445] Fix | Delete
[26446] Fix | Delete
[26447] Fix | Delete
function panel_PostFormat() {
[26448] Fix | Delete
const {
[26449] Fix | Delete
postFormat
[26450] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[26451] Fix | Delete
const {
[26452] Fix | Delete
getEditedPostAttribute
[26453] Fix | Delete
} = select(store_store);
[26454] Fix | Delete
const _postFormat = getEditedPostAttribute('format');
[26455] Fix | Delete
return {
[26456] Fix | Delete
postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard'
[26457] Fix | Delete
};
[26458] Fix | Delete
}, []);
[26459] Fix | Delete
const activeFormat = POST_FORMATS.find(format => format.id === postFormat);
[26460] Fix | Delete
[26461] Fix | Delete
// Use internal state instead of a ref to make sure that the component
[26462] Fix | Delete
// re-renders when the popover's anchor updates.
[26463] Fix | Delete
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
[26464] Fix | Delete
// Memoize popoverProps to avoid returning a new object every time.
[26465] Fix | Delete
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[26466] Fix | Delete
// Anchor the popover to the middle of the entire row so that it doesn't
[26467] Fix | Delete
// move around when the label changes.
[26468] Fix | Delete
anchor: popoverAnchor,
[26469] Fix | Delete
placement: 'left-start',
[26470] Fix | Delete
offset: 36,
[26471] Fix | Delete
shift: true
[26472] Fix | Delete
}), [popoverAnchor]);
[26473] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, {
[26474] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
[26475] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Format'),
[26476] Fix | Delete
ref: setPopoverAnchor,
[26477] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
[26478] Fix | Delete
popoverProps: popoverProps,
[26479] Fix | Delete
contentClassName: "editor-post-format__dialog",
[26480] Fix | Delete
focusOnMount: true,
[26481] Fix | Delete
renderToggle: ({
[26482] Fix | Delete
isOpen,
[26483] Fix | Delete
onToggle
[26484] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[26485] Fix | Delete
size: "compact",
[26486] Fix | Delete
variant: "tertiary",
[26487] Fix | Delete
"aria-expanded": isOpen,
[26488] Fix | Delete
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
[26489] Fix | Delete
// translators: %s: Current post format.
[26490] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Change format: %s'), activeFormat?.caption),
[26491] Fix | Delete
onClick: onToggle,
[26492] Fix | Delete
children: activeFormat?.caption
[26493] Fix | Delete
}),
[26494] Fix | Delete
renderContent: ({
[26495] Fix | Delete
onClose
[26496] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[26497] Fix | Delete
className: "editor-post-format__dialog-content",
[26498] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
[26499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function