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
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: reusable-blocks.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ "use strict";
[1] Fix | Delete
/******/ // The require scope
[2] Fix | Delete
/******/ var __webpack_require__ = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/************************************************************************/
[5] Fix | Delete
/******/ /* webpack/runtime/define property getters */
[6] Fix | Delete
/******/ (() => {
[7] Fix | Delete
/******/ // define getter functions for harmony exports
[8] Fix | Delete
/******/ __webpack_require__.d = (exports, definition) => {
[9] Fix | Delete
/******/ for(var key in definition) {
[10] Fix | Delete
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
[11] Fix | Delete
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
[12] Fix | Delete
/******/ }
[13] Fix | Delete
/******/ }
[14] Fix | Delete
/******/ };
[15] Fix | Delete
/******/ })();
[16] Fix | Delete
/******/
[17] Fix | Delete
/******/ /* webpack/runtime/hasOwnProperty shorthand */
[18] Fix | Delete
/******/ (() => {
[19] Fix | Delete
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
[20] Fix | Delete
/******/ })();
[21] Fix | Delete
/******/
[22] Fix | Delete
/******/ /* webpack/runtime/make namespace object */
[23] Fix | Delete
/******/ (() => {
[24] Fix | Delete
/******/ // define __esModule on exports
[25] Fix | Delete
/******/ __webpack_require__.r = (exports) => {
[26] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[27] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[28] Fix | Delete
/******/ }
[29] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[30] Fix | Delete
/******/ };
[31] Fix | Delete
/******/ })();
[32] Fix | Delete
/******/
[33] Fix | Delete
/************************************************************************/
[34] Fix | Delete
var __webpack_exports__ = {};
[35] Fix | Delete
// ESM COMPAT FLAG
[36] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[37] Fix | Delete
[38] Fix | Delete
// EXPORTS
[39] Fix | Delete
__webpack_require__.d(__webpack_exports__, {
[40] Fix | Delete
ReusableBlocksMenuItems: () => (/* reexport */ ReusableBlocksMenuItems),
[41] Fix | Delete
store: () => (/* reexport */ store)
[42] Fix | Delete
});
[43] Fix | Delete
[44] Fix | Delete
// NAMESPACE OBJECT: ./node_modules/@wordpress/reusable-blocks/build-module/store/actions.js
[45] Fix | Delete
var actions_namespaceObject = {};
[46] Fix | Delete
__webpack_require__.r(actions_namespaceObject);
[47] Fix | Delete
__webpack_require__.d(actions_namespaceObject, {
[48] Fix | Delete
__experimentalConvertBlockToStatic: () => (__experimentalConvertBlockToStatic),
[49] Fix | Delete
__experimentalConvertBlocksToReusable: () => (__experimentalConvertBlocksToReusable),
[50] Fix | Delete
__experimentalDeleteReusableBlock: () => (__experimentalDeleteReusableBlock),
[51] Fix | Delete
__experimentalSetEditingReusableBlock: () => (__experimentalSetEditingReusableBlock)
[52] Fix | Delete
});
[53] Fix | Delete
[54] Fix | Delete
// NAMESPACE OBJECT: ./node_modules/@wordpress/reusable-blocks/build-module/store/selectors.js
[55] Fix | Delete
var selectors_namespaceObject = {};
[56] Fix | Delete
__webpack_require__.r(selectors_namespaceObject);
[57] Fix | Delete
__webpack_require__.d(selectors_namespaceObject, {
[58] Fix | Delete
__experimentalIsEditingReusableBlock: () => (__experimentalIsEditingReusableBlock)
[59] Fix | Delete
});
[60] Fix | Delete
[61] Fix | Delete
;// CONCATENATED MODULE: external ["wp","data"]
[62] Fix | Delete
const external_wp_data_namespaceObject = window["wp"]["data"];
[63] Fix | Delete
;// CONCATENATED MODULE: external ["wp","blockEditor"]
[64] Fix | Delete
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
[65] Fix | Delete
;// CONCATENATED MODULE: external ["wp","blocks"]
[66] Fix | Delete
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
[67] Fix | Delete
;// CONCATENATED MODULE: external ["wp","i18n"]
[68] Fix | Delete
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
[69] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/actions.js
[70] Fix | Delete
/**
[71] Fix | Delete
* WordPress dependencies
[72] Fix | Delete
*/
[73] Fix | Delete
[74] Fix | Delete
[75] Fix | Delete
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Returns a generator converting a reusable block into a static block.
[79] Fix | Delete
*
[80] Fix | Delete
* @param {string} clientId The client ID of the block to attach.
[81] Fix | Delete
*/
[82] Fix | Delete
const __experimentalConvertBlockToStatic = clientId => ({
[83] Fix | Delete
registry
[84] Fix | Delete
}) => {
[85] Fix | Delete
const oldBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId);
[86] Fix | Delete
const reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', oldBlock.attributes.ref);
[87] Fix | Delete
const newBlocks = (0,external_wp_blocks_namespaceObject.parse)(typeof reusableBlock.content === 'function' ? reusableBlock.content(reusableBlock) : reusableBlock.content);
[88] Fix | Delete
registry.dispatch(external_wp_blockEditor_namespaceObject.store).replaceBlocks(oldBlock.clientId, newBlocks);
[89] Fix | Delete
};
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Returns a generator converting one or more static blocks into a pattern.
[93] Fix | Delete
*
[94] Fix | Delete
* @param {string[]} clientIds The client IDs of the block to detach.
[95] Fix | Delete
* @param {string} title Pattern title.
[96] Fix | Delete
* @param {undefined|'unsynced'} syncType They way block is synced, current undefined (synced) and 'unsynced'.
[97] Fix | Delete
*/
[98] Fix | Delete
const __experimentalConvertBlocksToReusable = (clientIds, title, syncType) => async ({
[99] Fix | Delete
registry,
[100] Fix | Delete
dispatch
[101] Fix | Delete
}) => {
[102] Fix | Delete
const meta = syncType === 'unsynced' ? {
[103] Fix | Delete
wp_pattern_sync_status: syncType
[104] Fix | Delete
} : undefined;
[105] Fix | Delete
const reusableBlock = {
[106] Fix | Delete
title: title || (0,external_wp_i18n_namespaceObject.__)('Untitled pattern block'),
[107] Fix | Delete
content: (0,external_wp_blocks_namespaceObject.serialize)(registry.select(external_wp_blockEditor_namespaceObject.store).getBlocksByClientId(clientIds)),
[108] Fix | Delete
status: 'publish',
[109] Fix | Delete
meta
[110] Fix | Delete
};
[111] Fix | Delete
const updatedRecord = await registry.dispatch('core').saveEntityRecord('postType', 'wp_block', reusableBlock);
[112] Fix | Delete
if (syncType === 'unsynced') {
[113] Fix | Delete
return;
[114] Fix | Delete
}
[115] Fix | Delete
const newBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/block', {
[116] Fix | Delete
ref: updatedRecord.id
[117] Fix | Delete
});
[118] Fix | Delete
registry.dispatch(external_wp_blockEditor_namespaceObject.store).replaceBlocks(clientIds, newBlock);
[119] Fix | Delete
dispatch.__experimentalSetEditingReusableBlock(newBlock.clientId, true);
[120] Fix | Delete
};
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Returns a generator deleting a reusable block.
[124] Fix | Delete
*
[125] Fix | Delete
* @param {string} id The ID of the reusable block to delete.
[126] Fix | Delete
*/
[127] Fix | Delete
const __experimentalDeleteReusableBlock = id => async ({
[128] Fix | Delete
registry
[129] Fix | Delete
}) => {
[130] Fix | Delete
const reusableBlock = registry.select('core').getEditedEntityRecord('postType', 'wp_block', id);
[131] Fix | Delete
[132] Fix | Delete
// Don't allow a reusable block with a temporary ID to be deleted.
[133] Fix | Delete
if (!reusableBlock) {
[134] Fix | Delete
return;
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
// Remove any other blocks that reference this reusable block.
[138] Fix | Delete
const allBlocks = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks();
[139] Fix | Delete
const associatedBlocks = allBlocks.filter(block => (0,external_wp_blocks_namespaceObject.isReusableBlock)(block) && block.attributes.ref === id);
[140] Fix | Delete
const associatedBlockClientIds = associatedBlocks.map(block => block.clientId);
[141] Fix | Delete
[142] Fix | Delete
// Remove the parsed block.
[143] Fix | Delete
if (associatedBlockClientIds.length) {
[144] Fix | Delete
registry.dispatch(external_wp_blockEditor_namespaceObject.store).removeBlocks(associatedBlockClientIds);
[145] Fix | Delete
}
[146] Fix | Delete
await registry.dispatch('core').deleteEntityRecord('postType', 'wp_block', id);
[147] Fix | Delete
};
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Returns an action descriptor for SET_EDITING_REUSABLE_BLOCK action.
[151] Fix | Delete
*
[152] Fix | Delete
* @param {string} clientId The clientID of the reusable block to target.
[153] Fix | Delete
* @param {boolean} isEditing Whether the block should be in editing state.
[154] Fix | Delete
* @return {Object} Action descriptor.
[155] Fix | Delete
*/
[156] Fix | Delete
function __experimentalSetEditingReusableBlock(clientId, isEditing) {
[157] Fix | Delete
return {
[158] Fix | Delete
type: 'SET_EDITING_REUSABLE_BLOCK',
[159] Fix | Delete
clientId,
[160] Fix | Delete
isEditing
[161] Fix | Delete
};
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/reducer.js
[165] Fix | Delete
/**
[166] Fix | Delete
* WordPress dependencies
[167] Fix | Delete
*/
[168] Fix | Delete
[169] Fix | Delete
function isEditingReusableBlock(state = {}, action) {
[170] Fix | Delete
if (action?.type === 'SET_EDITING_REUSABLE_BLOCK') {
[171] Fix | Delete
return {
[172] Fix | Delete
...state,
[173] Fix | Delete
[action.clientId]: action.isEditing
[174] Fix | Delete
};
[175] Fix | Delete
}
[176] Fix | Delete
return state;
[177] Fix | Delete
}
[178] Fix | Delete
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
[179] Fix | Delete
isEditingReusableBlock
[180] Fix | Delete
}));
[181] Fix | Delete
[182] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/selectors.js
[183] Fix | Delete
/**
[184] Fix | Delete
* Returns true if reusable block is in the editing state.
[185] Fix | Delete
*
[186] Fix | Delete
* @param {Object} state Global application state.
[187] Fix | Delete
* @param {number} clientId the clientID of the block.
[188] Fix | Delete
* @return {boolean} Whether the reusable block is in the editing state.
[189] Fix | Delete
*/
[190] Fix | Delete
function __experimentalIsEditingReusableBlock(state, clientId) {
[191] Fix | Delete
return state.isEditingReusableBlock[clientId];
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/store/index.js
[195] Fix | Delete
/**
[196] Fix | Delete
* WordPress dependencies
[197] Fix | Delete
*/
[198] Fix | Delete
[199] Fix | Delete
[200] Fix | Delete
/**
[201] Fix | Delete
* Internal dependencies
[202] Fix | Delete
*/
[203] Fix | Delete
[204] Fix | Delete
[205] Fix | Delete
[206] Fix | Delete
const STORE_NAME = 'core/reusable-blocks';
[207] Fix | Delete
[208] Fix | Delete
/**
[209] Fix | Delete
* Store definition for the reusable blocks namespace.
[210] Fix | Delete
*
[211] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
[212] Fix | Delete
*
[213] Fix | Delete
* @type {Object}
[214] Fix | Delete
*/
[215] Fix | Delete
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
[216] Fix | Delete
actions: actions_namespaceObject,
[217] Fix | Delete
reducer: reducer,
[218] Fix | Delete
selectors: selectors_namespaceObject
[219] Fix | Delete
});
[220] Fix | Delete
(0,external_wp_data_namespaceObject.register)(store);
[221] Fix | Delete
[222] Fix | Delete
;// CONCATENATED MODULE: external ["wp","element"]
[223] Fix | Delete
const external_wp_element_namespaceObject = window["wp"]["element"];
[224] Fix | Delete
;// CONCATENATED MODULE: external ["wp","components"]
[225] Fix | Delete
const external_wp_components_namespaceObject = window["wp"]["components"];
[226] Fix | Delete
;// CONCATENATED MODULE: external ["wp","primitives"]
[227] Fix | Delete
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
[228] Fix | Delete
;// CONCATENATED MODULE: external "ReactJSXRuntime"
[229] Fix | Delete
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
[230] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
[231] Fix | Delete
/**
[232] Fix | Delete
* WordPress dependencies
[233] Fix | Delete
*/
[234] Fix | Delete
[235] Fix | Delete
[236] Fix | Delete
const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
[237] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[238] Fix | Delete
viewBox: "0 0 24 24",
[239] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
[240] 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"
[241] Fix | Delete
})
[242] Fix | Delete
});
[243] Fix | Delete
/* harmony default export */ const library_symbol = (symbol);
[244] Fix | Delete
[245] Fix | Delete
;// CONCATENATED MODULE: external ["wp","notices"]
[246] Fix | Delete
const external_wp_notices_namespaceObject = window["wp"]["notices"];
[247] Fix | Delete
;// CONCATENATED MODULE: external ["wp","coreData"]
[248] Fix | Delete
const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
[249] Fix | Delete
;// CONCATENATED MODULE: external ["wp","privateApis"]
[250] Fix | Delete
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
[251] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/lock-unlock.js
[252] Fix | Delete
/**
[253] Fix | Delete
* WordPress dependencies
[254] Fix | Delete
*/
[255] Fix | Delete
[256] Fix | Delete
const {
[257] Fix | Delete
unlock
[258] Fix | Delete
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/reusable-blocks');
[259] Fix | Delete
[260] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.js
[261] Fix | Delete
/**
[262] Fix | Delete
* WordPress dependencies
[263] Fix | Delete
*/
[264] Fix | Delete
[265] Fix | Delete
[266] Fix | Delete
[267] Fix | Delete
[268] Fix | Delete
[269] Fix | Delete
[270] Fix | Delete
[271] Fix | Delete
[272] Fix | Delete
[273] Fix | Delete
[274] Fix | Delete
/**
[275] Fix | Delete
* Internal dependencies
[276] Fix | Delete
*/
[277] Fix | Delete
[278] Fix | Delete
[279] Fix | Delete
[280] Fix | Delete
[281] Fix | Delete
[282] Fix | Delete
const {
[283] Fix | Delete
useReusableBlocksRenameHint,
[284] Fix | Delete
ReusableBlocksRenameHint
[285] Fix | Delete
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Menu control to convert block(s) to reusable block.
[289] Fix | Delete
*
[290] Fix | Delete
* @param {Object} props Component props.
[291] Fix | Delete
* @param {string[]} props.clientIds Client ids of selected blocks.
[292] Fix | Delete
* @param {string} props.rootClientId ID of the currently selected top-level block.
[293] Fix | Delete
* @param {()=>void} props.onClose Callback to close the menu.
[294] Fix | Delete
* @return {import('react').ComponentType} The menu control or null.
[295] Fix | Delete
*/
[296] Fix | Delete
function ReusableBlockConvertButton({
[297] Fix | Delete
clientIds,
[298] Fix | Delete
rootClientId,
[299] Fix | Delete
onClose
[300] Fix | Delete
}) {
[301] Fix | Delete
const showRenameHint = useReusableBlocksRenameHint();
[302] Fix | Delete
const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined);
[303] Fix | Delete
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
[304] Fix | Delete
const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)('');
[305] Fix | Delete
const canConvert = (0,external_wp_data_namespaceObject.useSelect)(select => {
[306] Fix | Delete
var _getBlocksByClientId;
[307] Fix | Delete
const {
[308] Fix | Delete
canUser
[309] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[310] Fix | Delete
const {
[311] Fix | Delete
getBlocksByClientId,
[312] Fix | Delete
canInsertBlockType,
[313] Fix | Delete
getBlockRootClientId
[314] Fix | Delete
} = select(external_wp_blockEditor_namespaceObject.store);
[315] Fix | Delete
const rootId = rootClientId || (clientIds.length > 0 ? getBlockRootClientId(clientIds[0]) : undefined);
[316] Fix | Delete
const blocks = (_getBlocksByClientId = getBlocksByClientId(clientIds)) !== null && _getBlocksByClientId !== void 0 ? _getBlocksByClientId : [];
[317] Fix | Delete
const isReusable = blocks.length === 1 && blocks[0] && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]) && !!select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', blocks[0].attributes.ref);
[318] Fix | Delete
const _canConvert =
[319] Fix | Delete
// Hide when this is already a reusable block.
[320] Fix | Delete
!isReusable &&
[321] Fix | Delete
// Hide when reusable blocks are disabled.
[322] Fix | Delete
canInsertBlockType('core/block', rootId) && blocks.every(block =>
[323] Fix | Delete
// Guard against the case where a regular block has *just* been converted.
[324] Fix | Delete
!!block &&
[325] Fix | Delete
// Hide on invalid blocks.
[326] Fix | Delete
block.isValid &&
[327] Fix | Delete
// Hide when block doesn't support being made reusable.
[328] Fix | Delete
(0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'reusable', true)) &&
[329] Fix | Delete
// Hide when current doesn't have permission to do that.
[330] Fix | Delete
!!canUser('create', 'blocks');
[331] Fix | Delete
return _canConvert;
[332] Fix | Delete
}, [clientIds, rootClientId]);
[333] Fix | Delete
const {
[334] Fix | Delete
__experimentalConvertBlocksToReusable: convertBlocksToReusable
[335] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[336] Fix | Delete
const {
[337] Fix | Delete
createSuccessNotice,
[338] Fix | Delete
createErrorNotice
[339] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
[340] Fix | Delete
const onConvert = (0,external_wp_element_namespaceObject.useCallback)(async function (reusableBlockTitle) {
[341] Fix | Delete
try {
[342] Fix | Delete
await convertBlocksToReusable(clientIds, reusableBlockTitle, syncType);
[343] Fix | Delete
createSuccessNotice(!syncType ? (0,external_wp_i18n_namespaceObject.sprintf)(
[344] Fix | Delete
// translators: %s: the name the user has given to the pattern.
[345] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Synced pattern created: %s'), reusableBlockTitle) : (0,external_wp_i18n_namespaceObject.sprintf)(
[346] Fix | Delete
// translators: %s: the name the user has given to the pattern.
[347] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Unsynced pattern created: %s'), reusableBlockTitle), {
[348] Fix | Delete
type: 'snackbar',
[349] Fix | Delete
id: 'convert-to-reusable-block-success'
[350] Fix | Delete
});
[351] Fix | Delete
} catch (error) {
[352] Fix | Delete
createErrorNotice(error.message, {
[353] Fix | Delete
type: 'snackbar',
[354] Fix | Delete
id: 'convert-to-reusable-block-error'
[355] Fix | Delete
});
[356] Fix | Delete
}
[357] Fix | Delete
}, [convertBlocksToReusable, clientIds, syncType, createSuccessNotice, createErrorNotice]);
[358] Fix | Delete
if (!canConvert) {
[359] Fix | Delete
return null;
[360] Fix | Delete
}
[361] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[362] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[363] Fix | Delete
icon: library_symbol,
[364] Fix | Delete
onClick: () => setIsModalOpen(true),
[365] Fix | Delete
children: showRenameHint ? (0,external_wp_i18n_namespaceObject.__)('Create pattern/reusable block') : (0,external_wp_i18n_namespaceObject.__)('Create pattern')
[366] Fix | Delete
}), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[367] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'),
[368] Fix | Delete
onRequestClose: () => {
[369] Fix | Delete
setIsModalOpen(false);
[370] Fix | Delete
setTitle('');
[371] Fix | Delete
},
[372] Fix | Delete
overlayClassName: "reusable-blocks-menu-items__convert-modal",
[373] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
[374] Fix | Delete
onSubmit: event => {
[375] Fix | Delete
event.preventDefault();
[376] Fix | Delete
onConvert(title);
[377] Fix | Delete
setIsModalOpen(false);
[378] Fix | Delete
setTitle('');
[379] Fix | Delete
onClose();
[380] Fix | Delete
},
[381] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[382] Fix | Delete
spacing: "5",
[383] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
[384] Fix | Delete
__nextHasNoMarginBottom: true,
[385] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
[386] Fix | Delete
value: title,
[387] Fix | Delete
onChange: setTitle,
[388] Fix | Delete
placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern')
[389] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
[390] Fix | Delete
label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'),
[391] Fix | Delete
help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'),
[392] Fix | Delete
checked: !syncType,
[393] Fix | Delete
onChange: () => {
[394] Fix | Delete
setSyncType(!syncType ? 'unsynced' : undefined);
[395] Fix | Delete
}
[396] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[397] Fix | Delete
justify: "right",
[398] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[399] Fix | Delete
variant: "tertiary",
[400] Fix | Delete
onClick: () => {
[401] Fix | Delete
setIsModalOpen(false);
[402] Fix | Delete
setTitle('');
[403] Fix | Delete
},
[404] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
[405] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[406] Fix | Delete
variant: "primary",
[407] Fix | Delete
type: "submit",
[408] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Create')
[409] Fix | Delete
})]
[410] Fix | Delete
})]
[411] Fix | Delete
})
[412] Fix | Delete
})
[413] Fix | Delete
})]
[414] Fix | Delete
});
[415] Fix | Delete
}
[416] Fix | Delete
[417] Fix | Delete
;// CONCATENATED MODULE: external ["wp","url"]
[418] Fix | Delete
const external_wp_url_namespaceObject = window["wp"]["url"];
[419] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-blocks-manage-button.js
[420] Fix | Delete
/**
[421] Fix | Delete
* WordPress dependencies
[422] Fix | Delete
*/
[423] Fix | Delete
[424] Fix | Delete
[425] Fix | Delete
[426] Fix | Delete
[427] Fix | Delete
[428] Fix | Delete
[429] Fix | Delete
[430] Fix | Delete
[431] Fix | Delete
/**
[432] Fix | Delete
* Internal dependencies
[433] Fix | Delete
*/
[434] Fix | Delete
[435] Fix | Delete
[436] Fix | Delete
[437] Fix | Delete
[438] Fix | Delete
function ReusableBlocksManageButton({
[439] Fix | Delete
clientId
[440] Fix | Delete
}) {
[441] Fix | Delete
const {
[442] Fix | Delete
canRemove,
[443] Fix | Delete
isVisible,
[444] Fix | Delete
managePatternsUrl
[445] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[446] Fix | Delete
const {
[447] Fix | Delete
getBlock,
[448] Fix | Delete
canRemoveBlock,
[449] Fix | Delete
getBlockCount
[450] Fix | Delete
} = select(external_wp_blockEditor_namespaceObject.store);
[451] Fix | Delete
const {
[452] Fix | Delete
canUser
[453] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[454] Fix | Delete
const reusableBlock = getBlock(clientId);
[455] Fix | Delete
return {
[456] Fix | Delete
canRemove: canRemoveBlock(clientId),
[457] Fix | Delete
isVisible: !!reusableBlock && (0,external_wp_blocks_namespaceObject.isReusableBlock)(reusableBlock) && !!canUser('update', 'blocks', reusableBlock.attributes.ref),
[458] Fix | Delete
innerBlockCount: getBlockCount(clientId),
[459] Fix | Delete
// The site editor and templates both check whether the user
[460] Fix | Delete
// has edit_theme_options capabilities. We can leverage that here
[461] Fix | Delete
// and omit the manage patterns link if the user can't access it.
[462] Fix | Delete
managePatternsUrl: canUser('create', 'templates') ? (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', {
[463] Fix | Delete
path: '/patterns'
[464] Fix | Delete
}) : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
[465] Fix | Delete
post_type: 'wp_block'
[466] Fix | Delete
})
[467] Fix | Delete
};
[468] Fix | Delete
}, [clientId]);
[469] Fix | Delete
const {
[470] Fix | Delete
__experimentalConvertBlockToStatic: convertBlockToStatic
[471] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[472] Fix | Delete
if (!isVisible) {
[473] Fix | Delete
return null;
[474] Fix | Delete
}
[475] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[476] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[477] Fix | Delete
href: managePatternsUrl,
[478] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns')
[479] Fix | Delete
}), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[480] Fix | Delete
onClick: () => convertBlockToStatic(clientId),
[481] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Detach')
[482] Fix | Delete
})]
[483] Fix | Delete
});
[484] Fix | Delete
}
[485] Fix | Delete
/* harmony default export */ const reusable_blocks_manage_button = (ReusableBlocksManageButton);
[486] Fix | Delete
[487] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.js
[488] Fix | Delete
/**
[489] Fix | Delete
* WordPress dependencies
[490] Fix | Delete
*/
[491] Fix | Delete
[492] Fix | Delete
[493] Fix | Delete
/**
[494] Fix | Delete
* Internal dependencies
[495] Fix | Delete
*/
[496] Fix | Delete
[497] Fix | Delete
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function