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: patterns.js
*/
[1000] Fix | Delete
[1001] Fix | Delete
[1002] Fix | Delete
[1003] Fix | Delete
[1004] Fix | Delete
[1005] Fix | Delete
[1006] Fix | Delete
[1007] Fix | Delete
[1008] Fix | Delete
/**
[1009] Fix | Delete
* Internal dependencies
[1010] Fix | Delete
*/
[1011] Fix | Delete
[1012] Fix | Delete
[1013] Fix | Delete
[1014] Fix | Delete
[1015] Fix | Delete
[1016] Fix | Delete
function PatternsManageButton({
[1017] Fix | Delete
clientId
[1018] Fix | Delete
}) {
[1019] Fix | Delete
const {
[1020] Fix | Delete
canRemove,
[1021] Fix | Delete
isVisible,
[1022] Fix | Delete
managePatternsUrl
[1023] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[1024] Fix | Delete
const {
[1025] Fix | Delete
getBlock,
[1026] Fix | Delete
canRemoveBlock,
[1027] Fix | Delete
getBlockCount
[1028] Fix | Delete
} = select(external_wp_blockEditor_namespaceObject.store);
[1029] Fix | Delete
const {
[1030] Fix | Delete
canUser
[1031] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[1032] Fix | Delete
const reusableBlock = getBlock(clientId);
[1033] Fix | Delete
return {
[1034] Fix | Delete
canRemove: canRemoveBlock(clientId),
[1035] Fix | Delete
isVisible: !!reusableBlock && (0,external_wp_blocks_namespaceObject.isReusableBlock)(reusableBlock) && !!canUser('update', 'blocks', reusableBlock.attributes.ref),
[1036] Fix | Delete
innerBlockCount: getBlockCount(clientId),
[1037] Fix | Delete
// The site editor and templates both check whether the user
[1038] Fix | Delete
// has edit_theme_options capabilities. We can leverage that here
[1039] Fix | Delete
// and omit the manage patterns link if the user can't access it.
[1040] Fix | Delete
managePatternsUrl: canUser('create', 'templates') ? (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', {
[1041] Fix | Delete
path: '/patterns'
[1042] Fix | Delete
}) : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
[1043] Fix | Delete
post_type: 'wp_block'
[1044] Fix | Delete
})
[1045] Fix | Delete
};
[1046] Fix | Delete
}, [clientId]);
[1047] Fix | Delete
[1048] Fix | Delete
// Ignore reason: false positive of the lint rule.
[1049] Fix | Delete
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
[1050] Fix | Delete
const {
[1051] Fix | Delete
convertSyncedPatternToStatic
[1052] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[1053] Fix | Delete
if (!isVisible) {
[1054] Fix | Delete
return null;
[1055] Fix | Delete
}
[1056] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[1057] Fix | Delete
children: [canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[1058] Fix | Delete
onClick: () => convertSyncedPatternToStatic(clientId),
[1059] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Detach')
[1060] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[1061] Fix | Delete
href: managePatternsUrl,
[1062] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns')
[1063] Fix | Delete
})]
[1064] Fix | Delete
});
[1065] Fix | Delete
}
[1066] Fix | Delete
/* harmony default export */ const patterns_manage_button = (PatternsManageButton);
[1067] Fix | Delete
[1068] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/index.js
[1069] Fix | Delete
/**
[1070] Fix | Delete
* WordPress dependencies
[1071] Fix | Delete
*/
[1072] Fix | Delete
[1073] Fix | Delete
[1074] Fix | Delete
/**
[1075] Fix | Delete
* Internal dependencies
[1076] Fix | Delete
*/
[1077] Fix | Delete
[1078] Fix | Delete
[1079] Fix | Delete
[1080] Fix | Delete
[1081] Fix | Delete
[1082] Fix | Delete
function PatternsMenuItems({
[1083] Fix | Delete
rootClientId
[1084] Fix | Delete
}) {
[1085] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, {
[1086] Fix | Delete
children: ({
[1087] Fix | Delete
selectedClientIds,
[1088] Fix | Delete
onClose
[1089] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[1090] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternConvertButton, {
[1091] Fix | Delete
clientIds: selectedClientIds,
[1092] Fix | Delete
rootClientId: rootClientId,
[1093] Fix | Delete
closeBlockSettingsMenu: onClose
[1094] Fix | Delete
}), selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(patterns_manage_button, {
[1095] Fix | Delete
clientId: selectedClientIds[0]
[1096] Fix | Delete
})]
[1097] Fix | Delete
})
[1098] Fix | Delete
});
[1099] Fix | Delete
}
[1100] Fix | Delete
[1101] Fix | Delete
;// CONCATENATED MODULE: external ["wp","a11y"]
[1102] Fix | Delete
const external_wp_a11y_namespaceObject = window["wp"]["a11y"];
[1103] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/rename-pattern-category-modal.js
[1104] Fix | Delete
/**
[1105] Fix | Delete
* WordPress dependencies
[1106] Fix | Delete
*/
[1107] Fix | Delete
[1108] Fix | Delete
[1109] Fix | Delete
[1110] Fix | Delete
[1111] Fix | Delete
[1112] Fix | Delete
[1113] Fix | Delete
[1114] Fix | Delete
[1115] Fix | Delete
[1116] Fix | Delete
/**
[1117] Fix | Delete
* Internal dependencies
[1118] Fix | Delete
*/
[1119] Fix | Delete
[1120] Fix | Delete
[1121] Fix | Delete
[1122] Fix | Delete
function RenamePatternCategoryModal({
[1123] Fix | Delete
category,
[1124] Fix | Delete
existingCategories,
[1125] Fix | Delete
onClose,
[1126] Fix | Delete
onError,
[1127] Fix | Delete
onSuccess,
[1128] Fix | Delete
...props
[1129] Fix | Delete
}) {
[1130] Fix | Delete
const id = (0,external_wp_element_namespaceObject.useId)();
[1131] Fix | Delete
const textControlRef = (0,external_wp_element_namespaceObject.useRef)();
[1132] Fix | Delete
const [name, setName] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_htmlEntities_namespaceObject.decodeEntities)(category.name));
[1133] Fix | Delete
const [isSaving, setIsSaving] = (0,external_wp_element_namespaceObject.useState)(false);
[1134] Fix | Delete
const [validationMessage, setValidationMessage] = (0,external_wp_element_namespaceObject.useState)(false);
[1135] Fix | Delete
const validationMessageId = validationMessage ? `patterns-rename-pattern-category-modal__validation-message-${id}` : undefined;
[1136] Fix | Delete
const {
[1137] Fix | Delete
saveEntityRecord,
[1138] Fix | Delete
invalidateResolution
[1139] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
[1140] Fix | Delete
const {
[1141] Fix | Delete
createErrorNotice,
[1142] Fix | Delete
createSuccessNotice
[1143] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
[1144] Fix | Delete
const onChange = newName => {
[1145] Fix | Delete
if (validationMessage) {
[1146] Fix | Delete
setValidationMessage(undefined);
[1147] Fix | Delete
}
[1148] Fix | Delete
setName(newName);
[1149] Fix | Delete
};
[1150] Fix | Delete
const onSave = async event => {
[1151] Fix | Delete
event.preventDefault();
[1152] Fix | Delete
if (isSaving) {
[1153] Fix | Delete
return;
[1154] Fix | Delete
}
[1155] Fix | Delete
if (!name || name === category.name) {
[1156] Fix | Delete
const message = (0,external_wp_i18n_namespaceObject.__)('Please enter a new name for this category.');
[1157] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(message, 'assertive');
[1158] Fix | Delete
setValidationMessage(message);
[1159] Fix | Delete
textControlRef.current?.focus();
[1160] Fix | Delete
return;
[1161] Fix | Delete
}
[1162] Fix | Delete
[1163] Fix | Delete
// Check existing categories to avoid creating duplicates.
[1164] Fix | Delete
if (existingCategories.patternCategories.find(existingCategory => {
[1165] Fix | Delete
// Compare the id so that the we don't disallow the user changing the case of their current category
[1166] Fix | Delete
// (i.e. renaming 'test' to 'Test').
[1167] Fix | Delete
return existingCategory.id !== category.id && existingCategory.label.toLowerCase() === name.toLowerCase();
[1168] Fix | Delete
})) {
[1169] Fix | Delete
const message = (0,external_wp_i18n_namespaceObject.__)('This category already exists. Please use a different name.');
[1170] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(message, 'assertive');
[1171] Fix | Delete
setValidationMessage(message);
[1172] Fix | Delete
textControlRef.current?.focus();
[1173] Fix | Delete
return;
[1174] Fix | Delete
}
[1175] Fix | Delete
try {
[1176] Fix | Delete
setIsSaving(true);
[1177] Fix | Delete
[1178] Fix | Delete
// User pattern category properties may differ as they can be
[1179] Fix | Delete
// normalized for use alongside template part areas, core pattern
[1180] Fix | Delete
// categories etc. As a result we won't just destructure the passed
[1181] Fix | Delete
// category object.
[1182] Fix | Delete
const savedRecord = await saveEntityRecord('taxonomy', CATEGORY_SLUG, {
[1183] Fix | Delete
id: category.id,
[1184] Fix | Delete
slug: category.slug,
[1185] Fix | Delete
name
[1186] Fix | Delete
});
[1187] Fix | Delete
invalidateResolution('getUserPatternCategories');
[1188] Fix | Delete
onSuccess?.(savedRecord);
[1189] Fix | Delete
onClose();
[1190] Fix | Delete
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Pattern category renamed.'), {
[1191] Fix | Delete
type: 'snackbar',
[1192] Fix | Delete
id: 'pattern-category-update'
[1193] Fix | Delete
});
[1194] Fix | Delete
} catch (error) {
[1195] Fix | Delete
onError?.();
[1196] Fix | Delete
createErrorNotice(error.message, {
[1197] Fix | Delete
type: 'snackbar',
[1198] Fix | Delete
id: 'pattern-category-update'
[1199] Fix | Delete
});
[1200] Fix | Delete
} finally {
[1201] Fix | Delete
setIsSaving(false);
[1202] Fix | Delete
setName('');
[1203] Fix | Delete
}
[1204] Fix | Delete
};
[1205] Fix | Delete
const onRequestClose = () => {
[1206] Fix | Delete
onClose();
[1207] Fix | Delete
setName('');
[1208] Fix | Delete
};
[1209] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[1210] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Rename'),
[1211] Fix | Delete
onRequestClose: onRequestClose,
[1212] Fix | Delete
...props,
[1213] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
[1214] Fix | Delete
onSubmit: onSave,
[1215] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[1216] Fix | Delete
spacing: "5",
[1217] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[1218] Fix | Delete
spacing: "2",
[1219] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
[1220] Fix | Delete
ref: textControlRef,
[1221] Fix | Delete
__nextHasNoMarginBottom: true,
[1222] Fix | Delete
__next40pxDefaultSize: true,
[1223] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
[1224] Fix | Delete
value: name,
[1225] Fix | Delete
onChange: onChange,
[1226] Fix | Delete
"aria-describedby": validationMessageId,
[1227] Fix | Delete
required: true
[1228] Fix | Delete
}), validationMessage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[1229] Fix | Delete
className: "patterns-rename-pattern-category-modal__validation-message",
[1230] Fix | Delete
id: validationMessageId,
[1231] Fix | Delete
children: validationMessage
[1232] Fix | Delete
})]
[1233] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[1234] Fix | Delete
justify: "right",
[1235] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1236] Fix | Delete
__next40pxDefaultSize: true,
[1237] Fix | Delete
variant: "tertiary",
[1238] Fix | Delete
onClick: onRequestClose,
[1239] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
[1240] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1241] Fix | Delete
__next40pxDefaultSize: true,
[1242] Fix | Delete
variant: "primary",
[1243] Fix | Delete
type: "submit",
[1244] Fix | Delete
"aria-disabled": !name || name === category.name || isSaving,
[1245] Fix | Delete
isBusy: isSaving,
[1246] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Save')
[1247] Fix | Delete
})]
[1248] Fix | Delete
})]
[1249] Fix | Delete
})
[1250] Fix | Delete
})
[1251] Fix | Delete
});
[1252] Fix | Delete
}
[1253] Fix | Delete
[1254] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/allow-overrides-modal.js
[1255] Fix | Delete
/**
[1256] Fix | Delete
* WordPress dependencies
[1257] Fix | Delete
*/
[1258] Fix | Delete
[1259] Fix | Delete
[1260] Fix | Delete
[1261] Fix | Delete
[1262] Fix | Delete
[1263] Fix | Delete
[1264] Fix | Delete
function AllowOverridesModal({
[1265] Fix | Delete
placeholder,
[1266] Fix | Delete
initialName = '',
[1267] Fix | Delete
onClose,
[1268] Fix | Delete
onSave
[1269] Fix | Delete
}) {
[1270] Fix | Delete
const [editedBlockName, setEditedBlockName] = (0,external_wp_element_namespaceObject.useState)(initialName);
[1271] Fix | Delete
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
[1272] Fix | Delete
const isNameValid = !!editedBlockName.trim();
[1273] Fix | Delete
const handleSubmit = () => {
[1274] Fix | Delete
if (editedBlockName !== initialName) {
[1275] Fix | Delete
const message = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: new name/label for the block */
[1276] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'), editedBlockName);
[1277] Fix | Delete
[1278] Fix | Delete
// Must be assertive to immediately announce change.
[1279] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(message, 'assertive');
[1280] Fix | Delete
}
[1281] Fix | Delete
onSave(editedBlockName);
[1282] Fix | Delete
[1283] Fix | Delete
// Immediate close avoids ability to hit save multiple times.
[1284] Fix | Delete
onClose();
[1285] Fix | Delete
};
[1286] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[1287] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Enable overrides'),
[1288] Fix | Delete
onRequestClose: onClose,
[1289] Fix | Delete
focusOnMount: "firstContentElement",
[1290] Fix | Delete
aria: {
[1291] Fix | Delete
describedby: descriptionId
[1292] Fix | Delete
},
[1293] Fix | Delete
size: "small",
[1294] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
[1295] Fix | Delete
onSubmit: event => {
[1296] Fix | Delete
event.preventDefault();
[1297] Fix | Delete
if (!isNameValid) {
[1298] Fix | Delete
return;
[1299] Fix | Delete
}
[1300] Fix | Delete
handleSubmit();
[1301] Fix | Delete
},
[1302] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[1303] Fix | Delete
spacing: "6",
[1304] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[1305] Fix | Delete
id: descriptionId,
[1306] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override.')
[1307] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
[1308] Fix | Delete
__nextHasNoMarginBottom: true,
[1309] Fix | Delete
__next40pxDefaultSize: true,
[1310] Fix | Delete
value: editedBlockName,
[1311] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
[1312] Fix | Delete
help: (0,external_wp_i18n_namespaceObject.__)('For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.'),
[1313] Fix | Delete
placeholder: placeholder,
[1314] Fix | Delete
onChange: setEditedBlockName
[1315] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[1316] Fix | Delete
justify: "right",
[1317] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1318] Fix | Delete
__next40pxDefaultSize: true,
[1319] Fix | Delete
variant: "tertiary",
[1320] Fix | Delete
onClick: onClose,
[1321] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
[1322] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1323] Fix | Delete
__next40pxDefaultSize: true,
[1324] Fix | Delete
"aria-disabled": !isNameValid,
[1325] Fix | Delete
variant: "primary",
[1326] Fix | Delete
type: "submit",
[1327] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Enable')
[1328] Fix | Delete
})]
[1329] Fix | Delete
})]
[1330] Fix | Delete
})
[1331] Fix | Delete
})
[1332] Fix | Delete
});
[1333] Fix | Delete
}
[1334] Fix | Delete
function DisallowOverridesModal({
[1335] Fix | Delete
onClose,
[1336] Fix | Delete
onSave
[1337] Fix | Delete
}) {
[1338] Fix | Delete
const descriptionId = (0,external_wp_element_namespaceObject.useId)();
[1339] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
[1340] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Disable overrides'),
[1341] Fix | Delete
onRequestClose: onClose,
[1342] Fix | Delete
aria: {
[1343] Fix | Delete
describedby: descriptionId
[1344] Fix | Delete
},
[1345] Fix | Delete
size: "small",
[1346] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
[1347] Fix | Delete
onSubmit: event => {
[1348] Fix | Delete
event.preventDefault();
[1349] Fix | Delete
onSave();
[1350] Fix | Delete
onClose();
[1351] Fix | Delete
},
[1352] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[1353] Fix | Delete
spacing: "6",
[1354] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[1355] Fix | Delete
id: descriptionId,
[1356] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern.')
[1357] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[1358] Fix | Delete
justify: "right",
[1359] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1360] Fix | Delete
__next40pxDefaultSize: true,
[1361] Fix | Delete
variant: "tertiary",
[1362] Fix | Delete
onClick: onClose,
[1363] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Cancel')
[1364] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1365] Fix | Delete
__next40pxDefaultSize: true,
[1366] Fix | Delete
variant: "primary",
[1367] Fix | Delete
type: "submit",
[1368] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Disable')
[1369] Fix | Delete
})]
[1370] Fix | Delete
})]
[1371] Fix | Delete
})
[1372] Fix | Delete
})
[1373] Fix | Delete
});
[1374] Fix | Delete
}
[1375] Fix | Delete
[1376] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/pattern-overrides-controls.js
[1377] Fix | Delete
/**
[1378] Fix | Delete
* WordPress dependencies
[1379] Fix | Delete
*/
[1380] Fix | Delete
[1381] Fix | Delete
[1382] Fix | Delete
[1383] Fix | Delete
[1384] Fix | Delete
[1385] Fix | Delete
/**
[1386] Fix | Delete
* Internal dependencies
[1387] Fix | Delete
*/
[1388] Fix | Delete
[1389] Fix | Delete
[1390] Fix | Delete
[1391] Fix | Delete
[1392] Fix | Delete
[1393] Fix | Delete
function removeBindings(bindings) {
[1394] Fix | Delete
let updatedBindings = {
[1395] Fix | Delete
...bindings
[1396] Fix | Delete
};
[1397] Fix | Delete
delete updatedBindings.__default;
[1398] Fix | Delete
if (!Object.keys(updatedBindings).length) {
[1399] Fix | Delete
updatedBindings = undefined;
[1400] Fix | Delete
}
[1401] Fix | Delete
return updatedBindings;
[1402] Fix | Delete
}
[1403] Fix | Delete
function addBindings(bindings) {
[1404] Fix | Delete
return {
[1405] Fix | Delete
...bindings,
[1406] Fix | Delete
__default: {
[1407] Fix | Delete
source: PATTERN_OVERRIDES_BINDING_SOURCE
[1408] Fix | Delete
}
[1409] Fix | Delete
};
[1410] Fix | Delete
}
[1411] Fix | Delete
function PatternOverridesControls({
[1412] Fix | Delete
attributes,
[1413] Fix | Delete
setAttributes,
[1414] Fix | Delete
name: blockName
[1415] Fix | Delete
}) {
[1416] Fix | Delete
const controlId = (0,external_wp_element_namespaceObject.useId)();
[1417] Fix | Delete
const [showAllowOverridesModal, setShowAllowOverridesModal] = (0,external_wp_element_namespaceObject.useState)(false);
[1418] Fix | Delete
const [showDisallowOverridesModal, setShowDisallowOverridesModal] = (0,external_wp_element_namespaceObject.useState)(false);
[1419] Fix | Delete
const hasName = !!attributes.metadata?.name;
[1420] Fix | Delete
const defaultBindings = attributes.metadata?.bindings?.__default;
[1421] Fix | Delete
const hasOverrides = hasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE;
[1422] Fix | Delete
const isConnectedToOtherSources = defaultBindings?.source && defaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE;
[1423] Fix | Delete
function updateBindings(isChecked, customName) {
[1424] Fix | Delete
const prevBindings = attributes?.metadata?.bindings;
[1425] Fix | Delete
const updatedBindings = isChecked ? addBindings(prevBindings) : removeBindings(prevBindings);
[1426] Fix | Delete
const updatedMetadata = {
[1427] Fix | Delete
...attributes.metadata,
[1428] Fix | Delete
bindings: updatedBindings
[1429] Fix | Delete
};
[1430] Fix | Delete
if (customName) {
[1431] Fix | Delete
updatedMetadata.name = customName;
[1432] Fix | Delete
}
[1433] Fix | Delete
setAttributes({
[1434] Fix | Delete
metadata: updatedMetadata
[1435] Fix | Delete
});
[1436] Fix | Delete
}
[1437] Fix | Delete
[1438] Fix | Delete
// Avoid overwriting other (e.g. meta) bindings.
[1439] Fix | Delete
if (isConnectedToOtherSources) {
[1440] Fix | Delete
return null;
[1441] Fix | Delete
}
[1442] Fix | Delete
const hasUnsupportedImageAttributes = blockName === 'core/image' && (!!attributes.caption?.length || !!attributes.href?.length);
[1443] Fix | Delete
const helpText = !hasOverrides && hasUnsupportedImageAttributes ? (0,external_wp_i18n_namespaceObject.__)(`Overrides currently don't support image captions or links. Remove the caption or link first before enabling overrides.`) : (0,external_wp_i18n_namespaceObject.__)('Allow changes to this block throughout instances of this pattern.');
[1444] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[1445] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, {
[1446] Fix | Delete
group: "advanced",
[1447] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, {
[1448] Fix | Delete
id: controlId,
[1449] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Overrides'),
[1450] Fix | Delete
help: helpText,
[1451] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[1452] Fix | Delete
__next40pxDefaultSize: true,
[1453] Fix | Delete
className: "pattern-overrides-control__allow-overrides-button",
[1454] Fix | Delete
variant: "secondary",
[1455] Fix | Delete
"aria-haspopup": "dialog",
[1456] Fix | Delete
onClick: () => {
[1457] Fix | Delete
if (hasOverrides) {
[1458] Fix | Delete
setShowDisallowOverridesModal(true);
[1459] Fix | Delete
} else {
[1460] Fix | Delete
setShowAllowOverridesModal(true);
[1461] Fix | Delete
}
[1462] Fix | Delete
},
[1463] Fix | Delete
disabled: !hasOverrides && hasUnsupportedImageAttributes,
[1464] Fix | Delete
__experimentalIsFocusable: true,
[1465] Fix | Delete
children: hasOverrides ? (0,external_wp_i18n_namespaceObject.__)('Disable overrides') : (0,external_wp_i18n_namespaceObject.__)('Enable overrides')
[1466] Fix | Delete
})
[1467] Fix | Delete
})
[1468] Fix | Delete
}), showAllowOverridesModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AllowOverridesModal, {
[1469] Fix | Delete
initialName: attributes.metadata?.name,
[1470] Fix | Delete
onClose: () => setShowAllowOverridesModal(false),
[1471] Fix | Delete
onSave: newName => {
[1472] Fix | Delete
updateBindings(true, newName);
[1473] Fix | Delete
}
[1474] Fix | Delete
}), showDisallowOverridesModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DisallowOverridesModal, {
[1475] Fix | Delete
onClose: () => setShowDisallowOverridesModal(false),
[1476] Fix | Delete
onSave: () => updateBindings(false)
[1477] Fix | Delete
})]
[1478] Fix | Delete
});
[1479] Fix | Delete
}
[1480] Fix | Delete
/* harmony default export */ const pattern_overrides_controls = (PatternOverridesControls);
[1481] Fix | Delete
[1482] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/patterns/build-module/components/reset-overrides-control.js
[1483] Fix | Delete
/**
[1484] Fix | Delete
* WordPress dependencies
[1485] Fix | Delete
*/
[1486] Fix | Delete
[1487] Fix | Delete
[1488] Fix | Delete
[1489] Fix | Delete
[1490] Fix | Delete
[1491] Fix | Delete
const CONTENT = 'content';
[1492] Fix | Delete
function ResetOverridesControl(props) {
[1493] Fix | Delete
const name = props.attributes.metadata?.name;
[1494] Fix | Delete
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
[1495] Fix | Delete
const isOverriden = (0,external_wp_data_namespaceObject.useSelect)(select => {
[1496] Fix | Delete
if (!name) {
[1497] Fix | Delete
return;
[1498] Fix | Delete
}
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function