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
justify: "flex-start",
[57000] Fix | Delete
spacing: 1,
[57001] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[57002] Fix | Delete
className: "block-editor-list-view-block-select-button__title",
[57003] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
[57004] Fix | Delete
ellipsizeMode: "auto",
[57005] Fix | Delete
children: blockTitle
[57006] Fix | Delete
})
[57007] Fix | Delete
}), blockInformation?.anchor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[57008] Fix | Delete
className: "block-editor-list-view-block-select-button__anchor-wrapper",
[57009] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, {
[57010] Fix | Delete
className: "block-editor-list-view-block-select-button__anchor",
[57011] Fix | Delete
ellipsizeMode: "auto",
[57012] Fix | Delete
children: blockInformation.anchor
[57013] Fix | Delete
})
[57014] Fix | Delete
}), positionLabel && isSticky && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
[57015] Fix | Delete
text: positionLabel,
[57016] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[57017] Fix | Delete
icon: pin_small
[57018] Fix | Delete
})
[57019] Fix | Delete
}), images.length ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[57020] Fix | Delete
className: "block-editor-list-view-block-select-button__images",
[57021] Fix | Delete
"aria-hidden": true,
[57022] Fix | Delete
children: images.map((image, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[57023] Fix | Delete
className: "block-editor-list-view-block-select-button__image",
[57024] Fix | Delete
style: {
[57025] Fix | Delete
backgroundImage: `url(${image.url})`,
[57026] Fix | Delete
zIndex: images.length - index // Ensure the first image is on top, and subsequent images are behind.
[57027] Fix | Delete
}
[57028] Fix | Delete
}, image.clientId))
[57029] Fix | Delete
}) : null, shouldShowLockIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
[57030] Fix | Delete
className: "block-editor-list-view-block-select-button__lock",
[57031] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, {
[57032] Fix | Delete
icon: lock_small
[57033] Fix | Delete
})
[57034] Fix | Delete
})]
[57035] Fix | Delete
})]
[57036] Fix | Delete
});
[57037] Fix | Delete
}
[57038] Fix | Delete
/* harmony default export */ const block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
[57039] Fix | Delete
[57040] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-contents.js
[57041] Fix | Delete
/**
[57042] Fix | Delete
* External dependencies
[57043] Fix | Delete
*/
[57044] Fix | Delete
[57045] Fix | Delete
[57046] Fix | Delete
/**
[57047] Fix | Delete
* WordPress dependencies
[57048] Fix | Delete
*/
[57049] Fix | Delete
[57050] Fix | Delete
[57051] Fix | Delete
[57052] Fix | Delete
/**
[57053] Fix | Delete
* Internal dependencies
[57054] Fix | Delete
*/
[57055] Fix | Delete
[57056] Fix | Delete
[57057] Fix | Delete
[57058] Fix | Delete
[57059] Fix | Delete
[57060] Fix | Delete
[57061] Fix | Delete
[57062] Fix | Delete
const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)(({
[57063] Fix | Delete
onClick,
[57064] Fix | Delete
onToggleExpanded,
[57065] Fix | Delete
block,
[57066] Fix | Delete
isSelected,
[57067] Fix | Delete
position,
[57068] Fix | Delete
siblingBlockCount,
[57069] Fix | Delete
level,
[57070] Fix | Delete
isExpanded,
[57071] Fix | Delete
selectedClientIds,
[57072] Fix | Delete
...props
[57073] Fix | Delete
}, ref) => {
[57074] Fix | Delete
const {
[57075] Fix | Delete
clientId
[57076] Fix | Delete
} = block;
[57077] Fix | Delete
const {
[57078] Fix | Delete
blockMovingClientId,
[57079] Fix | Delete
selectedBlockInBlockEditor
[57080] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[57081] Fix | Delete
const {
[57082] Fix | Delete
hasBlockMovingClientId,
[57083] Fix | Delete
getSelectedBlockClientId
[57084] Fix | Delete
} = select(store);
[57085] Fix | Delete
return {
[57086] Fix | Delete
blockMovingClientId: hasBlockMovingClientId(),
[57087] Fix | Delete
selectedBlockInBlockEditor: getSelectedBlockClientId()
[57088] Fix | Delete
};
[57089] Fix | Delete
}, []);
[57090] Fix | Delete
const {
[57091] Fix | Delete
AdditionalBlockContent,
[57092] Fix | Delete
insertedBlock,
[57093] Fix | Delete
setInsertedBlock
[57094] Fix | Delete
} = useListViewContext();
[57095] Fix | Delete
const isBlockMoveTarget = blockMovingClientId && selectedBlockInBlockEditor === clientId;
[57096] Fix | Delete
const className = dist_clsx('block-editor-list-view-block-contents', {
[57097] Fix | Delete
'is-dropping-before': isBlockMoveTarget
[57098] Fix | Delete
});
[57099] Fix | Delete
[57100] Fix | Delete
// Only include all selected blocks if the currently clicked on block
[57101] Fix | Delete
// is one of the selected blocks. This ensures that if a user attempts
[57102] Fix | Delete
// to drag a block that isn't part of the selection, they're still able
[57103] Fix | Delete
// to drag it and rearrange its position.
[57104] Fix | Delete
const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId];
[57105] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[57106] Fix | Delete
children: [AdditionalBlockContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AdditionalBlockContent, {
[57107] Fix | Delete
block: block,
[57108] Fix | Delete
insertedBlock: insertedBlock,
[57109] Fix | Delete
setInsertedBlock: setInsertedBlock
[57110] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_draggable, {
[57111] Fix | Delete
appendToOwnerDocument: true,
[57112] Fix | Delete
clientIds: draggableClientIds,
[57113] Fix | Delete
cloneClassname: "block-editor-list-view-draggable-chip",
[57114] Fix | Delete
children: ({
[57115] Fix | Delete
draggable,
[57116] Fix | Delete
onDragStart,
[57117] Fix | Delete
onDragEnd
[57118] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_select_button, {
[57119] Fix | Delete
ref: ref,
[57120] Fix | Delete
className: className,
[57121] Fix | Delete
block: block,
[57122] Fix | Delete
onClick: onClick,
[57123] Fix | Delete
onToggleExpanded: onToggleExpanded,
[57124] Fix | Delete
isSelected: isSelected,
[57125] Fix | Delete
position: position,
[57126] Fix | Delete
siblingBlockCount: siblingBlockCount,
[57127] Fix | Delete
level: level,
[57128] Fix | Delete
draggable: draggable,
[57129] Fix | Delete
onDragStart: onDragStart,
[57130] Fix | Delete
onDragEnd: onDragEnd,
[57131] Fix | Delete
isExpanded: isExpanded,
[57132] Fix | Delete
...props
[57133] Fix | Delete
})
[57134] Fix | Delete
})]
[57135] Fix | Delete
});
[57136] Fix | Delete
});
[57137] Fix | Delete
/* harmony default export */ const block_contents = (ListViewBlockContents);
[57138] Fix | Delete
[57139] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/utils.js
[57140] Fix | Delete
/**
[57141] Fix | Delete
* WordPress dependencies
[57142] Fix | Delete
*/
[57143] Fix | Delete
[57144] Fix | Delete
[57145] Fix | Delete
const getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
[57146] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Block %1$d of %2$d, Level %3$d.'), position, siblingCount, level);
[57147] Fix | Delete
const getBlockPropertiesDescription = isLocked => isLocked ? (0,external_wp_i18n_namespaceObject.__)('This block is locked.') : '';
[57148] Fix | Delete
[57149] Fix | Delete
/**
[57150] Fix | Delete
* Returns true if the client ID occurs within the block selection or multi-selection,
[57151] Fix | Delete
* or false otherwise.
[57152] Fix | Delete
*
[57153] Fix | Delete
* @param {string} clientId Block client ID.
[57154] Fix | Delete
* @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.
[57155] Fix | Delete
*
[57156] Fix | Delete
* @return {boolean} Whether the block is in multi-selection set.
[57157] Fix | Delete
*/
[57158] Fix | Delete
const isClientIdSelected = (clientId, selectedBlockClientIds) => Array.isArray(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId;
[57159] Fix | Delete
[57160] Fix | Delete
/**
[57161] Fix | Delete
* From a start and end clientId of potentially different nesting levels,
[57162] Fix | Delete
* return the nearest-depth ids that have a common level of depth in the
[57163] Fix | Delete
* nesting hierarchy. For multiple block selection, this ensure that the
[57164] Fix | Delete
* selection is always at the same nesting level, and not split across
[57165] Fix | Delete
* separate levels.
[57166] Fix | Delete
*
[57167] Fix | Delete
* @param {string} startId The first id of a selection.
[57168] Fix | Delete
* @param {string} endId The end id of a selection, usually one that has been clicked on.
[57169] Fix | Delete
* @param {string[]} startParents An array of ancestor ids for the start id, in descending order.
[57170] Fix | Delete
* @param {string[]} endParents An array of ancestor ids for the end id, in descending order.
[57171] Fix | Delete
* @return {Object} An object containing the start and end ids.
[57172] Fix | Delete
*/
[57173] Fix | Delete
function getCommonDepthClientIds(startId, endId, startParents, endParents) {
[57174] Fix | Delete
const startPath = [...startParents, startId];
[57175] Fix | Delete
const endPath = [...endParents, endId];
[57176] Fix | Delete
const depth = Math.min(startPath.length, endPath.length) - 1;
[57177] Fix | Delete
const start = startPath[depth];
[57178] Fix | Delete
const end = endPath[depth];
[57179] Fix | Delete
return {
[57180] Fix | Delete
start,
[57181] Fix | Delete
end
[57182] Fix | Delete
};
[57183] Fix | Delete
}
[57184] Fix | Delete
[57185] Fix | Delete
/**
[57186] Fix | Delete
* Shift focus to the list view item associated with a particular clientId.
[57187] Fix | Delete
*
[57188] Fix | Delete
* @typedef {import('@wordpress/element').RefObject} RefObject
[57189] Fix | Delete
*
[57190] Fix | Delete
* @param {string} focusClientId The client ID of the block to focus.
[57191] Fix | Delete
* @param {?HTMLElement} treeGridElement The container element to search within.
[57192] Fix | Delete
*/
[57193] Fix | Delete
function focusListItem(focusClientId, treeGridElement) {
[57194] Fix | Delete
const getFocusElement = () => {
[57195] Fix | Delete
const row = treeGridElement?.querySelector(`[role=row][data-block="${focusClientId}"]`);
[57196] Fix | Delete
if (!row) {
[57197] Fix | Delete
return null;
[57198] Fix | Delete
}
[57199] Fix | Delete
// Focus the first focusable in the row, which is the ListViewBlockSelectButton.
[57200] Fix | Delete
return external_wp_dom_namespaceObject.focus.focusable.find(row)[0];
[57201] Fix | Delete
};
[57202] Fix | Delete
let focusElement = getFocusElement();
[57203] Fix | Delete
if (focusElement) {
[57204] Fix | Delete
focusElement.focus();
[57205] Fix | Delete
} else {
[57206] Fix | Delete
// The element hasn't been painted yet. Defer focusing on the next frame.
[57207] Fix | Delete
// This could happen when all blocks have been deleted and the default block
[57208] Fix | Delete
// hasn't been added to the editor yet.
[57209] Fix | Delete
window.requestAnimationFrame(() => {
[57210] Fix | Delete
focusElement = getFocusElement();
[57211] Fix | Delete
[57212] Fix | Delete
// Ignore if the element still doesn't exist.
[57213] Fix | Delete
if (focusElement) {
[57214] Fix | Delete
focusElement.focus();
[57215] Fix | Delete
}
[57216] Fix | Delete
});
[57217] Fix | Delete
}
[57218] Fix | Delete
}
[57219] Fix | Delete
[57220] Fix | Delete
/**
[57221] Fix | Delete
* Get values for the block that flag whether the block should be displaced up or down,
[57222] Fix | Delete
* whether the block is being nested, and whether the block appears after the dragged
[57223] Fix | Delete
* blocks. These values are used to determine the class names to apply to the block.
[57224] Fix | Delete
* The list view rows are displaced visually via CSS rules. Displacement rules:
[57225] Fix | Delete
* - `normal`: no displacement — used to apply a translateY of `0` so that the block
[57226] Fix | Delete
* appears in its original position, and moves to that position smoothly when dragging
[57227] Fix | Delete
* outside of the list view area.
[57228] Fix | Delete
* - `up`: the block should be displaced up, creating room beneath the block for the drop indicator.
[57229] Fix | Delete
* - `down`: the block should be displaced down, creating room above the block for the drop indicator.
[57230] Fix | Delete
*
[57231] Fix | Delete
* @param {Object} props
[57232] Fix | Delete
* @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId.
[57233] Fix | Delete
* @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to.
[57234] Fix | Delete
* @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to.
[57235] Fix | Delete
* @param {string} props.clientId The client id for the current block.
[57236] Fix | Delete
* @param {?number} props.firstDraggedBlockIndex The index of the first dragged block.
[57237] Fix | Delete
* @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement.
[57238] Fix | Delete
* @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values.
[57239] Fix | Delete
*/
[57240] Fix | Delete
function getDragDisplacementValues({
[57241] Fix | Delete
blockIndexes,
[57242] Fix | Delete
blockDropTargetIndex,
[57243] Fix | Delete
blockDropPosition,
[57244] Fix | Delete
clientId,
[57245] Fix | Delete
firstDraggedBlockIndex,
[57246] Fix | Delete
isDragged
[57247] Fix | Delete
}) {
[57248] Fix | Delete
let displacement;
[57249] Fix | Delete
let isNesting;
[57250] Fix | Delete
let isAfterDraggedBlocks;
[57251] Fix | Delete
if (!isDragged) {
[57252] Fix | Delete
isNesting = false;
[57253] Fix | Delete
const thisBlockIndex = blockIndexes[clientId];
[57254] Fix | Delete
isAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex;
[57255] Fix | Delete
[57256] Fix | Delete
// Determine where to displace the position of the current block, relative
[57257] Fix | Delete
// to the blocks being dragged (in their original position) and the drop target
[57258] Fix | Delete
// (the position where a user is currently dragging the blocks to).
[57259] Fix | Delete
if (blockDropTargetIndex !== undefined && blockDropTargetIndex !== null && firstDraggedBlockIndex !== undefined) {
[57260] Fix | Delete
// If the block is being dragged and there is a valid drop target,
[57261] Fix | Delete
// determine if the block being rendered should be displaced up or down.
[57262] Fix | Delete
[57263] Fix | Delete
if (thisBlockIndex !== undefined) {
[57264] Fix | Delete
if (thisBlockIndex >= firstDraggedBlockIndex && thisBlockIndex < blockDropTargetIndex) {
[57265] Fix | Delete
// If the current block appears after the set of dragged blocks
[57266] Fix | Delete
// (in their original position), but is before the drop target,
[57267] Fix | Delete
// then the current block should be displaced up.
[57268] Fix | Delete
displacement = 'up';
[57269] Fix | Delete
} else if (thisBlockIndex < firstDraggedBlockIndex && thisBlockIndex >= blockDropTargetIndex) {
[57270] Fix | Delete
// If the current block appears before the set of dragged blocks
[57271] Fix | Delete
// (in their original position), but is after the drop target,
[57272] Fix | Delete
// then the current block should be displaced down.
[57273] Fix | Delete
displacement = 'down';
[57274] Fix | Delete
} else {
[57275] Fix | Delete
displacement = 'normal';
[57276] Fix | Delete
}
[57277] Fix | Delete
isNesting = typeof blockDropTargetIndex === 'number' && blockDropTargetIndex - 1 === thisBlockIndex && blockDropPosition === 'inside';
[57278] Fix | Delete
}
[57279] Fix | Delete
} else if (blockDropTargetIndex === null && firstDraggedBlockIndex !== undefined) {
[57280] Fix | Delete
// A `null` value for `blockDropTargetIndex` indicates that the
[57281] Fix | Delete
// drop target is outside of the valid areas within the list view.
[57282] Fix | Delete
// In this case, the drag is still active, but as there is no
[57283] Fix | Delete
// valid drop target, we should remove the gap indicating where
[57284] Fix | Delete
// the block would be inserted.
[57285] Fix | Delete
if (thisBlockIndex !== undefined && thisBlockIndex >= firstDraggedBlockIndex) {
[57286] Fix | Delete
displacement = 'up';
[57287] Fix | Delete
} else {
[57288] Fix | Delete
displacement = 'normal';
[57289] Fix | Delete
}
[57290] Fix | Delete
} else if (blockDropTargetIndex !== undefined && blockDropTargetIndex !== null && firstDraggedBlockIndex === undefined) {
[57291] Fix | Delete
// If the blockdrop target is defined, but there are no dragged blocks,
[57292] Fix | Delete
// then the block should be displaced relative to the drop target.
[57293] Fix | Delete
if (thisBlockIndex !== undefined) {
[57294] Fix | Delete
if (thisBlockIndex < blockDropTargetIndex) {
[57295] Fix | Delete
displacement = 'normal';
[57296] Fix | Delete
} else {
[57297] Fix | Delete
displacement = 'down';
[57298] Fix | Delete
}
[57299] Fix | Delete
}
[57300] Fix | Delete
} else if (blockDropTargetIndex === null) {
[57301] Fix | Delete
displacement = 'normal';
[57302] Fix | Delete
}
[57303] Fix | Delete
}
[57304] Fix | Delete
return {
[57305] Fix | Delete
displacement,
[57306] Fix | Delete
isNesting,
[57307] Fix | Delete
isAfterDraggedBlocks
[57308] Fix | Delete
};
[57309] Fix | Delete
}
[57310] Fix | Delete
[57311] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js
[57312] Fix | Delete
/**
[57313] Fix | Delete
* External dependencies
[57314] Fix | Delete
*/
[57315] Fix | Delete
[57316] Fix | Delete
[57317] Fix | Delete
/**
[57318] Fix | Delete
* WordPress dependencies
[57319] Fix | Delete
*/
[57320] Fix | Delete
[57321] Fix | Delete
[57322] Fix | Delete
[57323] Fix | Delete
[57324] Fix | Delete
[57325] Fix | Delete
[57326] Fix | Delete
[57327] Fix | Delete
[57328] Fix | Delete
[57329] Fix | Delete
[57330] Fix | Delete
[57331] Fix | Delete
[57332] Fix | Delete
/**
[57333] Fix | Delete
* Internal dependencies
[57334] Fix | Delete
*/
[57335] Fix | Delete
[57336] Fix | Delete
[57337] Fix | Delete
[57338] Fix | Delete
[57339] Fix | Delete
[57340] Fix | Delete
[57341] Fix | Delete
[57342] Fix | Delete
[57343] Fix | Delete
[57344] Fix | Delete
[57345] Fix | Delete
[57346] Fix | Delete
[57347] Fix | Delete
[57348] Fix | Delete
[57349] Fix | Delete
function ListViewBlock({
[57350] Fix | Delete
block: {
[57351] Fix | Delete
clientId
[57352] Fix | Delete
},
[57353] Fix | Delete
displacement,
[57354] Fix | Delete
isAfterDraggedBlocks,
[57355] Fix | Delete
isDragged,
[57356] Fix | Delete
isNesting,
[57357] Fix | Delete
isSelected,
[57358] Fix | Delete
isBranchSelected,
[57359] Fix | Delete
selectBlock,
[57360] Fix | Delete
position,
[57361] Fix | Delete
level,
[57362] Fix | Delete
rowCount,
[57363] Fix | Delete
siblingBlockCount,
[57364] Fix | Delete
showBlockMovers,
[57365] Fix | Delete
path,
[57366] Fix | Delete
isExpanded,
[57367] Fix | Delete
selectedClientIds,
[57368] Fix | Delete
isSyncedBranch
[57369] Fix | Delete
}) {
[57370] Fix | Delete
const cellRef = (0,external_wp_element_namespaceObject.useRef)(null);
[57371] Fix | Delete
const rowRef = (0,external_wp_element_namespaceObject.useRef)(null);
[57372] Fix | Delete
const settingsRef = (0,external_wp_element_namespaceObject.useRef)(null);
[57373] Fix | Delete
const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
[57374] Fix | Delete
const [settingsAnchorRect, setSettingsAnchorRect] = (0,external_wp_element_namespaceObject.useState)();
[57375] Fix | Delete
const {
[57376] Fix | Delete
isLocked,
[57377] Fix | Delete
canEdit,
[57378] Fix | Delete
canMove
[57379] Fix | Delete
} = useBlockLock(clientId);
[57380] Fix | Delete
const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId;
[57381] Fix | Delete
const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
[57382] Fix | Delete
const {
[57383] Fix | Delete
toggleBlockHighlight,
[57384] Fix | Delete
duplicateBlocks,
[57385] Fix | Delete
multiSelect,
[57386] Fix | Delete
replaceBlocks,
[57387] Fix | Delete
removeBlocks,
[57388] Fix | Delete
insertAfterBlock,
[57389] Fix | Delete
insertBeforeBlock,
[57390] Fix | Delete
setOpenedBlockSettingsMenu
[57391] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[57392] Fix | Delete
const {
[57393] Fix | Delete
canInsertBlockType,
[57394] Fix | Delete
getSelectedBlockClientIds,
[57395] Fix | Delete
getPreviousBlockClientId,
[57396] Fix | Delete
getBlockRootClientId,
[57397] Fix | Delete
getBlockOrder,
[57398] Fix | Delete
getBlockParents,
[57399] Fix | Delete
getBlocksByClientId,
[57400] Fix | Delete
canRemoveBlocks,
[57401] Fix | Delete
isGroupable
[57402] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[57403] Fix | Delete
const {
[57404] Fix | Delete
getGroupingBlockName
[57405] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
[57406] Fix | Delete
const blockInformation = useBlockDisplayInformation(clientId);
[57407] Fix | Delete
const {
[57408] Fix | Delete
block,
[57409] Fix | Delete
blockName,
[57410] Fix | Delete
allowRightClickOverrides
[57411] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[57412] Fix | Delete
const {
[57413] Fix | Delete
getBlock,
[57414] Fix | Delete
getBlockName,
[57415] Fix | Delete
getSettings
[57416] Fix | Delete
} = select(store);
[57417] Fix | Delete
return {
[57418] Fix | Delete
block: getBlock(clientId),
[57419] Fix | Delete
blockName: getBlockName(clientId),
[57420] Fix | Delete
allowRightClickOverrides: getSettings().allowRightClickOverrides
[57421] Fix | Delete
};
[57422] Fix | Delete
}, [clientId]);
[57423] Fix | Delete
const showBlockActions =
[57424] Fix | Delete
// When a block hides its toolbar it also hides the block settings menu,
[57425] Fix | Delete
// since that menu is part of the toolbar in the editor canvas.
[57426] Fix | Delete
// List View respects this by also hiding the block settings menu.
[57427] Fix | Delete
(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, '__experimentalToolbar', true);
[57428] Fix | Delete
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock);
[57429] Fix | Delete
const descriptionId = `list-view-block-select-button__description-${instanceId}`;
[57430] Fix | Delete
const {
[57431] Fix | Delete
expand,
[57432] Fix | Delete
collapse,
[57433] Fix | Delete
collapseAll,
[57434] Fix | Delete
BlockSettingsMenu,
[57435] Fix | Delete
listViewInstanceId,
[57436] Fix | Delete
expandedState,
[57437] Fix | Delete
setInsertedBlock,
[57438] Fix | Delete
treeGridElementRef,
[57439] Fix | Delete
rootClientId
[57440] Fix | Delete
} = useListViewContext();
[57441] Fix | Delete
const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
[57442] Fix | Delete
[57443] Fix | Delete
// Determine which blocks to update:
[57444] Fix | Delete
// If the current (focused) block is part of the block selection, use the whole selection.
[57445] Fix | Delete
// If the focused block is not part of the block selection, only update the focused block.
[57446] Fix | Delete
function getBlocksToUpdate() {
[57447] Fix | Delete
const selectedBlockClientIds = getSelectedBlockClientIds();
[57448] Fix | Delete
const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId);
[57449] Fix | Delete
const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId;
[57450] Fix | Delete
const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId);
[57451] Fix | Delete
const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId];
[57452] Fix | Delete
return {
[57453] Fix | Delete
blocksToUpdate,
[57454] Fix | Delete
firstBlockClientId,
[57455] Fix | Delete
firstBlockRootClientId,
[57456] Fix | Delete
selectedBlockClientIds
[57457] Fix | Delete
};
[57458] Fix | Delete
}
[57459] Fix | Delete
[57460] Fix | Delete
/**
[57461] Fix | Delete
* @param {KeyboardEvent} event
[57462] Fix | Delete
*/
[57463] Fix | Delete
async function onKeyDown(event) {
[57464] Fix | Delete
if (event.defaultPrevented) {
[57465] Fix | Delete
return;
[57466] Fix | Delete
}
[57467] Fix | Delete
[57468] Fix | Delete
// Do not handle events if it comes from modals;
[57469] Fix | Delete
// retain the default behavior for these keys.
[57470] Fix | Delete
if (event.target.closest('[role=dialog]')) {
[57471] Fix | Delete
return;
[57472] Fix | Delete
}
[57473] Fix | Delete
const isDeleteKey = [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode);
[57474] Fix | Delete
[57475] Fix | Delete
// If multiple blocks are selected, deselect all blocks when the user
[57476] Fix | Delete
// presses the escape key.
[57477] Fix | Delete
if (isMatch('core/block-editor/unselect', event) && selectedClientIds.length > 0) {
[57478] Fix | Delete
event.stopPropagation();
[57479] Fix | Delete
event.preventDefault();
[57480] Fix | Delete
selectBlock(event, undefined);
[57481] Fix | Delete
} else if (isDeleteKey || isMatch('core/block-editor/remove', event)) {
[57482] Fix | Delete
var _getPreviousBlockClie;
[57483] Fix | Delete
const {
[57484] Fix | Delete
blocksToUpdate: blocksToDelete,
[57485] Fix | Delete
firstBlockClientId,
[57486] Fix | Delete
firstBlockRootClientId,
[57487] Fix | Delete
selectedBlockClientIds
[57488] Fix | Delete
} = getBlocksToUpdate();
[57489] Fix | Delete
[57490] Fix | Delete
// Don't update the selection if the blocks cannot be deleted.
[57491] Fix | Delete
if (!canRemoveBlocks(blocksToDelete)) {
[57492] Fix | Delete
return;
[57493] Fix | Delete
}
[57494] Fix | Delete
let blockToFocus = (_getPreviousBlockClie = getPreviousBlockClientId(firstBlockClientId)) !== null && _getPreviousBlockClie !== void 0 ? _getPreviousBlockClie :
[57495] Fix | Delete
// If the previous block is not found (when the first block is deleted),
[57496] Fix | Delete
// fallback to focus the parent block.
[57497] Fix | Delete
firstBlockRootClientId;
[57498] Fix | Delete
removeBlocks(blocksToDelete, false);
[57499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function