first commit
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-reconciler-constants.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
"production" !== process.env.NODE_ENV &&
|
||||
((exports.ConcurrentRoot = 1),
|
||||
(exports.ContinuousEventPriority = 8),
|
||||
(exports.DefaultEventPriority = 32),
|
||||
(exports.DiscreteEventPriority = 2),
|
||||
(exports.IdleEventPriority = 268435456),
|
||||
(exports.LegacyRoot = 0),
|
||||
(exports.NoEventPriority = 0));
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-reconciler-constants.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
exports.ConcurrentRoot = 1;
|
||||
exports.ContinuousEventPriority = 8;
|
||||
exports.DefaultEventPriority = 32;
|
||||
exports.DiscreteEventPriority = 2;
|
||||
exports.IdleEventPriority = 268435456;
|
||||
exports.LegacyRoot = 0;
|
||||
exports.NoEventPriority = 0;
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-reconciler-reflection.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
"production" !== process.env.NODE_ENV &&
|
||||
(function () {
|
||||
function getNearestMountedFiber(fiber) {
|
||||
for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; )
|
||||
(node = nextNode),
|
||||
0 !== (node.flags & 4098) && (fiber = node.return),
|
||||
(nextNode = node.return);
|
||||
for (; node.return; ) node = node.return;
|
||||
return 3 === node.tag ? fiber : null;
|
||||
}
|
||||
function assertIsMounted(fiber) {
|
||||
if (getNearestMountedFiber(fiber) !== fiber)
|
||||
throw Error("Unable to find node on an unmounted component.");
|
||||
}
|
||||
function findCurrentFiberUsingSlowPath(fiber) {
|
||||
var alternate = fiber.alternate;
|
||||
if (!alternate) {
|
||||
alternate = getNearestMountedFiber(fiber);
|
||||
if (null === alternate)
|
||||
throw Error("Unable to find node on an unmounted component.");
|
||||
return alternate !== fiber ? null : fiber;
|
||||
}
|
||||
for (var a = fiber, b = alternate; ; ) {
|
||||
var parentA = a.return;
|
||||
if (null === parentA) break;
|
||||
var parentB = parentA.alternate;
|
||||
if (null === parentB) {
|
||||
b = parentA.return;
|
||||
if (null !== b) {
|
||||
a = b;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (parentA.child === parentB.child) {
|
||||
for (parentB = parentA.child; parentB; ) {
|
||||
if (parentB === a) return assertIsMounted(parentA), fiber;
|
||||
if (parentB === b) return assertIsMounted(parentA), alternate;
|
||||
parentB = parentB.sibling;
|
||||
}
|
||||
throw Error("Unable to find node on an unmounted component.");
|
||||
}
|
||||
if (a.return !== b.return) (a = parentA), (b = parentB);
|
||||
else {
|
||||
for (var didFindChild = !1, _child = parentA.child; _child; ) {
|
||||
if (_child === a) {
|
||||
didFindChild = !0;
|
||||
a = parentA;
|
||||
b = parentB;
|
||||
break;
|
||||
}
|
||||
if (_child === b) {
|
||||
didFindChild = !0;
|
||||
b = parentA;
|
||||
a = parentB;
|
||||
break;
|
||||
}
|
||||
_child = _child.sibling;
|
||||
}
|
||||
if (!didFindChild) {
|
||||
for (_child = parentB.child; _child; ) {
|
||||
if (_child === a) {
|
||||
didFindChild = !0;
|
||||
a = parentB;
|
||||
b = parentA;
|
||||
break;
|
||||
}
|
||||
if (_child === b) {
|
||||
didFindChild = !0;
|
||||
b = parentB;
|
||||
a = parentA;
|
||||
break;
|
||||
}
|
||||
_child = _child.sibling;
|
||||
}
|
||||
if (!didFindChild)
|
||||
throw Error(
|
||||
"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
|
||||
);
|
||||
}
|
||||
}
|
||||
if (a.alternate !== b)
|
||||
throw Error(
|
||||
"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
|
||||
);
|
||||
}
|
||||
if (3 !== a.tag)
|
||||
throw Error("Unable to find node on an unmounted component.");
|
||||
return a.stateNode.current === a ? fiber : alternate;
|
||||
}
|
||||
function findCurrentHostFiberImpl(node) {
|
||||
var tag = node.tag;
|
||||
if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
|
||||
for (node = node.child; null !== node; ) {
|
||||
tag = findCurrentHostFiberImpl(node);
|
||||
if (null !== tag) return tag;
|
||||
node = node.sibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function findCurrentHostFiberWithNoPortalsImpl(node) {
|
||||
var tag = node.tag;
|
||||
if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
|
||||
for (node = node.child; null !== node; ) {
|
||||
if (
|
||||
4 !== node.tag &&
|
||||
((tag = findCurrentHostFiberWithNoPortalsImpl(node)), null !== tag)
|
||||
)
|
||||
return tag;
|
||||
node = node.sibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function traverseVisibleInstancesAndTextInstances(
|
||||
child,
|
||||
searchWithinHosts,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
for (; null !== child; ) {
|
||||
if (
|
||||
((5 === child.tag || 27 === child.tag || 6 === child.tag) &&
|
||||
fn(child, a, b, c)) ||
|
||||
((22 !== child.tag || null === child.memoizedState) &&
|
||||
(searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) &&
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
child.child,
|
||||
searchWithinHosts,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
))
|
||||
)
|
||||
return !0;
|
||||
child = child.sibling;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
function getFragmentParentInstanceOrContainerFiber(fiber) {
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag)
|
||||
return fiber;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
self,
|
||||
child,
|
||||
state
|
||||
) {
|
||||
for (; null !== child; ) {
|
||||
if (child === self) state.foundSelf = !0;
|
||||
else if (5 === child.tag || 27 === child.tag || 6 === child.tag) {
|
||||
if (state.foundSelf) return (result[1] = child), !0;
|
||||
result[0] = child;
|
||||
} else if (
|
||||
(22 !== child.tag || null === child.memoizedState) &&
|
||||
findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
self,
|
||||
child.child,
|
||||
state
|
||||
)
|
||||
)
|
||||
return !0;
|
||||
child = child.sibling;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
function findNextSibling(child) {
|
||||
searchTarget = child;
|
||||
return !0;
|
||||
}
|
||||
function isFiberPrecedingCheck(child, target, boundary) {
|
||||
return child === boundary
|
||||
? !0
|
||||
: child === target
|
||||
? ((searchTarget = child), !0)
|
||||
: !1;
|
||||
}
|
||||
function isFiberFollowingCheck(child, target, boundary) {
|
||||
return child === boundary
|
||||
? ((searchBoundary = child), !1)
|
||||
: child === target
|
||||
? (null !== searchBoundary && (searchTarget = child), !0)
|
||||
: !1;
|
||||
}
|
||||
function getParentForFragmentAncestors(inst) {
|
||||
if (null === inst) return null;
|
||||
do inst = null === inst ? null : inst.return;
|
||||
while (inst && 5 !== inst.tag && 27 !== inst.tag && 3 !== inst.tag);
|
||||
return inst ? inst : null;
|
||||
}
|
||||
function getLowestCommonAncestor(instA, instB, getParent) {
|
||||
for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA))
|
||||
depthA++;
|
||||
tempA = 0;
|
||||
for (var tempB = instB; tempB; tempB = getParent(tempB)) tempA++;
|
||||
for (; 0 < depthA - tempA; ) (instA = getParent(instA)), depthA--;
|
||||
for (; 0 < tempA - depthA; ) (instB = getParent(instB)), tempA--;
|
||||
for (; depthA--; ) {
|
||||
if (instA === instB || (null !== instB && instA === instB.alternate))
|
||||
return instA;
|
||||
instA = getParent(instA);
|
||||
instB = getParent(instB);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var searchTarget = null,
|
||||
searchBoundary = null;
|
||||
exports.doesFiberContain = function (parentFiber, childFiber) {
|
||||
for (
|
||||
var parentFiberAlternate = parentFiber.alternate;
|
||||
null !== childFiber;
|
||||
|
||||
) {
|
||||
if (childFiber === parentFiber || childFiber === parentFiberAlternate)
|
||||
return !0;
|
||||
childFiber = childFiber.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.fiberIsPortaledIntoHost = function (fiber) {
|
||||
var foundPortalParent = !1;
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
4 === fiber.tag && (foundPortalParent = !0);
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) break;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return foundPortalParent;
|
||||
};
|
||||
exports.findCurrentFiberUsingSlowPath = findCurrentFiberUsingSlowPath;
|
||||
exports.findCurrentHostFiber = function (parent) {
|
||||
parent = findCurrentFiberUsingSlowPath(parent);
|
||||
return null !== parent ? findCurrentHostFiberImpl(parent) : null;
|
||||
};
|
||||
exports.findCurrentHostFiberWithNoPortals = function (parent) {
|
||||
parent = findCurrentFiberUsingSlowPath(parent);
|
||||
return null !== parent
|
||||
? findCurrentHostFiberWithNoPortalsImpl(parent)
|
||||
: null;
|
||||
};
|
||||
exports.getActivityInstanceFromFiber = function (fiber) {
|
||||
if (31 === fiber.tag) {
|
||||
var activityState = fiber.memoizedState;
|
||||
null === activityState &&
|
||||
((fiber = fiber.alternate),
|
||||
null !== fiber && (activityState = fiber.memoizedState));
|
||||
if (null !== activityState) return activityState.dehydrated;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.getContainerFromFiber = function (fiber) {
|
||||
return 3 === fiber.tag ? fiber.stateNode.containerInfo : null;
|
||||
};
|
||||
exports.getFragmentInstanceOrTextInstanceSiblings = function (fiber) {
|
||||
var result = [null, null],
|
||||
parentHostFiber = getFragmentParentInstanceOrContainerFiber(fiber);
|
||||
if (null === parentHostFiber) return result;
|
||||
findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
fiber,
|
||||
parentHostFiber.child,
|
||||
{ foundSelf: !1 }
|
||||
);
|
||||
return result;
|
||||
};
|
||||
exports.getFragmentParentInstanceOrContainerFiber =
|
||||
getFragmentParentInstanceOrContainerFiber;
|
||||
exports.getFragmentPortalContainerInfo = function (fiber) {
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
if (4 === fiber.tag) return fiber.stateNode.containerInfo;
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) break;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.getInstanceFromHostFiber = function (fiber) {
|
||||
switch (fiber.tag) {
|
||||
case 5:
|
||||
case 27:
|
||||
case 6:
|
||||
return fiber.stateNode;
|
||||
case 3:
|
||||
return fiber.stateNode.containerInfo;
|
||||
default:
|
||||
throw Error("Expected to find a host node. This is a bug in React.");
|
||||
}
|
||||
};
|
||||
exports.getLowestCommonAncestor = getLowestCommonAncestor;
|
||||
exports.getNearestMountedFiber = getNearestMountedFiber;
|
||||
exports.getNextSiblingInstanceOrTextInstanceFiber = function (fiber) {
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
fiber.sibling,
|
||||
!1,
|
||||
findNextSibling
|
||||
);
|
||||
fiber = searchTarget;
|
||||
searchTarget = null;
|
||||
return fiber;
|
||||
};
|
||||
exports.getSuspenseInstanceFromFiber = function (fiber) {
|
||||
if (13 === fiber.tag) {
|
||||
var suspenseState = fiber.memoizedState;
|
||||
null === suspenseState &&
|
||||
((fiber = fiber.alternate),
|
||||
null !== fiber && (suspenseState = fiber.memoizedState));
|
||||
if (null !== suspenseState) return suspenseState.dehydrated;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.isFiberContainedByFragment = function (fiber, fragmentFiber) {
|
||||
for (; null !== fiber; ) {
|
||||
if (
|
||||
7 === fiber.tag &&
|
||||
(fiber === fragmentFiber || fiber.alternate === fragmentFiber)
|
||||
)
|
||||
return !0;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.isFiberFollowing = function (fiber, otherFiber) {
|
||||
var commonAncestor = getLowestCommonAncestor(
|
||||
fiber,
|
||||
otherFiber,
|
||||
getParentForFragmentAncestors
|
||||
);
|
||||
if (null === commonAncestor) return !1;
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
commonAncestor,
|
||||
!0,
|
||||
isFiberFollowingCheck,
|
||||
otherFiber,
|
||||
fiber
|
||||
);
|
||||
fiber = searchTarget;
|
||||
searchBoundary = searchTarget = null;
|
||||
return null !== fiber;
|
||||
};
|
||||
exports.isFiberPreceding = function (fiber, otherFiber) {
|
||||
var commonAncestor = getLowestCommonAncestor(
|
||||
fiber,
|
||||
otherFiber,
|
||||
getParentForFragmentAncestors
|
||||
);
|
||||
if (null === commonAncestor) return !1;
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
commonAncestor,
|
||||
!0,
|
||||
isFiberPrecedingCheck,
|
||||
otherFiber,
|
||||
fiber
|
||||
);
|
||||
fiber = searchTarget;
|
||||
searchTarget = null;
|
||||
return null !== fiber;
|
||||
};
|
||||
exports.isFiberSuspenseAndTimedOut = function (fiber) {
|
||||
var memoizedState = fiber.memoizedState;
|
||||
return (
|
||||
13 === fiber.tag &&
|
||||
null !== memoizedState &&
|
||||
null === memoizedState.dehydrated
|
||||
);
|
||||
};
|
||||
exports.isFragmentContainedByFiber = function (fragmentFiber) {
|
||||
var current = fragmentFiber;
|
||||
for (
|
||||
fragmentFiber =
|
||||
getFragmentParentInstanceOrContainerFiber(fragmentFiber);
|
||||
null !== current;
|
||||
|
||||
) {
|
||||
if (
|
||||
!(
|
||||
(5 !== current.tag && 3 !== current.tag && 27 !== current.tag) ||
|
||||
(current !== fragmentFiber && current.alternate !== fragmentFiber)
|
||||
)
|
||||
)
|
||||
return !0;
|
||||
current = current.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.traverseFragmentInstancesAndTextInstances = function (
|
||||
fragmentFiber,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
fragmentFiber.child,
|
||||
!1,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
);
|
||||
};
|
||||
exports.traverseFragmentInstancesAndTextInstancesDeeply = function (
|
||||
fragmentFiber,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
fragmentFiber.child,
|
||||
!0,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
);
|
||||
};
|
||||
})();
|
||||
+429
@@ -0,0 +1,429 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-reconciler-reflection.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
function formatProdErrorMessage(code) {
|
||||
var url = "https://react.dev/errors/" + code;
|
||||
if (1 < arguments.length) {
|
||||
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
||||
for (var i = 2; i < arguments.length; i++)
|
||||
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
||||
}
|
||||
return (
|
||||
"Minified React error #" +
|
||||
code +
|
||||
"; visit " +
|
||||
url +
|
||||
" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
|
||||
);
|
||||
}
|
||||
function getNearestMountedFiber(fiber) {
|
||||
for (var node = fiber, nextNode = node; nextNode && !nextNode.alternate; )
|
||||
(node = nextNode),
|
||||
0 !== (node.flags & 4098) && (fiber = node.return),
|
||||
(nextNode = node.return);
|
||||
for (; node.return; ) node = node.return;
|
||||
return 3 === node.tag ? fiber : null;
|
||||
}
|
||||
function assertIsMounted(fiber) {
|
||||
if (getNearestMountedFiber(fiber) !== fiber)
|
||||
throw Error(formatProdErrorMessage(188));
|
||||
}
|
||||
function findCurrentFiberUsingSlowPath(fiber) {
|
||||
var alternate = fiber.alternate;
|
||||
if (!alternate) {
|
||||
alternate = getNearestMountedFiber(fiber);
|
||||
if (null === alternate) throw Error(formatProdErrorMessage(188));
|
||||
return alternate !== fiber ? null : fiber;
|
||||
}
|
||||
for (var a = fiber, b = alternate; ; ) {
|
||||
var parentA = a.return;
|
||||
if (null === parentA) break;
|
||||
var parentB = parentA.alternate;
|
||||
if (null === parentB) {
|
||||
b = parentA.return;
|
||||
if (null !== b) {
|
||||
a = b;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (parentA.child === parentB.child) {
|
||||
for (parentB = parentA.child; parentB; ) {
|
||||
if (parentB === a) return assertIsMounted(parentA), fiber;
|
||||
if (parentB === b) return assertIsMounted(parentA), alternate;
|
||||
parentB = parentB.sibling;
|
||||
}
|
||||
throw Error(formatProdErrorMessage(188));
|
||||
}
|
||||
if (a.return !== b.return) (a = parentA), (b = parentB);
|
||||
else {
|
||||
for (var didFindChild = !1, child$0 = parentA.child; child$0; ) {
|
||||
if (child$0 === a) {
|
||||
didFindChild = !0;
|
||||
a = parentA;
|
||||
b = parentB;
|
||||
break;
|
||||
}
|
||||
if (child$0 === b) {
|
||||
didFindChild = !0;
|
||||
b = parentA;
|
||||
a = parentB;
|
||||
break;
|
||||
}
|
||||
child$0 = child$0.sibling;
|
||||
}
|
||||
if (!didFindChild) {
|
||||
for (child$0 = parentB.child; child$0; ) {
|
||||
if (child$0 === a) {
|
||||
didFindChild = !0;
|
||||
a = parentB;
|
||||
b = parentA;
|
||||
break;
|
||||
}
|
||||
if (child$0 === b) {
|
||||
didFindChild = !0;
|
||||
b = parentB;
|
||||
a = parentA;
|
||||
break;
|
||||
}
|
||||
child$0 = child$0.sibling;
|
||||
}
|
||||
if (!didFindChild) throw Error(formatProdErrorMessage(189));
|
||||
}
|
||||
}
|
||||
if (a.alternate !== b) throw Error(formatProdErrorMessage(190));
|
||||
}
|
||||
if (3 !== a.tag) throw Error(formatProdErrorMessage(188));
|
||||
return a.stateNode.current === a ? fiber : alternate;
|
||||
}
|
||||
function findCurrentHostFiberImpl(node) {
|
||||
var tag = node.tag;
|
||||
if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
|
||||
for (node = node.child; null !== node; ) {
|
||||
tag = findCurrentHostFiberImpl(node);
|
||||
if (null !== tag) return tag;
|
||||
node = node.sibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function findCurrentHostFiberWithNoPortalsImpl(node) {
|
||||
var tag = node.tag;
|
||||
if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
|
||||
for (node = node.child; null !== node; ) {
|
||||
if (
|
||||
4 !== node.tag &&
|
||||
((tag = findCurrentHostFiberWithNoPortalsImpl(node)), null !== tag)
|
||||
)
|
||||
return tag;
|
||||
node = node.sibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function traverseVisibleInstancesAndTextInstances(
|
||||
child,
|
||||
searchWithinHosts,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
for (; null !== child; ) {
|
||||
if (
|
||||
((5 === child.tag || 27 === child.tag || 6 === child.tag) &&
|
||||
fn(child, a, b, c)) ||
|
||||
((22 !== child.tag || null === child.memoizedState) &&
|
||||
(searchWithinHosts || (5 !== child.tag && 27 !== child.tag)) &&
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
child.child,
|
||||
searchWithinHosts,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
))
|
||||
)
|
||||
return !0;
|
||||
child = child.sibling;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
function getFragmentParentInstanceOrContainerFiber(fiber) {
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) return fiber;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
self,
|
||||
child,
|
||||
state
|
||||
) {
|
||||
for (; null !== child; ) {
|
||||
if (child === self) state.foundSelf = !0;
|
||||
else if (5 === child.tag || 27 === child.tag || 6 === child.tag) {
|
||||
if (state.foundSelf) return (result[1] = child), !0;
|
||||
result[0] = child;
|
||||
} else if (
|
||||
(22 !== child.tag || null === child.memoizedState) &&
|
||||
findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
self,
|
||||
child.child,
|
||||
state
|
||||
)
|
||||
)
|
||||
return !0;
|
||||
child = child.sibling;
|
||||
}
|
||||
return !1;
|
||||
}
|
||||
var searchTarget = null,
|
||||
searchBoundary = null;
|
||||
function findNextSibling(child) {
|
||||
searchTarget = child;
|
||||
return !0;
|
||||
}
|
||||
function isFiberPrecedingCheck(child, target, boundary) {
|
||||
return child === boundary
|
||||
? !0
|
||||
: child === target
|
||||
? ((searchTarget = child), !0)
|
||||
: !1;
|
||||
}
|
||||
function isFiberFollowingCheck(child, target, boundary) {
|
||||
return child === boundary
|
||||
? ((searchBoundary = child), !1)
|
||||
: child === target
|
||||
? (null !== searchBoundary && (searchTarget = child), !0)
|
||||
: !1;
|
||||
}
|
||||
function getParentForFragmentAncestors(inst) {
|
||||
if (null === inst) return null;
|
||||
do inst = null === inst ? null : inst.return;
|
||||
while (inst && 5 !== inst.tag && 27 !== inst.tag && 3 !== inst.tag);
|
||||
return inst ? inst : null;
|
||||
}
|
||||
function getLowestCommonAncestor(instA, instB, getParent) {
|
||||
for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++;
|
||||
tempA = 0;
|
||||
for (var tempB = instB; tempB; tempB = getParent(tempB)) tempA++;
|
||||
for (; 0 < depthA - tempA; ) (instA = getParent(instA)), depthA--;
|
||||
for (; 0 < tempA - depthA; ) (instB = getParent(instB)), tempA--;
|
||||
for (; depthA--; ) {
|
||||
if (instA === instB || (null !== instB && instA === instB.alternate))
|
||||
return instA;
|
||||
instA = getParent(instA);
|
||||
instB = getParent(instB);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.doesFiberContain = function (parentFiber, childFiber) {
|
||||
for (
|
||||
var parentFiberAlternate = parentFiber.alternate;
|
||||
null !== childFiber;
|
||||
|
||||
) {
|
||||
if (childFiber === parentFiber || childFiber === parentFiberAlternate)
|
||||
return !0;
|
||||
childFiber = childFiber.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.fiberIsPortaledIntoHost = function (fiber) {
|
||||
var foundPortalParent = !1;
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
4 === fiber.tag && (foundPortalParent = !0);
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) break;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return foundPortalParent;
|
||||
};
|
||||
exports.findCurrentFiberUsingSlowPath = findCurrentFiberUsingSlowPath;
|
||||
exports.findCurrentHostFiber = function (parent) {
|
||||
parent = findCurrentFiberUsingSlowPath(parent);
|
||||
return null !== parent ? findCurrentHostFiberImpl(parent) : null;
|
||||
};
|
||||
exports.findCurrentHostFiberWithNoPortals = function (parent) {
|
||||
parent = findCurrentFiberUsingSlowPath(parent);
|
||||
return null !== parent ? findCurrentHostFiberWithNoPortalsImpl(parent) : null;
|
||||
};
|
||||
exports.getActivityInstanceFromFiber = function (fiber) {
|
||||
if (31 === fiber.tag) {
|
||||
var activityState = fiber.memoizedState;
|
||||
null === activityState &&
|
||||
((fiber = fiber.alternate),
|
||||
null !== fiber && (activityState = fiber.memoizedState));
|
||||
if (null !== activityState) return activityState.dehydrated;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.getContainerFromFiber = function (fiber) {
|
||||
return 3 === fiber.tag ? fiber.stateNode.containerInfo : null;
|
||||
};
|
||||
exports.getFragmentInstanceOrTextInstanceSiblings = function (fiber) {
|
||||
var result = [null, null],
|
||||
parentHostFiber = getFragmentParentInstanceOrContainerFiber(fiber);
|
||||
if (null === parentHostFiber) return result;
|
||||
findFragmentInstanceOrTextInstanceSiblings(
|
||||
result,
|
||||
fiber,
|
||||
parentHostFiber.child,
|
||||
{ foundSelf: !1 }
|
||||
);
|
||||
return result;
|
||||
};
|
||||
exports.getFragmentParentInstanceOrContainerFiber =
|
||||
getFragmentParentInstanceOrContainerFiber;
|
||||
exports.getFragmentPortalContainerInfo = function (fiber) {
|
||||
for (fiber = fiber.return; null !== fiber; ) {
|
||||
if (4 === fiber.tag) return fiber.stateNode.containerInfo;
|
||||
if (3 === fiber.tag || 5 === fiber.tag || 27 === fiber.tag) break;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.getInstanceFromHostFiber = function (fiber) {
|
||||
switch (fiber.tag) {
|
||||
case 5:
|
||||
case 27:
|
||||
case 6:
|
||||
return fiber.stateNode;
|
||||
case 3:
|
||||
return fiber.stateNode.containerInfo;
|
||||
default:
|
||||
throw Error(formatProdErrorMessage(559));
|
||||
}
|
||||
};
|
||||
exports.getLowestCommonAncestor = getLowestCommonAncestor;
|
||||
exports.getNearestMountedFiber = getNearestMountedFiber;
|
||||
exports.getNextSiblingInstanceOrTextInstanceFiber = function (fiber) {
|
||||
traverseVisibleInstancesAndTextInstances(fiber.sibling, !1, findNextSibling);
|
||||
fiber = searchTarget;
|
||||
searchTarget = null;
|
||||
return fiber;
|
||||
};
|
||||
exports.getSuspenseInstanceFromFiber = function (fiber) {
|
||||
if (13 === fiber.tag) {
|
||||
var suspenseState = fiber.memoizedState;
|
||||
null === suspenseState &&
|
||||
((fiber = fiber.alternate),
|
||||
null !== fiber && (suspenseState = fiber.memoizedState));
|
||||
if (null !== suspenseState) return suspenseState.dehydrated;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
exports.isFiberContainedByFragment = function (fiber, fragmentFiber) {
|
||||
for (; null !== fiber; ) {
|
||||
if (
|
||||
7 === fiber.tag &&
|
||||
(fiber === fragmentFiber || fiber.alternate === fragmentFiber)
|
||||
)
|
||||
return !0;
|
||||
fiber = fiber.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.isFiberFollowing = function (fiber, otherFiber) {
|
||||
var commonAncestor = getLowestCommonAncestor(
|
||||
fiber,
|
||||
otherFiber,
|
||||
getParentForFragmentAncestors
|
||||
);
|
||||
if (null === commonAncestor) return !1;
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
commonAncestor,
|
||||
!0,
|
||||
isFiberFollowingCheck,
|
||||
otherFiber,
|
||||
fiber
|
||||
);
|
||||
fiber = searchTarget;
|
||||
searchBoundary = searchTarget = null;
|
||||
return null !== fiber;
|
||||
};
|
||||
exports.isFiberPreceding = function (fiber, otherFiber) {
|
||||
var commonAncestor = getLowestCommonAncestor(
|
||||
fiber,
|
||||
otherFiber,
|
||||
getParentForFragmentAncestors
|
||||
);
|
||||
if (null === commonAncestor) return !1;
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
commonAncestor,
|
||||
!0,
|
||||
isFiberPrecedingCheck,
|
||||
otherFiber,
|
||||
fiber
|
||||
);
|
||||
fiber = searchTarget;
|
||||
searchTarget = null;
|
||||
return null !== fiber;
|
||||
};
|
||||
exports.isFiberSuspenseAndTimedOut = function (fiber) {
|
||||
var memoizedState = fiber.memoizedState;
|
||||
return (
|
||||
13 === fiber.tag &&
|
||||
null !== memoizedState &&
|
||||
null === memoizedState.dehydrated
|
||||
);
|
||||
};
|
||||
exports.isFragmentContainedByFiber = function (fragmentFiber) {
|
||||
var current = fragmentFiber;
|
||||
for (
|
||||
fragmentFiber = getFragmentParentInstanceOrContainerFiber(fragmentFiber);
|
||||
null !== current;
|
||||
|
||||
) {
|
||||
if (
|
||||
!(
|
||||
(5 !== current.tag && 3 !== current.tag && 27 !== current.tag) ||
|
||||
(current !== fragmentFiber && current.alternate !== fragmentFiber)
|
||||
)
|
||||
)
|
||||
return !0;
|
||||
current = current.return;
|
||||
}
|
||||
return !1;
|
||||
};
|
||||
exports.traverseFragmentInstancesAndTextInstances = function (
|
||||
fragmentFiber,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
fragmentFiber.child,
|
||||
!1,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
);
|
||||
};
|
||||
exports.traverseFragmentInstancesAndTextInstancesDeeply = function (
|
||||
fragmentFiber,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
) {
|
||||
traverseVisibleInstancesAndTextInstances(
|
||||
fragmentFiber.child,
|
||||
!0,
|
||||
fn,
|
||||
a,
|
||||
b,
|
||||
c
|
||||
);
|
||||
};
|
||||
+21372
File diff suppressed because it is too large
Load Diff
+12950
File diff suppressed because it is too large
Load Diff
+14845
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user