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
setExpandedState({
[59000] Fix | Delete
type: 'expand',
[59001] Fix | Delete
clientIds: selectedBlockParentClientIds
[59002] Fix | Delete
});
[59003] Fix | Delete
}
[59004] Fix | Delete
}, [firstSelectedBlockClientId, selectedBlockParentClientIds, selectedTreeId, setExpandedState]);
[59005] Fix | Delete
return {
[59006] Fix | Delete
setSelectedTreeId
[59007] Fix | Delete
};
[59008] Fix | Delete
}
[59009] Fix | Delete
[59010] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-clipboard-handler.js
[59011] Fix | Delete
/**
[59012] Fix | Delete
* WordPress dependencies
[59013] Fix | Delete
*/
[59014] Fix | Delete
[59015] Fix | Delete
[59016] Fix | Delete
[59017] Fix | Delete
/**
[59018] Fix | Delete
* Internal dependencies
[59019] Fix | Delete
*/
[59020] Fix | Delete
[59021] Fix | Delete
[59022] Fix | Delete
[59023] Fix | Delete
[59024] Fix | Delete
[59025] Fix | Delete
// This hook borrows from useClipboardHandler in ../writing-flow/use-clipboard-handler.js
[59026] Fix | Delete
// and adds behaviour for the list view, while skipping partial selection.
[59027] Fix | Delete
function use_clipboard_handler_useClipboardHandler({
[59028] Fix | Delete
selectBlock
[59029] Fix | Delete
}) {
[59030] Fix | Delete
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
[59031] Fix | Delete
const {
[59032] Fix | Delete
getBlockOrder,
[59033] Fix | Delete
getBlockRootClientId,
[59034] Fix | Delete
getBlocksByClientId,
[59035] Fix | Delete
getPreviousBlockClientId,
[59036] Fix | Delete
getSelectedBlockClientIds,
[59037] Fix | Delete
getSettings,
[59038] Fix | Delete
canInsertBlockType,
[59039] Fix | Delete
canRemoveBlocks
[59040] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[59041] Fix | Delete
const {
[59042] Fix | Delete
flashBlock,
[59043] Fix | Delete
removeBlocks,
[59044] Fix | Delete
replaceBlocks,
[59045] Fix | Delete
insertBlocks
[59046] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[59047] Fix | Delete
const notifyCopy = useNotifyCopy();
[59048] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[59049] Fix | Delete
function updateFocusAndSelection(focusClientId, shouldSelectBlock) {
[59050] Fix | Delete
if (shouldSelectBlock) {
[59051] Fix | Delete
selectBlock(undefined, focusClientId, null, null);
[59052] Fix | Delete
}
[59053] Fix | Delete
focusListItem(focusClientId, node);
[59054] Fix | Delete
}
[59055] Fix | Delete
[59056] Fix | Delete
// Determine which blocks to update:
[59057] Fix | Delete
// If the current (focused) block is part of the block selection, use the whole selection.
[59058] Fix | Delete
// If the focused block is not part of the block selection, only update the focused block.
[59059] Fix | Delete
function getBlocksToUpdate(clientId) {
[59060] Fix | Delete
const selectedBlockClientIds = getSelectedBlockClientIds();
[59061] Fix | Delete
const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId);
[59062] Fix | Delete
const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId;
[59063] Fix | Delete
const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId);
[59064] Fix | Delete
const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId];
[59065] Fix | Delete
return {
[59066] Fix | Delete
blocksToUpdate,
[59067] Fix | Delete
firstBlockClientId,
[59068] Fix | Delete
firstBlockRootClientId,
[59069] Fix | Delete
originallySelectedBlockClientIds: selectedBlockClientIds
[59070] Fix | Delete
};
[59071] Fix | Delete
}
[59072] Fix | Delete
function handler(event) {
[59073] Fix | Delete
if (event.defaultPrevented) {
[59074] Fix | Delete
// This was possibly already handled in rich-text/use-paste-handler.js.
[59075] Fix | Delete
return;
[59076] Fix | Delete
}
[59077] Fix | Delete
[59078] Fix | Delete
// Only handle events that occur within the list view.
[59079] Fix | Delete
if (!node.contains(event.target.ownerDocument.activeElement)) {
[59080] Fix | Delete
return;
[59081] Fix | Delete
}
[59082] Fix | Delete
[59083] Fix | Delete
// Retrieve the block clientId associated with the focused list view row.
[59084] Fix | Delete
// This enables applying copy / cut / paste behavior to the focused block,
[59085] Fix | Delete
// rather than just the blocks that are currently selected.
[59086] Fix | Delete
const listViewRow = event.target.ownerDocument.activeElement?.closest('[role=row]');
[59087] Fix | Delete
const clientId = listViewRow?.dataset?.block;
[59088] Fix | Delete
if (!clientId) {
[59089] Fix | Delete
return;
[59090] Fix | Delete
}
[59091] Fix | Delete
const {
[59092] Fix | Delete
blocksToUpdate: selectedBlockClientIds,
[59093] Fix | Delete
firstBlockClientId,
[59094] Fix | Delete
firstBlockRootClientId,
[59095] Fix | Delete
originallySelectedBlockClientIds
[59096] Fix | Delete
} = getBlocksToUpdate(clientId);
[59097] Fix | Delete
if (selectedBlockClientIds.length === 0) {
[59098] Fix | Delete
return;
[59099] Fix | Delete
}
[59100] Fix | Delete
event.preventDefault();
[59101] Fix | Delete
if (event.type === 'copy' || event.type === 'cut') {
[59102] Fix | Delete
if (selectedBlockClientIds.length === 1) {
[59103] Fix | Delete
flashBlock(selectedBlockClientIds[0]);
[59104] Fix | Delete
}
[59105] Fix | Delete
notifyCopy(event.type, selectedBlockClientIds);
[59106] Fix | Delete
const blocks = getBlocksByClientId(selectedBlockClientIds);
[59107] Fix | Delete
setClipboardBlocks(event, blocks, registry);
[59108] Fix | Delete
}
[59109] Fix | Delete
if (event.type === 'cut') {
[59110] Fix | Delete
var _getPreviousBlockClie;
[59111] Fix | Delete
// Don't update the selection if the blocks cannot be deleted.
[59112] Fix | Delete
if (!canRemoveBlocks(selectedBlockClientIds)) {
[59113] Fix | Delete
return;
[59114] Fix | Delete
}
[59115] Fix | Delete
let blockToFocus = (_getPreviousBlockClie = getPreviousBlockClientId(firstBlockClientId)) !== null && _getPreviousBlockClie !== void 0 ? _getPreviousBlockClie :
[59116] Fix | Delete
// If the previous block is not found (when the first block is deleted),
[59117] Fix | Delete
// fallback to focus the parent block.
[59118] Fix | Delete
firstBlockRootClientId;
[59119] Fix | Delete
[59120] Fix | Delete
// Remove blocks, but don't update selection, and it will be handled below.
[59121] Fix | Delete
removeBlocks(selectedBlockClientIds, false);
[59122] Fix | Delete
[59123] Fix | Delete
// Update the selection if the original selection has been removed.
[59124] Fix | Delete
const shouldUpdateSelection = originallySelectedBlockClientIds.length > 0 && getSelectedBlockClientIds().length === 0;
[59125] Fix | Delete
[59126] Fix | Delete
// If there's no previous block nor parent block, focus the first block.
[59127] Fix | Delete
if (!blockToFocus) {
[59128] Fix | Delete
blockToFocus = getBlockOrder()[0];
[59129] Fix | Delete
}
[59130] Fix | Delete
updateFocusAndSelection(blockToFocus, shouldUpdateSelection);
[59131] Fix | Delete
} else if (event.type === 'paste') {
[59132] Fix | Delete
const {
[59133] Fix | Delete
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML
[59134] Fix | Delete
} = getSettings();
[59135] Fix | Delete
const blocks = getPasteBlocks(event, canUserUseUnfilteredHTML);
[59136] Fix | Delete
if (selectedBlockClientIds.length === 1) {
[59137] Fix | Delete
const [selectedBlockClientId] = selectedBlockClientIds;
[59138] Fix | Delete
[59139] Fix | Delete
// If a single block is focused, and the blocks to be posted can
[59140] Fix | Delete
// be inserted within the block, then append the pasted blocks
[59141] Fix | Delete
// within the focused block. For example, if you have copied a paragraph
[59142] Fix | Delete
// block and paste it within a single Group block, this will append
[59143] Fix | Delete
// the paragraph block within the Group block.
[59144] Fix | Delete
if (blocks.every(block => canInsertBlockType(block.name, selectedBlockClientId))) {
[59145] Fix | Delete
insertBlocks(blocks, undefined, selectedBlockClientId);
[59146] Fix | Delete
updateFocusAndSelection(blocks[0]?.clientId, false);
[59147] Fix | Delete
return;
[59148] Fix | Delete
}
[59149] Fix | Delete
}
[59150] Fix | Delete
replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1);
[59151] Fix | Delete
updateFocusAndSelection(blocks[0]?.clientId, false);
[59152] Fix | Delete
}
[59153] Fix | Delete
}
[59154] Fix | Delete
node.ownerDocument.addEventListener('copy', handler);
[59155] Fix | Delete
node.ownerDocument.addEventListener('cut', handler);
[59156] Fix | Delete
node.ownerDocument.addEventListener('paste', handler);
[59157] Fix | Delete
return () => {
[59158] Fix | Delete
node.ownerDocument.removeEventListener('copy', handler);
[59159] Fix | Delete
node.ownerDocument.removeEventListener('cut', handler);
[59160] Fix | Delete
node.ownerDocument.removeEventListener('paste', handler);
[59161] Fix | Delete
};
[59162] Fix | Delete
}, []);
[59163] Fix | Delete
}
[59164] Fix | Delete
[59165] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js
[59166] Fix | Delete
/**
[59167] Fix | Delete
* External dependencies
[59168] Fix | Delete
*/
[59169] Fix | Delete
[59170] Fix | Delete
[59171] Fix | Delete
/**
[59172] Fix | Delete
* WordPress dependencies
[59173] Fix | Delete
*/
[59174] Fix | Delete
[59175] Fix | Delete
[59176] Fix | Delete
[59177] Fix | Delete
[59178] Fix | Delete
[59179] Fix | Delete
[59180] Fix | Delete
[59181] Fix | Delete
/**
[59182] Fix | Delete
* Internal dependencies
[59183] Fix | Delete
*/
[59184] Fix | Delete
[59185] Fix | Delete
[59186] Fix | Delete
[59187] Fix | Delete
[59188] Fix | Delete
[59189] Fix | Delete
[59190] Fix | Delete
[59191] Fix | Delete
[59192] Fix | Delete
[59193] Fix | Delete
[59194] Fix | Delete
[59195] Fix | Delete
[59196] Fix | Delete
[59197] Fix | Delete
[59198] Fix | Delete
[59199] Fix | Delete
const expanded = (state, action) => {
[59200] Fix | Delete
if (action.type === 'clear') {
[59201] Fix | Delete
return {};
[59202] Fix | Delete
}
[59203] Fix | Delete
if (Array.isArray(action.clientIds)) {
[59204] Fix | Delete
return {
[59205] Fix | Delete
...state,
[59206] Fix | Delete
...action.clientIds.reduce((newState, id) => ({
[59207] Fix | Delete
...newState,
[59208] Fix | Delete
[id]: action.type === 'expand'
[59209] Fix | Delete
}), {})
[59210] Fix | Delete
};
[59211] Fix | Delete
}
[59212] Fix | Delete
return state;
[59213] Fix | Delete
};
[59214] Fix | Delete
const BLOCK_LIST_ITEM_HEIGHT = 32;
[59215] Fix | Delete
[59216] Fix | Delete
/** @typedef {import('react').ComponentType} ComponentType */
[59217] Fix | Delete
/** @typedef {import('react').Ref<HTMLElement>} Ref */
[59218] Fix | Delete
[59219] Fix | Delete
/**
[59220] Fix | Delete
* Show a hierarchical list of blocks.
[59221] Fix | Delete
*
[59222] Fix | Delete
* @param {Object} props Components props.
[59223] Fix | Delete
* @param {string} props.id An HTML element id for the root element of ListView.
[59224] Fix | Delete
* @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.
[59225] Fix | Delete
* @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.
[59226] Fix | Delete
* @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.
[59227] Fix | Delete
* @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.
[59228] Fix | Delete
* @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.
[59229] Fix | Delete
* @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.
[59230] Fix | Delete
* @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.
[59231] Fix | Delete
* @param {string} props.description Optional accessible description for the tree grid component.
[59232] Fix | Delete
* @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.
[59233] Fix | Delete
* @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.
[59234] Fix | Delete
* @param {Ref} ref Forwarded ref
[59235] Fix | Delete
*/
[59236] Fix | Delete
function ListViewComponent({
[59237] Fix | Delete
id,
[59238] Fix | Delete
blocks,
[59239] Fix | Delete
dropZoneElement,
[59240] Fix | Delete
showBlockMovers = false,
[59241] Fix | Delete
isExpanded = false,
[59242] Fix | Delete
showAppender = false,
[59243] Fix | Delete
blockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,
[59244] Fix | Delete
rootClientId,
[59245] Fix | Delete
description,
[59246] Fix | Delete
onSelect,
[59247] Fix | Delete
additionalBlockContent: AdditionalBlockContent
[59248] Fix | Delete
}, ref) {
[59249] Fix | Delete
// This can be removed once we no longer need to support the blocks prop.
[59250] Fix | Delete
if (blocks) {
[59251] Fix | Delete
external_wp_deprecated_default()('`blocks` property in `wp.blockEditor.__experimentalListView`', {
[59252] Fix | Delete
since: '6.3',
[59253] Fix | Delete
alternative: '`rootClientId` property'
[59254] Fix | Delete
});
[59255] Fix | Delete
}
[59256] Fix | Delete
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewComponent);
[59257] Fix | Delete
const {
[59258] Fix | Delete
clientIdsTree,
[59259] Fix | Delete
draggedClientIds,
[59260] Fix | Delete
selectedClientIds
[59261] Fix | Delete
} = useListViewClientIds({
[59262] Fix | Delete
blocks,
[59263] Fix | Delete
rootClientId
[59264] Fix | Delete
});
[59265] Fix | Delete
const blockIndexes = useListViewBlockIndexes(clientIdsTree);
[59266] Fix | Delete
const {
[59267] Fix | Delete
getBlock
[59268] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[59269] Fix | Delete
const {
[59270] Fix | Delete
visibleBlockCount,
[59271] Fix | Delete
shouldShowInnerBlocks
[59272] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[59273] Fix | Delete
const {
[59274] Fix | Delete
getGlobalBlockCount,
[59275] Fix | Delete
getClientIdsOfDescendants,
[59276] Fix | Delete
__unstableGetEditorMode
[59277] Fix | Delete
} = select(store);
[59278] Fix | Delete
const draggedBlockCount = draggedClientIds?.length > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0;
[59279] Fix | Delete
return {
[59280] Fix | Delete
visibleBlockCount: getGlobalBlockCount() - draggedBlockCount,
[59281] Fix | Delete
shouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out'
[59282] Fix | Delete
};
[59283] Fix | Delete
}, [draggedClientIds]);
[59284] Fix | Delete
const {
[59285] Fix | Delete
updateBlockSelection
[59286] Fix | Delete
} = useBlockSelection();
[59287] Fix | Delete
const [expandedState, setExpandedState] = (0,external_wp_element_namespaceObject.useReducer)(expanded, {});
[59288] Fix | Delete
const [insertedBlock, setInsertedBlock] = (0,external_wp_element_namespaceObject.useState)(null);
[59289] Fix | Delete
const {
[59290] Fix | Delete
setSelectedTreeId
[59291] Fix | Delete
} = useListViewExpandSelectedItem({
[59292] Fix | Delete
firstSelectedBlockClientId: selectedClientIds[0],
[59293] Fix | Delete
setExpandedState
[59294] Fix | Delete
});
[59295] Fix | Delete
const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(
[59296] Fix | Delete
/**
[59297] Fix | Delete
* @param {MouseEvent | KeyboardEvent | undefined} event
[59298] Fix | Delete
* @param {string} blockClientId
[59299] Fix | Delete
* @param {null | undefined | -1 | 1} focusPosition
[59300] Fix | Delete
*/
[59301] Fix | Delete
(event, blockClientId, focusPosition) => {
[59302] Fix | Delete
updateBlockSelection(event, blockClientId, null, focusPosition);
[59303] Fix | Delete
setSelectedTreeId(blockClientId);
[59304] Fix | Delete
if (onSelect) {
[59305] Fix | Delete
onSelect(getBlock(blockClientId));
[59306] Fix | Delete
}
[59307] Fix | Delete
}, [setSelectedTreeId, updateBlockSelection, onSelect, getBlock]);
[59308] Fix | Delete
const {
[59309] Fix | Delete
ref: dropZoneRef,
[59310] Fix | Delete
target: blockDropTarget
[59311] Fix | Delete
} = useListViewDropZone({
[59312] Fix | Delete
dropZoneElement,
[59313] Fix | Delete
expandedState,
[59314] Fix | Delete
setExpandedState
[59315] Fix | Delete
});
[59316] Fix | Delete
const elementRef = (0,external_wp_element_namespaceObject.useRef)();
[59317] Fix | Delete
[59318] Fix | Delete
// Allow handling of copy, cut, and paste events.
[59319] Fix | Delete
const clipBoardRef = use_clipboard_handler_useClipboardHandler({
[59320] Fix | Delete
selectBlock: selectEditorBlock
[59321] Fix | Delete
});
[59322] Fix | Delete
const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([clipBoardRef, elementRef, dropZoneRef, ref]);
[59323] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[59324] Fix | Delete
// If a blocks are already selected when the list view is initially
[59325] Fix | Delete
// mounted, shift focus to the first selected block.
[59326] Fix | Delete
if (selectedClientIds?.length) {
[59327] Fix | Delete
focusListItem(selectedClientIds[0], elementRef?.current);
[59328] Fix | Delete
}
[59329] Fix | Delete
// Disable reason: Only focus on the selected item when the list view is mounted.
[59330] Fix | Delete
// eslint-disable-next-line react-hooks/exhaustive-deps
[59331] Fix | Delete
}, []);
[59332] Fix | Delete
const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
[59333] Fix | Delete
if (!clientId) {
[59334] Fix | Delete
return;
[59335] Fix | Delete
}
[59336] Fix | Delete
const clientIds = Array.isArray(clientId) ? clientId : [clientId];
[59337] Fix | Delete
setExpandedState({
[59338] Fix | Delete
type: 'expand',
[59339] Fix | Delete
clientIds
[59340] Fix | Delete
});
[59341] Fix | Delete
}, [setExpandedState]);
[59342] Fix | Delete
const collapse = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
[59343] Fix | Delete
if (!clientId) {
[59344] Fix | Delete
return;
[59345] Fix | Delete
}
[59346] Fix | Delete
setExpandedState({
[59347] Fix | Delete
type: 'collapse',
[59348] Fix | Delete
clientIds: [clientId]
[59349] Fix | Delete
});
[59350] Fix | Delete
}, [setExpandedState]);
[59351] Fix | Delete
const collapseAll = (0,external_wp_element_namespaceObject.useCallback)(() => {
[59352] Fix | Delete
setExpandedState({
[59353] Fix | Delete
type: 'clear'
[59354] Fix | Delete
});
[59355] Fix | Delete
}, [setExpandedState]);
[59356] Fix | Delete
const expandRow = (0,external_wp_element_namespaceObject.useCallback)(row => {
[59357] Fix | Delete
expand(row?.dataset?.block);
[59358] Fix | Delete
}, [expand]);
[59359] Fix | Delete
const collapseRow = (0,external_wp_element_namespaceObject.useCallback)(row => {
[59360] Fix | Delete
collapse(row?.dataset?.block);
[59361] Fix | Delete
}, [collapse]);
[59362] Fix | Delete
const focusRow = (0,external_wp_element_namespaceObject.useCallback)((event, startRow, endRow) => {
[59363] Fix | Delete
if (event.shiftKey) {
[59364] Fix | Delete
updateBlockSelection(event, startRow?.dataset?.block, endRow?.dataset?.block);
[59365] Fix | Delete
}
[59366] Fix | Delete
}, [updateBlockSelection]);
[59367] Fix | Delete
useListViewCollapseItems({
[59368] Fix | Delete
collapseAll,
[59369] Fix | Delete
expand
[59370] Fix | Delete
});
[59371] Fix | Delete
const firstDraggedBlockClientId = draggedClientIds?.[0];
[59372] Fix | Delete
[59373] Fix | Delete
// Convert a blockDropTarget into indexes relative to the blocks in the list view.
[59374] Fix | Delete
// These values are used to determine which blocks should be displaced to make room
[59375] Fix | Delete
// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.
[59376] Fix | Delete
const {
[59377] Fix | Delete
blockDropTargetIndex,
[59378] Fix | Delete
blockDropPosition,
[59379] Fix | Delete
firstDraggedBlockIndex
[59380] Fix | Delete
} = (0,external_wp_element_namespaceObject.useMemo)(() => {
[59381] Fix | Delete
let _blockDropTargetIndex, _firstDraggedBlockIndex;
[59382] Fix | Delete
if (blockDropTarget?.clientId) {
[59383] Fix | Delete
const foundBlockIndex = blockIndexes[blockDropTarget.clientId];
[59384] Fix | Delete
// If dragging below or inside the block, treat the drop target as the next block.
[59385] Fix | Delete
_blockDropTargetIndex = foundBlockIndex === undefined || blockDropTarget?.dropPosition === 'top' ? foundBlockIndex : foundBlockIndex + 1;
[59386] Fix | Delete
} else if (blockDropTarget === null) {
[59387] Fix | Delete
// A `null` value is used to indicate that the user is dragging outside of the list view.
[59388] Fix | Delete
_blockDropTargetIndex = null;
[59389] Fix | Delete
}
[59390] Fix | Delete
if (firstDraggedBlockClientId) {
[59391] Fix | Delete
const foundBlockIndex = blockIndexes[firstDraggedBlockClientId];
[59392] Fix | Delete
_firstDraggedBlockIndex = foundBlockIndex === undefined || blockDropTarget?.dropPosition === 'top' ? foundBlockIndex : foundBlockIndex + 1;
[59393] Fix | Delete
}
[59394] Fix | Delete
return {
[59395] Fix | Delete
blockDropTargetIndex: _blockDropTargetIndex,
[59396] Fix | Delete
blockDropPosition: blockDropTarget?.dropPosition,
[59397] Fix | Delete
firstDraggedBlockIndex: _firstDraggedBlockIndex
[59398] Fix | Delete
};
[59399] Fix | Delete
}, [blockDropTarget, blockIndexes, firstDraggedBlockClientId]);
[59400] Fix | Delete
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[59401] Fix | Delete
blockDropPosition,
[59402] Fix | Delete
blockDropTargetIndex,
[59403] Fix | Delete
blockIndexes,
[59404] Fix | Delete
draggedClientIds,
[59405] Fix | Delete
expandedState,
[59406] Fix | Delete
expand,
[59407] Fix | Delete
firstDraggedBlockIndex,
[59408] Fix | Delete
collapse,
[59409] Fix | Delete
collapseAll,
[59410] Fix | Delete
BlockSettingsMenu,
[59411] Fix | Delete
listViewInstanceId: instanceId,
[59412] Fix | Delete
AdditionalBlockContent,
[59413] Fix | Delete
insertedBlock,
[59414] Fix | Delete
setInsertedBlock,
[59415] Fix | Delete
treeGridElementRef: elementRef,
[59416] Fix | Delete
rootClientId
[59417] Fix | Delete
}), [blockDropPosition, blockDropTargetIndex, blockIndexes, draggedClientIds, expandedState, expand, firstDraggedBlockIndex, collapse, collapseAll, BlockSettingsMenu, instanceId, AdditionalBlockContent, insertedBlock, setInsertedBlock, rootClientId]);
[59418] Fix | Delete
[59419] Fix | Delete
// List View renders a fixed number of items and relies on each having a fixed item height of 36px.
[59420] Fix | Delete
// If this value changes, we should also change the itemHeight value set in useFixedWindowList.
[59421] Fix | Delete
// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.
[59422] Fix | Delete
const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, BLOCK_LIST_ITEM_HEIGHT, visibleBlockCount, {
[59423] Fix | Delete
// Ensure that the windowing logic is recalculated when the expanded state changes.
[59424] Fix | Delete
// This is necessary because expanding a collapsed block in a short list view can
[59425] Fix | Delete
// switch the list view to a tall list view with a scrollbar, and vice versa.
[59426] Fix | Delete
// When this happens, the windowing logic needs to be recalculated to ensure that
[59427] Fix | Delete
// the correct number of blocks are rendered, by rechecking for a scroll container.
[59428] Fix | Delete
expandedState,
[59429] Fix | Delete
useWindowing: true,
[59430] Fix | Delete
windowOverscan: 40
[59431] Fix | Delete
});
[59432] Fix | Delete
[59433] Fix | Delete
// If there are no blocks to show and we're not showing the appender, do not render the list view.
[59434] Fix | Delete
if (!clientIdsTree.length && !showAppender) {
[59435] Fix | Delete
return null;
[59436] Fix | Delete
}
[59437] Fix | Delete
const describedById = description && `block-editor-list-view-description-${instanceId}`;
[59438] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, {
[59439] Fix | Delete
value: true,
[59440] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewDropIndicatorPreview, {
[59441] Fix | Delete
draggedBlockClientId: firstDraggedBlockClientId,
[59442] Fix | Delete
listViewRef: elementRef,
[59443] Fix | Delete
blockDropTarget: blockDropTarget
[59444] Fix | Delete
}), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
[59445] Fix | Delete
id: describedById,
[59446] Fix | Delete
children: description
[59447] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGrid, {
[59448] Fix | Delete
id: id,
[59449] Fix | Delete
className: dist_clsx('block-editor-list-view-tree', {
[59450] Fix | Delete
'is-dragging': draggedClientIds?.length > 0 && blockDropTargetIndex !== undefined
[59451] Fix | Delete
}),
[59452] Fix | Delete
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
[59453] Fix | Delete
ref: treeGridRef,
[59454] Fix | Delete
onCollapseRow: collapseRow,
[59455] Fix | Delete
onExpandRow: expandRow,
[59456] Fix | Delete
onFocusRow: focusRow,
[59457] Fix | Delete
applicationAriaLabel: (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
[59458] Fix | Delete
"aria-describedby": describedById,
[59459] Fix | Delete
style: {
[59460] Fix | Delete
'--wp-admin--list-view-dragged-items-height': draggedClientIds?.length ? `${BLOCK_LIST_ITEM_HEIGHT * (draggedClientIds.length - 1)}px` : null
[59461] Fix | Delete
},
[59462] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewContext.Provider, {
[59463] Fix | Delete
value: contextValue,
[59464] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(branch, {
[59465] Fix | Delete
blocks: clientIdsTree,
[59466] Fix | Delete
parentId: rootClientId,
[59467] Fix | Delete
selectBlock: selectEditorBlock,
[59468] Fix | Delete
showBlockMovers: showBlockMovers,
[59469] Fix | Delete
fixedListWindow: fixedListWindow,
[59470] Fix | Delete
selectedClientIds: selectedClientIds,
[59471] Fix | Delete
isExpanded: isExpanded,
[59472] Fix | Delete
shouldShowInnerBlocks: shouldShowInnerBlocks,
[59473] Fix | Delete
showAppender: showAppender
[59474] Fix | Delete
})
[59475] Fix | Delete
})
[59476] Fix | Delete
})]
[59477] Fix | Delete
});
[59478] Fix | Delete
}
[59479] Fix | Delete
[59480] Fix | Delete
// This is the private API for the ListView component.
[59481] Fix | Delete
// It allows access to all props, not just the public ones.
[59482] Fix | Delete
const PrivateListView = (0,external_wp_element_namespaceObject.forwardRef)(ListViewComponent);
[59483] Fix | Delete
[59484] Fix | Delete
// This is the public API for the ListView component.
[59485] Fix | Delete
// We wrap the PrivateListView component to hide some props from the public API.
[59486] Fix | Delete
/* harmony default export */ const components_list_view = ((0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
[59487] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, {
[59488] Fix | Delete
ref: ref,
[59489] Fix | Delete
...props,
[59490] Fix | Delete
showAppender: false,
[59491] Fix | Delete
rootClientId: null,
[59492] Fix | Delete
onSelect: null,
[59493] Fix | Delete
additionalBlockContent: null,
[59494] Fix | Delete
blockSettingsMenu: undefined
[59495] Fix | Delete
});
[59496] Fix | Delete
}));
[59497] Fix | Delete
[59498] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-navigation/dropdown.js
[59499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function