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
});
[5500] Fix | Delete
}
[5501] Fix | Delete
};
[5502] Fix | Delete
[5503] Fix | Delete
/**
[5504] Fix | Delete
* Action that removes an array of templates, template parts or patterns.
[5505] Fix | Delete
*
[5506] Fix | Delete
* @param {Array} items An array of template,template part or pattern objects to remove.
[5507] Fix | Delete
*/
[5508] Fix | Delete
const removeTemplates = items => async ({
[5509] Fix | Delete
registry
[5510] Fix | Delete
}) => {
[5511] Fix | Delete
const isResetting = items.every(item => !!item && (item.has_theme_file || item.templatePart && item.templatePart.has_theme_file));
[5512] Fix | Delete
const promiseResult = await Promise.allSettled(items.map(item => {
[5513] Fix | Delete
return registry.dispatch(external_wp_coreData_namespaceObject.store).deleteEntityRecord('postType', item.type, item.id, {
[5514] Fix | Delete
force: true
[5515] Fix | Delete
}, {
[5516] Fix | Delete
throwOnError: true
[5517] Fix | Delete
});
[5518] Fix | Delete
}));
[5519] Fix | Delete
[5520] Fix | Delete
// If all the promises were fulfilled with sucess.
[5521] Fix | Delete
if (promiseResult.every(({
[5522] Fix | Delete
status
[5523] Fix | Delete
}) => status === 'fulfilled')) {
[5524] Fix | Delete
let successMessage;
[5525] Fix | Delete
if (items.length === 1) {
[5526] Fix | Delete
// Depending on how the entity was retrieved its title might be
[5527] Fix | Delete
// an object or simple string.
[5528] Fix | Delete
const title = typeof items[0].title === 'string' ? items[0].title : items[0].title?.rendered;
[5529] Fix | Delete
successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */
[5530] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */
[5531] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('"%s" deleted.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title));
[5532] Fix | Delete
} else {
[5533] Fix | Delete
successMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('Items reset.') : (0,external_wp_i18n_namespaceObject.__)('Items deleted.');
[5534] Fix | Delete
}
[5535] Fix | Delete
registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice(successMessage, {
[5536] Fix | Delete
type: 'snackbar',
[5537] Fix | Delete
id: 'editor-template-deleted-success'
[5538] Fix | Delete
});
[5539] Fix | Delete
} else {
[5540] Fix | Delete
// If there was at lease one failure.
[5541] Fix | Delete
let errorMessage;
[5542] Fix | Delete
// If we were trying to delete a single template.
[5543] Fix | Delete
if (promiseResult.length === 1) {
[5544] Fix | Delete
if (promiseResult[0].reason?.message) {
[5545] Fix | Delete
errorMessage = promiseResult[0].reason.message;
[5546] Fix | Delete
} else {
[5547] Fix | Delete
errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the item.') : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the item.');
[5548] Fix | Delete
}
[5549] Fix | Delete
// If we were trying to delete a multiple templates
[5550] Fix | Delete
} else {
[5551] Fix | Delete
const errorMessages = new Set();
[5552] Fix | Delete
const failedPromises = promiseResult.filter(({
[5553] Fix | Delete
status
[5554] Fix | Delete
}) => status === 'rejected');
[5555] Fix | Delete
for (const failedPromise of failedPromises) {
[5556] Fix | Delete
if (failedPromise.reason?.message) {
[5557] Fix | Delete
errorMessages.add(failedPromise.reason.message);
[5558] Fix | Delete
}
[5559] Fix | Delete
}
[5560] Fix | Delete
if (errorMessages.size === 0) {
[5561] Fix | Delete
errorMessage = (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items.');
[5562] Fix | Delete
} else if (errorMessages.size === 1) {
[5563] Fix | Delete
errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */
[5564] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('An error occurred while reverting the items: %s'), [...errorMessages][0]) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: an error message */
[5565] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the items: %s'), [...errorMessages][0]);
[5566] Fix | Delete
} else {
[5567] Fix | Delete
errorMessage = isResetting ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */
[5568] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Some errors occurred while reverting the items: %s'), [...errorMessages].join(',')) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: a list of comma separated error messages */
[5569] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Some errors occurred while deleting the items: %s'), [...errorMessages].join(','));
[5570] Fix | Delete
}
[5571] Fix | Delete
}
[5572] Fix | Delete
registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(errorMessage, {
[5573] Fix | Delete
type: 'snackbar'
[5574] Fix | Delete
});
[5575] Fix | Delete
}
[5576] Fix | Delete
};
[5577] Fix | Delete
[5578] Fix | Delete
// EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js
[5579] Fix | Delete
var fast_deep_equal = __webpack_require__(5215);
[5580] Fix | Delete
var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal);
[5581] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
[5582] Fix | Delete
/**
[5583] Fix | Delete
* WordPress dependencies
[5584] Fix | Delete
*/
[5585] Fix | Delete
[5586] Fix | Delete
[5587] Fix | Delete
const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[5588] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[5589] Fix | Delete
viewBox: "0 0 24 24",
[5590] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[5591] Fix | Delete
d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
[5592] Fix | Delete
})
[5593] Fix | Delete
});
[5594] Fix | Delete
/* harmony default export */ const library_symbol = (symbol);
[5595] Fix | Delete
[5596] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
[5597] Fix | Delete
/**
[5598] Fix | Delete
* WordPress dependencies
[5599] Fix | Delete
*/
[5600] Fix | Delete
[5601] Fix | Delete
[5602] Fix | Delete
const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[5603] Fix | Delete
viewBox: "0 0 24 24",
[5604] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[5605] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[5606] Fix | Delete
d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
[5607] Fix | Delete
})
[5608] Fix | Delete
});
[5609] Fix | Delete
/* harmony default export */ const library_navigation = (navigation);
[5610] Fix | Delete
[5611] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
[5612] Fix | Delete
/**
[5613] Fix | Delete
* WordPress dependencies
[5614] Fix | Delete
*/
[5615] Fix | Delete
[5616] Fix | Delete
[5617] Fix | Delete
[5618] Fix | Delete
const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, {
[5619] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[5620] Fix | Delete
viewBox: "0 0 24 24",
[5621] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[5622] Fix | Delete
d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
[5623] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[5624] Fix | Delete
d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"
[5625] Fix | Delete
})]
[5626] Fix | Delete
});
[5627] Fix | Delete
/* harmony default export */ const library_page = (page);
[5628] Fix | Delete
[5629] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
[5630] Fix | Delete
/**
[5631] Fix | Delete
* WordPress dependencies
[5632] Fix | Delete
*/
[5633] Fix | Delete
[5634] Fix | Delete
[5635] Fix | Delete
const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[5636] Fix | Delete
viewBox: "0 0 24 24",
[5637] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[5638] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[5639] Fix | Delete
d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
[5640] Fix | Delete
})
[5641] Fix | Delete
});
[5642] Fix | Delete
/* harmony default export */ const library_verse = (verse);
[5643] Fix | Delete
[5644] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/memize/dist/index.js
[5645] Fix | Delete
/**
[5646] Fix | Delete
* Memize options object.
[5647] Fix | Delete
*
[5648] Fix | Delete
* @typedef MemizeOptions
[5649] Fix | Delete
*
[5650] Fix | Delete
* @property {number} [maxSize] Maximum size of the cache.
[5651] Fix | Delete
*/
[5652] Fix | Delete
[5653] Fix | Delete
/**
[5654] Fix | Delete
* Internal cache entry.
[5655] Fix | Delete
*
[5656] Fix | Delete
* @typedef MemizeCacheNode
[5657] Fix | Delete
*
[5658] Fix | Delete
* @property {?MemizeCacheNode|undefined} [prev] Previous node.
[5659] Fix | Delete
* @property {?MemizeCacheNode|undefined} [next] Next node.
[5660] Fix | Delete
* @property {Array<*>} args Function arguments for cache
[5661] Fix | Delete
* entry.
[5662] Fix | Delete
* @property {*} val Function result.
[5663] Fix | Delete
*/
[5664] Fix | Delete
[5665] Fix | Delete
/**
[5666] Fix | Delete
* Properties of the enhanced function for controlling cache.
[5667] Fix | Delete
*
[5668] Fix | Delete
* @typedef MemizeMemoizedFunction
[5669] Fix | Delete
*
[5670] Fix | Delete
* @property {()=>void} clear Clear the cache.
[5671] Fix | Delete
*/
[5672] Fix | Delete
[5673] Fix | Delete
/**
[5674] Fix | Delete
* Accepts a function to be memoized, and returns a new memoized function, with
[5675] Fix | Delete
* optional options.
[5676] Fix | Delete
*
[5677] Fix | Delete
* @template {(...args: any[]) => any} F
[5678] Fix | Delete
*
[5679] Fix | Delete
* @param {F} fn Function to memoize.
[5680] Fix | Delete
* @param {MemizeOptions} [options] Options object.
[5681] Fix | Delete
*
[5682] Fix | Delete
* @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function.
[5683] Fix | Delete
*/
[5684] Fix | Delete
function memize(fn, options) {
[5685] Fix | Delete
var size = 0;
[5686] Fix | Delete
[5687] Fix | Delete
/** @type {?MemizeCacheNode|undefined} */
[5688] Fix | Delete
var head;
[5689] Fix | Delete
[5690] Fix | Delete
/** @type {?MemizeCacheNode|undefined} */
[5691] Fix | Delete
var tail;
[5692] Fix | Delete
[5693] Fix | Delete
options = options || {};
[5694] Fix | Delete
[5695] Fix | Delete
function memoized(/* ...args */) {
[5696] Fix | Delete
var node = head,
[5697] Fix | Delete
len = arguments.length,
[5698] Fix | Delete
args,
[5699] Fix | Delete
i;
[5700] Fix | Delete
[5701] Fix | Delete
searchCache: while (node) {
[5702] Fix | Delete
// Perform a shallow equality test to confirm that whether the node
[5703] Fix | Delete
// under test is a candidate for the arguments passed. Two arrays
[5704] Fix | Delete
// are shallowly equal if their length matches and each entry is
[5705] Fix | Delete
// strictly equal between the two sets. Avoid abstracting to a
[5706] Fix | Delete
// function which could incur an arguments leaking deoptimization.
[5707] Fix | Delete
[5708] Fix | Delete
// Check whether node arguments match arguments length
[5709] Fix | Delete
if (node.args.length !== arguments.length) {
[5710] Fix | Delete
node = node.next;
[5711] Fix | Delete
continue;
[5712] Fix | Delete
}
[5713] Fix | Delete
[5714] Fix | Delete
// Check whether node arguments match arguments values
[5715] Fix | Delete
for (i = 0; i < len; i++) {
[5716] Fix | Delete
if (node.args[i] !== arguments[i]) {
[5717] Fix | Delete
node = node.next;
[5718] Fix | Delete
continue searchCache;
[5719] Fix | Delete
}
[5720] Fix | Delete
}
[5721] Fix | Delete
[5722] Fix | Delete
// At this point we can assume we've found a match
[5723] Fix | Delete
[5724] Fix | Delete
// Surface matched node to head if not already
[5725] Fix | Delete
if (node !== head) {
[5726] Fix | Delete
// As tail, shift to previous. Must only shift if not also
[5727] Fix | Delete
// head, since if both head and tail, there is no previous.
[5728] Fix | Delete
if (node === tail) {
[5729] Fix | Delete
tail = node.prev;
[5730] Fix | Delete
}
[5731] Fix | Delete
[5732] Fix | Delete
// Adjust siblings to point to each other. If node was tail,
[5733] Fix | Delete
// this also handles new tail's empty `next` assignment.
[5734] Fix | Delete
/** @type {MemizeCacheNode} */ (node.prev).next = node.next;
[5735] Fix | Delete
if (node.next) {
[5736] Fix | Delete
node.next.prev = node.prev;
[5737] Fix | Delete
}
[5738] Fix | Delete
[5739] Fix | Delete
node.next = head;
[5740] Fix | Delete
node.prev = null;
[5741] Fix | Delete
/** @type {MemizeCacheNode} */ (head).prev = node;
[5742] Fix | Delete
head = node;
[5743] Fix | Delete
}
[5744] Fix | Delete
[5745] Fix | Delete
// Return immediately
[5746] Fix | Delete
return node.val;
[5747] Fix | Delete
}
[5748] Fix | Delete
[5749] Fix | Delete
// No cached value found. Continue to insertion phase:
[5750] Fix | Delete
[5751] Fix | Delete
// Create a copy of arguments (avoid leaking deoptimization)
[5752] Fix | Delete
args = new Array(len);
[5753] Fix | Delete
for (i = 0; i < len; i++) {
[5754] Fix | Delete
args[i] = arguments[i];
[5755] Fix | Delete
}
[5756] Fix | Delete
[5757] Fix | Delete
node = {
[5758] Fix | Delete
args: args,
[5759] Fix | Delete
[5760] Fix | Delete
// Generate the result from original function
[5761] Fix | Delete
val: fn.apply(null, args),
[5762] Fix | Delete
};
[5763] Fix | Delete
[5764] Fix | Delete
// Don't need to check whether node is already head, since it would
[5765] Fix | Delete
// have been returned above already if it was
[5766] Fix | Delete
[5767] Fix | Delete
// Shift existing head down list
[5768] Fix | Delete
if (head) {
[5769] Fix | Delete
head.prev = node;
[5770] Fix | Delete
node.next = head;
[5771] Fix | Delete
} else {
[5772] Fix | Delete
// If no head, follows that there's no tail (at initial or reset)
[5773] Fix | Delete
tail = node;
[5774] Fix | Delete
}
[5775] Fix | Delete
[5776] Fix | Delete
// Trim tail if we're reached max size and are pending cache insertion
[5777] Fix | Delete
if (size === /** @type {MemizeOptions} */ (options).maxSize) {
[5778] Fix | Delete
tail = /** @type {MemizeCacheNode} */ (tail).prev;
[5779] Fix | Delete
/** @type {MemizeCacheNode} */ (tail).next = null;
[5780] Fix | Delete
} else {
[5781] Fix | Delete
size++;
[5782] Fix | Delete
}
[5783] Fix | Delete
[5784] Fix | Delete
head = node;
[5785] Fix | Delete
[5786] Fix | Delete
return node.val;
[5787] Fix | Delete
}
[5788] Fix | Delete
[5789] Fix | Delete
memoized.clear = function () {
[5790] Fix | Delete
head = null;
[5791] Fix | Delete
tail = null;
[5792] Fix | Delete
size = 0;
[5793] Fix | Delete
};
[5794] Fix | Delete
[5795] Fix | Delete
// Ignore reason: There's not a clear solution to create an intersection of
[5796] Fix | Delete
// the function with additional properties, where the goal is to retain the
[5797] Fix | Delete
// function signature of the incoming argument and add control properties
[5798] Fix | Delete
// on the return value.
[5799] Fix | Delete
[5800] Fix | Delete
// @ts-ignore
[5801] Fix | Delete
return memoized;
[5802] Fix | Delete
}
[5803] Fix | Delete
[5804] Fix | Delete
[5805] Fix | Delete
[5806] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/utils/get-filtered-template-parts.js
[5807] Fix | Delete
/**
[5808] Fix | Delete
* External dependencies
[5809] Fix | Delete
*/
[5810] Fix | Delete
[5811] Fix | Delete
[5812] Fix | Delete
/**
[5813] Fix | Delete
* WordPress dependencies
[5814] Fix | Delete
*/
[5815] Fix | Delete
[5816] Fix | Delete
const EMPTY_ARRAY = [];
[5817] Fix | Delete
[5818] Fix | Delete
/**
[5819] Fix | Delete
* Get a flattened and filtered list of template parts and the matching block for that template part.
[5820] Fix | Delete
*
[5821] Fix | Delete
* Takes a list of blocks defined within a template, and a list of template parts, and returns a
[5822] Fix | Delete
* flattened list of template parts and the matching block for that template part.
[5823] Fix | Delete
*
[5824] Fix | Delete
* @param {Array} blocks Blocks to flatten.
[5825] Fix | Delete
* @param {?Array} templateParts Available template parts.
[5826] Fix | Delete
* @return {Array} An array of template parts and their blocks.
[5827] Fix | Delete
*/
[5828] Fix | Delete
function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) {
[5829] Fix | Delete
const templatePartsById = templateParts ?
[5830] Fix | Delete
// Key template parts by their ID.
[5831] Fix | Delete
templateParts.reduce((newTemplateParts, part) => ({
[5832] Fix | Delete
...newTemplateParts,
[5833] Fix | Delete
[part.id]: part
[5834] Fix | Delete
}), {}) : {};
[5835] Fix | Delete
const result = [];
[5836] Fix | Delete
[5837] Fix | Delete
// Iterate over all blocks, recursing into inner blocks.
[5838] Fix | Delete
// Output will be based on a depth-first traversal.
[5839] Fix | Delete
const stack = [...blocks];
[5840] Fix | Delete
while (stack.length) {
[5841] Fix | Delete
const {
[5842] Fix | Delete
innerBlocks,
[5843] Fix | Delete
...block
[5844] Fix | Delete
} = stack.shift();
[5845] Fix | Delete
// Place inner blocks at the beginning of the stack to preserve order.
[5846] Fix | Delete
stack.unshift(...innerBlocks);
[5847] Fix | Delete
if ((0,external_wp_blocks_namespaceObject.isTemplatePart)(block)) {
[5848] Fix | Delete
const {
[5849] Fix | Delete
attributes: {
[5850] Fix | Delete
theme,
[5851] Fix | Delete
slug
[5852] Fix | Delete
}
[5853] Fix | Delete
} = block;
[5854] Fix | Delete
const templatePartId = `${theme}//${slug}`;
[5855] Fix | Delete
const templatePart = templatePartsById[templatePartId];
[5856] Fix | Delete
[5857] Fix | Delete
// Only add to output if the found template part block is in the list of available template parts.
[5858] Fix | Delete
if (templatePart) {
[5859] Fix | Delete
result.push({
[5860] Fix | Delete
templatePart,
[5861] Fix | Delete
block
[5862] Fix | Delete
});
[5863] Fix | Delete
}
[5864] Fix | Delete
}
[5865] Fix | Delete
}
[5866] Fix | Delete
return result;
[5867] Fix | Delete
}
[5868] Fix | Delete
const memoizedGetFilteredTemplatePartBlocks = memize(getFilteredTemplatePartBlocks);
[5869] Fix | Delete
[5870] Fix | Delete
[5871] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/private-selectors.js
[5872] Fix | Delete
/**
[5873] Fix | Delete
* External dependencies
[5874] Fix | Delete
*/
[5875] Fix | Delete
[5876] Fix | Delete
[5877] Fix | Delete
/**
[5878] Fix | Delete
* WordPress dependencies
[5879] Fix | Delete
*/
[5880] Fix | Delete
[5881] Fix | Delete
[5882] Fix | Delete
[5883] Fix | Delete
[5884] Fix | Delete
[5885] Fix | Delete
/**
[5886] Fix | Delete
* Internal dependencies
[5887] Fix | Delete
*/
[5888] Fix | Delete
[5889] Fix | Delete
[5890] Fix | Delete
[5891] Fix | Delete
const EMPTY_INSERTION_POINT = {
[5892] Fix | Delete
rootClientId: undefined,
[5893] Fix | Delete
insertionIndex: undefined,
[5894] Fix | Delete
filterValue: undefined
[5895] Fix | Delete
};
[5896] Fix | Delete
[5897] Fix | Delete
/**
[5898] Fix | Delete
* Get the insertion point for the inserter.
[5899] Fix | Delete
*
[5900] Fix | Delete
* @param {Object} state Global application state.
[5901] Fix | Delete
*
[5902] Fix | Delete
* @return {Object} The root client ID, index to insert at and starting filter value.
[5903] Fix | Delete
*/
[5904] Fix | Delete
const getInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => {
[5905] Fix | Delete
if (typeof state.blockInserterPanel === 'object') {
[5906] Fix | Delete
return state.blockInserterPanel;
[5907] Fix | Delete
}
[5908] Fix | Delete
if (getRenderingMode(state) === 'template-locked') {
[5909] Fix | Delete
const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content');
[5910] Fix | Delete
if (postContentClientId) {
[5911] Fix | Delete
return {
[5912] Fix | Delete
rootClientId: postContentClientId,
[5913] Fix | Delete
insertionIndex: undefined,
[5914] Fix | Delete
filterValue: undefined
[5915] Fix | Delete
};
[5916] Fix | Delete
}
[5917] Fix | Delete
}
[5918] Fix | Delete
return EMPTY_INSERTION_POINT;
[5919] Fix | Delete
}, state => {
[5920] Fix | Delete
const [postContentClientId] = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/post-content');
[5921] Fix | Delete
return [state.blockInserterPanel, getRenderingMode(state), postContentClientId];
[5922] Fix | Delete
}));
[5923] Fix | Delete
function getListViewToggleRef(state) {
[5924] Fix | Delete
return state.listViewToggleRef;
[5925] Fix | Delete
}
[5926] Fix | Delete
function getInserterSidebarToggleRef(state) {
[5927] Fix | Delete
return state.inserterSidebarToggleRef;
[5928] Fix | Delete
}
[5929] Fix | Delete
const CARD_ICONS = {
[5930] Fix | Delete
wp_block: library_symbol,
[5931] Fix | Delete
wp_navigation: library_navigation,
[5932] Fix | Delete
page: library_page,
[5933] Fix | Delete
post: library_verse
[5934] Fix | Delete
};
[5935] Fix | Delete
const getPostIcon = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, options) => {
[5936] Fix | Delete
{
[5937] Fix | Delete
if (postType === 'wp_template_part' || postType === 'wp_template') {
[5938] Fix | Delete
return __experimentalGetDefaultTemplatePartAreas(state).find(item => options.area === item.area)?.icon || library_layout;
[5939] Fix | Delete
}
[5940] Fix | Delete
if (CARD_ICONS[postType]) {
[5941] Fix | Delete
return CARD_ICONS[postType];
[5942] Fix | Delete
}
[5943] Fix | Delete
const postTypeEntity = select(external_wp_coreData_namespaceObject.store).getPostType(postType);
[5944] Fix | Delete
// `icon` is the `menu_icon` property of a post type. We
[5945] Fix | Delete
// only handle `dashicons` for now, even if the `menu_icon`
[5946] Fix | Delete
// also supports urls and svg as values.
[5947] Fix | Delete
if (typeof postTypeEntity?.icon === 'string' && postTypeEntity.icon.startsWith('dashicons-')) {
[5948] Fix | Delete
return postTypeEntity.icon.slice(10);
[5949] Fix | Delete
}
[5950] Fix | Delete
return library_page;
[5951] Fix | Delete
}
[5952] Fix | Delete
});
[5953] Fix | Delete
[5954] Fix | Delete
/**
[5955] Fix | Delete
* Returns the template parts and their blocks for the current edited template.
[5956] Fix | Delete
*
[5957] Fix | Delete
* @param {Object} state Global application state.
[5958] Fix | Delete
* @return {Array} Template parts and their blocks in an array.
[5959] Fix | Delete
*/
[5960] Fix | Delete
const getCurrentTemplateTemplateParts = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
[5961] Fix | Delete
const templateParts = select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
[5962] Fix | Delete
per_page: -1
[5963] Fix | Delete
});
[5964] Fix | Delete
const clientIds = select(external_wp_blockEditor_namespaceObject.store).getBlocksByName('core/template-part');
[5965] Fix | Delete
const blocks = select(external_wp_blockEditor_namespaceObject.store).getBlocksByClientId(clientIds);
[5966] Fix | Delete
return memoizedGetFilteredTemplatePartBlocks(blocks, templateParts);
[5967] Fix | Delete
});
[5968] Fix | Delete
[5969] Fix | Delete
/**
[5970] Fix | Delete
* Returns true if there are unsaved changes to the
[5971] Fix | Delete
* post's meta fields, and false otherwise.
[5972] Fix | Delete
*
[5973] Fix | Delete
* @param {Object} state Global application state.
[5974] Fix | Delete
* @param {string} postType The post type of the post.
[5975] Fix | Delete
* @param {number} postId The ID of the post.
[5976] Fix | Delete
*
[5977] Fix | Delete
* @return {boolean} Whether there are edits or not in the meta fields of the relevant post.
[5978] Fix | Delete
*/
[5979] Fix | Delete
const hasPostMetaChanges = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, postType, postId) => {
[5980] Fix | Delete
const {
[5981] Fix | Delete
type: currentPostType,
[5982] Fix | Delete
id: currentPostId
[5983] Fix | Delete
} = getCurrentPost(state);
[5984] Fix | Delete
// If no postType or postId is passed, use the current post.
[5985] Fix | Delete
const edits = select(external_wp_coreData_namespaceObject.store).getEntityRecordNonTransientEdits('postType', postType || currentPostType, postId || currentPostId);
[5986] Fix | Delete
if (!edits?.meta) {
[5987] Fix | Delete
return false;
[5988] Fix | Delete
}
[5989] Fix | Delete
[5990] Fix | Delete
// Compare if anything apart from `footnotes` has changed.
[5991] Fix | Delete
const originalPostMeta = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType || currentPostType, postId || currentPostId)?.meta;
[5992] Fix | Delete
return !fast_deep_equal_default()({
[5993] Fix | Delete
...originalPostMeta,
[5994] Fix | Delete
footnotes: undefined
[5995] Fix | Delete
}, {
[5996] Fix | Delete
...edits.meta,
[5997] Fix | Delete
footnotes: undefined
[5998] Fix | Delete
});
[5999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function