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: block-editor.js
function GridItemResizerInner({
[35500] Fix | Delete
clientId,
[35501] Fix | Delete
bounds,
[35502] Fix | Delete
blockElement,
[35503] Fix | Delete
rootBlockElement,
[35504] Fix | Delete
onChange
[35505] Fix | Delete
}) {
[35506] Fix | Delete
const [resizeDirection, setResizeDirection] = (0,external_wp_element_namespaceObject.useState)(null);
[35507] Fix | Delete
const [enableSide, setEnableSide] = (0,external_wp_element_namespaceObject.useState)({
[35508] Fix | Delete
top: false,
[35509] Fix | Delete
bottom: false,
[35510] Fix | Delete
left: false,
[35511] Fix | Delete
right: false
[35512] Fix | Delete
});
[35513] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[35514] Fix | Delete
const observer = new window.ResizeObserver(() => {
[35515] Fix | Delete
const blockClientRect = blockElement.getBoundingClientRect();
[35516] Fix | Delete
const rootBlockClientRect = rootBlockElement.getBoundingClientRect();
[35517] Fix | Delete
setEnableSide({
[35518] Fix | Delete
top: blockClientRect.top > rootBlockClientRect.top,
[35519] Fix | Delete
bottom: blockClientRect.bottom < rootBlockClientRect.bottom,
[35520] Fix | Delete
left: blockClientRect.left > rootBlockClientRect.left,
[35521] Fix | Delete
right: blockClientRect.right < rootBlockClientRect.right
[35522] Fix | Delete
});
[35523] Fix | Delete
});
[35524] Fix | Delete
observer.observe(blockElement);
[35525] Fix | Delete
return () => observer.disconnect();
[35526] Fix | Delete
}, [blockElement, rootBlockElement]);
[35527] Fix | Delete
const justification = {
[35528] Fix | Delete
right: 'flex-start',
[35529] Fix | Delete
left: 'flex-end'
[35530] Fix | Delete
};
[35531] Fix | Delete
const alignment = {
[35532] Fix | Delete
top: 'flex-end',
[35533] Fix | Delete
bottom: 'flex-start'
[35534] Fix | Delete
};
[35535] Fix | Delete
const styles = {
[35536] Fix | Delete
display: 'flex',
[35537] Fix | Delete
justifyContent: 'center',
[35538] Fix | Delete
alignItems: 'center',
[35539] Fix | Delete
...(justification[resizeDirection] && {
[35540] Fix | Delete
justifyContent: justification[resizeDirection]
[35541] Fix | Delete
}),
[35542] Fix | Delete
...(alignment[resizeDirection] && {
[35543] Fix | Delete
alignItems: alignment[resizeDirection]
[35544] Fix | Delete
})
[35545] Fix | Delete
};
[35546] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, {
[35547] Fix | Delete
className: "block-editor-grid-item-resizer",
[35548] Fix | Delete
clientId: clientId,
[35549] Fix | Delete
__unstablePopoverSlot: "block-toolbar",
[35550] Fix | Delete
additionalStyles: styles,
[35551] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, {
[35552] Fix | Delete
className: "block-editor-grid-item-resizer__box",
[35553] Fix | Delete
size: {
[35554] Fix | Delete
width: '100%',
[35555] Fix | Delete
height: '100%'
[35556] Fix | Delete
},
[35557] Fix | Delete
enable: {
[35558] Fix | Delete
bottom: enableSide.bottom,
[35559] Fix | Delete
bottomLeft: false,
[35560] Fix | Delete
bottomRight: false,
[35561] Fix | Delete
left: enableSide.left,
[35562] Fix | Delete
right: enableSide.right,
[35563] Fix | Delete
top: enableSide.top,
[35564] Fix | Delete
topLeft: false,
[35565] Fix | Delete
topRight: false
[35566] Fix | Delete
},
[35567] Fix | Delete
bounds: bounds,
[35568] Fix | Delete
boundsByDirection: true,
[35569] Fix | Delete
onResizeStart: (event, direction) => {
[35570] Fix | Delete
/*
[35571] Fix | Delete
* The container justification and alignment need to be set
[35572] Fix | Delete
* according to the direction the resizer is being dragged in,
[35573] Fix | Delete
* so that it resizes in the right direction.
[35574] Fix | Delete
*/
[35575] Fix | Delete
setResizeDirection(direction);
[35576] Fix | Delete
[35577] Fix | Delete
/*
[35578] Fix | Delete
* The mouseup event on the resize handle doesn't trigger if the mouse
[35579] Fix | Delete
* isn't directly above the handle, so we try to detect if it happens
[35580] Fix | Delete
* outside the grid and dispatch a mouseup event on the handle.
[35581] Fix | Delete
*/
[35582] Fix | Delete
blockElement.ownerDocument.addEventListener('mouseup', () => {
[35583] Fix | Delete
event.target.dispatchEvent(new Event('mouseup', {
[35584] Fix | Delete
bubbles: true
[35585] Fix | Delete
}));
[35586] Fix | Delete
}, {
[35587] Fix | Delete
once: true
[35588] Fix | Delete
});
[35589] Fix | Delete
},
[35590] Fix | Delete
onResizeStop: (event, direction, boxElement) => {
[35591] Fix | Delete
const columnGap = parseFloat(getComputedCSS(rootBlockElement, 'column-gap'));
[35592] Fix | Delete
const rowGap = parseFloat(getComputedCSS(rootBlockElement, 'row-gap'));
[35593] Fix | Delete
const gridColumnTracks = getGridTracks(getComputedCSS(rootBlockElement, 'grid-template-columns'), columnGap);
[35594] Fix | Delete
const gridRowTracks = getGridTracks(getComputedCSS(rootBlockElement, 'grid-template-rows'), rowGap);
[35595] Fix | Delete
const rect = new window.DOMRect(blockElement.offsetLeft + boxElement.offsetLeft, blockElement.offsetTop + boxElement.offsetTop, boxElement.offsetWidth, boxElement.offsetHeight);
[35596] Fix | Delete
const columnStart = getClosestTrack(gridColumnTracks, rect.left) + 1;
[35597] Fix | Delete
const rowStart = getClosestTrack(gridRowTracks, rect.top) + 1;
[35598] Fix | Delete
const columnEnd = getClosestTrack(gridColumnTracks, rect.right, 'end') + 1;
[35599] Fix | Delete
const rowEnd = getClosestTrack(gridRowTracks, rect.bottom, 'end') + 1;
[35600] Fix | Delete
onChange({
[35601] Fix | Delete
columnSpan: columnEnd - columnStart + 1,
[35602] Fix | Delete
rowSpan: rowEnd - rowStart + 1
[35603] Fix | Delete
});
[35604] Fix | Delete
}
[35605] Fix | Delete
})
[35606] Fix | Delete
});
[35607] Fix | Delete
}
[35608] Fix | Delete
[35609] Fix | Delete
/**
[35610] Fix | Delete
* Given a grid-template-columns or grid-template-rows CSS property value, gets the start and end
[35611] Fix | Delete
* position in pixels of each grid track.
[35612] Fix | Delete
*
[35613] Fix | Delete
* https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track
[35614] Fix | Delete
*
[35615] Fix | Delete
* @param {string} template The grid-template-columns or grid-template-rows CSS property value.
[35616] Fix | Delete
* Only supports fixed sizes in pixels.
[35617] Fix | Delete
* @param {number} gap The gap between grid tracks in pixels.
[35618] Fix | Delete
*
[35619] Fix | Delete
* @return {Array<{start: number, end: number}>} An array of objects with the start and end
[35620] Fix | Delete
* position in pixels of each grid track.
[35621] Fix | Delete
*/
[35622] Fix | Delete
function getGridTracks(template, gap) {
[35623] Fix | Delete
const tracks = [];
[35624] Fix | Delete
for (const size of template.split(' ')) {
[35625] Fix | Delete
const previousTrack = tracks[tracks.length - 1];
[35626] Fix | Delete
const start = previousTrack ? previousTrack.end + gap : 0;
[35627] Fix | Delete
const end = start + parseFloat(size);
[35628] Fix | Delete
tracks.push({
[35629] Fix | Delete
start,
[35630] Fix | Delete
end
[35631] Fix | Delete
});
[35632] Fix | Delete
}
[35633] Fix | Delete
return tracks;
[35634] Fix | Delete
}
[35635] Fix | Delete
[35636] Fix | Delete
/**
[35637] Fix | Delete
* Given an array of grid tracks and a position in pixels, gets the index of the closest track to
[35638] Fix | Delete
* that position.
[35639] Fix | Delete
*
[35640] Fix | Delete
* https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track
[35641] Fix | Delete
*
[35642] Fix | Delete
* @param {Array<{start: number, end: number}>} tracks An array of objects with the start and end
[35643] Fix | Delete
* position in pixels of each grid track.
[35644] Fix | Delete
* @param {number} position The position in pixels.
[35645] Fix | Delete
* @param {string} edge The edge of the track to compare the
[35646] Fix | Delete
* position to. Either 'start' or 'end'.
[35647] Fix | Delete
*
[35648] Fix | Delete
* @return {number} The index of the closest track to the position. 0-based, unlike CSS grid which
[35649] Fix | Delete
* is 1-based.
[35650] Fix | Delete
*/
[35651] Fix | Delete
function getClosestTrack(tracks, position, edge = 'start') {
[35652] Fix | Delete
return tracks.reduce((closest, track, index) => Math.abs(track[edge] - position) < Math.abs(tracks[closest][edge] - position) ? index : closest, 0);
[35653] Fix | Delete
}
[35654] Fix | Delete
[35655] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/layout-child.js
[35656] Fix | Delete
/**
[35657] Fix | Delete
* WordPress dependencies
[35658] Fix | Delete
*/
[35659] Fix | Delete
[35660] Fix | Delete
[35661] Fix | Delete
[35662] Fix | Delete
[35663] Fix | Delete
/**
[35664] Fix | Delete
* Internal dependencies
[35665] Fix | Delete
*/
[35666] Fix | Delete
[35667] Fix | Delete
[35668] Fix | Delete
[35669] Fix | Delete
[35670] Fix | Delete
[35671] Fix | Delete
[35672] Fix | Delete
[35673] Fix | Delete
function useBlockPropsChildLayoutStyles({
[35674] Fix | Delete
style
[35675] Fix | Delete
}) {
[35676] Fix | Delete
var _style$layout;
[35677] Fix | Delete
const shouldRenderChildLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)(select => {
[35678] Fix | Delete
return !select(store).getSettings().disableLayoutStyles;
[35679] Fix | Delete
});
[35680] Fix | Delete
const layout = (_style$layout = style?.layout) !== null && _style$layout !== void 0 ? _style$layout : {};
[35681] Fix | Delete
const {
[35682] Fix | Delete
selfStretch,
[35683] Fix | Delete
flexSize,
[35684] Fix | Delete
columnStart,
[35685] Fix | Delete
rowStart,
[35686] Fix | Delete
columnSpan,
[35687] Fix | Delete
rowSpan
[35688] Fix | Delete
} = layout;
[35689] Fix | Delete
const parentLayout = useLayout() || {};
[35690] Fix | Delete
const {
[35691] Fix | Delete
columnCount,
[35692] Fix | Delete
minimumColumnWidth
[35693] Fix | Delete
} = parentLayout;
[35694] Fix | Delete
const id = (0,external_wp_compose_namespaceObject.useInstanceId)(useBlockPropsChildLayoutStyles);
[35695] Fix | Delete
const selector = `.wp-container-content-${id}`;
[35696] Fix | Delete
let css = '';
[35697] Fix | Delete
if (shouldRenderChildLayoutStyles) {
[35698] Fix | Delete
if (selfStretch === 'fixed' && flexSize) {
[35699] Fix | Delete
css = `${selector} {
[35700] Fix | Delete
flex-basis: ${flexSize};
[35701] Fix | Delete
box-sizing: border-box;
[35702] Fix | Delete
}`;
[35703] Fix | Delete
} else if (selfStretch === 'fill') {
[35704] Fix | Delete
css = `${selector} {
[35705] Fix | Delete
flex-grow: 1;
[35706] Fix | Delete
}`;
[35707] Fix | Delete
} else if (columnStart && columnSpan) {
[35708] Fix | Delete
css = `${selector} {
[35709] Fix | Delete
grid-column: ${columnStart} / span ${columnSpan};
[35710] Fix | Delete
}`;
[35711] Fix | Delete
} else if (columnStart) {
[35712] Fix | Delete
css = `${selector} {
[35713] Fix | Delete
grid-column: ${columnStart};
[35714] Fix | Delete
}`;
[35715] Fix | Delete
} else if (columnSpan) {
[35716] Fix | Delete
css = `${selector} {
[35717] Fix | Delete
grid-column: span ${columnSpan};
[35718] Fix | Delete
}`;
[35719] Fix | Delete
}
[35720] Fix | Delete
/**
[35721] Fix | Delete
* If minimumColumnWidth is set on the parent, or if no
[35722] Fix | Delete
* columnCount is set, the grid is responsive so a
[35723] Fix | Delete
* container query is needed for the span to resize.
[35724] Fix | Delete
*/
[35725] Fix | Delete
if ((columnSpan || columnStart) && (minimumColumnWidth || !columnCount)) {
[35726] Fix | Delete
// Check if columnSpan and columnStart are numbers so Math.max doesn't break.
[35727] Fix | Delete
const columnSpanNumber = columnSpan ? parseInt(columnSpan) : null;
[35728] Fix | Delete
const columnStartNumber = columnStart ? parseInt(columnStart) : null;
[35729] Fix | Delete
const highestNumber = Math.max(columnSpanNumber, columnStartNumber);
[35730] Fix | Delete
let parentColumnValue = parseFloat(minimumColumnWidth);
[35731] Fix | Delete
/**
[35732] Fix | Delete
* 12rem is the default minimumColumnWidth value.
[35733] Fix | Delete
* If parentColumnValue is not a number, default to 12.
[35734] Fix | Delete
*/
[35735] Fix | Delete
if (isNaN(parentColumnValue)) {
[35736] Fix | Delete
parentColumnValue = 12;
[35737] Fix | Delete
}
[35738] Fix | Delete
let parentColumnUnit = minimumColumnWidth?.replace(parentColumnValue, '');
[35739] Fix | Delete
/**
[35740] Fix | Delete
* Check that parent column unit is either 'px', 'rem' or 'em'.
[35741] Fix | Delete
* If not, default to 'rem'.
[35742] Fix | Delete
*/
[35743] Fix | Delete
if (!['px', 'rem', 'em'].includes(parentColumnUnit)) {
[35744] Fix | Delete
parentColumnUnit = 'rem';
[35745] Fix | Delete
}
[35746] Fix | Delete
const defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5;
[35747] Fix | Delete
const containerQueryValue = highestNumber * parentColumnValue + (highestNumber - 1) * defaultGapValue;
[35748] Fix | Delete
// If a span is set we want to preserve it as long as possible, otherwise we just reset the value.
[35749] Fix | Delete
const gridColumnValue = columnSpan ? '1/-1' : 'auto';
[35750] Fix | Delete
css += `@container (max-width: ${containerQueryValue}${parentColumnUnit}) {
[35751] Fix | Delete
${selector} {
[35752] Fix | Delete
grid-column: ${gridColumnValue};
[35753] Fix | Delete
}
[35754] Fix | Delete
}`;
[35755] Fix | Delete
}
[35756] Fix | Delete
if (rowStart && rowSpan) {
[35757] Fix | Delete
css += `${selector} {
[35758] Fix | Delete
grid-row: ${rowStart} / span ${rowSpan};
[35759] Fix | Delete
}`;
[35760] Fix | Delete
} else if (rowStart) {
[35761] Fix | Delete
css += `${selector} {
[35762] Fix | Delete
grid-row: ${rowStart};
[35763] Fix | Delete
}`;
[35764] Fix | Delete
} else if (rowSpan) {
[35765] Fix | Delete
css += `${selector} {
[35766] Fix | Delete
grid-row: span ${rowSpan};
[35767] Fix | Delete
}`;
[35768] Fix | Delete
}
[35769] Fix | Delete
}
[35770] Fix | Delete
useStyleOverride({
[35771] Fix | Delete
css
[35772] Fix | Delete
});
[35773] Fix | Delete
[35774] Fix | Delete
// Only attach a container class if there is generated CSS to be attached.
[35775] Fix | Delete
if (!css) {
[35776] Fix | Delete
return;
[35777] Fix | Delete
}
[35778] Fix | Delete
[35779] Fix | Delete
// Attach a `wp-container-content` id-based classname.
[35780] Fix | Delete
return {
[35781] Fix | Delete
className: `wp-container-content-${id}`
[35782] Fix | Delete
};
[35783] Fix | Delete
}
[35784] Fix | Delete
function ChildLayoutControlsPure({
[35785] Fix | Delete
clientId,
[35786] Fix | Delete
style,
[35787] Fix | Delete
setAttributes
[35788] Fix | Delete
}) {
[35789] Fix | Delete
const {
[35790] Fix | Delete
type: parentLayoutType = 'default',
[35791] Fix | Delete
allowSizingOnChildren = false
[35792] Fix | Delete
} = useLayout() || {};
[35793] Fix | Delete
const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => {
[35794] Fix | Delete
return select(store).getBlockRootClientId(clientId);
[35795] Fix | Delete
}, [clientId]);
[35796] Fix | Delete
[35797] Fix | Delete
// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.
[35798] Fix | Delete
const [resizerBounds, setResizerBounds] = (0,external_wp_element_namespaceObject.useState)();
[35799] Fix | Delete
if (parentLayoutType !== 'grid') {
[35800] Fix | Delete
return null;
[35801] Fix | Delete
}
[35802] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[35803] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizer, {
[35804] Fix | Delete
clientId: rootClientId,
[35805] Fix | Delete
contentRef: setResizerBounds
[35806] Fix | Delete
}), allowSizingOnChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemResizer, {
[35807] Fix | Delete
clientId: clientId
[35808] Fix | Delete
// Don't allow resizing beyond the grid visualizer.
[35809] Fix | Delete
,
[35810] Fix | Delete
bounds: resizerBounds,
[35811] Fix | Delete
onChange: ({
[35812] Fix | Delete
columnSpan,
[35813] Fix | Delete
rowSpan
[35814] Fix | Delete
}) => {
[35815] Fix | Delete
setAttributes({
[35816] Fix | Delete
style: {
[35817] Fix | Delete
...style,
[35818] Fix | Delete
layout: {
[35819] Fix | Delete
...style?.layout,
[35820] Fix | Delete
columnSpan,
[35821] Fix | Delete
rowSpan
[35822] Fix | Delete
}
[35823] Fix | Delete
}
[35824] Fix | Delete
});
[35825] Fix | Delete
}
[35826] Fix | Delete
})]
[35827] Fix | Delete
});
[35828] Fix | Delete
}
[35829] Fix | Delete
/* harmony default export */ const layout_child = ({
[35830] Fix | Delete
useBlockProps: useBlockPropsChildLayoutStyles,
[35831] Fix | Delete
edit: ChildLayoutControlsPure,
[35832] Fix | Delete
attributeKeys: ['style'],
[35833] Fix | Delete
hasSupport() {
[35834] Fix | Delete
return true;
[35835] Fix | Delete
}
[35836] Fix | Delete
});
[35837] Fix | Delete
[35838] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js
[35839] Fix | Delete
/**
[35840] Fix | Delete
* WordPress dependencies
[35841] Fix | Delete
*/
[35842] Fix | Delete
[35843] Fix | Delete
[35844] Fix | Delete
[35845] Fix | Delete
/**
[35846] Fix | Delete
* Internal dependencies
[35847] Fix | Delete
*/
[35848] Fix | Delete
[35849] Fix | Delete
[35850] Fix | Delete
/**
[35851] Fix | Delete
* Contains the properties `ConvertToGroupButton` component needs.
[35852] Fix | Delete
*
[35853] Fix | Delete
* @typedef {Object} ConvertToGroupButtonProps
[35854] Fix | Delete
* @property {string[]} clientIds An array of the selected client ids.
[35855] Fix | Delete
* @property {boolean} isGroupable Indicates if the selected blocks can be grouped.
[35856] Fix | Delete
* @property {boolean} isUngroupable Indicates if the selected blocks can be ungrouped.
[35857] Fix | Delete
* @property {WPBlock[]} blocksSelection An array of the selected blocks.
[35858] Fix | Delete
* @property {string} groupingBlockName The name of block used for handling grouping interactions.
[35859] Fix | Delete
*/
[35860] Fix | Delete
[35861] Fix | Delete
/**
[35862] Fix | Delete
* Returns the properties `ConvertToGroupButton` component needs to work properly.
[35863] Fix | Delete
* It is used in `BlockSettingsMenuControls` to know if `ConvertToGroupButton`
[35864] Fix | Delete
* should be rendered, to avoid ending up with an empty MenuGroup.
[35865] Fix | Delete
*
[35866] Fix | Delete
* @param {?string[]} selectedClientIds An optional array of clientIds to group. The selected blocks
[35867] Fix | Delete
* from the block editor store are used if this is not provided.
[35868] Fix | Delete
*
[35869] Fix | Delete
* @return {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`.
[35870] Fix | Delete
*/
[35871] Fix | Delete
function useConvertToGroupButtonProps(selectedClientIds) {
[35872] Fix | Delete
return (0,external_wp_data_namespaceObject.useSelect)(select => {
[35873] Fix | Delete
const {
[35874] Fix | Delete
getBlocksByClientId,
[35875] Fix | Delete
getSelectedBlockClientIds,
[35876] Fix | Delete
isUngroupable,
[35877] Fix | Delete
isGroupable
[35878] Fix | Delete
} = select(store);
[35879] Fix | Delete
const {
[35880] Fix | Delete
getGroupingBlockName,
[35881] Fix | Delete
getBlockType
[35882] Fix | Delete
} = select(external_wp_blocks_namespaceObject.store);
[35883] Fix | Delete
const clientIds = selectedClientIds?.length ? selectedClientIds : getSelectedBlockClientIds();
[35884] Fix | Delete
const blocksSelection = getBlocksByClientId(clientIds);
[35885] Fix | Delete
const [firstSelectedBlock] = blocksSelection;
[35886] Fix | Delete
const _isUngroupable = clientIds.length === 1 && isUngroupable(clientIds[0]);
[35887] Fix | Delete
return {
[35888] Fix | Delete
clientIds,
[35889] Fix | Delete
isGroupable: isGroupable(clientIds),
[35890] Fix | Delete
isUngroupable: _isUngroupable,
[35891] Fix | Delete
blocksSelection,
[35892] Fix | Delete
groupingBlockName: getGroupingBlockName(),
[35893] Fix | Delete
onUngroup: _isUngroupable && getBlockType(firstSelectedBlock.name)?.transforms?.ungroup
[35894] Fix | Delete
};
[35895] Fix | Delete
}, [selectedClientIds]);
[35896] Fix | Delete
}
[35897] Fix | Delete
[35898] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/index.js
[35899] Fix | Delete
/**
[35900] Fix | Delete
* WordPress dependencies
[35901] Fix | Delete
*/
[35902] Fix | Delete
[35903] Fix | Delete
[35904] Fix | Delete
[35905] Fix | Delete
[35906] Fix | Delete
[35907] Fix | Delete
[35908] Fix | Delete
/**
[35909] Fix | Delete
* Internal dependencies
[35910] Fix | Delete
*/
[35911] Fix | Delete
[35912] Fix | Delete
[35913] Fix | Delete
[35914] Fix | Delete
[35915] Fix | Delete
[35916] Fix | Delete
[35917] Fix | Delete
function ConvertToGroupButton({
[35918] Fix | Delete
clientIds,
[35919] Fix | Delete
isGroupable,
[35920] Fix | Delete
isUngroupable,
[35921] Fix | Delete
onUngroup,
[35922] Fix | Delete
blocksSelection,
[35923] Fix | Delete
groupingBlockName,
[35924] Fix | Delete
onClose = () => {}
[35925] Fix | Delete
}) {
[35926] Fix | Delete
const {
[35927] Fix | Delete
getSelectedBlockClientIds
[35928] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[35929] Fix | Delete
const {
[35930] Fix | Delete
replaceBlocks
[35931] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[35932] Fix | Delete
const onConvertToGroup = () => {
[35933] Fix | Delete
// Activate the `transform` on the Grouping Block which does the conversion.
[35934] Fix | Delete
const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
[35935] Fix | Delete
if (newBlocks) {
[35936] Fix | Delete
replaceBlocks(clientIds, newBlocks);
[35937] Fix | Delete
}
[35938] Fix | Delete
};
[35939] Fix | Delete
const onConvertFromGroup = () => {
[35940] Fix | Delete
let innerBlocks = blocksSelection[0].innerBlocks;
[35941] Fix | Delete
if (!innerBlocks.length) {
[35942] Fix | Delete
return;
[35943] Fix | Delete
}
[35944] Fix | Delete
if (onUngroup) {
[35945] Fix | Delete
innerBlocks = onUngroup(blocksSelection[0].attributes, blocksSelection[0].innerBlocks);
[35946] Fix | Delete
}
[35947] Fix | Delete
replaceBlocks(clientIds, innerBlocks);
[35948] Fix | Delete
};
[35949] Fix | Delete
if (!isGroupable && !isUngroupable) {
[35950] Fix | Delete
return null;
[35951] Fix | Delete
}
[35952] Fix | Delete
const selectedBlockClientIds = getSelectedBlockClientIds();
[35953] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[35954] Fix | Delete
children: [isGroupable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[35955] Fix | Delete
shortcut: selectedBlockClientIds.length > 1 ? external_wp_keycodes_namespaceObject.displayShortcut.primary('g') : undefined,
[35956] Fix | Delete
onClick: () => {
[35957] Fix | Delete
onConvertToGroup();
[35958] Fix | Delete
onClose();
[35959] Fix | Delete
},
[35960] Fix | Delete
children: (0,external_wp_i18n_namespaceObject._x)('Group', 'verb')
[35961] Fix | Delete
}), isUngroupable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
[35962] Fix | Delete
onClick: () => {
[35963] Fix | Delete
onConvertFromGroup();
[35964] Fix | Delete
onClose();
[35965] Fix | Delete
},
[35966] Fix | Delete
children: (0,external_wp_i18n_namespaceObject._x)('Ungroup', 'Ungrouping blocks from within a grouping block back into individual blocks within the Editor ')
[35967] Fix | Delete
})]
[35968] Fix | Delete
});
[35969] Fix | Delete
}
[35970] Fix | Delete
[35971] Fix | Delete
[35972] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-lock/use-block-lock.js
[35973] Fix | Delete
/**
[35974] Fix | Delete
* WordPress dependencies
[35975] Fix | Delete
*/
[35976] Fix | Delete
[35977] Fix | Delete
[35978] Fix | Delete
/**
[35979] Fix | Delete
* Internal dependencies
[35980] Fix | Delete
*/
[35981] Fix | Delete
[35982] Fix | Delete
[35983] Fix | Delete
/**
[35984] Fix | Delete
* Return details about the block lock status.
[35985] Fix | Delete
*
[35986] Fix | Delete
* @param {string} clientId The block client Id.
[35987] Fix | Delete
*
[35988] Fix | Delete
* @return {Object} Block lock status
[35989] Fix | Delete
*/
[35990] Fix | Delete
function useBlockLock(clientId) {
[35991] Fix | Delete
return (0,external_wp_data_namespaceObject.useSelect)(select => {
[35992] Fix | Delete
const {
[35993] Fix | Delete
canEditBlock,
[35994] Fix | Delete
canMoveBlock,
[35995] Fix | Delete
canRemoveBlock,
[35996] Fix | Delete
canLockBlockType,
[35997] Fix | Delete
getBlockName,
[35998] Fix | Delete
getTemplateLock
[35999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function