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
[50500] Fix | Delete
[50501] Fix | Delete
[50502] Fix | Delete
[50503] Fix | Delete
[50504] Fix | Delete
/**
[50505] Fix | Delete
* Internal dependencies
[50506] Fix | Delete
*/
[50507] Fix | Delete
[50508] Fix | Delete
[50509] Fix | Delete
/**
[50510] Fix | Delete
* Set of key codes upon which typing is to be initiated on a keydown event.
[50511] Fix | Delete
*
[50512] Fix | Delete
* @type {Set<number>}
[50513] Fix | Delete
*/
[50514] Fix | Delete
[50515] Fix | Delete
const KEY_DOWN_ELIGIBLE_KEY_CODES = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.RIGHT, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.ENTER, external_wp_keycodes_namespaceObject.BACKSPACE]);
[50516] Fix | Delete
[50517] Fix | Delete
/**
[50518] Fix | Delete
* Returns true if a given keydown event can be inferred as intent to start
[50519] Fix | Delete
* typing, or false otherwise. A keydown is considered eligible if it is a
[50520] Fix | Delete
* text navigation without shift active.
[50521] Fix | Delete
*
[50522] Fix | Delete
* @param {KeyboardEvent} event Keydown event to test.
[50523] Fix | Delete
*
[50524] Fix | Delete
* @return {boolean} Whether event is eligible to start typing.
[50525] Fix | Delete
*/
[50526] Fix | Delete
function isKeyDownEligibleForStartTyping(event) {
[50527] Fix | Delete
const {
[50528] Fix | Delete
keyCode,
[50529] Fix | Delete
shiftKey
[50530] Fix | Delete
} = event;
[50531] Fix | Delete
return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode);
[50532] Fix | Delete
}
[50533] Fix | Delete
[50534] Fix | Delete
/**
[50535] Fix | Delete
* Removes the `isTyping` flag when the mouse moves in the document of the given
[50536] Fix | Delete
* element.
[50537] Fix | Delete
*/
[50538] Fix | Delete
function useMouseMoveTypingReset() {
[50539] Fix | Delete
const isTyping = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isTyping(), []);
[50540] Fix | Delete
const {
[50541] Fix | Delete
stopTyping
[50542] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[50543] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[50544] Fix | Delete
if (!isTyping) {
[50545] Fix | Delete
return;
[50546] Fix | Delete
}
[50547] Fix | Delete
const {
[50548] Fix | Delete
ownerDocument
[50549] Fix | Delete
} = node;
[50550] Fix | Delete
let lastClientX;
[50551] Fix | Delete
let lastClientY;
[50552] Fix | Delete
[50553] Fix | Delete
/**
[50554] Fix | Delete
* On mouse move, unset typing flag if user has moved cursor.
[50555] Fix | Delete
*
[50556] Fix | Delete
* @param {MouseEvent} event Mousemove event.
[50557] Fix | Delete
*/
[50558] Fix | Delete
function stopTypingOnMouseMove(event) {
[50559] Fix | Delete
const {
[50560] Fix | Delete
clientX,
[50561] Fix | Delete
clientY
[50562] Fix | Delete
} = event;
[50563] Fix | Delete
[50564] Fix | Delete
// We need to check that the mouse really moved because Safari
[50565] Fix | Delete
// triggers mousemove events when shift or ctrl are pressed.
[50566] Fix | Delete
if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) {
[50567] Fix | Delete
stopTyping();
[50568] Fix | Delete
}
[50569] Fix | Delete
lastClientX = clientX;
[50570] Fix | Delete
lastClientY = clientY;
[50571] Fix | Delete
}
[50572] Fix | Delete
ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove);
[50573] Fix | Delete
return () => {
[50574] Fix | Delete
ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove);
[50575] Fix | Delete
};
[50576] Fix | Delete
}, [isTyping, stopTyping]);
[50577] Fix | Delete
}
[50578] Fix | Delete
[50579] Fix | Delete
/**
[50580] Fix | Delete
* Sets and removes the `isTyping` flag based on user actions:
[50581] Fix | Delete
*
[50582] Fix | Delete
* - Sets the flag if the user types within the given element.
[50583] Fix | Delete
* - Removes the flag when the user selects some text, focusses a non-text
[50584] Fix | Delete
* field, presses ESC or TAB, or moves the mouse in the document.
[50585] Fix | Delete
*/
[50586] Fix | Delete
function useTypingObserver() {
[50587] Fix | Delete
const {
[50588] Fix | Delete
isTyping
[50589] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[50590] Fix | Delete
const {
[50591] Fix | Delete
isTyping: _isTyping
[50592] Fix | Delete
} = select(store);
[50593] Fix | Delete
return {
[50594] Fix | Delete
isTyping: _isTyping()
[50595] Fix | Delete
};
[50596] Fix | Delete
}, []);
[50597] Fix | Delete
const {
[50598] Fix | Delete
startTyping,
[50599] Fix | Delete
stopTyping
[50600] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[50601] Fix | Delete
const ref1 = useMouseMoveTypingReset();
[50602] Fix | Delete
const ref2 = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[50603] Fix | Delete
const {
[50604] Fix | Delete
ownerDocument
[50605] Fix | Delete
} = node;
[50606] Fix | Delete
const {
[50607] Fix | Delete
defaultView
[50608] Fix | Delete
} = ownerDocument;
[50609] Fix | Delete
const selection = defaultView.getSelection();
[50610] Fix | Delete
[50611] Fix | Delete
// Listeners to stop typing should only be added when typing.
[50612] Fix | Delete
// Listeners to start typing should only be added when not typing.
[50613] Fix | Delete
if (isTyping) {
[50614] Fix | Delete
let timerId;
[50615] Fix | Delete
[50616] Fix | Delete
/**
[50617] Fix | Delete
* Stops typing when focus transitions to a non-text field element.
[50618] Fix | Delete
*
[50619] Fix | Delete
* @param {FocusEvent} event Focus event.
[50620] Fix | Delete
*/
[50621] Fix | Delete
function stopTypingOnNonTextField(event) {
[50622] Fix | Delete
const {
[50623] Fix | Delete
target
[50624] Fix | Delete
} = event;
[50625] Fix | Delete
[50626] Fix | Delete
// Since focus to a non-text field via arrow key will trigger
[50627] Fix | Delete
// before the keydown event, wait until after current stack
[50628] Fix | Delete
// before evaluating whether typing is to be stopped. Otherwise,
[50629] Fix | Delete
// typing will re-start.
[50630] Fix | Delete
timerId = defaultView.setTimeout(() => {
[50631] Fix | Delete
if (!(0,external_wp_dom_namespaceObject.isTextField)(target)) {
[50632] Fix | Delete
stopTyping();
[50633] Fix | Delete
}
[50634] Fix | Delete
});
[50635] Fix | Delete
}
[50636] Fix | Delete
[50637] Fix | Delete
/**
[50638] Fix | Delete
* Unsets typing flag if user presses Escape while typing flag is
[50639] Fix | Delete
* active.
[50640] Fix | Delete
*
[50641] Fix | Delete
* @param {KeyboardEvent} event Keypress or keydown event to
[50642] Fix | Delete
* interpret.
[50643] Fix | Delete
*/
[50644] Fix | Delete
function stopTypingOnEscapeKey(event) {
[50645] Fix | Delete
const {
[50646] Fix | Delete
keyCode
[50647] Fix | Delete
} = event;
[50648] Fix | Delete
if (keyCode === external_wp_keycodes_namespaceObject.ESCAPE || keyCode === external_wp_keycodes_namespaceObject.TAB) {
[50649] Fix | Delete
stopTyping();
[50650] Fix | Delete
}
[50651] Fix | Delete
}
[50652] Fix | Delete
[50653] Fix | Delete
/**
[50654] Fix | Delete
* On selection change, unset typing flag if user has made an
[50655] Fix | Delete
* uncollapsed (shift) selection.
[50656] Fix | Delete
*/
[50657] Fix | Delete
function stopTypingOnSelectionUncollapse() {
[50658] Fix | Delete
if (!selection.isCollapsed) {
[50659] Fix | Delete
stopTyping();
[50660] Fix | Delete
}
[50661] Fix | Delete
}
[50662] Fix | Delete
node.addEventListener('focus', stopTypingOnNonTextField);
[50663] Fix | Delete
node.addEventListener('keydown', stopTypingOnEscapeKey);
[50664] Fix | Delete
ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse);
[50665] Fix | Delete
return () => {
[50666] Fix | Delete
defaultView.clearTimeout(timerId);
[50667] Fix | Delete
node.removeEventListener('focus', stopTypingOnNonTextField);
[50668] Fix | Delete
node.removeEventListener('keydown', stopTypingOnEscapeKey);
[50669] Fix | Delete
ownerDocument.removeEventListener('selectionchange', stopTypingOnSelectionUncollapse);
[50670] Fix | Delete
};
[50671] Fix | Delete
}
[50672] Fix | Delete
[50673] Fix | Delete
/**
[50674] Fix | Delete
* Handles a keypress or keydown event to infer intention to start
[50675] Fix | Delete
* typing.
[50676] Fix | Delete
*
[50677] Fix | Delete
* @param {KeyboardEvent} event Keypress or keydown event to interpret.
[50678] Fix | Delete
*/
[50679] Fix | Delete
function startTypingInTextField(event) {
[50680] Fix | Delete
const {
[50681] Fix | Delete
type,
[50682] Fix | Delete
target
[50683] Fix | Delete
} = event;
[50684] Fix | Delete
[50685] Fix | Delete
// Abort early if already typing, or key press is incurred outside a
[50686] Fix | Delete
// text field (e.g. arrow-ing through toolbar buttons).
[50687] Fix | Delete
// Ignore typing if outside the current DOM container
[50688] Fix | Delete
if (!(0,external_wp_dom_namespaceObject.isTextField)(target) || !node.contains(target)) {
[50689] Fix | Delete
return;
[50690] Fix | Delete
}
[50691] Fix | Delete
[50692] Fix | Delete
// Special-case keydown because certain keys do not emit a keypress
[50693] Fix | Delete
// event. Conversely avoid keydown as the canonical event since
[50694] Fix | Delete
// there are many keydown which are explicitly not targeted for
[50695] Fix | Delete
// typing.
[50696] Fix | Delete
if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) {
[50697] Fix | Delete
return;
[50698] Fix | Delete
}
[50699] Fix | Delete
startTyping();
[50700] Fix | Delete
}
[50701] Fix | Delete
node.addEventListener('keypress', startTypingInTextField);
[50702] Fix | Delete
node.addEventListener('keydown', startTypingInTextField);
[50703] Fix | Delete
return () => {
[50704] Fix | Delete
node.removeEventListener('keypress', startTypingInTextField);
[50705] Fix | Delete
node.removeEventListener('keydown', startTypingInTextField);
[50706] Fix | Delete
};
[50707] Fix | Delete
}, [isTyping, startTyping, stopTyping]);
[50708] Fix | Delete
return (0,external_wp_compose_namespaceObject.useMergeRefs)([ref1, ref2]);
[50709] Fix | Delete
}
[50710] Fix | Delete
function ObserveTyping({
[50711] Fix | Delete
children
[50712] Fix | Delete
}) {
[50713] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[50714] Fix | Delete
ref: useTypingObserver(),
[50715] Fix | Delete
children: children
[50716] Fix | Delete
});
[50717] Fix | Delete
}
[50718] Fix | Delete
[50719] Fix | Delete
/**
[50720] Fix | Delete
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md
[50721] Fix | Delete
*/
[50722] Fix | Delete
/* harmony default export */ const observe_typing = (ObserveTyping);
[50723] Fix | Delete
[50724] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js
[50725] Fix | Delete
/**
[50726] Fix | Delete
* External dependencies
[50727] Fix | Delete
*/
[50728] Fix | Delete
[50729] Fix | Delete
[50730] Fix | Delete
/**
[50731] Fix | Delete
* WordPress dependencies
[50732] Fix | Delete
*/
[50733] Fix | Delete
[50734] Fix | Delete
[50735] Fix | Delete
[50736] Fix | Delete
[50737] Fix | Delete
/**
[50738] Fix | Delete
* Internal dependencies
[50739] Fix | Delete
*/
[50740] Fix | Delete
[50741] Fix | Delete
[50742] Fix | Delete
[50743] Fix | Delete
[50744] Fix | Delete
[50745] Fix | Delete
[50746] Fix | Delete
[50747] Fix | Delete
[50748] Fix | Delete
[50749] Fix | Delete
[50750] Fix | Delete
[50751] Fix | Delete
[50752] Fix | Delete
const block_list_IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)();
[50753] Fix | Delete
const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
[50754] Fix | Delete
function block_list_Root({
[50755] Fix | Delete
className,
[50756] Fix | Delete
...settings
[50757] Fix | Delete
}) {
[50758] Fix | Delete
const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
[50759] Fix | Delete
const {
[50760] Fix | Delete
isOutlineMode,
[50761] Fix | Delete
isFocusMode,
[50762] Fix | Delete
editorMode,
[50763] Fix | Delete
temporarilyEditingAsBlocks
[50764] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[50765] Fix | Delete
const {
[50766] Fix | Delete
getSettings,
[50767] Fix | Delete
__unstableGetEditorMode,
[50768] Fix | Delete
getTemporarilyEditingAsBlocks,
[50769] Fix | Delete
isTyping
[50770] Fix | Delete
} = unlock(select(store));
[50771] Fix | Delete
const {
[50772] Fix | Delete
outlineMode,
[50773] Fix | Delete
focusMode
[50774] Fix | Delete
} = getSettings();
[50775] Fix | Delete
return {
[50776] Fix | Delete
isOutlineMode: outlineMode && !isTyping(),
[50777] Fix | Delete
isFocusMode: focusMode,
[50778] Fix | Delete
editorMode: __unstableGetEditorMode(),
[50779] Fix | Delete
temporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks()
[50780] Fix | Delete
};
[50781] Fix | Delete
}, []);
[50782] Fix | Delete
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
[50783] Fix | Delete
const {
[50784] Fix | Delete
setBlockVisibility
[50785] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[50786] Fix | Delete
const delayedBlockVisibilityUpdates = (0,external_wp_compose_namespaceObject.useDebounce)((0,external_wp_element_namespaceObject.useCallback)(() => {
[50787] Fix | Delete
const updates = {};
[50788] Fix | Delete
pendingBlockVisibilityUpdatesPerRegistry.get(registry).forEach(([id, isIntersecting]) => {
[50789] Fix | Delete
updates[id] = isIntersecting;
[50790] Fix | Delete
});
[50791] Fix | Delete
setBlockVisibility(updates);
[50792] Fix | Delete
}, [registry]), 300, {
[50793] Fix | Delete
trailing: true
[50794] Fix | Delete
});
[50795] Fix | Delete
const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => {
[50796] Fix | Delete
const {
[50797] Fix | Delete
IntersectionObserver: Observer
[50798] Fix | Delete
} = window;
[50799] Fix | Delete
if (!Observer) {
[50800] Fix | Delete
return;
[50801] Fix | Delete
}
[50802] Fix | Delete
return new Observer(entries => {
[50803] Fix | Delete
if (!pendingBlockVisibilityUpdatesPerRegistry.get(registry)) {
[50804] Fix | Delete
pendingBlockVisibilityUpdatesPerRegistry.set(registry, []);
[50805] Fix | Delete
}
[50806] Fix | Delete
for (const entry of entries) {
[50807] Fix | Delete
const clientId = entry.target.getAttribute('data-block');
[50808] Fix | Delete
pendingBlockVisibilityUpdatesPerRegistry.get(registry).push([clientId, entry.isIntersecting]);
[50809] Fix | Delete
}
[50810] Fix | Delete
delayedBlockVisibilityUpdates();
[50811] Fix | Delete
});
[50812] Fix | Delete
}, []);
[50813] Fix | Delete
const innerBlocksProps = useInnerBlocksProps({
[50814] Fix | Delete
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useBlockSelectionClearer(), useInBetweenInserter(), useTypingObserver()]),
[50815] Fix | Delete
className: dist_clsx('is-root-container', className, {
[50816] Fix | Delete
'is-outline-mode': isOutlineMode,
[50817] Fix | Delete
'is-focus-mode': isFocusMode && isLargeViewport,
[50818] Fix | Delete
'is-navigate-mode': editorMode === 'navigation'
[50819] Fix | Delete
})
[50820] Fix | Delete
}, settings);
[50821] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_list_IntersectionObserver.Provider, {
[50822] Fix | Delete
value: intersectionObserver,
[50823] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[50824] Fix | Delete
...innerBlocksProps
[50825] Fix | Delete
}), !!temporarilyEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StopEditingAsBlocksOnOutsideSelect, {
[50826] Fix | Delete
clientId: temporarilyEditingAsBlocks
[50827] Fix | Delete
})]
[50828] Fix | Delete
});
[50829] Fix | Delete
}
[50830] Fix | Delete
function StopEditingAsBlocksOnOutsideSelect({
[50831] Fix | Delete
clientId
[50832] Fix | Delete
}) {
[50833] Fix | Delete
const {
[50834] Fix | Delete
stopEditingAsBlocks
[50835] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[50836] Fix | Delete
const isBlockOrDescendantSelected = (0,external_wp_data_namespaceObject.useSelect)(select => {
[50837] Fix | Delete
const {
[50838] Fix | Delete
isBlockSelected,
[50839] Fix | Delete
hasSelectedInnerBlock
[50840] Fix | Delete
} = select(store);
[50841] Fix | Delete
return isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true);
[50842] Fix | Delete
}, [clientId]);
[50843] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[50844] Fix | Delete
if (!isBlockOrDescendantSelected) {
[50845] Fix | Delete
stopEditingAsBlocks(clientId);
[50846] Fix | Delete
}
[50847] Fix | Delete
}, [isBlockOrDescendantSelected, clientId, stopEditingAsBlocks]);
[50848] Fix | Delete
return null;
[50849] Fix | Delete
}
[50850] Fix | Delete
function BlockList(settings) {
[50851] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, {
[50852] Fix | Delete
value: DEFAULT_BLOCK_EDIT_CONTEXT,
[50853] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_list_Root, {
[50854] Fix | Delete
...settings
[50855] Fix | Delete
})
[50856] Fix | Delete
});
[50857] Fix | Delete
}
[50858] Fix | Delete
const block_list_EMPTY_ARRAY = [];
[50859] Fix | Delete
const block_list_EMPTY_SET = new Set();
[50860] Fix | Delete
function Items({
[50861] Fix | Delete
placeholder,
[50862] Fix | Delete
rootClientId,
[50863] Fix | Delete
renderAppender: CustomAppender,
[50864] Fix | Delete
__experimentalAppenderTagName,
[50865] Fix | Delete
layout = defaultLayout
[50866] Fix | Delete
}) {
[50867] Fix | Delete
// Avoid passing CustomAppender to useSelect because it could be a new
[50868] Fix | Delete
// function on every render.
[50869] Fix | Delete
const hasAppender = CustomAppender !== false;
[50870] Fix | Delete
const hasCustomAppender = !!CustomAppender;
[50871] Fix | Delete
const {
[50872] Fix | Delete
order,
[50873] Fix | Delete
selectedBlocks,
[50874] Fix | Delete
visibleBlocks,
[50875] Fix | Delete
shouldRenderAppender
[50876] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[50877] Fix | Delete
const {
[50878] Fix | Delete
getSettings,
[50879] Fix | Delete
getBlockOrder,
[50880] Fix | Delete
getSelectedBlockClientId,
[50881] Fix | Delete
getSelectedBlockClientIds,
[50882] Fix | Delete
__unstableGetVisibleBlocks,
[50883] Fix | Delete
getTemplateLock,
[50884] Fix | Delete
getBlockEditingMode,
[50885] Fix | Delete
__unstableGetEditorMode
[50886] Fix | Delete
} = select(store);
[50887] Fix | Delete
const _order = getBlockOrder(rootClientId);
[50888] Fix | Delete
if (getSettings().__unstableIsPreviewMode) {
[50889] Fix | Delete
return {
[50890] Fix | Delete
order: _order,
[50891] Fix | Delete
selectedBlocks: block_list_EMPTY_ARRAY,
[50892] Fix | Delete
visibleBlocks: block_list_EMPTY_SET
[50893] Fix | Delete
};
[50894] Fix | Delete
}
[50895] Fix | Delete
const selectedBlockClientId = getSelectedBlockClientId();
[50896] Fix | Delete
return {
[50897] Fix | Delete
order: _order,
[50898] Fix | Delete
selectedBlocks: getSelectedBlockClientIds(),
[50899] Fix | Delete
visibleBlocks: __unstableGetVisibleBlocks(),
[50900] Fix | Delete
shouldRenderAppender: hasAppender && __unstableGetEditorMode() !== 'zoom-out' && (hasCustomAppender ? !getTemplateLock(rootClientId) && getBlockEditingMode(rootClientId) !== 'disabled' : rootClientId === selectedBlockClientId || !rootClientId && !selectedBlockClientId && !_order.length)
[50901] Fix | Delete
};
[50902] Fix | Delete
}, [rootClientId, hasAppender, hasCustomAppender]);
[50903] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(LayoutProvider, {
[50904] Fix | Delete
value: layout,
[50905] Fix | Delete
children: [order.map(clientId => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.AsyncModeProvider, {
[50906] Fix | Delete
value:
[50907] Fix | Delete
// Only provide data asynchronously if the block is
[50908] Fix | Delete
// not visible and not selected.
[50909] Fix | Delete
!visibleBlocks.has(clientId) && !selectedBlocks.includes(clientId),
[50910] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_list_block, {
[50911] Fix | Delete
rootClientId: rootClientId,
[50912] Fix | Delete
clientId: clientId
[50913] Fix | Delete
})
[50914] Fix | Delete
}, clientId)), order.length < 1 && placeholder, shouldRenderAppender && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListAppender, {
[50915] Fix | Delete
tagName: __experimentalAppenderTagName,
[50916] Fix | Delete
rootClientId: rootClientId,
[50917] Fix | Delete
CustomAppender: CustomAppender
[50918] Fix | Delete
})]
[50919] Fix | Delete
});
[50920] Fix | Delete
}
[50921] Fix | Delete
function BlockListItems(props) {
[50922] Fix | Delete
// This component needs to always be synchronous as it's the one changing
[50923] Fix | Delete
// the async mode depending on the block selection.
[50924] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.AsyncModeProvider, {
[50925] Fix | Delete
value: false,
[50926] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Items, {
[50927] Fix | Delete
...props
[50928] Fix | Delete
})
[50929] Fix | Delete
});
[50930] Fix | Delete
}
[50931] Fix | Delete
[50932] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-block-toolbar-popover-props.js
[50933] Fix | Delete
/**
[50934] Fix | Delete
* WordPress dependencies
[50935] Fix | Delete
*/
[50936] Fix | Delete
[50937] Fix | Delete
[50938] Fix | Delete
[50939] Fix | Delete
[50940] Fix | Delete
[50941] Fix | Delete
/**
[50942] Fix | Delete
* Internal dependencies
[50943] Fix | Delete
*/
[50944] Fix | Delete
[50945] Fix | Delete
[50946] Fix | Delete
[50947] Fix | Delete
const COMMON_PROPS = {
[50948] Fix | Delete
placement: 'top-start'
[50949] Fix | Delete
};
[50950] Fix | Delete
[50951] Fix | Delete
// By default the toolbar sets the `shift` prop. If the user scrolls the page
[50952] Fix | Delete
// down the toolbar will stay on screen by adopting a sticky position at the
[50953] Fix | Delete
// top of the viewport.
[50954] Fix | Delete
const DEFAULT_PROPS = {
[50955] Fix | Delete
...COMMON_PROPS,
[50956] Fix | Delete
flip: false,
[50957] Fix | Delete
shift: true
[50958] Fix | Delete
};
[50959] Fix | Delete
[50960] Fix | Delete
// When there isn't enough height between the top of the block and the editor
[50961] Fix | Delete
// canvas, the `shift` prop is set to `false`, as it will cause the block to be
[50962] Fix | Delete
// obscured. The `flip` behavior is enabled, which positions the toolbar below
[50963] Fix | Delete
// the block. This only happens if the block is smaller than the viewport, as
[50964] Fix | Delete
// otherwise the toolbar will be off-screen.
[50965] Fix | Delete
const RESTRICTED_HEIGHT_PROPS = {
[50966] Fix | Delete
...COMMON_PROPS,
[50967] Fix | Delete
flip: true,
[50968] Fix | Delete
shift: false
[50969] Fix | Delete
};
[50970] Fix | Delete
[50971] Fix | Delete
/**
[50972] Fix | Delete
* Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height.
[50973] Fix | Delete
*
[50974] Fix | Delete
* @param {Element} contentElement The DOM element that represents the editor content or canvas.
[50975] Fix | Delete
* @param {Element} selectedBlockElement The outer DOM element of the first selected block.
[50976] Fix | Delete
* @param {Element} scrollContainer The scrollable container for the contentElement.
[50977] Fix | Delete
* @param {number} toolbarHeight The height of the toolbar in pixels.
[50978] Fix | Delete
* @param {boolean} isSticky Whether or not the selected block is sticky or fixed.
[50979] Fix | Delete
*
[50980] Fix | Delete
* @return {Object} The popover props used to determine the position of the toolbar.
[50981] Fix | Delete
*/
[50982] Fix | Delete
function getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky) {
[50983] Fix | Delete
if (!contentElement || !selectedBlockElement) {
[50984] Fix | Delete
return DEFAULT_PROPS;
[50985] Fix | Delete
}
[50986] Fix | Delete
[50987] Fix | Delete
// Get how far the content area has been scrolled.
[50988] Fix | Delete
const scrollTop = scrollContainer?.scrollTop || 0;
[50989] Fix | Delete
const blockRect = selectedBlockElement.getBoundingClientRect();
[50990] Fix | Delete
const contentRect = contentElement.getBoundingClientRect();
[50991] Fix | Delete
[50992] Fix | Delete
// Get the vertical position of top of the visible content area.
[50993] Fix | Delete
const topOfContentElementInViewport = scrollTop + contentRect.top;
[50994] Fix | Delete
[50995] Fix | Delete
// The document element's clientHeight represents the viewport height.
[50996] Fix | Delete
const viewportHeight = contentElement.ownerDocument.documentElement.clientHeight;
[50997] Fix | Delete
[50998] Fix | Delete
// The restricted height area is calculated as the sum of the
[50999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function