code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function includesSomeLane(a, b) {
return (a & b) !== NoLanes;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | includesSomeLane | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isSubsetOfLanes(set, subset) {
return (set & subset) === subset;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | isSubsetOfLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mergeLanes(a, b) {
return a | b;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | mergeLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function removeLanes(set, subset) {
return set & ~subset;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | removeLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function intersectLanes(a, b) {
return a & b;
} // Seems redundant, but it changes the type from a single lane (used for | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | intersectLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function laneToLanes(lane) {
return lane;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | laneToLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function higherPriorityLane(a, b) {
// This works because the bit ranges decrease in priority as you go left.
return a !== NoLane && a < b ? a : b;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | higherPriorityLane | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function createLaneMap(initial) {
// Intentionally pushing one by one.
// https://v8.dev/blog/elements-kinds#avoid-creating-holes
var laneMap = [];
for (var i = 0; i < TotalLanes; i++) {
laneMap.push(initial);
}
return laneMap;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | createLaneMap | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markRootUpdated(root, updateLane, eventTime) {
root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update
// could unblock them. Clear the suspended lanes so that we can try rendering
// them again.
//
// TODO: We really only need to unsuspend ... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | markRootUpdated | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markRootSuspended(root, suspendedLanes) {
root.suspendedLanes |= suspendedLanes;
root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times.
var expirationTimes = root.expirationTimes;
var lanes = suspendedLanes;
while (lanes > 0) {
... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | markRootSuspended | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markRootPinged(root, pingedLanes, eventTime) {
root.pingedLanes |= root.suspendedLanes & pingedLanes;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | markRootPinged | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markRootFinished(root, remainingLanes) {
var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;
root.pendingLanes = remainingLanes; // Let's try everything again
root.suspendedLanes = NoLanes;
root.pingedLanes = NoLanes;
root.expiredLanes &= remainingLanes;
root.mutableReadLan... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | markRootFinished | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markRootEntangled(root, entangledLanes) {
// In addition to entangling each of the given lanes with each other, we also
// have to consider _transitive_ entanglements. For each lane that is already
// entangled with *any* of the given lanes, that lane is now transitively
// entangled with *all*... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | markRootEntangled | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getBumpedLaneForHydration(root, renderLanes) {
var renderLane = getHighestPriorityLane(renderLanes);
var lane;
switch (renderLane) {
case InputContinuousLane:
lane = InputContinuousHydrationLane;
break;
case DefaultLane:
lane = DefaultHydrationLane;
bre... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | getBumpedLaneForHydration | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function addFiberToLanesMap(root, fiber, lanes) {
if (!isDevToolsPresent) {
return;
}
var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;
while (lanes > 0) {
var index = laneToIndex(lanes);
var lane = 1 << index;
var updaters = pendingUpdatersLaneMap[index];
update... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | addFiberToLanesMap | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function movePendingFibersToMemoized(root, lanes) {
if (!isDevToolsPresent) {
return;
}
var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;
var memoizedUpdaters = root.memoizedUpdaters;
while (lanes > 0) {
var index = laneToIndex(lanes);
var lane = 1 << index;
var up... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | movePendingFibersToMemoized | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getTransitionsForLanes(root, lanes) {
{
return null;
}
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | getTransitionsForLanes | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getCurrentUpdatePriority() {
return currentUpdatePriority;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | getCurrentUpdatePriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setCurrentUpdatePriority(newPriority) {
currentUpdatePriority = newPriority;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setCurrentUpdatePriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function runWithPriority(priority, fn) {
var previousPriority = currentUpdatePriority;
try {
currentUpdatePriority = priority;
return fn();
} finally {
currentUpdatePriority = previousPriority;
}
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | runWithPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function higherEventPriority(a, b) {
return a !== 0 && a < b ? a : b;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | higherEventPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function lowerEventPriority(a, b) {
return a === 0 || a > b ? a : b;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | lowerEventPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isHigherEventPriority(a, b) {
return a !== 0 && a < b;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | isHigherEventPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function lanesToEventPriority(lanes) {
var lane = getHighestPriorityLane(lanes);
if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
return DiscreteEventPriority;
}
if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
return ContinuousEventPriority;
}
if (includesNo... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | lanesToEventPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isRootDehydrated(root) {
var currentState = root.current.memoizedState;
return currentState.isDehydrated;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | isRootDehydrated | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setAttemptSynchronousHydration(fn) {
_attemptSynchronousHydration = fn;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setAttemptSynchronousHydration | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setAttemptContinuousHydration(fn) {
attemptContinuousHydration = fn;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setAttemptContinuousHydration | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setAttemptHydrationAtCurrentPriority(fn) {
attemptHydrationAtCurrentPriority = fn;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setAttemptHydrationAtCurrentPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setGetCurrentUpdatePriority(fn) {
getCurrentUpdatePriority$1 = fn;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setGetCurrentUpdatePriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setAttemptHydrationAtPriority(fn) {
attemptHydrationAtPriority = fn;
} // TODO: Upgrade this definition once we're on a newer version of Flow that | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setAttemptHydrationAtPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isDiscreteEventThatRequiresHydration(eventType) {
return discreteReplayableEvents.indexOf(eventType) > -1;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | isDiscreteEventThatRequiresHydration | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
return {
blockedOn: blockedOn,
domEventName: domEventName,
eventSystemFlags: eventSystemFlags,
nativeEvent: nativeEvent,
targetContainers: [targetContainer]
};
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | createQueuedReplayableEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function clearIfContinuousEvent(domEventName, nativeEvent) {
switch (domEventName) {
case 'focusin':
case 'focusout':
queuedFocus = null;
break;
case 'dragenter':
case 'dragleave':
queuedDrag = null;
break;
case 'mouseover':
case 'mouseout':
... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | clearIfContinuousEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventNam... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | accumulateOrCreateContinuousQueuedReplayableEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
// These set relatedTarget to null because the replayed event will be treated as if we
// moved from outside the window (no target) onto the target once it hydrates.
// Instead of mutating we could clo... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | queueIfContinuousEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function attemptExplicitHydrationTarget(queuedTarget) {
// TODO: This function shares a lot of logic with findInstanceBlockingEvent.
// Try to unify them. It's a bit tricky since it would require two return
// values.
var targetInst = getClosestInstanceFromNode(queuedTarget.target);
if (targetInst ... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | attemptExplicitHydrationTarget | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function queueExplicitHydrationTarget(target) {
// TODO: This will read the priority if it's dispatched by the React
// event system but not native events. Should read window.event.type, like
// we do for updates (getCurrentEventPriority).
var updatePriority = getCurrentUpdatePriority$1();
var queue... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | queueExplicitHydrationTarget | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function attemptReplayContinuousQueuedEvent(queuedEvent) {
if (queuedEvent.blockedOn !== null) {
return false;
}
var targetContainers = queuedEvent.targetContainers;
while (targetContainers.length > 0) {
var targetContainer = targetContainers[0];
var nextBlockedOn = findInstanceBlock... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | attemptReplayContinuousQueuedEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
map.delete(key);
}
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | attemptReplayContinuousQueuedEventInMap | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function replayUnblockedEvents() {
hasScheduledReplayAttempt = false;
if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
queuedFocus = null;
}
if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
queuedDrag = null;
}
if (queuedM... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | replayUnblockedEvents | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
if (queuedEvent.blockedOn === unblocked) {
queuedEvent.blockedOn = null;
if (!hasScheduledReplayAttempt) {
hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
// now unblocked.... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | scheduleCallbackIfUnblocked | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function retryIfBlockedOn(unblocked) {
// Mark anything that was blocked on this as no longer blocked
// and eligible for a replay.
if (queuedDiscreteEvents.length > 0) {
scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I ... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | retryIfBlockedOn | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
unblock = function (queuedEvent) {
return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | unblock | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setEnabled(enabled) {
_enabled = !!enabled;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | setEnabled | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isEnabled() {
return _enabled;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | isEnabled | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
var eventPriority = getEventPriority(domEventName);
var listenerWrapper;
switch (eventPriority) {
case DiscreteEventPriority:
listenerWrapper = dispatchDiscreteEvent;
break;
case ... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | createEventListenerWrapperWithPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
var previousPriority = getCurrentUpdatePriority();
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = null;
try {
setCurrentUpdatePriority(DiscreteEventPriority);
... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | dispatchDiscreteEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
var previousPriority = getCurrentUpdatePriority();
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = null;
try {
setCurrentUpdatePriority(ContinuousEventPriority)... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | dispatchContinuousEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
if (!_enabled) {
return;
}
{
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
}
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | dispatchEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
if (blockedOn === null) {
dispatchEventForPlugi... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
// TODO: Warn if _enabled is false.
return_targetInst = null;
var nativeEventTarget = getEventTarget(nativeEvent);
var targetInst = getClosestInstanceFromNode(nativeEventTarget);
if (targetInst !== nu... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | findInstanceBlockingEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getEventPriority(domEventName) {
switch (domEventName) {
// Used by SimpleEventPlugin:
case 'cancel':
case 'click':
case 'close':
case 'contextmenu':
case 'copy':
case 'cut':
case 'auxclick':
case 'dblclick':
case 'dragend':
case 'dragstart'... | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | getEventPriority | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function addEventBubbleListener(target, eventType, listener) {
target.addEventListener(eventType, listener, false);
return listener;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | addEventBubbleListener | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function addEventCaptureListener(target, eventType, listener) {
target.addEventListener(eventType, listener, true);
return listener;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | addEventCaptureListener | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
target.addEventListener(eventType, listener, {
capture: true,
passive: passive
});
return listener;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | addEventCaptureListenerWithPassiveFlag | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
target.addEventListener(eventType, listener, {
passive: passive
});
return listener;
} | `ReactInstanceMap` maintains a mapping from a public facing stateful
instance (key) and the internal representation (value). This allows public
methods to accept the user facing instance as an argument and map them back
to internal methods.
Note that this module is currently shared and assumed to be stateless.
If this... | addEventBubbleListenerWithPassiveFlag | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function initialize(nativeEventTarget) {
root = nativeEventTarget;
startText = getText();
return true;
} | These variables store information about text content of a target node,
allowing comparison of content before and after a given event.
Identify the node where selection currently begins, then observe
both its text content and its current position in the DOM. Since the
browser may natively replace the target node during... | initialize | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function reset() {
root = null;
startText = null;
fallbackText = null;
} | These variables store information about text content of a target node,
allowing comparison of content before and after a given event.
Identify the node where selection currently begins, then observe
both its text content and its current position in the DOM. Since the
browser may natively replace the target node during... | reset | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getData() {
if (fallbackText) {
return fallbackText;
}
var start;
var startValue = startText;
var startLength = startValue.length;
var end;
var endValue = getText();
var endLength = endValue.length;
for (start = 0; start < startLength; start++) {
if (startValue... | These variables store information about text content of a target node,
allowing comparison of content before and after a given event.
Identify the node where selection currently begins, then observe
both its text content and its current position in the DOM. Since the
browser may natively replace the target node during... | getData | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getText() {
if ('value' in root) {
return root.value;
}
return root.textContent;
} | These variables store information about text content of a target node,
allowing comparison of content before and after a given event.
Identify the node where selection currently begins, then observe
both its text content and its current position in the DOM. Since the
browser may natively replace the target node during... | getText | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
... | `charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does ... | getEventCharCode | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function functionThatReturnsTrue() {
return true;
} | `charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does ... | functionThatReturnsTrue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function functionThatReturnsFalse() {
return false;
} // This is intentionally a factory so that we have different returned constructors. | `charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does ... | functionThatReturnsFalse | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function createSyntheticEvent(Interface) {
/**
* Synthetic events are dispatched by event plugins, typically in response to a
* top-level event delegation handler.
*
* These systems should generally use pooling to reduce the frequency of garbage
* collection. The system should check `isPers... | `charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does ... | createSyntheticEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
this._reactName = reactName;
this._targetInst = targetInst;
this.type = reactEventType;
this.nativeEvent = nativeEvent;
this.target = nativeEventTarget;
this.currentTarget = null;
... | Synthetic events are dispatched by event plugins, typically in response to a
top-level event delegation handler.
These systems should generally use pooling to reduce the frequency of garbage
collection. The system should check `isPersistent` to determine whether the
event should be released into the pool after being d... | SyntheticBaseEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateMouseMovementPolyfillState(event) {
if (event !== lastMouseEvent) {
if (lastMouseEvent && event.type === 'mousemove') {
lastMovementX = event.screenX - lastMouseEvent.screenX;
lastMovementY = event.screenY - lastMouseEvent.screenY;
} else {
lastMovementX = 0;
... | @interface Event
@see http://www.w3.org/TR/DOM-Level-3-Events/ | updateMouseMovementPolyfillState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`... | @param {object} nativeEvent Native browser event.
@return {string} Normalized `key` property. | getEventKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
} | Translation from modifier key to the associated property in the event.
@see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers | modifierStateGetter | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
} | Translation from modifier key to the associated property in the event.
@see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers | getEventModifierState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function registerEvents() {
registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);
registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);
registerTwoPhaseEvent('onCompositionStart', ['compositionstart', '... | @interface WheelEvent
@see http://www.w3.org/TR/DOM-Level-3-Events/ | registerEvents | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isKeypressCommand(nativeEvent) {
return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
!(nativeEvent.ctrlKey && nativeEvent.altKey);
} | Return whether a native keypress event is assumed to be a command.
This is required because Firefox fires `keypress` events for key commands
(cut, copy, select-all, etc.) even though no character is inserted. | isKeypressCommand | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getCompositionEventType(domEventName) {
switch (domEventName) {
case 'compositionstart':
return 'onCompositionStart';
case 'compositionend':
return 'onCompositionEnd';
case 'compositionupdate':
return 'onCompositionUpdate';
}
} | Translate native top level events into event types. | getCompositionEventType | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isFallbackCompositionStart(domEventName, nativeEvent) {
return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;
} | Does our fallback best-guess model think this event signifies that
composition has begun? | isFallbackCompositionStart | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isFallbackCompositionEnd(domEventName, nativeEvent) {
switch (domEventName) {
case 'keyup':
// Command keys insert or clear IME input.
return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
case 'keydown':
// Expect IME keyCode on each keydown. If we get any other
... | Does our fallback mode think that this event is the end of composition? | isFallbackCompositionEnd | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getDataFromCustomEvent(nativeEvent) {
var detail = nativeEvent.detail;
if (typeof detail === 'object' && 'data' in detail) {
return detail.data;
}
return null;
} | Google Input Tools provides composition data via a CustomEvent,
with the `data` property populated in the `detail` object. If this
is available on the event object, use it. If not, this is a plain
composition event and we have nothing special to extract.
@param {object} nativeEvent
@return {?string} | getDataFromCustomEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isUsingKoreanIME(nativeEvent) {
return nativeEvent.locale === 'ko';
} // Track the current IME composition status, if any. | Check if a composition event was triggered by Korean IME.
Our fallback mode does not work well with IE's Korean IME,
so just use native composition events when Korean IME is used.
Although CompositionEvent.locale property is deprecated,
it is available in IE, where our fallback mode is enabled.
@param {object} nativeE... | isUsingKoreanIME | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getFallbackBeforeInputChars(domEventName, nativeEvent) {
// If we are currently composing (IME) and using a fallback to do so,
// try to extract the composed characters from the fallback object.
// If composition event is available, we extract a string only at
// compositionevent, otherwise ext... | For browsers that do not provide the `textInput` event, extract the
appropriate string to use for SyntheticInputEvent. | getFallbackBeforeInputChars | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
var chars;
if (canUseTextInputEvent) {
chars = getNativeBeforeInputChars(domEventName, nativeEvent);
} else {
chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
} // If n... | Extract a SyntheticInputEvent for `beforeInput`, based on either native
`textInput` or fallback behavior.
@return {?object} A SyntheticInputEvent. | extractBeforeInputEvent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isTextInputElement(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
if (nodeName === 'input') {
return !!supportedInputTypes[elem.type];
}
if (nodeName === 'textarea') {
return true;
}
return false;
} | @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary | isTextInputElement | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function startWatchingForValueChange(target, targetInst) {
activeElement = target;
activeElementInst = targetInst;
activeElement.attachEvent('onpropertychange', handlePropertyChange);
} | (For IE <=9) Starts tracking propertychange events on the passed-in element
and override the value property so that we can distinguish user events from
value changes in JS. | startWatchingForValueChange | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function stopWatchingForValueChange() {
if (!activeElement) {
return;
}
activeElement.detachEvent('onpropertychange', handlePropertyChange);
activeElement = null;
activeElementInst = null;
} | (For IE <=9) Removes the event listeners from the currently-tracked element,
if any exists. | stopWatchingForValueChange | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
if (getInstIfValueChanged(activeElementInst)) {
manualDispatchChangeEvent(nativeEvent);
}
} | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | handlePropertyChange | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
if (domEventName === 'focusin') {
// In IE9, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining... | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | handleEventsForInputEventPolyfill | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
... | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | getTargetInstForInputEventPolyfill | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
var getTargetInstFunc, handleEventFunc;
if (shouldUseChangeEvent(targetNode)) {
getTargetInstF... | This plugin creates an `onChange` event that normalizes change events
across form elements. This event fires at a time when it's possible to
change the element's value without seeing a flicker.
Supported elements are:
- input (see `isTextInputElement`)
- textarea
- select | extractEvents$1 | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function registerEvents$2() {
registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);
registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);
registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);
registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);
} | This plugin creates an `onChange` event that normalizes change events
across form elements. This event fires at a time when it's possible to
change the element's value without seeing a flicker.
Supported elements are:
- input (see `isTextInputElement`)
- textarea
- select | registerEvents$2 | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';
var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';
if (isOverE... | For almost every interaction we care about, there will be both a top-level
`mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
we do not extract duplicate events. However, moving the mouse into the
browser from outside will not fire a `mouseout` event. In this case, we use
the `mouseover` top-leve... | extractEvents$2 | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function shallowEqual(objA, objB) {
if (objectIs(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);
if (keysA.length !== keysB... | Performs equality by iterating through keys on an object and returning false
when any key has values which are not strictly equal between the arguments.
Returns true when the values of all keys are strictly equal. | shallowEqual | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getLeafNode(node) {
while (node && node.firstChild) {
node = node.firstChild;
}
return node;
} | Given any node return the first leaf node without children.
@param {DOMElement|DOMTextNode} node
@return {DOMElement|DOMTextNode} | getLeafNode | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getSiblingNode(node) {
while (node) {
if (node.nextSibling) {
return node.nextSibling;
}
node = node.parentNode;
}
} | Get the next sibling within a container. This will walk up the
DOM if a node's siblings have been exhausted.
@param {DOMElement|DOMTextNode} node
@return {?DOMElement|DOMTextNode} | getSiblingNode | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getNodeForCharacterOffset(root, offset) {
var node = getLeafNode(root);
var nodeStart = 0;
var nodeEnd = 0;
while (node) {
if (node.nodeType === TEXT_NODE) {
nodeEnd = nodeStart + node.textContent.length;
if (nodeStart <= offset && nodeEnd >= offset) {
return {... | Get object describing the nodes which contain characters at offset.
@param {DOMElement|DOMTextNode} root
@param {number} offset
@return {?object} | getNodeForCharacterOffset | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
var length = 0;
var start = -1;
var end = -1;
var indexWithinAnchor = 0;
var indexWithinFocus = 0;
var node = outerNode;
var parentNode = null;
outer: while (true) {
var next = null;... | Returns {start, end} where `start` is the character/codepoint index of
(anchorNode, anchorOffset) within the textContent of `outerNode`, and
`end` is the index of (focusNode, focusOffset).
Returns null if you pass in garbage input but we should probably just crash.
Exported only for testing. | getModernOffsetsFromPoints | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function setOffsets(node, offsets) {
var doc = node.ownerDocument || document;
var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
// (For instance: TinyMCE editor used in a list component that supports pasting to add more,
// fails when pasting 100+ items... | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | setOffsets | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isTextNode(node) {
return node && node.nodeType === TEXT_NODE;
} | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | isTextNode | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function containsNode(outerNode, innerNode) {
if (!outerNode || !innerNode) {
return false;
} else if (outerNode === innerNode) {
return true;
} else if (isTextNode(outerNode)) {
return false;
} else if (isTextNode(innerNode)) {
return containsNode(outerNode, innerNode.parentNode... | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | containsNode | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isInDocument(node) {
return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
} | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | isInDocument | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isSameOriginFrame(iframe) {
try {
// Accessing the contentDocument of a HTMLIframeElement can cause the browser
// to throw, e.g. if it has a cross-origin src attribute.
// Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
// ifr... | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | isSameOriginFrame | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getActiveElementDeep() {
var win = window;
var element = getActiveElement();
while (element instanceof win.HTMLIFrameElement) {
if (isSameOriginFrame(element)) {
win = element.contentWindow;
} else {
return element;
}
element = getActiveElement(win.document... | In modern non-IE browsers, we can support both forward and backward
selections.
Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programmatically create a backward selection. Thus, for all IE
versions, we use the old IE API... | getActiveElementDeep | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function hasSelectionCapabilities(elem) {
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem... | @hasSelectionCapabilities: we get the element types that support selection
from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
and `selectionEnd` rows. | hasSelectionCapabilities | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getSelectionInformation() {
var focusedElem = getActiveElementDeep();
return {
focusedElem: focusedElem,
selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
};
} | @hasSelectionCapabilities: we get the element types that support selection
from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
and `selectionEnd` rows. | getSelectionInformation | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.