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
selectBlock: selectBlock,
[58000] Fix | Delete
isSelected: isSelected,
[58001] Fix | Delete
isBranchSelected: isSelectedBranch,
[58002] Fix | Delete
isDragged: isDragged,
[58003] Fix | Delete
level: level,
[58004] Fix | Delete
position: position,
[58005] Fix | Delete
rowCount: rowCount,
[58006] Fix | Delete
siblingBlockCount: blockCount,
[58007] Fix | Delete
showBlockMovers: showBlockMovers,
[58008] Fix | Delete
path: updatedPath,
[58009] Fix | Delete
isExpanded: isDragged ? false : shouldExpand,
[58010] Fix | Delete
listPosition: nextPosition,
[58011] Fix | Delete
selectedClientIds: selectedClientIds,
[58012] Fix | Delete
isSyncedBranch: syncedBranch,
[58013] Fix | Delete
displacement: displacement,
[58014] Fix | Delete
isAfterDraggedBlocks: isAfterDraggedBlocks,
[58015] Fix | Delete
isNesting: isNesting
[58016] Fix | Delete
}), !showBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", {
[58017] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", {
[58018] Fix | Delete
className: "block-editor-list-view-placeholder"
[58019] Fix | Delete
})
[58020] Fix | Delete
}), hasNestedBlocks && shouldExpand && !isDragged && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewBranch, {
[58021] Fix | Delete
parentId: clientId,
[58022] Fix | Delete
blocks: innerBlocks,
[58023] Fix | Delete
selectBlock: selectBlock,
[58024] Fix | Delete
showBlockMovers: showBlockMovers,
[58025] Fix | Delete
level: level + 1,
[58026] Fix | Delete
path: updatedPath,
[58027] Fix | Delete
listPosition: nextPosition + 1,
[58028] Fix | Delete
fixedListWindow: fixedListWindow,
[58029] Fix | Delete
isBranchSelected: isSelectedBranch,
[58030] Fix | Delete
selectedClientIds: selectedClientIds,
[58031] Fix | Delete
isExpanded: isExpanded,
[58032] Fix | Delete
isSyncedBranch: syncedBranch
[58033] Fix | Delete
})]
[58034] Fix | Delete
}, clientId);
[58035] Fix | Delete
}), showAppender && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridRow, {
[58036] Fix | Delete
level: level,
[58037] Fix | Delete
setSize: rowCount,
[58038] Fix | Delete
positionInSet: rowCount,
[58039] Fix | Delete
isExpanded: true,
[58040] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
[58041] Fix | Delete
children: treeGridCellProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Appender, {
[58042] Fix | Delete
clientId: parentId,
[58043] Fix | Delete
nestingLevel: level,
[58044] Fix | Delete
blockCount: blockCount,
[58045] Fix | Delete
...treeGridCellProps
[58046] Fix | Delete
})
[58047] Fix | Delete
})
[58048] Fix | Delete
})]
[58049] Fix | Delete
});
[58050] Fix | Delete
}
[58051] Fix | Delete
/* harmony default export */ const branch = ((0,external_wp_element_namespaceObject.memo)(ListViewBranch));
[58052] Fix | Delete
[58053] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js
[58054] Fix | Delete
/**
[58055] Fix | Delete
* External dependencies
[58056] Fix | Delete
*/
[58057] Fix | Delete
[58058] Fix | Delete
[58059] Fix | Delete
/**
[58060] Fix | Delete
* WordPress dependencies
[58061] Fix | Delete
*/
[58062] Fix | Delete
[58063] Fix | Delete
[58064] Fix | Delete
[58065] Fix | Delete
[58066] Fix | Delete
[58067] Fix | Delete
/**
[58068] Fix | Delete
* Internal dependencies
[58069] Fix | Delete
*/
[58070] Fix | Delete
[58071] Fix | Delete
[58072] Fix | Delete
[58073] Fix | Delete
[58074] Fix | Delete
[58075] Fix | Delete
[58076] Fix | Delete
function ListViewDropIndicatorPreview({
[58077] Fix | Delete
draggedBlockClientId,
[58078] Fix | Delete
listViewRef,
[58079] Fix | Delete
blockDropTarget
[58080] Fix | Delete
}) {
[58081] Fix | Delete
const blockInformation = useBlockDisplayInformation(draggedBlockClientId);
[58082] Fix | Delete
const blockTitle = useBlockDisplayTitle({
[58083] Fix | Delete
clientId: draggedBlockClientId,
[58084] Fix | Delete
context: 'list-view'
[58085] Fix | Delete
});
[58086] Fix | Delete
const {
[58087] Fix | Delete
rootClientId,
[58088] Fix | Delete
clientId,
[58089] Fix | Delete
dropPosition
[58090] Fix | Delete
} = blockDropTarget || {};
[58091] Fix | Delete
const [rootBlockElement, blockElement] = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58092] Fix | Delete
if (!listViewRef.current) {
[58093] Fix | Delete
return [];
[58094] Fix | Delete
}
[58095] Fix | Delete
[58096] Fix | Delete
// The rootClientId will be defined whenever dropping into inner
[58097] Fix | Delete
// block lists, but is undefined when dropping at the root level.
[58098] Fix | Delete
const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(`[data-block="${rootClientId}"]`) : undefined;
[58099] Fix | Delete
[58100] Fix | Delete
// The clientId represents the sibling block, the dragged block will
[58101] Fix | Delete
// usually be inserted adjacent to it. It will be undefined when
[58102] Fix | Delete
// dropping a block into an empty block list.
[58103] Fix | Delete
const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined;
[58104] Fix | Delete
return [_rootBlockElement, _blockElement];
[58105] Fix | Delete
}, [listViewRef, rootClientId, clientId]);
[58106] Fix | Delete
[58107] Fix | Delete
// The targetElement is the element that the drop indicator will appear
[58108] Fix | Delete
// before or after. When dropping into an empty block list, blockElement
[58109] Fix | Delete
// is undefined, so the indicator will appear after the rootBlockElement.
[58110] Fix | Delete
const targetElement = blockElement || rootBlockElement;
[58111] Fix | Delete
const rtl = (0,external_wp_i18n_namespaceObject.isRTL)();
[58112] Fix | Delete
const getDropIndicatorWidth = (0,external_wp_element_namespaceObject.useCallback)((targetElementRect, indent) => {
[58113] Fix | Delete
if (!targetElement) {
[58114] Fix | Delete
return 0;
[58115] Fix | Delete
}
[58116] Fix | Delete
[58117] Fix | Delete
// Default to assuming that the width of the drop indicator
[58118] Fix | Delete
// should be the same as the target element.
[58119] Fix | Delete
let width = targetElement.offsetWidth;
[58120] Fix | Delete
[58121] Fix | Delete
// In deeply nested lists, where a scrollbar is present,
[58122] Fix | Delete
// the width of the drop indicator should be the width of
[58123] Fix | Delete
// the scroll container, minus the distance from the left
[58124] Fix | Delete
// edge of the scroll container to the left edge of the
[58125] Fix | Delete
// target element.
[58126] Fix | Delete
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement, 'horizontal');
[58127] Fix | Delete
const ownerDocument = targetElement.ownerDocument;
[58128] Fix | Delete
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
[58129] Fix | Delete
if (scrollContainer && !windowScroll) {
[58130] Fix | Delete
const scrollContainerRect = scrollContainer.getBoundingClientRect();
[58131] Fix | Delete
const distanceBetweenContainerAndTarget = (0,external_wp_i18n_namespaceObject.isRTL)() ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left;
[58132] Fix | Delete
const scrollContainerWidth = scrollContainer.clientWidth;
[58133] Fix | Delete
if (scrollContainerWidth < width + distanceBetweenContainerAndTarget) {
[58134] Fix | Delete
width = scrollContainerWidth - distanceBetweenContainerAndTarget;
[58135] Fix | Delete
}
[58136] Fix | Delete
[58137] Fix | Delete
// LTR logic for ensuring the drop indicator does not extend
[58138] Fix | Delete
// beyond the right edge of the scroll container.
[58139] Fix | Delete
if (!rtl && targetElementRect.left + indent < scrollContainerRect.left) {
[58140] Fix | Delete
width -= scrollContainerRect.left - targetElementRect.left;
[58141] Fix | Delete
return width;
[58142] Fix | Delete
}
[58143] Fix | Delete
[58144] Fix | Delete
// RTL logic for ensuring the drop indicator does not extend
[58145] Fix | Delete
// beyond the right edge of the scroll container.
[58146] Fix | Delete
if (rtl && targetElementRect.right - indent > scrollContainerRect.right) {
[58147] Fix | Delete
width -= targetElementRect.right - scrollContainerRect.right;
[58148] Fix | Delete
return width;
[58149] Fix | Delete
}
[58150] Fix | Delete
}
[58151] Fix | Delete
[58152] Fix | Delete
// Subtract the indent from the final width of the indicator.
[58153] Fix | Delete
return width - indent;
[58154] Fix | Delete
}, [rtl, targetElement]);
[58155] Fix | Delete
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58156] Fix | Delete
if (!targetElement) {
[58157] Fix | Delete
return {};
[58158] Fix | Delete
}
[58159] Fix | Delete
const targetElementRect = targetElement.getBoundingClientRect();
[58160] Fix | Delete
return {
[58161] Fix | Delete
width: getDropIndicatorWidth(targetElementRect, 0)
[58162] Fix | Delete
};
[58163] Fix | Delete
}, [getDropIndicatorWidth, targetElement]);
[58164] Fix | Delete
const horizontalScrollOffsetStyle = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58165] Fix | Delete
if (!targetElement) {
[58166] Fix | Delete
return {};
[58167] Fix | Delete
}
[58168] Fix | Delete
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement);
[58169] Fix | Delete
const ownerDocument = targetElement.ownerDocument;
[58170] Fix | Delete
const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement;
[58171] Fix | Delete
if (scrollContainer && !windowScroll) {
[58172] Fix | Delete
const scrollContainerRect = scrollContainer.getBoundingClientRect();
[58173] Fix | Delete
const targetElementRect = targetElement.getBoundingClientRect();
[58174] Fix | Delete
const distanceBetweenContainerAndTarget = rtl ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left;
[58175] Fix | Delete
if (!rtl && scrollContainerRect.left > targetElementRect.left) {
[58176] Fix | Delete
return {
[58177] Fix | Delete
transform: `translateX( ${distanceBetweenContainerAndTarget}px )`
[58178] Fix | Delete
};
[58179] Fix | Delete
}
[58180] Fix | Delete
if (rtl && scrollContainerRect.right < targetElementRect.right) {
[58181] Fix | Delete
return {
[58182] Fix | Delete
transform: `translateX( ${distanceBetweenContainerAndTarget * -1}px )`
[58183] Fix | Delete
};
[58184] Fix | Delete
}
[58185] Fix | Delete
}
[58186] Fix | Delete
return {};
[58187] Fix | Delete
}, [rtl, targetElement]);
[58188] Fix | Delete
const ariaLevel = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58189] Fix | Delete
if (!rootBlockElement) {
[58190] Fix | Delete
return 1;
[58191] Fix | Delete
}
[58192] Fix | Delete
const _ariaLevel = parseInt(rootBlockElement.getAttribute('aria-level'), 10);
[58193] Fix | Delete
return _ariaLevel ? _ariaLevel + 1 : 1;
[58194] Fix | Delete
}, [rootBlockElement]);
[58195] Fix | Delete
const hasAdjacentSelectedBranch = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58196] Fix | Delete
if (!targetElement) {
[58197] Fix | Delete
return false;
[58198] Fix | Delete
}
[58199] Fix | Delete
return targetElement.classList.contains('is-branch-selected');
[58200] Fix | Delete
}, [targetElement]);
[58201] Fix | Delete
const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58202] Fix | Delete
const isValidDropPosition = dropPosition === 'top' || dropPosition === 'bottom' || dropPosition === 'inside';
[58203] Fix | Delete
if (!targetElement || !isValidDropPosition) {
[58204] Fix | Delete
return undefined;
[58205] Fix | Delete
}
[58206] Fix | Delete
return {
[58207] Fix | Delete
contextElement: targetElement,
[58208] Fix | Delete
getBoundingClientRect() {
[58209] Fix | Delete
const rect = targetElement.getBoundingClientRect();
[58210] Fix | Delete
// In RTL languages, the drop indicator should be positioned
[58211] Fix | Delete
// to the left of the target element, with the width of the
[58212] Fix | Delete
// indicator determining the indent at the right edge of the
[58213] Fix | Delete
// target element. In LTR languages, the drop indicator should
[58214] Fix | Delete
// end at the right edge of the target element, with the indent
[58215] Fix | Delete
// added to the position of the left edge of the target element.
[58216] Fix | Delete
// let left = rtl ? rect.left : rect.left + indent;
[58217] Fix | Delete
let left = rect.left;
[58218] Fix | Delete
let top = 0;
[58219] Fix | Delete
[58220] Fix | Delete
// In deeply nested lists, where a scrollbar is present,
[58221] Fix | Delete
// the width of the drop indicator should be the width of
[58222] Fix | Delete
// the visible area of the scroll container. Additionally,
[58223] Fix | Delete
// the left edge of the drop indicator line needs to be
[58224] Fix | Delete
// offset by the distance the left edge of the target element
[58225] Fix | Delete
// and the left edge of the scroll container. The ensures
[58226] Fix | Delete
// that the drop indicator position never breaks out of the
[58227] Fix | Delete
// visible area of the scroll container.
[58228] Fix | Delete
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement, 'horizontal');
[58229] Fix | Delete
const doc = targetElement.ownerDocument;
[58230] Fix | Delete
const windowScroll = scrollContainer === doc.body || scrollContainer === doc.documentElement;
[58231] Fix | Delete
[58232] Fix | Delete
// If the scroll container is not the window, offset the left position, if need be.
[58233] Fix | Delete
if (scrollContainer && !windowScroll) {
[58234] Fix | Delete
const scrollContainerRect = scrollContainer.getBoundingClientRect();
[58235] Fix | Delete
[58236] Fix | Delete
// In RTL languages, a vertical scrollbar is present on the
[58237] Fix | Delete
// left edge of the scroll container. The width of the
[58238] Fix | Delete
// scrollbar needs to be accounted for when positioning the
[58239] Fix | Delete
// drop indicator.
[58240] Fix | Delete
const scrollbarWidth = rtl ? scrollContainer.offsetWidth - scrollContainer.clientWidth : 0;
[58241] Fix | Delete
if (left < scrollContainerRect.left + scrollbarWidth) {
[58242] Fix | Delete
left = scrollContainerRect.left + scrollbarWidth;
[58243] Fix | Delete
}
[58244] Fix | Delete
}
[58245] Fix | Delete
if (dropPosition === 'top') {
[58246] Fix | Delete
top = rect.top - rect.height * 2;
[58247] Fix | Delete
} else {
[58248] Fix | Delete
// `dropPosition` is either `bottom` or `inside`
[58249] Fix | Delete
top = rect.top;
[58250] Fix | Delete
}
[58251] Fix | Delete
const width = getDropIndicatorWidth(rect, 0);
[58252] Fix | Delete
const height = rect.height;
[58253] Fix | Delete
return new window.DOMRect(left, top, width, height);
[58254] Fix | Delete
}
[58255] Fix | Delete
};
[58256] Fix | Delete
}, [targetElement, dropPosition, getDropIndicatorWidth, rtl]);
[58257] Fix | Delete
if (!targetElement) {
[58258] Fix | Delete
return null;
[58259] Fix | Delete
}
[58260] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, {
[58261] Fix | Delete
animate: false,
[58262] Fix | Delete
anchor: popoverAnchor,
[58263] Fix | Delete
focusOnMount: false,
[58264] Fix | Delete
className: "block-editor-list-view-drop-indicator--preview",
[58265] Fix | Delete
variant: "unstyled",
[58266] Fix | Delete
flip: false,
[58267] Fix | Delete
resize: true,
[58268] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[58269] Fix | Delete
style: style,
[58270] Fix | Delete
className: dist_clsx('block-editor-list-view-drop-indicator__line', {
[58271] Fix | Delete
'block-editor-list-view-drop-indicator__line--darker': hasAdjacentSelectedBranch
[58272] Fix | Delete
}),
[58273] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[58274] Fix | Delete
className: "block-editor-list-view-leaf",
[58275] Fix | Delete
"aria-level": ariaLevel,
[58276] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[58277] Fix | Delete
className: dist_clsx('block-editor-list-view-block-select-button', 'block-editor-list-view-block-contents'),
[58278] Fix | Delete
style: horizontalScrollOffsetStyle,
[58279] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewExpander, {
[58280] Fix | Delete
onClick: () => {}
[58281] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, {
[58282] Fix | Delete
icon: blockInformation?.icon,
[58283] Fix | Delete
showColors: true,
[58284] Fix | Delete
context: "list-view"
[58285] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
[58286] Fix | Delete
alignment: "center",
[58287] Fix | Delete
className: "block-editor-list-view-block-select-button__label-wrapper",
[58288] Fix | Delete
justify: "flex-start",
[58289] Fix | Delete
spacing: 1,
[58290] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[58291] Fix | Delete
className: "block-editor-list-view-block-select-button__title",
[58292] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
[58293] Fix | Delete
ellipsizeMode: "auto",
[58294] Fix | Delete
children: blockTitle
[58295] Fix | Delete
})
[58296] Fix | Delete
})
[58297] Fix | Delete
})]
[58298] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[58299] Fix | Delete
className: "block-editor-list-view-block__menu-cell"
[58300] Fix | Delete
})]
[58301] Fix | Delete
})
[58302] Fix | Delete
})
[58303] Fix | Delete
});
[58304] Fix | Delete
}
[58305] Fix | Delete
[58306] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-block-selection.js
[58307] Fix | Delete
/**
[58308] Fix | Delete
* WordPress dependencies
[58309] Fix | Delete
*/
[58310] Fix | Delete
[58311] Fix | Delete
[58312] Fix | Delete
[58313] Fix | Delete
[58314] Fix | Delete
[58315] Fix | Delete
[58316] Fix | Delete
[58317] Fix | Delete
/**
[58318] Fix | Delete
* Internal dependencies
[58319] Fix | Delete
*/
[58320] Fix | Delete
[58321] Fix | Delete
[58322] Fix | Delete
function useBlockSelection() {
[58323] Fix | Delete
const {
[58324] Fix | Delete
clearSelectedBlock,
[58325] Fix | Delete
multiSelect,
[58326] Fix | Delete
selectBlock
[58327] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[58328] Fix | Delete
const {
[58329] Fix | Delete
getBlockName,
[58330] Fix | Delete
getBlockParents,
[58331] Fix | Delete
getBlockSelectionStart,
[58332] Fix | Delete
getSelectedBlockClientIds,
[58333] Fix | Delete
hasMultiSelection,
[58334] Fix | Delete
hasSelectedBlock
[58335] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[58336] Fix | Delete
const {
[58337] Fix | Delete
getBlockType
[58338] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
[58339] Fix | Delete
const updateBlockSelection = (0,external_wp_element_namespaceObject.useCallback)(async (event, clientId, destinationClientId, focusPosition) => {
[58340] Fix | Delete
if (!event?.shiftKey && event?.keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) {
[58341] Fix | Delete
selectBlock(clientId, focusPosition);
[58342] Fix | Delete
return;
[58343] Fix | Delete
}
[58344] Fix | Delete
[58345] Fix | Delete
// To handle multiple block selection via the `SHIFT` key, prevent
[58346] Fix | Delete
// the browser default behavior of opening the link in a new window.
[58347] Fix | Delete
event.preventDefault();
[58348] Fix | Delete
const isOnlyDeselection = event.type === 'keydown' && event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE;
[58349] Fix | Delete
const isKeyPress = event.type === 'keydown' && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN || event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END);
[58350] Fix | Delete
[58351] Fix | Delete
// Handle clicking on a block when no blocks are selected, and return early.
[58352] Fix | Delete
if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) {
[58353] Fix | Delete
selectBlock(clientId, null);
[58354] Fix | Delete
return;
[58355] Fix | Delete
}
[58356] Fix | Delete
const selectedBlocks = getSelectedBlockClientIds();
[58357] Fix | Delete
const clientIdWithParents = [...getBlockParents(clientId), clientId];
[58358] Fix | Delete
if (isOnlyDeselection || isKeyPress && !selectedBlocks.some(blockId => clientIdWithParents.includes(blockId))) {
[58359] Fix | Delete
// Ensure that shift-selecting blocks via the keyboard only
[58360] Fix | Delete
// expands the current selection if focusing over already
[58361] Fix | Delete
// selected blocks. Otherwise, clear the selection so that
[58362] Fix | Delete
// a user can create a new selection entirely by keyboard.
[58363] Fix | Delete
await clearSelectedBlock();
[58364] Fix | Delete
}
[58365] Fix | Delete
[58366] Fix | Delete
// Update selection, if not only clearing the selection.
[58367] Fix | Delete
if (!isOnlyDeselection) {
[58368] Fix | Delete
let startTarget = getBlockSelectionStart();
[58369] Fix | Delete
let endTarget = clientId;
[58370] Fix | Delete
[58371] Fix | Delete
// Handle keyboard behavior for selecting multiple blocks.
[58372] Fix | Delete
if (isKeyPress) {
[58373] Fix | Delete
if (!hasSelectedBlock() && !hasMultiSelection()) {
[58374] Fix | Delete
// Set the starting point of the selection to the currently
[58375] Fix | Delete
// focused block, if there are no blocks currently selected.
[58376] Fix | Delete
// This ensures that as the selection is expanded or contracted,
[58377] Fix | Delete
// the starting point of the selection is anchored to that block.
[58378] Fix | Delete
startTarget = clientId;
[58379] Fix | Delete
}
[58380] Fix | Delete
if (destinationClientId) {
[58381] Fix | Delete
// If the user presses UP or DOWN, we want to ensure that the block they're
[58382] Fix | Delete
// moving to is the target for selection, and not the currently focused one.
[58383] Fix | Delete
endTarget = destinationClientId;
[58384] Fix | Delete
}
[58385] Fix | Delete
}
[58386] Fix | Delete
const startParents = getBlockParents(startTarget);
[58387] Fix | Delete
const endParents = getBlockParents(endTarget);
[58388] Fix | Delete
const {
[58389] Fix | Delete
start,
[58390] Fix | Delete
end
[58391] Fix | Delete
} = getCommonDepthClientIds(startTarget, endTarget, startParents, endParents);
[58392] Fix | Delete
await multiSelect(start, end, null);
[58393] Fix | Delete
}
[58394] Fix | Delete
[58395] Fix | Delete
// Announce deselected block, or number of deselected blocks if
[58396] Fix | Delete
// the total number of blocks deselected is greater than one.
[58397] Fix | Delete
const updatedSelectedBlocks = getSelectedBlockClientIds();
[58398] Fix | Delete
[58399] Fix | Delete
// If the selection is greater than 1 and the Home or End keys
[58400] Fix | Delete
// were used to generate the selection, then skip announcing the
[58401] Fix | Delete
// deselected blocks.
[58402] Fix | Delete
if ((event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END) && updatedSelectedBlocks.length > 1) {
[58403] Fix | Delete
return;
[58404] Fix | Delete
}
[58405] Fix | Delete
const selectionDiff = selectedBlocks.filter(blockId => !updatedSelectedBlocks.includes(blockId));
[58406] Fix | Delete
let label;
[58407] Fix | Delete
if (selectionDiff.length === 1) {
[58408] Fix | Delete
const title = getBlockType(getBlockName(selectionDiff[0]))?.title;
[58409] Fix | Delete
if (title) {
[58410] Fix | Delete
label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: block name */
[58411] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('%s deselected.'), title);
[58412] Fix | Delete
}
[58413] Fix | Delete
} else if (selectionDiff.length > 1) {
[58414] Fix | Delete
label = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of deselected blocks */
[58415] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('%s blocks deselected.'), selectionDiff.length);
[58416] Fix | Delete
}
[58417] Fix | Delete
if (label) {
[58418] Fix | Delete
(0,external_wp_a11y_namespaceObject.speak)(label, 'assertive');
[58419] Fix | Delete
}
[58420] Fix | Delete
}, [clearSelectedBlock, getBlockName, getBlockType, getBlockParents, getBlockSelectionStart, getSelectedBlockClientIds, hasMultiSelection, hasSelectedBlock, multiSelect, selectBlock]);
[58421] Fix | Delete
return {
[58422] Fix | Delete
updateBlockSelection
[58423] Fix | Delete
};
[58424] Fix | Delete
}
[58425] Fix | Delete
[58426] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-block-indexes.js
[58427] Fix | Delete
/**
[58428] Fix | Delete
* WordPress dependencies
[58429] Fix | Delete
*/
[58430] Fix | Delete
[58431] Fix | Delete
function useListViewBlockIndexes(blocks) {
[58432] Fix | Delete
const blockIndexes = (0,external_wp_element_namespaceObject.useMemo)(() => {
[58433] Fix | Delete
const indexes = {};
[58434] Fix | Delete
let currentGlobalIndex = 0;
[58435] Fix | Delete
const traverseBlocks = blockList => {
[58436] Fix | Delete
blockList.forEach(block => {
[58437] Fix | Delete
indexes[block.clientId] = currentGlobalIndex;
[58438] Fix | Delete
currentGlobalIndex++;
[58439] Fix | Delete
if (block.innerBlocks.length > 0) {
[58440] Fix | Delete
traverseBlocks(block.innerBlocks);
[58441] Fix | Delete
}
[58442] Fix | Delete
});
[58443] Fix | Delete
};
[58444] Fix | Delete
traverseBlocks(blocks);
[58445] Fix | Delete
return indexes;
[58446] Fix | Delete
}, [blocks]);
[58447] Fix | Delete
return blockIndexes;
[58448] Fix | Delete
}
[58449] Fix | Delete
[58450] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-client-ids.js
[58451] Fix | Delete
/**
[58452] Fix | Delete
* WordPress dependencies
[58453] Fix | Delete
*/
[58454] Fix | Delete
[58455] Fix | Delete
[58456] Fix | Delete
[58457] Fix | Delete
/**
[58458] Fix | Delete
* Internal dependencies
[58459] Fix | Delete
*/
[58460] Fix | Delete
[58461] Fix | Delete
[58462] Fix | Delete
function useListViewClientIds({
[58463] Fix | Delete
blocks,
[58464] Fix | Delete
rootClientId
[58465] Fix | Delete
}) {
[58466] Fix | Delete
return (0,external_wp_data_namespaceObject.useSelect)(select => {
[58467] Fix | Delete
const {
[58468] Fix | Delete
getDraggedBlockClientIds,
[58469] Fix | Delete
getSelectedBlockClientIds,
[58470] Fix | Delete
getEnabledClientIdsTree
[58471] Fix | Delete
} = unlock(select(store));
[58472] Fix | Delete
return {
[58473] Fix | Delete
selectedClientIds: getSelectedBlockClientIds(),
[58474] Fix | Delete
draggedClientIds: getDraggedBlockClientIds(),
[58475] Fix | Delete
clientIdsTree: blocks !== null && blocks !== void 0 ? blocks : getEnabledClientIdsTree(rootClientId)
[58476] Fix | Delete
};
[58477] Fix | Delete
}, [blocks, rootClientId]);
[58478] Fix | Delete
}
[58479] Fix | Delete
[58480] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-collapse-items.js
[58481] Fix | Delete
/**
[58482] Fix | Delete
* WordPress dependencies
[58483] Fix | Delete
*/
[58484] Fix | Delete
[58485] Fix | Delete
[58486] Fix | Delete
[58487] Fix | Delete
/**
[58488] Fix | Delete
* Internal dependencies
[58489] Fix | Delete
*/
[58490] Fix | Delete
[58491] Fix | Delete
[58492] Fix | Delete
function useListViewCollapseItems({
[58493] Fix | Delete
collapseAll,
[58494] Fix | Delete
expand
[58495] Fix | Delete
}) {
[58496] Fix | Delete
const {
[58497] Fix | Delete
expandedBlock,
[58498] Fix | Delete
getBlockParents
[58499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function