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
* WordPress dependencies
[42500] Fix | Delete
*/
[42501] Fix | Delete
[42502] Fix | Delete
[42503] Fix | Delete
[42504] Fix | Delete
[42505] Fix | Delete
[42506] Fix | Delete
/**
[42507] Fix | Delete
* Internal dependencies
[42508] Fix | Delete
*/
[42509] Fix | Delete
[42510] Fix | Delete
function useSelectAll() {
[42511] Fix | Delete
const {
[42512] Fix | Delete
getBlockOrder,
[42513] Fix | Delete
getSelectedBlockClientIds,
[42514] Fix | Delete
getBlockRootClientId
[42515] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[42516] Fix | Delete
const {
[42517] Fix | Delete
multiSelect,
[42518] Fix | Delete
selectBlock
[42519] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[42520] Fix | Delete
const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)();
[42521] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[42522] Fix | Delete
function onKeyDown(event) {
[42523] Fix | Delete
if (!isMatch('core/block-editor/select-all', event)) {
[42524] Fix | Delete
return;
[42525] Fix | Delete
}
[42526] Fix | Delete
const selectedClientIds = getSelectedBlockClientIds();
[42527] Fix | Delete
if (selectedClientIds.length < 2 && !(0,external_wp_dom_namespaceObject.isEntirelySelected)(event.target)) {
[42528] Fix | Delete
return;
[42529] Fix | Delete
}
[42530] Fix | Delete
event.preventDefault();
[42531] Fix | Delete
const [firstSelectedClientId] = selectedClientIds;
[42532] Fix | Delete
const rootClientId = getBlockRootClientId(firstSelectedClientId);
[42533] Fix | Delete
const blockClientIds = getBlockOrder(rootClientId);
[42534] Fix | Delete
[42535] Fix | Delete
// If we have selected all sibling nested blocks, try selecting up a
[42536] Fix | Delete
// level. See: https://github.com/WordPress/gutenberg/pull/31859/
[42537] Fix | Delete
if (selectedClientIds.length === blockClientIds.length) {
[42538] Fix | Delete
if (rootClientId) {
[42539] Fix | Delete
node.ownerDocument.defaultView.getSelection().removeAllRanges();
[42540] Fix | Delete
selectBlock(rootClientId);
[42541] Fix | Delete
}
[42542] Fix | Delete
return;
[42543] Fix | Delete
}
[42544] Fix | Delete
multiSelect(blockClientIds[0], blockClientIds[blockClientIds.length - 1]);
[42545] Fix | Delete
}
[42546] Fix | Delete
node.addEventListener('keydown', onKeyDown);
[42547] Fix | Delete
return () => {
[42548] Fix | Delete
node.removeEventListener('keydown', onKeyDown);
[42549] Fix | Delete
};
[42550] Fix | Delete
}, []);
[42551] Fix | Delete
}
[42552] Fix | Delete
[42553] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-drag-selection.js
[42554] Fix | Delete
/**
[42555] Fix | Delete
* WordPress dependencies
[42556] Fix | Delete
*/
[42557] Fix | Delete
[42558] Fix | Delete
[42559] Fix | Delete
[42560] Fix | Delete
/**
[42561] Fix | Delete
* Internal dependencies
[42562] Fix | Delete
*/
[42563] Fix | Delete
[42564] Fix | Delete
[42565] Fix | Delete
/**
[42566] Fix | Delete
* Sets the `contenteditable` wrapper element to `value`.
[42567] Fix | Delete
*
[42568] Fix | Delete
* @param {HTMLElement} node Block element.
[42569] Fix | Delete
* @param {boolean} value `contentEditable` value (true or false)
[42570] Fix | Delete
*/
[42571] Fix | Delete
function setContentEditableWrapper(node, value) {
[42572] Fix | Delete
node.contentEditable = value;
[42573] Fix | Delete
// Firefox doesn't automatically move focus.
[42574] Fix | Delete
if (value) {
[42575] Fix | Delete
node.focus();
[42576] Fix | Delete
}
[42577] Fix | Delete
}
[42578] Fix | Delete
[42579] Fix | Delete
/**
[42580] Fix | Delete
* Sets a multi-selection based on the native selection across blocks.
[42581] Fix | Delete
*/
[42582] Fix | Delete
function useDragSelection() {
[42583] Fix | Delete
const {
[42584] Fix | Delete
startMultiSelect,
[42585] Fix | Delete
stopMultiSelect
[42586] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[42587] Fix | Delete
const {
[42588] Fix | Delete
isSelectionEnabled,
[42589] Fix | Delete
hasSelectedBlock,
[42590] Fix | Delete
isDraggingBlocks,
[42591] Fix | Delete
isMultiSelecting
[42592] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[42593] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[42594] Fix | Delete
const {
[42595] Fix | Delete
ownerDocument
[42596] Fix | Delete
} = node;
[42597] Fix | Delete
const {
[42598] Fix | Delete
defaultView
[42599] Fix | Delete
} = ownerDocument;
[42600] Fix | Delete
let anchorElement;
[42601] Fix | Delete
let rafId;
[42602] Fix | Delete
function onMouseUp() {
[42603] Fix | Delete
stopMultiSelect();
[42604] Fix | Delete
// Equivalent to attaching the listener once.
[42605] Fix | Delete
defaultView.removeEventListener('mouseup', onMouseUp);
[42606] Fix | Delete
// The browser selection won't have updated yet at this point,
[42607] Fix | Delete
// so wait until the next animation frame to get the browser
[42608] Fix | Delete
// selection.
[42609] Fix | Delete
rafId = defaultView.requestAnimationFrame(() => {
[42610] Fix | Delete
if (!hasSelectedBlock()) {
[42611] Fix | Delete
return;
[42612] Fix | Delete
}
[42613] Fix | Delete
[42614] Fix | Delete
// If the selection is complete (on mouse up), and no
[42615] Fix | Delete
// multiple blocks have been selected, set focus back to the
[42616] Fix | Delete
// anchor element. if the anchor element contains the
[42617] Fix | Delete
// selection. Additionally, the contentEditable wrapper can
[42618] Fix | Delete
// now be disabled again.
[42619] Fix | Delete
setContentEditableWrapper(node, false);
[42620] Fix | Delete
const selection = defaultView.getSelection();
[42621] Fix | Delete
if (selection.rangeCount) {
[42622] Fix | Delete
const range = selection.getRangeAt(0);
[42623] Fix | Delete
const {
[42624] Fix | Delete
commonAncestorContainer
[42625] Fix | Delete
} = range;
[42626] Fix | Delete
const clonedRange = range.cloneRange();
[42627] Fix | Delete
if (anchorElement.contains(commonAncestorContainer)) {
[42628] Fix | Delete
anchorElement.focus();
[42629] Fix | Delete
selection.removeAllRanges();
[42630] Fix | Delete
selection.addRange(clonedRange);
[42631] Fix | Delete
}
[42632] Fix | Delete
}
[42633] Fix | Delete
});
[42634] Fix | Delete
}
[42635] Fix | Delete
function onMouseLeave({
[42636] Fix | Delete
buttons,
[42637] Fix | Delete
target,
[42638] Fix | Delete
relatedTarget
[42639] Fix | Delete
}) {
[42640] Fix | Delete
// If we're moving into a child element, ignore. We're tracking
[42641] Fix | Delete
// the mouse leaving the element to a parent, no a child.
[42642] Fix | Delete
if (target.contains(relatedTarget)) {
[42643] Fix | Delete
return;
[42644] Fix | Delete
}
[42645] Fix | Delete
[42646] Fix | Delete
// Avoid triggering a multi-selection if the user is already
[42647] Fix | Delete
// dragging blocks.
[42648] Fix | Delete
if (isDraggingBlocks()) {
[42649] Fix | Delete
return;
[42650] Fix | Delete
}
[42651] Fix | Delete
[42652] Fix | Delete
// The primary button must be pressed to initiate selection.
[42653] Fix | Delete
// See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
[42654] Fix | Delete
if (buttons !== 1) {
[42655] Fix | Delete
return;
[42656] Fix | Delete
}
[42657] Fix | Delete
[42658] Fix | Delete
// Abort if we are already multi-selecting.
[42659] Fix | Delete
if (isMultiSelecting()) {
[42660] Fix | Delete
return;
[42661] Fix | Delete
}
[42662] Fix | Delete
[42663] Fix | Delete
// Abort if selection is leaving writing flow.
[42664] Fix | Delete
if (node === target) {
[42665] Fix | Delete
return;
[42666] Fix | Delete
}
[42667] Fix | Delete
[42668] Fix | Delete
// Check the attribute, not the contentEditable attribute. All
[42669] Fix | Delete
// child elements of the content editable wrapper are editable
[42670] Fix | Delete
// and return true for this property. We only want to start
[42671] Fix | Delete
// multi selecting when the mouse leaves the wrapper.
[42672] Fix | Delete
if (target.getAttribute('contenteditable') !== 'true') {
[42673] Fix | Delete
return;
[42674] Fix | Delete
}
[42675] Fix | Delete
if (!isSelectionEnabled()) {
[42676] Fix | Delete
return;
[42677] Fix | Delete
}
[42678] Fix | Delete
[42679] Fix | Delete
// Do not rely on the active element because it may change after
[42680] Fix | Delete
// the mouse leaves for the first time. See
[42681] Fix | Delete
// https://github.com/WordPress/gutenberg/issues/48747.
[42682] Fix | Delete
anchorElement = target;
[42683] Fix | Delete
startMultiSelect();
[42684] Fix | Delete
[42685] Fix | Delete
// `onSelectionStart` is called after `mousedown` and
[42686] Fix | Delete
// `mouseleave` (from a block). The selection ends when
[42687] Fix | Delete
// `mouseup` happens anywhere in the window.
[42688] Fix | Delete
defaultView.addEventListener('mouseup', onMouseUp);
[42689] Fix | Delete
[42690] Fix | Delete
// Allow cross contentEditable selection by temporarily making
[42691] Fix | Delete
// all content editable. We can't rely on using the store and
[42692] Fix | Delete
// React because re-rending happens too slowly. We need to be
[42693] Fix | Delete
// able to select across instances immediately.
[42694] Fix | Delete
setContentEditableWrapper(node, true);
[42695] Fix | Delete
}
[42696] Fix | Delete
node.addEventListener('mouseout', onMouseLeave);
[42697] Fix | Delete
return () => {
[42698] Fix | Delete
node.removeEventListener('mouseout', onMouseLeave);
[42699] Fix | Delete
defaultView.removeEventListener('mouseup', onMouseUp);
[42700] Fix | Delete
defaultView.cancelAnimationFrame(rafId);
[42701] Fix | Delete
};
[42702] Fix | Delete
}, [startMultiSelect, stopMultiSelect, isSelectionEnabled, hasSelectedBlock]);
[42703] Fix | Delete
}
[42704] Fix | Delete
[42705] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-selection-observer.js
[42706] Fix | Delete
/**
[42707] Fix | Delete
* WordPress dependencies
[42708] Fix | Delete
*/
[42709] Fix | Delete
[42710] Fix | Delete
[42711] Fix | Delete
[42712] Fix | Delete
[42713] Fix | Delete
/**
[42714] Fix | Delete
* Internal dependencies
[42715] Fix | Delete
*/
[42716] Fix | Delete
[42717] Fix | Delete
[42718] Fix | Delete
[42719] Fix | Delete
/**
[42720] Fix | Delete
* Extract the selection start node from the selection. When the anchor node is
[42721] Fix | Delete
* not a text node, the selection offset is the index of a child node.
[42722] Fix | Delete
*
[42723] Fix | Delete
* @param {Selection} selection The selection.
[42724] Fix | Delete
*
[42725] Fix | Delete
* @return {Element} The selection start node.
[42726] Fix | Delete
*/
[42727] Fix | Delete
function extractSelectionStartNode(selection) {
[42728] Fix | Delete
const {
[42729] Fix | Delete
anchorNode,
[42730] Fix | Delete
anchorOffset
[42731] Fix | Delete
} = selection;
[42732] Fix | Delete
if (anchorNode.nodeType === anchorNode.TEXT_NODE) {
[42733] Fix | Delete
return anchorNode;
[42734] Fix | Delete
}
[42735] Fix | Delete
if (anchorOffset === 0) {
[42736] Fix | Delete
return anchorNode;
[42737] Fix | Delete
}
[42738] Fix | Delete
return anchorNode.childNodes[anchorOffset - 1];
[42739] Fix | Delete
}
[42740] Fix | Delete
[42741] Fix | Delete
/**
[42742] Fix | Delete
* Extract the selection end node from the selection. When the focus node is not
[42743] Fix | Delete
* a text node, the selection offset is the index of a child node. The selection
[42744] Fix | Delete
* reaches up to but excluding that child node.
[42745] Fix | Delete
*
[42746] Fix | Delete
* @param {Selection} selection The selection.
[42747] Fix | Delete
*
[42748] Fix | Delete
* @return {Element} The selection start node.
[42749] Fix | Delete
*/
[42750] Fix | Delete
function extractSelectionEndNode(selection) {
[42751] Fix | Delete
const {
[42752] Fix | Delete
focusNode,
[42753] Fix | Delete
focusOffset
[42754] Fix | Delete
} = selection;
[42755] Fix | Delete
if (focusNode.nodeType === focusNode.TEXT_NODE) {
[42756] Fix | Delete
return focusNode;
[42757] Fix | Delete
}
[42758] Fix | Delete
if (focusOffset === focusNode.childNodes.length) {
[42759] Fix | Delete
return focusNode;
[42760] Fix | Delete
}
[42761] Fix | Delete
return focusNode.childNodes[focusOffset];
[42762] Fix | Delete
}
[42763] Fix | Delete
function findDepth(a, b) {
[42764] Fix | Delete
let depth = 0;
[42765] Fix | Delete
while (a[depth] === b[depth]) {
[42766] Fix | Delete
depth++;
[42767] Fix | Delete
}
[42768] Fix | Delete
return depth;
[42769] Fix | Delete
}
[42770] Fix | Delete
[42771] Fix | Delete
/**
[42772] Fix | Delete
* Sets the `contenteditable` wrapper element to `value`.
[42773] Fix | Delete
*
[42774] Fix | Delete
* @param {HTMLElement} node Block element.
[42775] Fix | Delete
* @param {boolean} value `contentEditable` value (true or false)
[42776] Fix | Delete
*/
[42777] Fix | Delete
function use_selection_observer_setContentEditableWrapper(node, value) {
[42778] Fix | Delete
// Since we are calling this on every selection change, check if the value
[42779] Fix | Delete
// needs to be updated first because it trigger the browser to recalculate
[42780] Fix | Delete
// style.
[42781] Fix | Delete
if (node.contentEditable !== String(value)) {
[42782] Fix | Delete
node.contentEditable = value;
[42783] Fix | Delete
[42784] Fix | Delete
// Firefox doesn't automatically move focus.
[42785] Fix | Delete
if (value) {
[42786] Fix | Delete
node.focus();
[42787] Fix | Delete
}
[42788] Fix | Delete
}
[42789] Fix | Delete
}
[42790] Fix | Delete
function getRichTextElement(node) {
[42791] Fix | Delete
const element = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement;
[42792] Fix | Delete
return element?.closest('[data-wp-block-attribute-key]');
[42793] Fix | Delete
}
[42794] Fix | Delete
[42795] Fix | Delete
/**
[42796] Fix | Delete
* Sets a multi-selection based on the native selection across blocks.
[42797] Fix | Delete
*/
[42798] Fix | Delete
function useSelectionObserver() {
[42799] Fix | Delete
const {
[42800] Fix | Delete
multiSelect,
[42801] Fix | Delete
selectBlock,
[42802] Fix | Delete
selectionChange
[42803] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[42804] Fix | Delete
const {
[42805] Fix | Delete
getBlockParents,
[42806] Fix | Delete
getBlockSelectionStart,
[42807] Fix | Delete
isMultiSelecting
[42808] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[42809] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[42810] Fix | Delete
const {
[42811] Fix | Delete
ownerDocument
[42812] Fix | Delete
} = node;
[42813] Fix | Delete
const {
[42814] Fix | Delete
defaultView
[42815] Fix | Delete
} = ownerDocument;
[42816] Fix | Delete
function onSelectionChange(event) {
[42817] Fix | Delete
const selection = defaultView.getSelection();
[42818] Fix | Delete
if (!selection.rangeCount) {
[42819] Fix | Delete
return;
[42820] Fix | Delete
}
[42821] Fix | Delete
const startNode = extractSelectionStartNode(selection);
[42822] Fix | Delete
const endNode = extractSelectionEndNode(selection);
[42823] Fix | Delete
if (!node.contains(startNode) || !node.contains(endNode)) {
[42824] Fix | Delete
return;
[42825] Fix | Delete
}
[42826] Fix | Delete
[42827] Fix | Delete
// If selection is collapsed and we haven't used `shift+click`,
[42828] Fix | Delete
// end multi selection and disable the contentEditable wrapper.
[42829] Fix | Delete
// We have to check about `shift+click` case because elements
[42830] Fix | Delete
// that don't support text selection might be involved, and we might
[42831] Fix | Delete
// update the clientIds to multi-select blocks.
[42832] Fix | Delete
// For now we check if the event is a `mouse` event.
[42833] Fix | Delete
const isClickShift = event.shiftKey && event.type === 'mouseup';
[42834] Fix | Delete
if (selection.isCollapsed && !isClickShift) {
[42835] Fix | Delete
if (node.contentEditable === 'true' && !isMultiSelecting()) {
[42836] Fix | Delete
use_selection_observer_setContentEditableWrapper(node, false);
[42837] Fix | Delete
let element = startNode.nodeType === startNode.ELEMENT_NODE ? startNode : startNode.parentElement;
[42838] Fix | Delete
element = element?.closest('[contenteditable]');
[42839] Fix | Delete
element?.focus();
[42840] Fix | Delete
}
[42841] Fix | Delete
return;
[42842] Fix | Delete
}
[42843] Fix | Delete
let startClientId = getBlockClientId(startNode);
[42844] Fix | Delete
let endClientId = getBlockClientId(endNode);
[42845] Fix | Delete
[42846] Fix | Delete
// If the selection has changed and we had pressed `shift+click`,
[42847] Fix | Delete
// we need to check if in an element that doesn't support
[42848] Fix | Delete
// text selection has been clicked.
[42849] Fix | Delete
if (isClickShift) {
[42850] Fix | Delete
const selectedClientId = getBlockSelectionStart();
[42851] Fix | Delete
const clickedClientId = getBlockClientId(event.target);
[42852] Fix | Delete
// `endClientId` is not defined if we end the selection by clicking a non-selectable block.
[42853] Fix | Delete
// We need to check if there was already a selection with a non-selectable focusNode.
[42854] Fix | Delete
const focusNodeIsNonSelectable = clickedClientId !== endClientId;
[42855] Fix | Delete
if (startClientId === endClientId && selection.isCollapsed || !endClientId || focusNodeIsNonSelectable) {
[42856] Fix | Delete
endClientId = clickedClientId;
[42857] Fix | Delete
}
[42858] Fix | Delete
// Handle the case when we have a non-selectable block
[42859] Fix | Delete
// selected and click another one.
[42860] Fix | Delete
if (startClientId !== selectedClientId) {
[42861] Fix | Delete
startClientId = selectedClientId;
[42862] Fix | Delete
}
[42863] Fix | Delete
}
[42864] Fix | Delete
[42865] Fix | Delete
// If the selection did not involve a block, return.
[42866] Fix | Delete
if (startClientId === undefined && endClientId === undefined) {
[42867] Fix | Delete
use_selection_observer_setContentEditableWrapper(node, false);
[42868] Fix | Delete
return;
[42869] Fix | Delete
}
[42870] Fix | Delete
const isSingularSelection = startClientId === endClientId;
[42871] Fix | Delete
if (isSingularSelection) {
[42872] Fix | Delete
if (!isMultiSelecting()) {
[42873] Fix | Delete
selectBlock(startClientId);
[42874] Fix | Delete
} else {
[42875] Fix | Delete
multiSelect(startClientId, startClientId);
[42876] Fix | Delete
}
[42877] Fix | Delete
} else {
[42878] Fix | Delete
const startPath = [...getBlockParents(startClientId), startClientId];
[42879] Fix | Delete
const endPath = [...getBlockParents(endClientId), endClientId];
[42880] Fix | Delete
const depth = findDepth(startPath, endPath);
[42881] Fix | Delete
if (startPath[depth] !== startClientId || endPath[depth] !== endClientId) {
[42882] Fix | Delete
multiSelect(startPath[depth], endPath[depth]);
[42883] Fix | Delete
return;
[42884] Fix | Delete
}
[42885] Fix | Delete
const richTextElementStart = getRichTextElement(startNode);
[42886] Fix | Delete
const richTextElementEnd = getRichTextElement(endNode);
[42887] Fix | Delete
if (richTextElementStart && richTextElementEnd) {
[42888] Fix | Delete
var _richTextDataStart$st, _richTextDataEnd$star;
[42889] Fix | Delete
const range = selection.getRangeAt(0);
[42890] Fix | Delete
const richTextDataStart = (0,external_wp_richText_namespaceObject.create)({
[42891] Fix | Delete
element: richTextElementStart,
[42892] Fix | Delete
range,
[42893] Fix | Delete
__unstableIsEditableTree: true
[42894] Fix | Delete
});
[42895] Fix | Delete
const richTextDataEnd = (0,external_wp_richText_namespaceObject.create)({
[42896] Fix | Delete
element: richTextElementEnd,
[42897] Fix | Delete
range,
[42898] Fix | Delete
__unstableIsEditableTree: true
[42899] Fix | Delete
});
[42900] Fix | Delete
const startOffset = (_richTextDataStart$st = richTextDataStart.start) !== null && _richTextDataStart$st !== void 0 ? _richTextDataStart$st : richTextDataStart.end;
[42901] Fix | Delete
const endOffset = (_richTextDataEnd$star = richTextDataEnd.start) !== null && _richTextDataEnd$star !== void 0 ? _richTextDataEnd$star : richTextDataEnd.end;
[42902] Fix | Delete
selectionChange({
[42903] Fix | Delete
start: {
[42904] Fix | Delete
clientId: startClientId,
[42905] Fix | Delete
attributeKey: richTextElementStart.dataset.wpBlockAttributeKey,
[42906] Fix | Delete
offset: startOffset
[42907] Fix | Delete
},
[42908] Fix | Delete
end: {
[42909] Fix | Delete
clientId: endClientId,
[42910] Fix | Delete
attributeKey: richTextElementEnd.dataset.wpBlockAttributeKey,
[42911] Fix | Delete
offset: endOffset
[42912] Fix | Delete
}
[42913] Fix | Delete
});
[42914] Fix | Delete
} else {
[42915] Fix | Delete
multiSelect(startClientId, endClientId);
[42916] Fix | Delete
}
[42917] Fix | Delete
}
[42918] Fix | Delete
}
[42919] Fix | Delete
ownerDocument.addEventListener('selectionchange', onSelectionChange);
[42920] Fix | Delete
defaultView.addEventListener('mouseup', onSelectionChange);
[42921] Fix | Delete
return () => {
[42922] Fix | Delete
ownerDocument.removeEventListener('selectionchange', onSelectionChange);
[42923] Fix | Delete
defaultView.removeEventListener('mouseup', onSelectionChange);
[42924] Fix | Delete
};
[42925] Fix | Delete
}, [multiSelect, selectBlock, selectionChange, getBlockParents]);
[42926] Fix | Delete
}
[42927] Fix | Delete
[42928] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-click-selection.js
[42929] Fix | Delete
/**
[42930] Fix | Delete
* WordPress dependencies
[42931] Fix | Delete
*/
[42932] Fix | Delete
[42933] Fix | Delete
[42934] Fix | Delete
[42935] Fix | Delete
/**
[42936] Fix | Delete
* Internal dependencies
[42937] Fix | Delete
*/
[42938] Fix | Delete
[42939] Fix | Delete
[42940] Fix | Delete
function useClickSelection() {
[42941] Fix | Delete
const {
[42942] Fix | Delete
selectBlock
[42943] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
[42944] Fix | Delete
const {
[42945] Fix | Delete
isSelectionEnabled,
[42946] Fix | Delete
getBlockSelectionStart,
[42947] Fix | Delete
hasMultiSelection
[42948] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(store);
[42949] Fix | Delete
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
[42950] Fix | Delete
function onMouseDown(event) {
[42951] Fix | Delete
// The main button.
[42952] Fix | Delete
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
[42953] Fix | Delete
if (!isSelectionEnabled() || event.button !== 0) {
[42954] Fix | Delete
return;
[42955] Fix | Delete
}
[42956] Fix | Delete
const startClientId = getBlockSelectionStart();
[42957] Fix | Delete
const clickedClientId = getBlockClientId(event.target);
[42958] Fix | Delete
if (event.shiftKey) {
[42959] Fix | Delete
if (startClientId !== clickedClientId) {
[42960] Fix | Delete
node.contentEditable = true;
[42961] Fix | Delete
// Firefox doesn't automatically move focus.
[42962] Fix | Delete
node.focus();
[42963] Fix | Delete
}
[42964] Fix | Delete
} else if (hasMultiSelection()) {
[42965] Fix | Delete
// Allow user to escape out of a multi-selection to a
[42966] Fix | Delete
// singular selection of a block via click. This is handled
[42967] Fix | Delete
// here since focus handling excludes blocks when there is
[42968] Fix | Delete
// multiselection, as focus can be incurred by starting a
[42969] Fix | Delete
// multiselection (focus moved to first block's multi-
[42970] Fix | Delete
// controls).
[42971] Fix | Delete
selectBlock(clickedClientId);
[42972] Fix | Delete
}
[42973] Fix | Delete
}
[42974] Fix | Delete
node.addEventListener('mousedown', onMouseDown);
[42975] Fix | Delete
return () => {
[42976] Fix | Delete
node.removeEventListener('mousedown', onMouseDown);
[42977] Fix | Delete
};
[42978] Fix | Delete
}, [selectBlock, isSelectionEnabled, getBlockSelectionStart, hasMultiSelection]);
[42979] Fix | Delete
}
[42980] Fix | Delete
[42981] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-input.js
[42982] Fix | Delete
/**
[42983] Fix | Delete
* WordPress dependencies
[42984] Fix | Delete
*/
[42985] Fix | Delete
[42986] Fix | Delete
[42987] Fix | Delete
[42988] Fix | Delete
[42989] Fix | Delete
[42990] Fix | Delete
/**
[42991] Fix | Delete
* Internal dependencies
[42992] Fix | Delete
*/
[42993] Fix | Delete
[42994] Fix | Delete
[42995] Fix | Delete
/**
[42996] Fix | Delete
* Handles input for selections across blocks.
[42997] Fix | Delete
*/
[42998] Fix | Delete
function useInput() {
[42999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function