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
if (dropZoneElement && parentBlockOrientation === 'horizontal') {
[50000] Fix | Delete
const rect = dropZoneElement.getBoundingClientRect();
[50001] Fix | Delete
const [distance, edge] = getDistanceToNearestEdge(position, rect, ['left', 'right']);
[50002] Fix | Delete
[50003] Fix | Delete
// If dragging over the left or right of the drop zone, insert the block
[50004] Fix | Delete
// before or after the parent block. This only applies to blocks that use
[50005] Fix | Delete
// a drop zone element, typically container blocks such as Group.
[50006] Fix | Delete
if (rect.width > MINIMUM_WIDTH_FOR_THRESHOLD && distance < THRESHOLD_DISTANCE) {
[50007] Fix | Delete
if (isRightToLeft && edge === 'right' || !isRightToLeft && edge === 'left') {
[50008] Fix | Delete
return [rootBlockIndex, 'before'];
[50009] Fix | Delete
}
[50010] Fix | Delete
if (isRightToLeft && edge === 'left' || !isRightToLeft && edge === 'right') {
[50011] Fix | Delete
return [rootBlockIndex + 1, 'after'];
[50012] Fix | Delete
}
[50013] Fix | Delete
}
[50014] Fix | Delete
}
[50015] Fix | Delete
blocksData.forEach(({
[50016] Fix | Delete
isUnmodifiedDefaultBlock,
[50017] Fix | Delete
getBoundingClientRect,
[50018] Fix | Delete
blockIndex,
[50019] Fix | Delete
blockOrientation
[50020] Fix | Delete
}) => {
[50021] Fix | Delete
const rect = getBoundingClientRect();
[50022] Fix | Delete
let [distance, edge] = getDistanceToNearestEdge(position, rect, allowedEdges);
[50023] Fix | Delete
// If the the point is close to a side, prioritize that side.
[50024] Fix | Delete
const [sideDistance, sideEdge] = getDistanceToNearestEdge(position, rect, ['left', 'right']);
[50025] Fix | Delete
const isPointInsideRect = isPointContainedByRect(position, rect);
[50026] Fix | Delete
[50027] Fix | Delete
// Prioritize the element if the point is inside of an unmodified default block.
[50028] Fix | Delete
if (isUnmodifiedDefaultBlock && isPointInsideRect) {
[50029] Fix | Delete
distance = 0;
[50030] Fix | Delete
} else if (orientation === 'vertical' && blockOrientation !== 'horizontal' && (isPointInsideRect && sideDistance < THRESHOLD_DISTANCE || !isPointInsideRect && isPointWithinTopAndBottomBoundariesOfRect(position, rect))) {
[50031] Fix | Delete
/**
[50032] Fix | Delete
* This condition should only apply when the layout is vertical (otherwise there's
[50033] Fix | Delete
* no need to create a Row) and dropzones should only activate when the block is
[50034] Fix | Delete
* either within and close to the sides of the target block or on its outer sides.
[50035] Fix | Delete
*/
[50036] Fix | Delete
targetBlockIndex = blockIndex;
[50037] Fix | Delete
nearestSide = sideEdge;
[50038] Fix | Delete
}
[50039] Fix | Delete
if (distance < minDistance) {
[50040] Fix | Delete
// Where the dropped block will be inserted on the nearest block.
[50041] Fix | Delete
insertPosition = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left' ? 'after' : 'before';
[50042] Fix | Delete
[50043] Fix | Delete
// Update the currently known best candidate.
[50044] Fix | Delete
minDistance = distance;
[50045] Fix | Delete
nearestIndex = blockIndex;
[50046] Fix | Delete
}
[50047] Fix | Delete
});
[50048] Fix | Delete
const adjacentIndex = nearestIndex + (insertPosition === 'after' ? 1 : -1);
[50049] Fix | Delete
const isNearestBlockUnmodifiedDefaultBlock = !!blocksData[nearestIndex]?.isUnmodifiedDefaultBlock;
[50050] Fix | Delete
const isAdjacentBlockUnmodifiedDefaultBlock = !!blocksData[adjacentIndex]?.isUnmodifiedDefaultBlock;
[50051] Fix | Delete
[50052] Fix | Delete
// If the target index is set then group with the block at that index.
[50053] Fix | Delete
if (targetBlockIndex !== null) {
[50054] Fix | Delete
return [targetBlockIndex, 'group', nearestSide];
[50055] Fix | Delete
}
[50056] Fix | Delete
// If both blocks are not unmodified default blocks then just insert between them.
[50057] Fix | Delete
if (!isNearestBlockUnmodifiedDefaultBlock && !isAdjacentBlockUnmodifiedDefaultBlock) {
[50058] Fix | Delete
// If the user is dropping to the trailing edge of the block
[50059] Fix | Delete
// add 1 to the index to represent dragging after.
[50060] Fix | Delete
const insertionIndex = insertPosition === 'after' ? nearestIndex + 1 : nearestIndex;
[50061] Fix | Delete
return [insertionIndex, 'insert'];
[50062] Fix | Delete
}
[50063] Fix | Delete
[50064] Fix | Delete
// Otherwise, replace the nearest unmodified default block.
[50065] Fix | Delete
return [isNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex, 'replace'];
[50066] Fix | Delete
}
[50067] Fix | Delete
[50068] Fix | Delete
/**
[50069] Fix | Delete
* Check if the dragged blocks can be dropped on the target.
[50070] Fix | Delete
* @param {Function} getBlockType
[50071] Fix | Delete
* @param {Object[]} allowedBlocks
[50072] Fix | Delete
* @param {string[]} draggedBlockNames
[50073] Fix | Delete
* @param {string} targetBlockName
[50074] Fix | Delete
* @return {boolean} Whether the dragged blocks can be dropped on the target.
[50075] Fix | Delete
*/
[50076] Fix | Delete
function isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName) {
[50077] Fix | Delete
// At root level allowedBlocks is undefined and all blocks are allowed.
[50078] Fix | Delete
// Otherwise, check if all dragged blocks are allowed.
[50079] Fix | Delete
let areBlocksAllowed = true;
[50080] Fix | Delete
if (allowedBlocks) {
[50081] Fix | Delete
const allowedBlockNames = allowedBlocks?.map(({
[50082] Fix | Delete
name
[50083] Fix | Delete
}) => name);
[50084] Fix | Delete
areBlocksAllowed = draggedBlockNames.every(name => allowedBlockNames?.includes(name));
[50085] Fix | Delete
}
[50086] Fix | Delete
[50087] Fix | Delete
// Work out if dragged blocks have an allowed parent and if so
[50088] Fix | Delete
// check target block matches the allowed parent.
[50089] Fix | Delete
const draggedBlockTypes = draggedBlockNames.map(name => getBlockType(name));
[50090] Fix | Delete
const targetMatchesDraggedBlockParents = draggedBlockTypes.every(block => {
[50091] Fix | Delete
const [allowedParentName] = block?.parent || [];
[50092] Fix | Delete
if (!allowedParentName) {
[50093] Fix | Delete
return true;
[50094] Fix | Delete
}
[50095] Fix | Delete
return allowedParentName === targetBlockName;
[50096] Fix | Delete
});
[50097] Fix | Delete
return areBlocksAllowed && targetMatchesDraggedBlockParents;
[50098] Fix | Delete
}
[50099] Fix | Delete
[50100] Fix | Delete
/**
[50101] Fix | Delete
* @typedef {Object} WPBlockDropZoneConfig
[50102] Fix | Delete
* @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone.
[50103] Fix | Delete
* @property {string} rootClientId The root client id for the block list.
[50104] Fix | Delete
*/
[50105] Fix | Delete
[50106] Fix | Delete
/**
[50107] Fix | Delete
* A React hook that can be used to make a block list handle drag and drop.
[50108] Fix | Delete
*
[50109] Fix | Delete
* @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
[50110] Fix | Delete
*/
[50111] Fix | Delete
function useBlockDropZone({
[50112] Fix | Delete
dropZoneElement,
[50113] Fix | Delete
// An undefined value represents a top-level block. Default to an empty
[50114] Fix | Delete
// string for this so that `targetRootClientId` can be easily compared to
[50115] Fix | Delete
// values returned by the `getRootBlockClientId` selector, which also uses
[50116] Fix | Delete
// an empty string to represent top-level blocks.
[50117] Fix | Delete
rootClientId: targetRootClientId = '',
[50118] Fix | Delete
parentClientId: parentBlockClientId = '',
[50119] Fix | Delete
isDisabled = false
[50120] Fix | Delete
} = {}) {
[50121] Fix | Delete
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
[50122] Fix | Delete
const [dropTarget, setDropTarget] = (0,external_wp_element_namespaceObject.useState)({
[50123] Fix | Delete
index: null,
[50124] Fix | Delete
operation: 'insert'
[50125] Fix | Delete
});
[50126] Fix | Delete
const {
[50127] Fix | Delete
getBlockType
[50128] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store);
[50129] Fix | Delete
const {
[50130] Fix | Delete
getBlockListSettings,
[50131] Fix | Delete
getBlocks,
[50132] Fix | Delete
getBlockIndex,
[50133] Fix | Delete
getDraggedBlockClientIds,
[50134] Fix | Delete
getBlockNamesByClientId,
[50135] Fix | Delete
getAllowedBlocks,
[50136] Fix | Delete
isDragging
[50137] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useSelect)(store));
[50138] Fix | Delete
const {
[50139] Fix | Delete
showInsertionPoint,
[50140] Fix | Delete
hideInsertionPoint,
[50141] Fix | Delete
startDragging,
[50142] Fix | Delete
stopDragging
[50143] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[50144] Fix | Delete
const onBlockDrop = useOnBlockDrop(dropTarget.operation === 'before' || dropTarget.operation === 'after' ? parentBlockClientId : targetRootClientId, dropTarget.index, {
[50145] Fix | Delete
operation: dropTarget.operation,
[50146] Fix | Delete
nearestSide: dropTarget.nearestSide
[50147] Fix | Delete
});
[50148] Fix | Delete
const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, ownerDocument) => {
[50149] Fix | Delete
if (!isDragging()) {
[50150] Fix | Delete
// When dragging from the desktop, no drag start event is fired.
[50151] Fix | Delete
// So, ensure that the drag state is set when the user drags over a drop zone.
[50152] Fix | Delete
startDragging();
[50153] Fix | Delete
}
[50154] Fix | Delete
const allowedBlocks = getAllowedBlocks(targetRootClientId);
[50155] Fix | Delete
const targetBlockName = getBlockNamesByClientId([targetRootClientId])[0];
[50156] Fix | Delete
const draggedBlockNames = getBlockNamesByClientId(getDraggedBlockClientIds());
[50157] Fix | Delete
const isBlockDroppingAllowed = isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName);
[50158] Fix | Delete
if (!isBlockDroppingAllowed) {
[50159] Fix | Delete
return;
[50160] Fix | Delete
}
[50161] Fix | Delete
const blocks = getBlocks(targetRootClientId);
[50162] Fix | Delete
[50163] Fix | Delete
// The block list is empty, don't show the insertion point but still allow dropping.
[50164] Fix | Delete
if (blocks.length === 0) {
[50165] Fix | Delete
registry.batch(() => {
[50166] Fix | Delete
setDropTarget({
[50167] Fix | Delete
index: 0,
[50168] Fix | Delete
operation: 'insert'
[50169] Fix | Delete
});
[50170] Fix | Delete
showInsertionPoint(targetRootClientId, 0, {
[50171] Fix | Delete
operation: 'insert'
[50172] Fix | Delete
});
[50173] Fix | Delete
});
[50174] Fix | Delete
return;
[50175] Fix | Delete
}
[50176] Fix | Delete
const blocksData = blocks.map(block => {
[50177] Fix | Delete
const clientId = block.clientId;
[50178] Fix | Delete
return {
[50179] Fix | Delete
isUnmodifiedDefaultBlock: (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block),
[50180] Fix | Delete
getBoundingClientRect: () => ownerDocument.getElementById(`block-${clientId}`).getBoundingClientRect(),
[50181] Fix | Delete
blockIndex: getBlockIndex(clientId),
[50182] Fix | Delete
blockOrientation: getBlockListSettings(clientId)?.orientation
[50183] Fix | Delete
};
[50184] Fix | Delete
});
[50185] Fix | Delete
const [targetIndex, operation, nearestSide] = getDropTargetPosition(blocksData, {
[50186] Fix | Delete
x: event.clientX,
[50187] Fix | Delete
y: event.clientY
[50188] Fix | Delete
}, getBlockListSettings(targetRootClientId)?.orientation, {
[50189] Fix | Delete
dropZoneElement,
[50190] Fix | Delete
parentBlockClientId,
[50191] Fix | Delete
parentBlockOrientation: parentBlockClientId ? getBlockListSettings(parentBlockClientId)?.orientation : undefined,
[50192] Fix | Delete
rootBlockIndex: getBlockIndex(targetRootClientId)
[50193] Fix | Delete
});
[50194] Fix | Delete
registry.batch(() => {
[50195] Fix | Delete
setDropTarget({
[50196] Fix | Delete
index: targetIndex,
[50197] Fix | Delete
operation,
[50198] Fix | Delete
nearestSide
[50199] Fix | Delete
});
[50200] Fix | Delete
const insertionPointClientId = ['before', 'after'].includes(operation) ? parentBlockClientId : targetRootClientId;
[50201] Fix | Delete
showInsertionPoint(insertionPointClientId, targetIndex, {
[50202] Fix | Delete
operation,
[50203] Fix | Delete
nearestSide
[50204] Fix | Delete
});
[50205] Fix | Delete
});
[50206] Fix | Delete
}, [getAllowedBlocks, targetRootClientId, getBlockNamesByClientId, getDraggedBlockClientIds, getBlockType, getBlocks, getBlockListSettings, dropZoneElement, parentBlockClientId, getBlockIndex, registry, showInsertionPoint, isDragging, startDragging]), 200);
[50207] Fix | Delete
return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
[50208] Fix | Delete
dropZoneElement,
[50209] Fix | Delete
isDisabled,
[50210] Fix | Delete
onDrop: onBlockDrop,
[50211] Fix | Delete
onDragOver(event) {
[50212] Fix | Delete
// `currentTarget` is only available while the event is being
[50213] Fix | Delete
// handled, so get it now and pass it to the thottled function.
[50214] Fix | Delete
// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget
[50215] Fix | Delete
throttled(event, event.currentTarget.ownerDocument);
[50216] Fix | Delete
},
[50217] Fix | Delete
onDragLeave() {
[50218] Fix | Delete
throttled.cancel();
[50219] Fix | Delete
hideInsertionPoint();
[50220] Fix | Delete
},
[50221] Fix | Delete
onDragEnd() {
[50222] Fix | Delete
throttled.cancel();
[50223] Fix | Delete
stopDragging();
[50224] Fix | Delete
hideInsertionPoint();
[50225] Fix | Delete
}
[50226] Fix | Delete
});
[50227] Fix | Delete
}
[50228] Fix | Delete
[50229] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js
[50230] Fix | Delete
/**
[50231] Fix | Delete
* External dependencies
[50232] Fix | Delete
*/
[50233] Fix | Delete
[50234] Fix | Delete
[50235] Fix | Delete
/**
[50236] Fix | Delete
* WordPress dependencies
[50237] Fix | Delete
*/
[50238] Fix | Delete
[50239] Fix | Delete
[50240] Fix | Delete
[50241] Fix | Delete
[50242] Fix | Delete
[50243] Fix | Delete
/**
[50244] Fix | Delete
* Internal dependencies
[50245] Fix | Delete
*/
[50246] Fix | Delete
[50247] Fix | Delete
[50248] Fix | Delete
[50249] Fix | Delete
[50250] Fix | Delete
[50251] Fix | Delete
[50252] Fix | Delete
[50253] Fix | Delete
[50254] Fix | Delete
[50255] Fix | Delete
[50256] Fix | Delete
[50257] Fix | Delete
[50258] Fix | Delete
[50259] Fix | Delete
const inner_blocks_EMPTY_OBJECT = {};
[50260] Fix | Delete
function BlockContext({
[50261] Fix | Delete
children,
[50262] Fix | Delete
clientId
[50263] Fix | Delete
}) {
[50264] Fix | Delete
const context = useBlockContext(clientId);
[50265] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContextProvider, {
[50266] Fix | Delete
value: context,
[50267] Fix | Delete
children: children
[50268] Fix | Delete
});
[50269] Fix | Delete
}
[50270] Fix | Delete
const BlockListItemsMemo = (0,external_wp_element_namespaceObject.memo)(BlockListItems);
[50271] Fix | Delete
[50272] Fix | Delete
/**
[50273] Fix | Delete
* InnerBlocks is a component which allows a single block to have multiple blocks
[50274] Fix | Delete
* as children. The UncontrolledInnerBlocks component is used whenever the inner
[50275] Fix | Delete
* blocks are not controlled by another entity. In other words, it is normally
[50276] Fix | Delete
* used for inner blocks in the post editor
[50277] Fix | Delete
*
[50278] Fix | Delete
* @param {Object} props The component props.
[50279] Fix | Delete
*/
[50280] Fix | Delete
function UncontrolledInnerBlocks(props) {
[50281] Fix | Delete
const {
[50282] Fix | Delete
clientId,
[50283] Fix | Delete
allowedBlocks,
[50284] Fix | Delete
prioritizedInserterBlocks,
[50285] Fix | Delete
defaultBlock,
[50286] Fix | Delete
directInsert,
[50287] Fix | Delete
__experimentalDefaultBlock,
[50288] Fix | Delete
__experimentalDirectInsert,
[50289] Fix | Delete
template,
[50290] Fix | Delete
templateLock,
[50291] Fix | Delete
wrapperRef,
[50292] Fix | Delete
templateInsertUpdatesSelection,
[50293] Fix | Delete
__experimentalCaptureToolbars: captureToolbars,
[50294] Fix | Delete
__experimentalAppenderTagName,
[50295] Fix | Delete
renderAppender,
[50296] Fix | Delete
orientation,
[50297] Fix | Delete
placeholder,
[50298] Fix | Delete
layout,
[50299] Fix | Delete
name,
[50300] Fix | Delete
blockType,
[50301] Fix | Delete
parentLock,
[50302] Fix | Delete
defaultLayout
[50303] Fix | Delete
} = props;
[50304] Fix | Delete
useNestedSettingsUpdate(clientId, parentLock, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout);
[50305] Fix | Delete
useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection);
[50306] Fix | Delete
const defaultLayoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'layout') || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalLayout') || inner_blocks_EMPTY_OBJECT;
[50307] Fix | Delete
const {
[50308] Fix | Delete
allowSizingOnChildren = false
[50309] Fix | Delete
} = defaultLayoutBlockSupport;
[50310] Fix | Delete
const usedLayout = layout || defaultLayoutBlockSupport;
[50311] Fix | Delete
const memoedLayout = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[50312] Fix | Delete
// Default layout will know about any content/wide size defined by the theme.
[50313] Fix | Delete
...defaultLayout,
[50314] Fix | Delete
...usedLayout,
[50315] Fix | Delete
...(allowSizingOnChildren && {
[50316] Fix | Delete
allowSizingOnChildren: true
[50317] Fix | Delete
})
[50318] Fix | Delete
}), [defaultLayout, usedLayout, allowSizingOnChildren]);
[50319] Fix | Delete
[50320] Fix | Delete
// For controlled inner blocks, we don't want a change in blocks to
[50321] Fix | Delete
// re-render the blocks list.
[50322] Fix | Delete
const items = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItemsMemo, {
[50323] Fix | Delete
rootClientId: clientId,
[50324] Fix | Delete
renderAppender: renderAppender,
[50325] Fix | Delete
__experimentalAppenderTagName: __experimentalAppenderTagName,
[50326] Fix | Delete
layout: memoedLayout,
[50327] Fix | Delete
wrapperRef: wrapperRef,
[50328] Fix | Delete
placeholder: placeholder
[50329] Fix | Delete
});
[50330] Fix | Delete
if (Object.keys(blockType.providesContext).length === 0) {
[50331] Fix | Delete
return items;
[50332] Fix | Delete
}
[50333] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContext, {
[50334] Fix | Delete
clientId: clientId,
[50335] Fix | Delete
children: items
[50336] Fix | Delete
});
[50337] Fix | Delete
}
[50338] Fix | Delete
[50339] Fix | Delete
/**
[50340] Fix | Delete
* The controlled inner blocks component wraps the uncontrolled inner blocks
[50341] Fix | Delete
* component with the blockSync hook. This keeps the innerBlocks of the block in
[50342] Fix | Delete
* the block-editor store in sync with the blocks of the controlling entity. An
[50343] Fix | Delete
* example of an inner block controller is a template part block, which provides
[50344] Fix | Delete
* its own blocks from the template part entity data source.
[50345] Fix | Delete
*
[50346] Fix | Delete
* @param {Object} props The component props.
[50347] Fix | Delete
*/
[50348] Fix | Delete
function ControlledInnerBlocks(props) {
[50349] Fix | Delete
useBlockSync(props);
[50350] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UncontrolledInnerBlocks, {
[50351] Fix | Delete
...props
[50352] Fix | Delete
});
[50353] Fix | Delete
}
[50354] Fix | Delete
const ForwardedInnerBlocks = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
[50355] Fix | Delete
const innerBlocksProps = useInnerBlocksProps({
[50356] Fix | Delete
ref
[50357] Fix | Delete
}, props);
[50358] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[50359] Fix | Delete
className: "block-editor-inner-blocks",
[50360] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[50361] Fix | Delete
...innerBlocksProps
[50362] Fix | Delete
})
[50363] Fix | Delete
});
[50364] Fix | Delete
});
[50365] Fix | Delete
[50366] Fix | Delete
/**
[50367] Fix | Delete
* This hook is used to lightly mark an element as an inner blocks wrapper
[50368] Fix | Delete
* element. Call this hook and pass the returned props to the element to mark as
[50369] Fix | Delete
* an inner blocks wrapper, automatically rendering inner blocks as children. If
[50370] Fix | Delete
* you define a ref for the element, it is important to pass the ref to this
[50371] Fix | Delete
* hook, which the hook in turn will pass to the component through the props it
[50372] Fix | Delete
* returns. Optionally, you can also pass any other props through this hook, and
[50373] Fix | Delete
* they will be merged and returned.
[50374] Fix | Delete
*
[50375] Fix | Delete
* @param {Object} props Optional. Props to pass to the element. Must contain
[50376] Fix | Delete
* the ref if one is defined.
[50377] Fix | Delete
* @param {Object} options Optional. Inner blocks options.
[50378] Fix | Delete
*
[50379] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
[50380] Fix | Delete
*/
[50381] Fix | Delete
function useInnerBlocksProps(props = {}, options = {}) {
[50382] Fix | Delete
const {
[50383] Fix | Delete
__unstableDisableLayoutClassNames,
[50384] Fix | Delete
__unstableDisableDropZone,
[50385] Fix | Delete
dropZoneElement
[50386] Fix | Delete
} = options;
[50387] Fix | Delete
const {
[50388] Fix | Delete
clientId,
[50389] Fix | Delete
layout = null,
[50390] Fix | Delete
__unstableLayoutClassNames: layoutClassNames = ''
[50391] Fix | Delete
} = useBlockEditContext();
[50392] Fix | Delete
const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
[50393] Fix | Delete
const {
[50394] Fix | Delete
getBlockName,
[50395] Fix | Delete
isBlockSelected,
[50396] Fix | Delete
hasSelectedInnerBlock,
[50397] Fix | Delete
__unstableGetEditorMode,
[50398] Fix | Delete
getTemplateLock,
[50399] Fix | Delete
getBlockRootClientId,
[50400] Fix | Delete
getBlockEditingMode,
[50401] Fix | Delete
getBlockSettings,
[50402] Fix | Delete
isDragging,
[50403] Fix | Delete
getSettings
[50404] Fix | Delete
} = unlock(select(store));
[50405] Fix | Delete
let _isDropZoneDisabled;
[50406] Fix | Delete
// In zoom out mode, we want to disable the drop zone for the sections.
[50407] Fix | Delete
// The inner blocks belonging to the section drop zone is
[50408] Fix | Delete
// already disabled by the blocks themselves being disabled.
[50409] Fix | Delete
if (__unstableGetEditorMode() === 'zoom-out') {
[50410] Fix | Delete
const {
[50411] Fix | Delete
sectionRootClientId
[50412] Fix | Delete
} = unlock(getSettings());
[50413] Fix | Delete
_isDropZoneDisabled = clientId !== sectionRootClientId;
[50414] Fix | Delete
}
[50415] Fix | Delete
if (!clientId) {
[50416] Fix | Delete
return {
[50417] Fix | Delete
isDropZoneDisabled: _isDropZoneDisabled
[50418] Fix | Delete
};
[50419] Fix | Delete
}
[50420] Fix | Delete
const {
[50421] Fix | Delete
hasBlockSupport,
[50422] Fix | Delete
getBlockType
[50423] Fix | Delete
} = select(external_wp_blocks_namespaceObject.store);
[50424] Fix | Delete
const blockName = getBlockName(clientId);
[50425] Fix | Delete
const enableClickThrough = __unstableGetEditorMode() === 'navigation';
[50426] Fix | Delete
const blockEditingMode = getBlockEditingMode(clientId);
[50427] Fix | Delete
const parentClientId = getBlockRootClientId(clientId);
[50428] Fix | Delete
const [defaultLayout] = getBlockSettings(clientId, 'layout');
[50429] Fix | Delete
if (_isDropZoneDisabled !== undefined) {
[50430] Fix | Delete
_isDropZoneDisabled = blockEditingMode === 'disabled';
[50431] Fix | Delete
}
[50432] Fix | Delete
return {
[50433] Fix | Delete
__experimentalCaptureToolbars: hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false),
[50434] Fix | Delete
hasOverlay: blockName !== 'core/template' && !isBlockSelected(clientId) && !hasSelectedInnerBlock(clientId, true) && enableClickThrough && !isDragging(),
[50435] Fix | Delete
name: blockName,
[50436] Fix | Delete
blockType: getBlockType(blockName),
[50437] Fix | Delete
parentLock: getTemplateLock(parentClientId),
[50438] Fix | Delete
parentClientId,
[50439] Fix | Delete
isDropZoneDisabled: _isDropZoneDisabled,
[50440] Fix | Delete
defaultLayout
[50441] Fix | Delete
};
[50442] Fix | Delete
}, [clientId]);
[50443] Fix | Delete
const {
[50444] Fix | Delete
__experimentalCaptureToolbars,
[50445] Fix | Delete
hasOverlay,
[50446] Fix | Delete
name,
[50447] Fix | Delete
blockType,
[50448] Fix | Delete
parentLock,
[50449] Fix | Delete
parentClientId,
[50450] Fix | Delete
isDropZoneDisabled,
[50451] Fix | Delete
defaultLayout
[50452] Fix | Delete
} = selected;
[50453] Fix | Delete
const blockDropZoneRef = useBlockDropZone({
[50454] Fix | Delete
dropZoneElement,
[50455] Fix | Delete
rootClientId: clientId,
[50456] Fix | Delete
parentClientId
[50457] Fix | Delete
});
[50458] Fix | Delete
const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, __unstableDisableDropZone || isDropZoneDisabled ? null : blockDropZoneRef]);
[50459] Fix | Delete
const innerBlocksProps = {
[50460] Fix | Delete
__experimentalCaptureToolbars,
[50461] Fix | Delete
layout,
[50462] Fix | Delete
name,
[50463] Fix | Delete
blockType,
[50464] Fix | Delete
parentLock,
[50465] Fix | Delete
defaultLayout,
[50466] Fix | Delete
...options
[50467] Fix | Delete
};
[50468] Fix | Delete
const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks;
[50469] Fix | Delete
return {
[50470] Fix | Delete
...props,
[50471] Fix | Delete
ref,
[50472] Fix | Delete
className: dist_clsx(props.className, 'block-editor-block-list__layout', __unstableDisableLayoutClassNames ? '' : layoutClassNames, {
[50473] Fix | Delete
'has-overlay': hasOverlay
[50474] Fix | Delete
}),
[50475] Fix | Delete
children: clientId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InnerBlocks, {
[50476] Fix | Delete
...innerBlocksProps,
[50477] Fix | Delete
clientId: clientId
[50478] Fix | Delete
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, {
[50479] Fix | Delete
...options
[50480] Fix | Delete
})
[50481] Fix | Delete
};
[50482] Fix | Delete
}
[50483] Fix | Delete
useInnerBlocksProps.save = external_wp_blocks_namespaceObject.__unstableGetInnerBlocksProps;
[50484] Fix | Delete
[50485] Fix | Delete
// Expose default appender placeholders as components.
[50486] Fix | Delete
ForwardedInnerBlocks.DefaultBlockAppender = default_block_appender;
[50487] Fix | Delete
ForwardedInnerBlocks.ButtonBlockAppender = inner_blocks_button_block_appender;
[50488] Fix | Delete
ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;
[50489] Fix | Delete
[50490] Fix | Delete
/**
[50491] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
[50492] Fix | Delete
*/
[50493] Fix | Delete
/* harmony default export */ const inner_blocks = (ForwardedInnerBlocks);
[50494] Fix | Delete
[50495] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/observe-typing/index.js
[50496] Fix | Delete
/**
[50497] Fix | Delete
* WordPress dependencies
[50498] Fix | Delete
*/
[50499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function