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
resetBlocks,
[41500] Fix | Delete
resetSelection,
[41501] Fix | Delete
replaceInnerBlocks,
[41502] Fix | Delete
setHasControlledInnerBlocks,
[41503] Fix | Delete
__unstableMarkNextChangeAsNotPersistent
[41504] Fix | Delete
} = registry.dispatch(store);
[41505] Fix | Delete
const {
[41506] Fix | Delete
getBlockName,
[41507] Fix | Delete
getBlocks,
[41508] Fix | Delete
getSelectionStart,
[41509] Fix | Delete
getSelectionEnd
[41510] Fix | Delete
} = registry.select(store);
[41511] Fix | Delete
const isControlled = (0,external_wp_data_namespaceObject.useSelect)(select => {
[41512] Fix | Delete
return !clientId || select(store).areInnerBlocksControlled(clientId);
[41513] Fix | Delete
}, [clientId]);
[41514] Fix | Delete
const pendingChanges = (0,external_wp_element_namespaceObject.useRef)({
[41515] Fix | Delete
incoming: null,
[41516] Fix | Delete
outgoing: []
[41517] Fix | Delete
});
[41518] Fix | Delete
const subscribed = (0,external_wp_element_namespaceObject.useRef)(false);
[41519] Fix | Delete
const setControlledBlocks = () => {
[41520] Fix | Delete
if (!controlledBlocks) {
[41521] Fix | Delete
return;
[41522] Fix | Delete
}
[41523] Fix | Delete
[41524] Fix | Delete
// We don't need to persist this change because we only replace
[41525] Fix | Delete
// controlled inner blocks when the change was caused by an entity,
[41526] Fix | Delete
// and so it would already be persisted.
[41527] Fix | Delete
__unstableMarkNextChangeAsNotPersistent();
[41528] Fix | Delete
if (clientId) {
[41529] Fix | Delete
// It is important to batch here because otherwise,
[41530] Fix | Delete
// as soon as `setHasControlledInnerBlocks` is called
[41531] Fix | Delete
// the effect to restore might be triggered
[41532] Fix | Delete
// before the actual blocks get set properly in state.
[41533] Fix | Delete
registry.batch(() => {
[41534] Fix | Delete
setHasControlledInnerBlocks(clientId, true);
[41535] Fix | Delete
const storeBlocks = controlledBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
[41536] Fix | Delete
if (subscribed.current) {
[41537] Fix | Delete
pendingChanges.current.incoming = storeBlocks;
[41538] Fix | Delete
}
[41539] Fix | Delete
__unstableMarkNextChangeAsNotPersistent();
[41540] Fix | Delete
replaceInnerBlocks(clientId, storeBlocks);
[41541] Fix | Delete
});
[41542] Fix | Delete
} else {
[41543] Fix | Delete
if (subscribed.current) {
[41544] Fix | Delete
pendingChanges.current.incoming = controlledBlocks;
[41545] Fix | Delete
}
[41546] Fix | Delete
resetBlocks(controlledBlocks);
[41547] Fix | Delete
}
[41548] Fix | Delete
};
[41549] Fix | Delete
[41550] Fix | Delete
// Clean up the changes made by setControlledBlocks() when the component
[41551] Fix | Delete
// containing useBlockSync() unmounts.
[41552] Fix | Delete
const unsetControlledBlocks = () => {
[41553] Fix | Delete
__unstableMarkNextChangeAsNotPersistent();
[41554] Fix | Delete
if (clientId) {
[41555] Fix | Delete
setHasControlledInnerBlocks(clientId, false);
[41556] Fix | Delete
__unstableMarkNextChangeAsNotPersistent();
[41557] Fix | Delete
replaceInnerBlocks(clientId, []);
[41558] Fix | Delete
} else {
[41559] Fix | Delete
resetBlocks([]);
[41560] Fix | Delete
}
[41561] Fix | Delete
};
[41562] Fix | Delete
[41563] Fix | Delete
// Add a subscription to the block-editor registry to detect when changes
[41564] Fix | Delete
// have been made. This lets us inform the data source of changes. This
[41565] Fix | Delete
// is an effect so that the subscriber can run synchronously without
[41566] Fix | Delete
// waiting for React renders for changes.
[41567] Fix | Delete
const onInputRef = (0,external_wp_element_namespaceObject.useRef)(onInput);
[41568] Fix | Delete
const onChangeRef = (0,external_wp_element_namespaceObject.useRef)(onChange);
[41569] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41570] Fix | Delete
onInputRef.current = onInput;
[41571] Fix | Delete
onChangeRef.current = onChange;
[41572] Fix | Delete
}, [onInput, onChange]);
[41573] Fix | Delete
[41574] Fix | Delete
// Determine if blocks need to be reset when they change.
[41575] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41576] Fix | Delete
if (pendingChanges.current.outgoing.includes(controlledBlocks)) {
[41577] Fix | Delete
// Skip block reset if the value matches expected outbound sync
[41578] Fix | Delete
// triggered by this component by a preceding change detection.
[41579] Fix | Delete
// Only skip if the value matches expectation, since a reset should
[41580] Fix | Delete
// still occur if the value is modified (not equal by reference),
[41581] Fix | Delete
// to allow that the consumer may apply modifications to reflect
[41582] Fix | Delete
// back on the editor.
[41583] Fix | Delete
if (pendingChanges.current.outgoing[pendingChanges.current.outgoing.length - 1] === controlledBlocks) {
[41584] Fix | Delete
pendingChanges.current.outgoing = [];
[41585] Fix | Delete
}
[41586] Fix | Delete
} else if (getBlocks(clientId) !== controlledBlocks) {
[41587] Fix | Delete
// Reset changing value in all other cases than the sync described
[41588] Fix | Delete
// above. Since this can be reached in an update following an out-
[41589] Fix | Delete
// bound sync, unset the outbound value to avoid considering it in
[41590] Fix | Delete
// subsequent renders.
[41591] Fix | Delete
pendingChanges.current.outgoing = [];
[41592] Fix | Delete
setControlledBlocks();
[41593] Fix | Delete
if (controlledSelection) {
[41594] Fix | Delete
resetSelection(controlledSelection.selectionStart, controlledSelection.selectionEnd, controlledSelection.initialPosition);
[41595] Fix | Delete
}
[41596] Fix | Delete
}
[41597] Fix | Delete
}, [controlledBlocks, clientId]);
[41598] Fix | Delete
const isMounted = (0,external_wp_element_namespaceObject.useRef)(false);
[41599] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41600] Fix | Delete
// On mount, controlled blocks are already set in the effect above.
[41601] Fix | Delete
if (!isMounted.current) {
[41602] Fix | Delete
isMounted.current = true;
[41603] Fix | Delete
return;
[41604] Fix | Delete
}
[41605] Fix | Delete
[41606] Fix | Delete
// When the block becomes uncontrolled, it means its inner state has been reset
[41607] Fix | Delete
// we need to take the blocks again from the external value property.
[41608] Fix | Delete
if (!isControlled) {
[41609] Fix | Delete
pendingChanges.current.outgoing = [];
[41610] Fix | Delete
setControlledBlocks();
[41611] Fix | Delete
}
[41612] Fix | Delete
}, [isControlled]);
[41613] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41614] Fix | Delete
const {
[41615] Fix | Delete
getSelectedBlocksInitialCaretPosition,
[41616] Fix | Delete
isLastBlockChangePersistent,
[41617] Fix | Delete
__unstableIsLastBlockChangeIgnored,
[41618] Fix | Delete
areInnerBlocksControlled
[41619] Fix | Delete
} = registry.select(store);
[41620] Fix | Delete
let blocks = getBlocks(clientId);
[41621] Fix | Delete
let isPersistent = isLastBlockChangePersistent();
[41622] Fix | Delete
let previousAreBlocksDifferent = false;
[41623] Fix | Delete
subscribed.current = true;
[41624] Fix | Delete
const unsubscribe = registry.subscribe(() => {
[41625] Fix | Delete
// Sometimes, when changing block lists, lingering subscriptions
[41626] Fix | Delete
// might trigger before they are cleaned up. If the block for which
[41627] Fix | Delete
// the subscription runs is no longer in the store, this would clear
[41628] Fix | Delete
// its parent entity's block list. To avoid this, we bail out if
[41629] Fix | Delete
// the subscription is triggering for a block (`clientId !== null`)
[41630] Fix | Delete
// and its block name can't be found because it's not on the list.
[41631] Fix | Delete
// (`getBlockName( clientId ) === null`).
[41632] Fix | Delete
if (clientId !== null && getBlockName(clientId) === null) {
[41633] Fix | Delete
return;
[41634] Fix | Delete
}
[41635] Fix | Delete
[41636] Fix | Delete
// When RESET_BLOCKS on parent blocks get called, the controlled blocks
[41637] Fix | Delete
// can reset to uncontrolled, in these situations, it means we need to populate
[41638] Fix | Delete
// the blocks again from the external blocks (the value property here)
[41639] Fix | Delete
// and we should stop triggering onChange
[41640] Fix | Delete
const isStillControlled = !clientId || areInnerBlocksControlled(clientId);
[41641] Fix | Delete
if (!isStillControlled) {
[41642] Fix | Delete
return;
[41643] Fix | Delete
}
[41644] Fix | Delete
const newIsPersistent = isLastBlockChangePersistent();
[41645] Fix | Delete
const newBlocks = getBlocks(clientId);
[41646] Fix | Delete
const areBlocksDifferent = newBlocks !== blocks;
[41647] Fix | Delete
blocks = newBlocks;
[41648] Fix | Delete
if (areBlocksDifferent && (pendingChanges.current.incoming || __unstableIsLastBlockChangeIgnored())) {
[41649] Fix | Delete
pendingChanges.current.incoming = null;
[41650] Fix | Delete
isPersistent = newIsPersistent;
[41651] Fix | Delete
return;
[41652] Fix | Delete
}
[41653] Fix | Delete
[41654] Fix | Delete
// Since we often dispatch an action to mark the previous action as
[41655] Fix | Delete
// persistent, we need to make sure that the blocks changed on the
[41656] Fix | Delete
// previous action before committing the change.
[41657] Fix | Delete
const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent;
[41658] Fix | Delete
if (areBlocksDifferent || didPersistenceChange) {
[41659] Fix | Delete
isPersistent = newIsPersistent;
[41660] Fix | Delete
// We know that onChange/onInput will update controlledBlocks.
[41661] Fix | Delete
// We need to be aware that it was caused by an outgoing change
[41662] Fix | Delete
// so that we do not treat it as an incoming change later on,
[41663] Fix | Delete
// which would cause a block reset.
[41664] Fix | Delete
pendingChanges.current.outgoing.push(blocks);
[41665] Fix | Delete
[41666] Fix | Delete
// Inform the controlling entity that changes have been made to
[41667] Fix | Delete
// the block-editor store they should be aware about.
[41668] Fix | Delete
const updateParent = isPersistent ? onChangeRef.current : onInputRef.current;
[41669] Fix | Delete
const undoIgnore = undoIgnoreBlocks.has(blocks);
[41670] Fix | Delete
if (undoIgnore) {
[41671] Fix | Delete
undoIgnoreBlocks.delete(blocks);
[41672] Fix | Delete
}
[41673] Fix | Delete
updateParent(blocks, {
[41674] Fix | Delete
selection: {
[41675] Fix | Delete
selectionStart: getSelectionStart(),
[41676] Fix | Delete
selectionEnd: getSelectionEnd(),
[41677] Fix | Delete
initialPosition: getSelectedBlocksInitialCaretPosition()
[41678] Fix | Delete
},
[41679] Fix | Delete
undoIgnore
[41680] Fix | Delete
});
[41681] Fix | Delete
}
[41682] Fix | Delete
previousAreBlocksDifferent = areBlocksDifferent;
[41683] Fix | Delete
}, store);
[41684] Fix | Delete
return () => {
[41685] Fix | Delete
subscribed.current = false;
[41686] Fix | Delete
unsubscribe();
[41687] Fix | Delete
};
[41688] Fix | Delete
}, [registry, clientId]);
[41689] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41690] Fix | Delete
return () => {
[41691] Fix | Delete
unsetControlledBlocks();
[41692] Fix | Delete
};
[41693] Fix | Delete
}, []);
[41694] Fix | Delete
}
[41695] Fix | Delete
[41696] Fix | Delete
;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
[41697] Fix | Delete
const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
[41698] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js
[41699] Fix | Delete
/**
[41700] Fix | Delete
* WordPress dependencies
[41701] Fix | Delete
*/
[41702] Fix | Delete
[41703] Fix | Delete
[41704] Fix | Delete
[41705] Fix | Delete
[41706] Fix | Delete
function KeyboardShortcuts() {
[41707] Fix | Delete
return null;
[41708] Fix | Delete
}
[41709] Fix | Delete
function KeyboardShortcutsRegister() {
[41710] Fix | Delete
// Registering the shortcuts.
[41711] Fix | Delete
const {
[41712] Fix | Delete
registerShortcut
[41713] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
[41714] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41715] Fix | Delete
registerShortcut({
[41716] Fix | Delete
name: 'core/block-editor/duplicate',
[41717] Fix | Delete
category: 'block',
[41718] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Duplicate the selected block(s).'),
[41719] Fix | Delete
keyCombination: {
[41720] Fix | Delete
modifier: 'primaryShift',
[41721] Fix | Delete
character: 'd'
[41722] Fix | Delete
}
[41723] Fix | Delete
});
[41724] Fix | Delete
registerShortcut({
[41725] Fix | Delete
name: 'core/block-editor/remove',
[41726] Fix | Delete
category: 'block',
[41727] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Remove the selected block(s).'),
[41728] Fix | Delete
keyCombination: {
[41729] Fix | Delete
modifier: 'access',
[41730] Fix | Delete
character: 'z'
[41731] Fix | Delete
}
[41732] Fix | Delete
});
[41733] Fix | Delete
registerShortcut({
[41734] Fix | Delete
name: 'core/block-editor/insert-before',
[41735] Fix | Delete
category: 'block',
[41736] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block before the selected block(s).'),
[41737] Fix | Delete
keyCombination: {
[41738] Fix | Delete
modifier: 'primaryAlt',
[41739] Fix | Delete
character: 't'
[41740] Fix | Delete
}
[41741] Fix | Delete
});
[41742] Fix | Delete
registerShortcut({
[41743] Fix | Delete
name: 'core/block-editor/insert-after',
[41744] Fix | Delete
category: 'block',
[41745] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block after the selected block(s).'),
[41746] Fix | Delete
keyCombination: {
[41747] Fix | Delete
modifier: 'primaryAlt',
[41748] Fix | Delete
character: 'y'
[41749] Fix | Delete
}
[41750] Fix | Delete
});
[41751] Fix | Delete
registerShortcut({
[41752] Fix | Delete
name: 'core/block-editor/delete-multi-selection',
[41753] Fix | Delete
category: 'block',
[41754] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Delete selection.'),
[41755] Fix | Delete
keyCombination: {
[41756] Fix | Delete
character: 'del'
[41757] Fix | Delete
},
[41758] Fix | Delete
aliases: [{
[41759] Fix | Delete
character: 'backspace'
[41760] Fix | Delete
}]
[41761] Fix | Delete
});
[41762] Fix | Delete
registerShortcut({
[41763] Fix | Delete
name: 'core/block-editor/select-all',
[41764] Fix | Delete
category: 'selection',
[41765] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Select all text when typing. Press again to select all blocks.'),
[41766] Fix | Delete
keyCombination: {
[41767] Fix | Delete
modifier: 'primary',
[41768] Fix | Delete
character: 'a'
[41769] Fix | Delete
}
[41770] Fix | Delete
});
[41771] Fix | Delete
registerShortcut({
[41772] Fix | Delete
name: 'core/block-editor/unselect',
[41773] Fix | Delete
category: 'selection',
[41774] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Clear selection.'),
[41775] Fix | Delete
keyCombination: {
[41776] Fix | Delete
character: 'escape'
[41777] Fix | Delete
}
[41778] Fix | Delete
});
[41779] Fix | Delete
registerShortcut({
[41780] Fix | Delete
name: 'core/block-editor/multi-text-selection',
[41781] Fix | Delete
category: 'selection',
[41782] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Select text across multiple blocks.'),
[41783] Fix | Delete
keyCombination: {
[41784] Fix | Delete
modifier: 'shift',
[41785] Fix | Delete
character: 'arrow'
[41786] Fix | Delete
}
[41787] Fix | Delete
});
[41788] Fix | Delete
registerShortcut({
[41789] Fix | Delete
name: 'core/block-editor/focus-toolbar',
[41790] Fix | Delete
category: 'global',
[41791] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the nearest toolbar.'),
[41792] Fix | Delete
keyCombination: {
[41793] Fix | Delete
modifier: 'alt',
[41794] Fix | Delete
character: 'F10'
[41795] Fix | Delete
}
[41796] Fix | Delete
});
[41797] Fix | Delete
registerShortcut({
[41798] Fix | Delete
name: 'core/block-editor/move-up',
[41799] Fix | Delete
category: 'block',
[41800] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) up.'),
[41801] Fix | Delete
keyCombination: {
[41802] Fix | Delete
modifier: 'secondary',
[41803] Fix | Delete
character: 't'
[41804] Fix | Delete
}
[41805] Fix | Delete
});
[41806] Fix | Delete
registerShortcut({
[41807] Fix | Delete
name: 'core/block-editor/move-down',
[41808] Fix | Delete
category: 'block',
[41809] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) down.'),
[41810] Fix | Delete
keyCombination: {
[41811] Fix | Delete
modifier: 'secondary',
[41812] Fix | Delete
character: 'y'
[41813] Fix | Delete
}
[41814] Fix | Delete
});
[41815] Fix | Delete
[41816] Fix | Delete
// List view shortcuts.
[41817] Fix | Delete
registerShortcut({
[41818] Fix | Delete
name: 'core/block-editor/collapse-list-view',
[41819] Fix | Delete
category: 'list-view',
[41820] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Collapse all other items.'),
[41821] Fix | Delete
keyCombination: {
[41822] Fix | Delete
modifier: 'alt',
[41823] Fix | Delete
character: 'l'
[41824] Fix | Delete
}
[41825] Fix | Delete
});
[41826] Fix | Delete
registerShortcut({
[41827] Fix | Delete
name: 'core/block-editor/group',
[41828] Fix | Delete
category: 'block',
[41829] Fix | Delete
description: (0,external_wp_i18n_namespaceObject.__)('Create a group block from the selected multiple blocks.'),
[41830] Fix | Delete
keyCombination: {
[41831] Fix | Delete
modifier: 'primary',
[41832] Fix | Delete
character: 'g'
[41833] Fix | Delete
}
[41834] Fix | Delete
});
[41835] Fix | Delete
}, [registerShortcut]);
[41836] Fix | Delete
return null;
[41837] Fix | Delete
}
[41838] Fix | Delete
KeyboardShortcuts.Register = KeyboardShortcutsRegister;
[41839] Fix | Delete
/* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
[41840] Fix | Delete
[41841] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js
[41842] Fix | Delete
/**
[41843] Fix | Delete
* WordPress dependencies
[41844] Fix | Delete
*/
[41845] Fix | Delete
[41846] Fix | Delete
[41847] Fix | Delete
[41848] Fix | Delete
[41849] Fix | Delete
/**
[41850] Fix | Delete
* Internal dependencies
[41851] Fix | Delete
*/
[41852] Fix | Delete
[41853] Fix | Delete
[41854] Fix | Delete
[41855] Fix | Delete
[41856] Fix | Delete
[41857] Fix | Delete
[41858] Fix | Delete
[41859] Fix | Delete
/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */
[41860] Fix | Delete
[41861] Fix | Delete
[41862] Fix | Delete
const ExperimentalBlockEditorProvider = with_registry_provider(props => {
[41863] Fix | Delete
const {
[41864] Fix | Delete
children,
[41865] Fix | Delete
settings,
[41866] Fix | Delete
stripExperimentalSettings = false
[41867] Fix | Delete
} = props;
[41868] Fix | Delete
const {
[41869] Fix | Delete
__experimentalUpdateSettings
[41870] Fix | Delete
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
[41871] Fix | Delete
(0,external_wp_element_namespaceObject.useEffect)(() => {
[41872] Fix | Delete
__experimentalUpdateSettings({
[41873] Fix | Delete
...settings,
[41874] Fix | Delete
__internalIsInitialized: true
[41875] Fix | Delete
}, {
[41876] Fix | Delete
stripExperimentalSettings,
[41877] Fix | Delete
reset: true
[41878] Fix | Delete
});
[41879] Fix | Delete
}, [settings, stripExperimentalSettings, __experimentalUpdateSettings]);
[41880] Fix | Delete
[41881] Fix | Delete
// Syncs the entity provider with changes in the block-editor store.
[41882] Fix | Delete
useBlockSync(props);
[41883] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, {
[41884] Fix | Delete
passthrough: true,
[41885] Fix | Delete
children: [!settings?.__unstableIsPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefsProvider, {
[41886] Fix | Delete
children: children
[41887] Fix | Delete
})]
[41888] Fix | Delete
});
[41889] Fix | Delete
});
[41890] Fix | Delete
const BlockEditorProvider = props => {
[41891] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, {
[41892] Fix | Delete
...props,
[41893] Fix | Delete
stripExperimentalSettings: true,
[41894] Fix | Delete
children: props.children
[41895] Fix | Delete
});
[41896] Fix | Delete
};
[41897] Fix | Delete
/* harmony default export */ const provider = (BlockEditorProvider);
[41898] Fix | Delete
[41899] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js
[41900] Fix | Delete
/**
[41901] Fix | Delete
* WordPress dependencies
[41902] Fix | Delete
*/
[41903] Fix | Delete
[41904] Fix | Delete
[41905] Fix | Delete
[41906] Fix | Delete
/**
[41907] Fix | Delete
* Internal dependencies
[41908] Fix | Delete
*/
[41909] Fix | Delete
[41910] Fix | Delete
[41911] Fix | Delete
/**
[41912] Fix | Delete
* Pass the returned ref callback to an element that should clear block
[41913] Fix | Delete
* selection. Selection will only be cleared if the element is clicked directly,
[41914] Fix | Delete
* not if a child element is clicked.
[41915] Fix | Delete
*
[41916] Fix | Delete
* @return {import('react').RefCallback} Ref callback.
[41917] Fix | Delete
*/
[41918] Fix | Delete
[41919] Fix | Delete
function useBlockSelectionClearer() {
[41920] Fix | Delete
const {
[41921] Fix | Delete
getSettings,
[41922] Fix | Delete
hasSelectedBlock,
[41923] Fix | Delete
hasMultiSelection
[41924] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[41925] Fix | Delete
const {
[41926] Fix | Delete
clearSelectedBlock
[41927] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[41928] Fix | Delete
const {
[41929] Fix | Delete
clearBlockSelection: isEnabled
[41930] Fix | Delete
} = getSettings();
[41931] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[41932] Fix | Delete
if (!isEnabled) {
[41933] Fix | Delete
return;
[41934] Fix | Delete
}
[41935] Fix | Delete
function onMouseDown(event) {
[41936] Fix | Delete
if (!hasSelectedBlock() && !hasMultiSelection()) {
[41937] Fix | Delete
return;
[41938] Fix | Delete
}
[41939] Fix | Delete
[41940] Fix | Delete
// Only handle clicks on the element, not the children.
[41941] Fix | Delete
if (event.target !== node) {
[41942] Fix | Delete
return;
[41943] Fix | Delete
}
[41944] Fix | Delete
clearSelectedBlock();
[41945] Fix | Delete
}
[41946] Fix | Delete
node.addEventListener('mousedown', onMouseDown);
[41947] Fix | Delete
return () => {
[41948] Fix | Delete
node.removeEventListener('mousedown', onMouseDown);
[41949] Fix | Delete
};
[41950] Fix | Delete
}, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock, isEnabled]);
[41951] Fix | Delete
}
[41952] Fix | Delete
function BlockSelectionClearer(props) {
[41953] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
[41954] Fix | Delete
ref: useBlockSelectionClearer(),
[41955] Fix | Delete
...props
[41956] Fix | Delete
});
[41957] Fix | Delete
}
[41958] Fix | Delete
[41959] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js
[41960] Fix | Delete
/**
[41961] Fix | Delete
* WordPress dependencies
[41962] Fix | Delete
*/
[41963] Fix | Delete
[41964] Fix | Delete
[41965] Fix | Delete
[41966] Fix | Delete
/**
[41967] Fix | Delete
* Internal dependencies
[41968] Fix | Delete
*/
[41969] Fix | Delete
[41970] Fix | Delete
function selector(select) {
[41971] Fix | Delete
const {
[41972] Fix | Delete
isMultiSelecting,
[41973] Fix | Delete
getMultiSelectedBlockClientIds,
[41974] Fix | Delete
hasMultiSelection,
[41975] Fix | Delete
getSelectedBlockClientId,
[41976] Fix | Delete
getSelectedBlocksInitialCaretPosition,
[41977] Fix | Delete
__unstableIsFullySelected
[41978] Fix | Delete
} = select(store);
[41979] Fix | Delete
return {
[41980] Fix | Delete
isMultiSelecting: isMultiSelecting(),
[41981] Fix | Delete
multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
[41982] Fix | Delete
hasMultiSelection: hasMultiSelection(),
[41983] Fix | Delete
selectedBlockClientId: getSelectedBlockClientId(),
[41984] Fix | Delete
initialPosition: getSelectedBlocksInitialCaretPosition(),
[41985] Fix | Delete
isFullSelection: __unstableIsFullySelected()
[41986] Fix | Delete
};
[41987] Fix | Delete
}
[41988] Fix | Delete
function useMultiSelection() {
[41989] Fix | Delete
const {
[41990] Fix | Delete
initialPosition,
[41991] Fix | Delete
isMultiSelecting,
[41992] Fix | Delete
multiSelectedBlockClientIds,
[41993] Fix | Delete
hasMultiSelection,
[41994] Fix | Delete
selectedBlockClientId,
[41995] Fix | Delete
isFullSelection
[41996] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
[41997] Fix | Delete
[41998] Fix | Delete
/**
[41999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function