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
if (!blockDisplayInformation?.title) {
[21000] Fix | Delete
return null;
[21001] Fix | Delete
}
[21002] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[21003] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableBlockSettingsMenuFirstItem, {
[21004] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[21005] Fix | Delete
onClick: () => {
[21006] Fix | Delete
selectBlock(contentLockingParent);
[21007] Fix | Delete
modifyContentLockBlock(contentLockingParent);
[21008] Fix | Delete
onClose();
[21009] Fix | Delete
},
[21010] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Unlock')
[21011] Fix | Delete
})
[21012] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[21013] Fix | Delete
variant: "muted",
[21014] Fix | Delete
as: "p",
[21015] Fix | Delete
className: "editor-content-only-settings-menu__description",
[21016] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Temporarily unlock the parent block to edit, delete or make further changes to this block.')
[21017] Fix | Delete
})]
[21018] Fix | Delete
});
[21019] Fix | Delete
}
[21020] Fix | Delete
function ContentOnlySettingsMenu() {
[21021] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
[21022] Fix | Delete
children: ({
[21023] Fix | Delete
selectedClientIds,
[21024] Fix | Delete
onClose
[21025] Fix | Delete
}) => selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenuItems, {
[21026] Fix | Delete
clientId: selectedClientIds[0],
[21027] Fix | Delete
onClose: onClose
[21028] Fix | Delete
})
[21029] Fix | Delete
});
[21030] Fix | Delete
}
[21031] Fix | Delete
[21032] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/start-template-options/index.js
[21033] Fix | Delete
/**
[21034] Fix | Delete
* WordPress dependencies
[21035] Fix | Delete
*/
[21036] Fix | Delete
[21037] Fix | Delete
[21038] Fix | Delete
[21039] Fix | Delete
[21040] Fix | Delete
[21041] Fix | Delete
[21042] Fix | Delete
[21043] Fix | Delete
[21044] Fix | Delete
[21045] Fix | Delete
/**
[21046] Fix | Delete
* Internal dependencies
[21047] Fix | Delete
*/
[21048] Fix | Delete
[21049] Fix | Delete
[21050] Fix | Delete
[21051] Fix | Delete
[21052] Fix | Delete
function useFallbackTemplateContent(slug, isCustom = false) {
[21053] Fix | Delete
return (0,external_wp_data_namespaceObject.useSelect)(select => {
[21054] Fix | Delete
const {
[21055] Fix | Delete
getEntityRecord,
[21056] Fix | Delete
getDefaultTemplateId
[21057] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[21058] Fix | Delete
const templateId = getDefaultTemplateId({
[21059] Fix | Delete
slug,
[21060] Fix | Delete
is_custom: isCustom,
[21061] Fix | Delete
ignore_empty: true
[21062] Fix | Delete
});
[21063] Fix | Delete
return templateId ? getEntityRecord('postType', TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined;
[21064] Fix | Delete
}, [slug, isCustom]);
[21065] Fix | Delete
}
[21066] Fix | Delete
function start_template_options_useStartPatterns(fallbackContent) {
[21067] Fix | Delete
const {
[21068] Fix | Delete
slug,
[21069] Fix | Delete
patterns
[21070] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[21071] Fix | Delete
const {
[21072] Fix | Delete
getCurrentPostType,
[21073] Fix | Delete
getCurrentPostId
[21074] Fix | Delete
} = select(store_store);
[21075] Fix | Delete
const {
[21076] Fix | Delete
getEntityRecord,
[21077] Fix | Delete
getBlockPatterns
[21078] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[21079] Fix | Delete
const postId = getCurrentPostId();
[21080] Fix | Delete
const postType = getCurrentPostType();
[21081] Fix | Delete
const record = getEntityRecord('postType', postType, postId);
[21082] Fix | Delete
return {
[21083] Fix | Delete
slug: record.slug,
[21084] Fix | Delete
patterns: getBlockPatterns()
[21085] Fix | Delete
};
[21086] Fix | Delete
}, []);
[21087] Fix | Delete
const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme().stylesheet);
[21088] Fix | Delete
[21089] Fix | Delete
// Duplicated from packages/block-library/src/pattern/edit.js.
[21090] Fix | Delete
function injectThemeAttributeInBlockTemplateContent(block) {
[21091] Fix | Delete
if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) {
[21092] Fix | Delete
block.innerBlocks = block.innerBlocks.map(innerBlock => {
[21093] Fix | Delete
if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) {
[21094] Fix | Delete
innerBlock.attributes.theme = currentThemeStylesheet;
[21095] Fix | Delete
}
[21096] Fix | Delete
return innerBlock;
[21097] Fix | Delete
});
[21098] Fix | Delete
}
[21099] Fix | Delete
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
[21100] Fix | Delete
block.attributes.theme = currentThemeStylesheet;
[21101] Fix | Delete
}
[21102] Fix | Delete
return block;
[21103] Fix | Delete
}
[21104] Fix | Delete
return (0,external_wp_element_namespaceObject.useMemo)(() => {
[21105] Fix | Delete
// filter patterns that are supposed to be used in the current template being edited.
[21106] Fix | Delete
return [{
[21107] Fix | Delete
name: 'fallback',
[21108] Fix | Delete
blocks: (0,external_wp_blocks_namespaceObject.parse)(fallbackContent),
[21109] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Fallback content')
[21110] Fix | Delete
}, ...patterns.filter(pattern => {
[21111] Fix | Delete
return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType));
[21112] Fix | Delete
}).map(pattern => {
[21113] Fix | Delete
return {
[21114] Fix | Delete
...pattern,
[21115] Fix | Delete
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block))
[21116] Fix | Delete
};
[21117] Fix | Delete
})];
[21118] Fix | Delete
}, [fallbackContent, slug, patterns]);
[21119] Fix | Delete
}
[21120] Fix | Delete
function start_template_options_PatternSelection({
[21121] Fix | Delete
fallbackContent,
[21122] Fix | Delete
onChoosePattern,
[21123] Fix | Delete
postType
[21124] Fix | Delete
}) {
[21125] Fix | Delete
const [,, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType);
[21126] Fix | Delete
const blockPatterns = start_template_options_useStartPatterns(fallbackContent);
[21127] Fix | Delete
const shownBlockPatterns = (0,external_wp_compose_namespaceObject.useAsyncList)(blockPatterns);
[21128] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
[21129] Fix | Delete
blockPatterns: blockPatterns,
[21130] Fix | Delete
shownPatterns: shownBlockPatterns,
[21131] Fix | Delete
onClickPattern: (pattern, blocks) => {
[21132] Fix | Delete
onChange(blocks, {
[21133] Fix | Delete
selection: undefined
[21134] Fix | Delete
});
[21135] Fix | Delete
onChoosePattern();
[21136] Fix | Delete
}
[21137] Fix | Delete
});
[21138] Fix | Delete
}
[21139] Fix | Delete
function StartModal({
[21140] Fix | Delete
slug,
[21141] Fix | Delete
isCustom,
[21142] Fix | Delete
onClose,
[21143] Fix | Delete
postType
[21144] Fix | Delete
}) {
[21145] Fix | Delete
const fallbackContent = useFallbackTemplateContent(slug, isCustom);
[21146] Fix | Delete
if (!fallbackContent) {
[21147] Fix | Delete
return null;
[21148] Fix | Delete
}
[21149] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, {
[21150] Fix | Delete
className: "editor-start-template-options__modal",
[21151] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'),
[21152] Fix | Delete
closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
[21153] Fix | Delete
focusOnMount: "firstElement",
[21154] Fix | Delete
onRequestClose: onClose,
[21155] Fix | Delete
isFullScreen: true,
[21156] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[21157] Fix | Delete
className: "editor-start-template-options__modal-content",
[21158] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(start_template_options_PatternSelection, {
[21159] Fix | Delete
fallbackContent: fallbackContent,
[21160] Fix | Delete
slug: slug,
[21161] Fix | Delete
isCustom: isCustom,
[21162] Fix | Delete
postType: postType,
[21163] Fix | Delete
onChoosePattern: () => {
[21164] Fix | Delete
onClose();
[21165] Fix | Delete
}
[21166] Fix | Delete
})
[21167] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, {
[21168] Fix | Delete
className: "editor-start-template-options__modal__actions",
[21169] Fix | Delete
justify: "flex-end",
[21170] Fix | Delete
expanded: false,
[21171] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, {
[21172] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[21173] Fix | Delete
variant: "tertiary",
[21174] Fix | Delete
onClick: onClose,
[21175] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Skip')
[21176] Fix | Delete
})
[21177] Fix | Delete
})
[21178] Fix | Delete
})]
[21179] Fix | Delete
});
[21180] Fix | Delete
}
[21181] Fix | Delete
function StartTemplateOptions() {
[21182] Fix | Delete
const [isClosed, setIsClosed] = (0,external_wp_element_namespaceObject.useState)(false);
[21183] Fix | Delete
const {
[21184] Fix | Delete
shouldOpenModal,
[21185] Fix | Delete
slug,
[21186] Fix | Delete
isCustom,
[21187] Fix | Delete
postType,
[21188] Fix | Delete
postId
[21189] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[21190] Fix | Delete
const {
[21191] Fix | Delete
getCurrentPostType,
[21192] Fix | Delete
getCurrentPostId
[21193] Fix | Delete
} = select(store_store);
[21194] Fix | Delete
const _postType = getCurrentPostType();
[21195] Fix | Delete
const _postId = getCurrentPostId();
[21196] Fix | Delete
const {
[21197] Fix | Delete
getEditedEntityRecord,
[21198] Fix | Delete
hasEditsForEntityRecord
[21199] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[21200] Fix | Delete
const templateRecord = getEditedEntityRecord('postType', _postType, _postId);
[21201] Fix | Delete
const hasEdits = hasEditsForEntityRecord('postType', _postType, _postId);
[21202] Fix | Delete
return {
[21203] Fix | Delete
shouldOpenModal: !hasEdits && '' === templateRecord.content && TEMPLATE_POST_TYPE === _postType,
[21204] Fix | Delete
slug: templateRecord.slug,
[21205] Fix | Delete
isCustom: templateRecord.is_custom,
[21206] Fix | Delete
postType: _postType,
[21207] Fix | Delete
postId: _postId
[21208] Fix | Delete
};
[21209] Fix | Delete
}, []);
[21210] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[21211] Fix | Delete
// Should reset the modal state when navigating to a new page/post.
[21212] Fix | Delete
setIsClosed(false);
[21213] Fix | Delete
}, [postType, postId]);
[21214] Fix | Delete
if (!shouldOpenModal || isClosed) {
[21215] Fix | Delete
return null;
[21216] Fix | Delete
}
[21217] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartModal, {
[21218] Fix | Delete
slug: slug,
[21219] Fix | Delete
isCustom: isCustom,
[21220] Fix | Delete
postType: postType,
[21221] Fix | Delete
onClose: () => setIsClosed(true)
[21222] Fix | Delete
});
[21223] Fix | Delete
}
[21224] Fix | Delete
[21225] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/index.js
[21226] Fix | Delete
/**
[21227] Fix | Delete
* WordPress dependencies
[21228] Fix | Delete
*/
[21229] Fix | Delete
[21230] Fix | Delete
[21231] Fix | Delete
[21232] Fix | Delete
[21233] Fix | Delete
[21234] Fix | Delete
[21235] Fix | Delete
[21236] Fix | Delete
[21237] Fix | Delete
[21238] Fix | Delete
/**
[21239] Fix | Delete
* Internal dependencies
[21240] Fix | Delete
*/
[21241] Fix | Delete
[21242] Fix | Delete
[21243] Fix | Delete
[21244] Fix | Delete
[21245] Fix | Delete
[21246] Fix | Delete
[21247] Fix | Delete
[21248] Fix | Delete
[21249] Fix | Delete
[21250] Fix | Delete
[21251] Fix | Delete
[21252] Fix | Delete
[21253] Fix | Delete
[21254] Fix | Delete
[21255] Fix | Delete
[21256] Fix | Delete
[21257] Fix | Delete
[21258] Fix | Delete
[21259] Fix | Delete
[21260] Fix | Delete
const {
[21261] Fix | Delete
ExperimentalBlockEditorProvider
[21262] Fix | Delete
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
[21263] Fix | Delete
const {
[21264] Fix | Delete
PatternsMenuItems
[21265] Fix | Delete
} = unlock(external_wp_patterns_namespaceObject.privateApis);
[21266] Fix | Delete
const provider_noop = () => {};
[21267] Fix | Delete
[21268] Fix | Delete
/**
[21269] Fix | Delete
* These are global entities that are only there to split blocks into logical units
[21270] Fix | Delete
* They don't provide a "context" for the current post/page being rendered.
[21271] Fix | Delete
* So we should not use their ids as post context. This is important to allow post blocks
[21272] Fix | Delete
* (post content, post title) to be used within them without issues.
[21273] Fix | Delete
*/
[21274] Fix | Delete
const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_template', 'wp_navigation', 'wp_template_part'];
[21275] Fix | Delete
[21276] Fix | Delete
/**
[21277] Fix | Delete
* Depending on the post, template and template mode,
[21278] Fix | Delete
* returns the appropriate blocks and change handlers for the block editor provider.
[21279] Fix | Delete
*
[21280] Fix | Delete
* @param {Array} post Block list.
[21281] Fix | Delete
* @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.
[21282] Fix | Delete
* @param {string} mode Rendering mode.
[21283] Fix | Delete
*
[21284] Fix | Delete
* @example
[21285] Fix | Delete
* ```jsx
[21286] Fix | Delete
* const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );
[21287] Fix | Delete
* ```
[21288] Fix | Delete
*
[21289] Fix | Delete
* @return {Array} Block editor props.
[21290] Fix | Delete
*/
[21291] Fix | Delete
function useBlockEditorProps(post, template, mode) {
[21292] Fix | Delete
const rootLevelPost = mode === 'post-only' || !template ? 'post' : 'template';
[21293] Fix | Delete
const [postBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', post.type, {
[21294] Fix | Delete
id: post.id
[21295] Fix | Delete
});
[21296] Fix | Delete
const [templateBlocks, onInputTemplate, onChangeTemplate] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', template?.type, {
[21297] Fix | Delete
id: template?.id
[21298] Fix | Delete
});
[21299] Fix | Delete
const maybeNavigationBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
[21300] Fix | Delete
if (post.type === 'wp_navigation') {
[21301] Fix | Delete
return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', {
[21302] Fix | Delete
ref: post.id,
[21303] Fix | Delete
// As the parent editor is locked with `templateLock`, the template locking
[21304] Fix | Delete
// must be explicitly "unset" on the block itself to allow the user to modify
[21305] Fix | Delete
// the block's content.
[21306] Fix | Delete
templateLock: false
[21307] Fix | Delete
})];
[21308] Fix | Delete
}
[21309] Fix | Delete
}, [post.type, post.id]);
[21310] Fix | Delete
[21311] Fix | Delete
// It is important that we don't create a new instance of blocks on every change
[21312] Fix | Delete
// We should only create a new instance if the blocks them selves change, not a dependency of them.
[21313] Fix | Delete
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
[21314] Fix | Delete
if (maybeNavigationBlocks) {
[21315] Fix | Delete
return maybeNavigationBlocks;
[21316] Fix | Delete
}
[21317] Fix | Delete
if (rootLevelPost === 'template') {
[21318] Fix | Delete
return templateBlocks;
[21319] Fix | Delete
}
[21320] Fix | Delete
return postBlocks;
[21321] Fix | Delete
}, [maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks]);
[21322] Fix | Delete
[21323] Fix | Delete
// Handle fallback to postBlocks outside of the above useMemo, to ensure
[21324] Fix | Delete
// that constructed block templates that call `createBlock` are not generated
[21325] Fix | Delete
// too frequently. This ensures that clientIds are stable.
[21326] Fix | Delete
const disableRootLevelChanges = !!template && mode === 'template-locked' || post.type === 'wp_navigation';
[21327] Fix | Delete
if (disableRootLevelChanges) {
[21328] Fix | Delete
return [blocks, provider_noop, provider_noop];
[21329] Fix | Delete
}
[21330] Fix | Delete
return [blocks, rootLevelPost === 'post' ? onInput : onInputTemplate, rootLevelPost === 'post' ? onChange : onChangeTemplate];
[21331] Fix | Delete
}
[21332] Fix | Delete
[21333] Fix | Delete
/**
[21334] Fix | Delete
* This component provides the editor context and manages the state of the block editor.
[21335] Fix | Delete
*
[21336] Fix | Delete
* @param {Object} props The component props.
[21337] Fix | Delete
* @param {Object} props.post The post object.
[21338] Fix | Delete
* @param {Object} props.settings The editor settings.
[21339] Fix | Delete
* @param {boolean} props.recovery Indicates if the editor is in recovery mode.
[21340] Fix | Delete
* @param {Array} props.initialEdits The initial edits for the editor.
[21341] Fix | Delete
* @param {Object} props.children The child components.
[21342] Fix | Delete
* @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.
[21343] Fix | Delete
* @param {Object} [props.__unstableTemplate] The template object.
[21344] Fix | Delete
*
[21345] Fix | Delete
* @example
[21346] Fix | Delete
* ```jsx
[21347] Fix | Delete
* <ExperimentalEditorProvider
[21348] Fix | Delete
* post={ post }
[21349] Fix | Delete
* settings={ settings }
[21350] Fix | Delete
* recovery={ recovery }
[21351] Fix | Delete
* initialEdits={ initialEdits }
[21352] Fix | Delete
* __unstableTemplate={ template }
[21353] Fix | Delete
* >
[21354] Fix | Delete
* { children }
[21355] Fix | Delete
* </ExperimentalEditorProvider>
[21356] Fix | Delete
*
[21357] Fix | Delete
* @return {Object} The rendered ExperimentalEditorProvider component.
[21358] Fix | Delete
*/
[21359] Fix | Delete
const ExperimentalEditorProvider = with_registry_provider(({
[21360] Fix | Delete
post,
[21361] Fix | Delete
settings,
[21362] Fix | Delete
recovery,
[21363] Fix | Delete
initialEdits,
[21364] Fix | Delete
children,
[21365] Fix | Delete
BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
[21366] Fix | Delete
__unstableTemplate: template
[21367] Fix | Delete
}) => {
[21368] Fix | Delete
const mode = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getRenderingMode(), []);
[21369] Fix | Delete
const shouldRenderTemplate = !!template && mode !== 'post-only';
[21370] Fix | Delete
const rootLevelPost = shouldRenderTemplate ? template : post;
[21371] Fix | Delete
const defaultBlockContext = (0,external_wp_element_namespaceObject.useMemo)(() => {
[21372] Fix | Delete
const postContext = !NON_CONTEXTUAL_POST_TYPES.includes(rootLevelPost.type) || shouldRenderTemplate ? {
[21373] Fix | Delete
postId: post.id,
[21374] Fix | Delete
postType: post.type
[21375] Fix | Delete
} : {};
[21376] Fix | Delete
return {
[21377] Fix | Delete
...postContext,
[21378] Fix | Delete
templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined
[21379] Fix | Delete
};
[21380] Fix | Delete
}, [shouldRenderTemplate, post.id, post.type, rootLevelPost.type, rootLevelPost.slug]);
[21381] Fix | Delete
const {
[21382] Fix | Delete
editorSettings,
[21383] Fix | Delete
selection,
[21384] Fix | Delete
isReady
[21385] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[21386] Fix | Delete
const {
[21387] Fix | Delete
getEditorSettings,
[21388] Fix | Delete
getEditorSelection,
[21389] Fix | Delete
__unstableIsEditorReady
[21390] Fix | Delete
} = select(store_store);
[21391] Fix | Delete
return {
[21392] Fix | Delete
editorSettings: getEditorSettings(),
[21393] Fix | Delete
isReady: __unstableIsEditorReady(),
[21394] Fix | Delete
selection: getEditorSelection()
[21395] Fix | Delete
};
[21396] Fix | Delete
}, []);
[21397] Fix | Delete
const {
[21398] Fix | Delete
id,
[21399] Fix | Delete
type
[21400] Fix | Delete
} = rootLevelPost;
[21401] Fix | Delete
const blockEditorSettings = use_block_editor_settings(editorSettings, type, id, mode);
[21402] Fix | Delete
const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode);
[21403] Fix | Delete
const {
[21404] Fix | Delete
updatePostLock,
[21405] Fix | Delete
setupEditor,
[21406] Fix | Delete
updateEditorSettings,
[21407] Fix | Delete
setCurrentTemplateId,
[21408] Fix | Delete
setEditedPost,
[21409] Fix | Delete
setRenderingMode
[21410] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
[21411] Fix | Delete
const {
[21412] Fix | Delete
createWarningNotice
[21413] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
[21414] Fix | Delete
[21415] Fix | Delete
// Ideally this should be synced on each change and not just something you do once.
[21416] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[21417] Fix | Delete
// Assume that we don't need to initialize in the case of an error recovery.
[21418] Fix | Delete
if (recovery) {
[21419] Fix | Delete
return;
[21420] Fix | Delete
}
[21421] Fix | Delete
updatePostLock(settings.postLock);
[21422] Fix | Delete
setupEditor(post, initialEdits, settings.template);
[21423] Fix | Delete
if (settings.autosave) {
[21424] Fix | Delete
createWarningNotice((0,external_wp_i18n_namespaceObject.__)('There is an autosave of this post that is more recent than the version below.'), {
[21425] Fix | Delete
id: 'autosave-exists',
[21426] Fix | Delete
actions: [{
[21427] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('View the autosave'),
[21428] Fix | Delete
url: settings.autosave.editLink
[21429] Fix | Delete
}]
[21430] Fix | Delete
});
[21431] Fix | Delete
}
[21432] Fix | Delete
}, []);
[21433] Fix | Delete
[21434] Fix | Delete
// Synchronizes the active post with the state
[21435] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[21436] Fix | Delete
setEditedPost(post.type, post.id);
[21437] Fix | Delete
}, [post.type, post.id, setEditedPost]);
[21438] Fix | Delete
[21439] Fix | Delete
// Synchronize the editor settings as they change.
[21440] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[21441] Fix | Delete
updateEditorSettings(settings);
[21442] Fix | Delete
}, [settings, updateEditorSettings]);
[21443] Fix | Delete
[21444] Fix | Delete
// Synchronizes the active template with the state.
[21445] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[21446] Fix | Delete
setCurrentTemplateId(template?.id);
[21447] Fix | Delete
}, [template?.id, setCurrentTemplateId]);
[21448] Fix | Delete
[21449] Fix | Delete
// Sets the right rendering mode when loading the editor.
[21450] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[21451] Fix | Delete
var _settings$defaultRend;
[21452] Fix | Delete
setRenderingMode((_settings$defaultRend = settings.defaultRenderingMode) !== null && _settings$defaultRend !== void 0 ? _settings$defaultRend : 'post-only');
[21453] Fix | Delete
}, [settings.defaultRenderingMode, setRenderingMode]);
[21454] Fix | Delete
useHideBlocksFromInserter(post.type, mode);
[21455] Fix | Delete
[21456] Fix | Delete
// Register the editor commands.
[21457] Fix | Delete
useCommands();
[21458] Fix | Delete
if (!isReady) {
[21459] Fix | Delete
return null;
[21460] Fix | Delete
}
[21461] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, {
[21462] Fix | Delete
kind: "root",
[21463] Fix | Delete
type: "site",
[21464] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, {
[21465] Fix | Delete
kind: "postType",
[21466] Fix | Delete
type: post.type,
[21467] Fix | Delete
id: post.id,
[21468] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
[21469] Fix | Delete
value: defaultBlockContext,
[21470] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockEditorProviderComponent, {
[21471] Fix | Delete
value: blocks,
[21472] Fix | Delete
onChange: onChange,
[21473] Fix | Delete
onInput: onInput,
[21474] Fix | Delete
selection: selection,
[21475] Fix | Delete
settings: blockEditorSettings,
[21476] Fix | Delete
useSubRegistry: false,
[21477] Fix | Delete
children: [children, !settings.__unstableIsPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[21478] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlySettingsMenu, {}), mode === 'template-locked' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisableNonPageContentBlocks, {}), type === 'wp_navigation' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationBlockEditingMode, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRemovalWarnings, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartPageOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StartTemplateOptions, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternRenameModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternDuplicateModal, {})]
[21479] Fix | Delete
})]
[21480] Fix | Delete
})
[21481] Fix | Delete
})
[21482] Fix | Delete
})
[21483] Fix | Delete
});
[21484] Fix | Delete
});
[21485] Fix | Delete
[21486] Fix | Delete
/**
[21487] Fix | Delete
* This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).
[21488] Fix | Delete
*
[21489] Fix | Delete
* It supports a large number of post types, including post, page, templates,
[21490] Fix | Delete
* custom post types, patterns, template parts.
[21491] Fix | Delete
*
[21492] Fix | Delete
* All modification and changes are performed to the `@wordpress/core-data` store.
[21493] Fix | Delete
*
[21494] Fix | Delete
* @param {Object} props The component props.
[21495] Fix | Delete
* @param {Object} [props.post] The post object to edit. This is required.
[21496] Fix | Delete
* @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.
[21497] Fix | Delete
* This is optional and can only be used when the post type supports templates (like posts and pages).
[21498] Fix | Delete
* @param {Object} [props.settings] The settings object to use for the editor.
[21499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function