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: compose.js
/* eslint-enable jsdoc/no-undefined-types */
[5500] Fix | Delete
// Disable reason: We're doing something pretty JavaScript-y here where the
[5501] Fix | Delete
// ref will always have a current value that is not null or undefined but it
[5502] Fix | Delete
// needs to start as undefined. We don't want to change the return type so
[5503] Fix | Delete
// it's easier to just ts-ignore this specific line that's complaining about
[5504] Fix | Delete
// undefined not being part of T.
[5505] Fix | Delete
// @ts-ignore
[5506] Fix | Delete
const ref = (0,external_wp_element_namespaceObject.useRef)();
[5507] Fix | Delete
ref.current = value;
[5508] Fix | Delete
return ref;
[5509] Fix | Delete
}
[5510] Fix | Delete
[5511] Fix | Delete
/**
[5512] Fix | Delete
* A hook to facilitate drag and drop handling.
[5513] Fix | Delete
*
[5514] Fix | Delete
* @param {Object} props Named parameters.
[5515] Fix | Delete
* @param {?HTMLElement} [props.dropZoneElement] Optional element to be used as the drop zone.
[5516] Fix | Delete
* @param {boolean} [props.isDisabled] Whether or not to disable the drop zone.
[5517] Fix | Delete
* @param {(e: DragEvent) => void} [props.onDragStart] Called when dragging has started.
[5518] Fix | Delete
* @param {(e: DragEvent) => void} [props.onDragEnter] Called when the zone is entered.
[5519] Fix | Delete
* @param {(e: DragEvent) => void} [props.onDragOver] Called when the zone is moved within.
[5520] Fix | Delete
* @param {(e: DragEvent) => void} [props.onDragLeave] Called when the zone is left.
[5521] Fix | Delete
* @param {(e: MouseEvent) => void} [props.onDragEnd] Called when dragging has ended.
[5522] Fix | Delete
* @param {(e: DragEvent) => void} [props.onDrop] Called when dropping in the zone.
[5523] Fix | Delete
*
[5524] Fix | Delete
* @return {import('react').RefCallback<HTMLElement>} Ref callback to be passed to the drop zone element.
[5525] Fix | Delete
*/
[5526] Fix | Delete
function useDropZone({
[5527] Fix | Delete
dropZoneElement,
[5528] Fix | Delete
isDisabled,
[5529] Fix | Delete
onDrop: _onDrop,
[5530] Fix | Delete
onDragStart: _onDragStart,
[5531] Fix | Delete
onDragEnter: _onDragEnter,
[5532] Fix | Delete
onDragLeave: _onDragLeave,
[5533] Fix | Delete
onDragEnd: _onDragEnd,
[5534] Fix | Delete
onDragOver: _onDragOver
[5535] Fix | Delete
}) {
[5536] Fix | Delete
const onDropRef = useFreshRef(_onDrop);
[5537] Fix | Delete
const onDragStartRef = useFreshRef(_onDragStart);
[5538] Fix | Delete
const onDragEnterRef = useFreshRef(_onDragEnter);
[5539] Fix | Delete
const onDragLeaveRef = useFreshRef(_onDragLeave);
[5540] Fix | Delete
const onDragEndRef = useFreshRef(_onDragEnd);
[5541] Fix | Delete
const onDragOverRef = useFreshRef(_onDragOver);
[5542] Fix | Delete
return useRefEffect(elem => {
[5543] Fix | Delete
if (isDisabled) {
[5544] Fix | Delete
return;
[5545] Fix | Delete
}
[5546] Fix | Delete
[5547] Fix | Delete
// If a custom dropZoneRef is passed, use that instead of the element.
[5548] Fix | Delete
// This allows the dropzone to cover an expanded area, rather than
[5549] Fix | Delete
// be restricted to the area of the ref returned by this hook.
[5550] Fix | Delete
const element = dropZoneElement !== null && dropZoneElement !== void 0 ? dropZoneElement : elem;
[5551] Fix | Delete
let isDragging = false;
[5552] Fix | Delete
const {
[5553] Fix | Delete
ownerDocument
[5554] Fix | Delete
} = element;
[5555] Fix | Delete
[5556] Fix | Delete
/**
[5557] Fix | Delete
* Checks if an element is in the drop zone.
[5558] Fix | Delete
*
[5559] Fix | Delete
* @param {EventTarget|null} targetToCheck
[5560] Fix | Delete
*
[5561] Fix | Delete
* @return {boolean} True if in drop zone, false if not.
[5562] Fix | Delete
*/
[5563] Fix | Delete
function isElementInZone(targetToCheck) {
[5564] Fix | Delete
const {
[5565] Fix | Delete
defaultView
[5566] Fix | Delete
} = ownerDocument;
[5567] Fix | Delete
if (!targetToCheck || !defaultView || !(targetToCheck instanceof defaultView.HTMLElement) || !element.contains(targetToCheck)) {
[5568] Fix | Delete
return false;
[5569] Fix | Delete
}
[5570] Fix | Delete
[5571] Fix | Delete
/** @type {HTMLElement|null} */
[5572] Fix | Delete
let elementToCheck = targetToCheck;
[5573] Fix | Delete
do {
[5574] Fix | Delete
if (elementToCheck.dataset.isDropZone) {
[5575] Fix | Delete
return elementToCheck === element;
[5576] Fix | Delete
}
[5577] Fix | Delete
} while (elementToCheck = elementToCheck.parentElement);
[5578] Fix | Delete
return false;
[5579] Fix | Delete
}
[5580] Fix | Delete
function maybeDragStart( /** @type {DragEvent} */event) {
[5581] Fix | Delete
if (isDragging) {
[5582] Fix | Delete
return;
[5583] Fix | Delete
}
[5584] Fix | Delete
isDragging = true;
[5585] Fix | Delete
[5586] Fix | Delete
// Note that `dragend` doesn't fire consistently for file and
[5587] Fix | Delete
// HTML drag events where the drag origin is outside the browser
[5588] Fix | Delete
// window. In Firefox it may also not fire if the originating
[5589] Fix | Delete
// node is removed.
[5590] Fix | Delete
ownerDocument.addEventListener('dragend', maybeDragEnd);
[5591] Fix | Delete
ownerDocument.addEventListener('mousemove', maybeDragEnd);
[5592] Fix | Delete
if (onDragStartRef.current) {
[5593] Fix | Delete
onDragStartRef.current(event);
[5594] Fix | Delete
}
[5595] Fix | Delete
}
[5596] Fix | Delete
function onDragEnter( /** @type {DragEvent} */event) {
[5597] Fix | Delete
event.preventDefault();
[5598] Fix | Delete
[5599] Fix | Delete
// The `dragenter` event will also fire when entering child
[5600] Fix | Delete
// elements, but we only want to call `onDragEnter` when
[5601] Fix | Delete
// entering the drop zone, which means the `relatedTarget`
[5602] Fix | Delete
// (element that has been left) should be outside the drop zone.
[5603] Fix | Delete
if (element.contains( /** @type {Node} */event.relatedTarget)) {
[5604] Fix | Delete
return;
[5605] Fix | Delete
}
[5606] Fix | Delete
if (onDragEnterRef.current) {
[5607] Fix | Delete
onDragEnterRef.current(event);
[5608] Fix | Delete
}
[5609] Fix | Delete
}
[5610] Fix | Delete
function onDragOver( /** @type {DragEvent} */event) {
[5611] Fix | Delete
// Only call onDragOver for the innermost hovered drop zones.
[5612] Fix | Delete
if (!event.defaultPrevented && onDragOverRef.current) {
[5613] Fix | Delete
onDragOverRef.current(event);
[5614] Fix | Delete
}
[5615] Fix | Delete
[5616] Fix | Delete
// Prevent the browser default while also signalling to parent
[5617] Fix | Delete
// drop zones that `onDragOver` is already handled.
[5618] Fix | Delete
event.preventDefault();
[5619] Fix | Delete
}
[5620] Fix | Delete
function onDragLeave( /** @type {DragEvent} */event) {
[5621] Fix | Delete
// The `dragleave` event will also fire when leaving child
[5622] Fix | Delete
// elements, but we only want to call `onDragLeave` when
[5623] Fix | Delete
// leaving the drop zone, which means the `relatedTarget`
[5624] Fix | Delete
// (element that has been entered) should be outside the drop
[5625] Fix | Delete
// zone.
[5626] Fix | Delete
// Note: This is not entirely reliable in Safari due to this bug
[5627] Fix | Delete
// https://bugs.webkit.org/show_bug.cgi?id=66547
[5628] Fix | Delete
if (isElementInZone(event.relatedTarget)) {
[5629] Fix | Delete
return;
[5630] Fix | Delete
}
[5631] Fix | Delete
if (onDragLeaveRef.current) {
[5632] Fix | Delete
onDragLeaveRef.current(event);
[5633] Fix | Delete
}
[5634] Fix | Delete
}
[5635] Fix | Delete
function onDrop( /** @type {DragEvent} */event) {
[5636] Fix | Delete
// Don't handle drop if an inner drop zone already handled it.
[5637] Fix | Delete
if (event.defaultPrevented) {
[5638] Fix | Delete
return;
[5639] Fix | Delete
}
[5640] Fix | Delete
[5641] Fix | Delete
// Prevent the browser default while also signalling to parent
[5642] Fix | Delete
// drop zones that `onDrop` is already handled.
[5643] Fix | Delete
event.preventDefault();
[5644] Fix | Delete
[5645] Fix | Delete
// This seemingly useless line has been shown to resolve a
[5646] Fix | Delete
// Safari issue where files dragged directly from the dock are
[5647] Fix | Delete
// not recognized.
[5648] Fix | Delete
// eslint-disable-next-line no-unused-expressions
[5649] Fix | Delete
event.dataTransfer && event.dataTransfer.files.length;
[5650] Fix | Delete
if (onDropRef.current) {
[5651] Fix | Delete
onDropRef.current(event);
[5652] Fix | Delete
}
[5653] Fix | Delete
maybeDragEnd(event);
[5654] Fix | Delete
}
[5655] Fix | Delete
function maybeDragEnd( /** @type {MouseEvent} */event) {
[5656] Fix | Delete
if (!isDragging) {
[5657] Fix | Delete
return;
[5658] Fix | Delete
}
[5659] Fix | Delete
isDragging = false;
[5660] Fix | Delete
ownerDocument.removeEventListener('dragend', maybeDragEnd);
[5661] Fix | Delete
ownerDocument.removeEventListener('mousemove', maybeDragEnd);
[5662] Fix | Delete
if (onDragEndRef.current) {
[5663] Fix | Delete
onDragEndRef.current(event);
[5664] Fix | Delete
}
[5665] Fix | Delete
}
[5666] Fix | Delete
element.dataset.isDropZone = 'true';
[5667] Fix | Delete
element.addEventListener('drop', onDrop);
[5668] Fix | Delete
element.addEventListener('dragenter', onDragEnter);
[5669] Fix | Delete
element.addEventListener('dragover', onDragOver);
[5670] Fix | Delete
element.addEventListener('dragleave', onDragLeave);
[5671] Fix | Delete
// The `dragstart` event doesn't fire if the drag started outside
[5672] Fix | Delete
// the document.
[5673] Fix | Delete
ownerDocument.addEventListener('dragenter', maybeDragStart);
[5674] Fix | Delete
return () => {
[5675] Fix | Delete
delete element.dataset.isDropZone;
[5676] Fix | Delete
element.removeEventListener('drop', onDrop);
[5677] Fix | Delete
element.removeEventListener('dragenter', onDragEnter);
[5678] Fix | Delete
element.removeEventListener('dragover', onDragOver);
[5679] Fix | Delete
element.removeEventListener('dragleave', onDragLeave);
[5680] Fix | Delete
ownerDocument.removeEventListener('dragend', maybeDragEnd);
[5681] Fix | Delete
ownerDocument.removeEventListener('mousemove', maybeDragEnd);
[5682] Fix | Delete
ownerDocument.removeEventListener('dragenter', maybeDragStart);
[5683] Fix | Delete
};
[5684] Fix | Delete
}, [isDisabled, dropZoneElement] // Refresh when the passed in dropZoneElement changes.
[5685] Fix | Delete
);
[5686] Fix | Delete
}
[5687] Fix | Delete
[5688] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focusable-iframe/index.js
[5689] Fix | Delete
/**
[5690] Fix | Delete
* External dependencies
[5691] Fix | Delete
*/
[5692] Fix | Delete
[5693] Fix | Delete
/**
[5694] Fix | Delete
* Internal dependencies
[5695] Fix | Delete
*/
[5696] Fix | Delete
[5697] Fix | Delete
[5698] Fix | Delete
/**
[5699] Fix | Delete
* Dispatches a bubbling focus event when the iframe receives focus. Use
[5700] Fix | Delete
* `onFocus` as usual on the iframe or a parent element.
[5701] Fix | Delete
*
[5702] Fix | Delete
* @return Ref to pass to the iframe.
[5703] Fix | Delete
*/
[5704] Fix | Delete
function useFocusableIframe() {
[5705] Fix | Delete
return useRefEffect(element => {
[5706] Fix | Delete
const {
[5707] Fix | Delete
ownerDocument
[5708] Fix | Delete
} = element;
[5709] Fix | Delete
if (!ownerDocument) {
[5710] Fix | Delete
return;
[5711] Fix | Delete
}
[5712] Fix | Delete
const {
[5713] Fix | Delete
defaultView
[5714] Fix | Delete
} = ownerDocument;
[5715] Fix | Delete
if (!defaultView) {
[5716] Fix | Delete
return;
[5717] Fix | Delete
}
[5718] Fix | Delete
[5719] Fix | Delete
/**
[5720] Fix | Delete
* Checks whether the iframe is the activeElement, inferring that it has
[5721] Fix | Delete
* then received focus, and dispatches a focus event.
[5722] Fix | Delete
*/
[5723] Fix | Delete
function checkFocus() {
[5724] Fix | Delete
if (ownerDocument && ownerDocument.activeElement === element) {
[5725] Fix | Delete
element.focus();
[5726] Fix | Delete
}
[5727] Fix | Delete
}
[5728] Fix | Delete
defaultView.addEventListener('blur', checkFocus);
[5729] Fix | Delete
return () => {
[5730] Fix | Delete
defaultView.removeEventListener('blur', checkFocus);
[5731] Fix | Delete
};
[5732] Fix | Delete
}, []);
[5733] Fix | Delete
}
[5734] Fix | Delete
[5735] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-fixed-window-list/index.js
[5736] Fix | Delete
/**
[5737] Fix | Delete
* WordPress dependencies
[5738] Fix | Delete
*/
[5739] Fix | Delete
[5740] Fix | Delete
[5741] Fix | Delete
[5742] Fix | Delete
[5743] Fix | Delete
/**
[5744] Fix | Delete
* Internal dependencies
[5745] Fix | Delete
*/
[5746] Fix | Delete
[5747] Fix | Delete
const DEFAULT_INIT_WINDOW_SIZE = 30;
[5748] Fix | Delete
[5749] Fix | Delete
/**
[5750] Fix | Delete
* @typedef {Object} WPFixedWindowList
[5751] Fix | Delete
*
[5752] Fix | Delete
* @property {number} visibleItems Items visible in the current viewport
[5753] Fix | Delete
* @property {number} start Start index of the window
[5754] Fix | Delete
* @property {number} end End index of the window
[5755] Fix | Delete
* @property {(index:number)=>boolean} itemInView Returns true if item is in the window
[5756] Fix | Delete
*/
[5757] Fix | Delete
[5758] Fix | Delete
/**
[5759] Fix | Delete
* @typedef {Object} WPFixedWindowListOptions
[5760] Fix | Delete
*
[5761] Fix | Delete
* @property {number} [windowOverscan] Renders windowOverscan number of items before and after the calculated visible window.
[5762] Fix | Delete
* @property {boolean} [useWindowing] When false avoids calculating the window size
[5763] Fix | Delete
* @property {number} [initWindowSize] Initial window size to use on first render before we can calculate the window size.
[5764] Fix | Delete
* @property {any} [expandedState] Used to recalculate the window size when the expanded state of a list changes.
[5765] Fix | Delete
*/
[5766] Fix | Delete
[5767] Fix | Delete
/**
[5768] Fix | Delete
*
[5769] Fix | Delete
* @param {import('react').RefObject<HTMLElement>} elementRef Used to find the closest scroll container that contains element.
[5770] Fix | Delete
* @param { number } itemHeight Fixed item height in pixels
[5771] Fix | Delete
* @param { number } totalItems Total items in list
[5772] Fix | Delete
* @param { WPFixedWindowListOptions } [options] Options object
[5773] Fix | Delete
* @return {[ WPFixedWindowList, setFixedListWindow:(nextWindow:WPFixedWindowList)=>void]} Array with the fixed window list and setter
[5774] Fix | Delete
*/
[5775] Fix | Delete
function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
[5776] Fix | Delete
var _options$initWindowSi, _options$useWindowing;
[5777] Fix | Delete
const initWindowSize = (_options$initWindowSi = options?.initWindowSize) !== null && _options$initWindowSi !== void 0 ? _options$initWindowSi : DEFAULT_INIT_WINDOW_SIZE;
[5778] Fix | Delete
const useWindowing = (_options$useWindowing = options?.useWindowing) !== null && _options$useWindowing !== void 0 ? _options$useWindowing : true;
[5779] Fix | Delete
const [fixedListWindow, setFixedListWindow] = (0,external_wp_element_namespaceObject.useState)({
[5780] Fix | Delete
visibleItems: initWindowSize,
[5781] Fix | Delete
start: 0,
[5782] Fix | Delete
end: initWindowSize,
[5783] Fix | Delete
itemInView: ( /** @type {number} */index) => {
[5784] Fix | Delete
return index >= 0 && index <= initWindowSize;
[5785] Fix | Delete
}
[5786] Fix | Delete
});
[5787] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[5788] Fix | Delete
if (!useWindowing) {
[5789] Fix | Delete
return;
[5790] Fix | Delete
}
[5791] Fix | Delete
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
[5792] Fix | Delete
const measureWindow = ( /** @type {boolean | undefined} */initRender) => {
[5793] Fix | Delete
var _options$windowOversc;
[5794] Fix | Delete
if (!scrollContainer) {
[5795] Fix | Delete
return;
[5796] Fix | Delete
}
[5797] Fix | Delete
const visibleItems = Math.ceil(scrollContainer.clientHeight / itemHeight);
[5798] Fix | Delete
// Aim to keep opening list view fast, afterward we can optimize for scrolling.
[5799] Fix | Delete
const windowOverscan = initRender ? visibleItems : (_options$windowOversc = options?.windowOverscan) !== null && _options$windowOversc !== void 0 ? _options$windowOversc : visibleItems;
[5800] Fix | Delete
const firstViewableIndex = Math.floor(scrollContainer.scrollTop / itemHeight);
[5801] Fix | Delete
const start = Math.max(0, firstViewableIndex - windowOverscan);
[5802] Fix | Delete
const end = Math.min(totalItems - 1, firstViewableIndex + visibleItems + windowOverscan);
[5803] Fix | Delete
setFixedListWindow(lastWindow => {
[5804] Fix | Delete
const nextWindow = {
[5805] Fix | Delete
visibleItems,
[5806] Fix | Delete
start,
[5807] Fix | Delete
end,
[5808] Fix | Delete
itemInView: ( /** @type {number} */index) => {
[5809] Fix | Delete
return start <= index && index <= end;
[5810] Fix | Delete
}
[5811] Fix | Delete
};
[5812] Fix | Delete
if (lastWindow.start !== nextWindow.start || lastWindow.end !== nextWindow.end || lastWindow.visibleItems !== nextWindow.visibleItems) {
[5813] Fix | Delete
return nextWindow;
[5814] Fix | Delete
}
[5815] Fix | Delete
return lastWindow;
[5816] Fix | Delete
});
[5817] Fix | Delete
};
[5818] Fix | Delete
measureWindow(true);
[5819] Fix | Delete
const debounceMeasureList = debounce(() => {
[5820] Fix | Delete
measureWindow();
[5821] Fix | Delete
}, 16);
[5822] Fix | Delete
scrollContainer?.addEventListener('scroll', debounceMeasureList);
[5823] Fix | Delete
scrollContainer?.ownerDocument?.defaultView?.addEventListener('resize', debounceMeasureList);
[5824] Fix | Delete
scrollContainer?.ownerDocument?.defaultView?.addEventListener('resize', debounceMeasureList);
[5825] Fix | Delete
return () => {
[5826] Fix | Delete
scrollContainer?.removeEventListener('scroll', debounceMeasureList);
[5827] Fix | Delete
scrollContainer?.ownerDocument?.defaultView?.removeEventListener('resize', debounceMeasureList);
[5828] Fix | Delete
};
[5829] Fix | Delete
}, [itemHeight, elementRef, totalItems, options?.expandedState, options?.windowOverscan, useWindowing]);
[5830] Fix | Delete
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
[5831] Fix | Delete
if (!useWindowing) {
[5832] Fix | Delete
return;
[5833] Fix | Delete
}
[5834] Fix | Delete
const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
[5835] Fix | Delete
const handleKeyDown = ( /** @type {KeyboardEvent} */event) => {
[5836] Fix | Delete
switch (event.keyCode) {
[5837] Fix | Delete
case external_wp_keycodes_namespaceObject.HOME:
[5838] Fix | Delete
{
[5839] Fix | Delete
return scrollContainer?.scrollTo({
[5840] Fix | Delete
top: 0
[5841] Fix | Delete
});
[5842] Fix | Delete
}
[5843] Fix | Delete
case external_wp_keycodes_namespaceObject.END:
[5844] Fix | Delete
{
[5845] Fix | Delete
return scrollContainer?.scrollTo({
[5846] Fix | Delete
top: totalItems * itemHeight
[5847] Fix | Delete
});
[5848] Fix | Delete
}
[5849] Fix | Delete
case external_wp_keycodes_namespaceObject.PAGEUP:
[5850] Fix | Delete
{
[5851] Fix | Delete
return scrollContainer?.scrollTo({
[5852] Fix | Delete
top: scrollContainer.scrollTop - fixedListWindow.visibleItems * itemHeight
[5853] Fix | Delete
});
[5854] Fix | Delete
}
[5855] Fix | Delete
case external_wp_keycodes_namespaceObject.PAGEDOWN:
[5856] Fix | Delete
{
[5857] Fix | Delete
return scrollContainer?.scrollTo({
[5858] Fix | Delete
top: scrollContainer.scrollTop + fixedListWindow.visibleItems * itemHeight
[5859] Fix | Delete
});
[5860] Fix | Delete
}
[5861] Fix | Delete
}
[5862] Fix | Delete
};
[5863] Fix | Delete
scrollContainer?.ownerDocument?.defaultView?.addEventListener('keydown', handleKeyDown);
[5864] Fix | Delete
return () => {
[5865] Fix | Delete
scrollContainer?.ownerDocument?.defaultView?.removeEventListener('keydown', handleKeyDown);
[5866] Fix | Delete
};
[5867] Fix | Delete
}, [totalItems, itemHeight, elementRef, fixedListWindow.visibleItems, useWindowing, options?.expandedState]);
[5868] Fix | Delete
return [fixedListWindow, setFixedListWindow];
[5869] Fix | Delete
}
[5870] Fix | Delete
[5871] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-observable-value/index.js
[5872] Fix | Delete
/**
[5873] Fix | Delete
* WordPress dependencies
[5874] Fix | Delete
*/
[5875] Fix | Delete
[5876] Fix | Delete
[5877] Fix | Delete
/**
[5878] Fix | Delete
* Internal dependencies
[5879] Fix | Delete
*/
[5880] Fix | Delete
[5881] Fix | Delete
/**
[5882] Fix | Delete
* React hook that lets you observe an entry in an `ObservableMap`. The hook returns the
[5883] Fix | Delete
* current value corresponding to the key, or `undefined` when there is no value stored.
[5884] Fix | Delete
* It also observes changes to the value and triggers an update of the calling component
[5885] Fix | Delete
* in case the value changes.
[5886] Fix | Delete
*
[5887] Fix | Delete
* @template K The type of the keys in the map.
[5888] Fix | Delete
* @template V The type of the values in the map.
[5889] Fix | Delete
* @param map The `ObservableMap` to observe.
[5890] Fix | Delete
* @param name The map key to observe.
[5891] Fix | Delete
* @return The value corresponding to the map key requested.
[5892] Fix | Delete
*/
[5893] Fix | Delete
function useObservableValue(map, name) {
[5894] Fix | Delete
const [subscribe, getValue] = (0,external_wp_element_namespaceObject.useMemo)(() => [listener => map.subscribe(name, listener), () => map.get(name)], [map, name]);
[5895] Fix | Delete
return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, getValue, getValue);
[5896] Fix | Delete
}
[5897] Fix | Delete
[5898] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/index.js
[5899] Fix | Delete
// The `createHigherOrderComponent` helper and helper types.
[5900] Fix | Delete
[5901] Fix | Delete
// The `debounce` helper and its types.
[5902] Fix | Delete
[5903] Fix | Delete
// The `throttle` helper and its types.
[5904] Fix | Delete
[5905] Fix | Delete
// The `ObservableMap` data structure
[5906] Fix | Delete
[5907] Fix | Delete
[5908] Fix | Delete
// The `compose` and `pipe` helpers (inspired by `flowRight` and `flow` from Lodash).
[5909] Fix | Delete
[5910] Fix | Delete
[5911] Fix | Delete
[5912] Fix | Delete
// Higher-order components.
[5913] Fix | Delete
[5914] Fix | Delete
[5915] Fix | Delete
[5916] Fix | Delete
[5917] Fix | Delete
[5918] Fix | Delete
[5919] Fix | Delete
[5920] Fix | Delete
// Hooks.
[5921] Fix | Delete
[5922] Fix | Delete
[5923] Fix | Delete
[5924] Fix | Delete
[5925] Fix | Delete
[5926] Fix | Delete
[5927] Fix | Delete
[5928] Fix | Delete
[5929] Fix | Delete
[5930] Fix | Delete
[5931] Fix | Delete
[5932] Fix | Delete
[5933] Fix | Delete
[5934] Fix | Delete
[5935] Fix | Delete
[5936] Fix | Delete
[5937] Fix | Delete
[5938] Fix | Delete
[5939] Fix | Delete
[5940] Fix | Delete
[5941] Fix | Delete
[5942] Fix | Delete
[5943] Fix | Delete
[5944] Fix | Delete
[5945] Fix | Delete
[5946] Fix | Delete
[5947] Fix | Delete
[5948] Fix | Delete
[5949] Fix | Delete
[5950] Fix | Delete
[5951] Fix | Delete
})();
[5952] Fix | Delete
[5953] Fix | Delete
(window.wp = window.wp || {}).compose = __webpack_exports__;
[5954] Fix | Delete
/******/ })()
[5955] Fix | Delete
;
[5956] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function