mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Preinits should support a nonce option (#26744)
Currently there is no way to provide a nonce when using
`ReactDOM.preinit(..., { as: 'script' })`
This PR adds `nonce?: string` as an option
While implementing this PR I added a test to also show you can pass
`integrity`. This test isn't directly related to the nonce change.
DiffTrain build for [b12bea62d9](https://github.com/facebook/react/commit/b12bea62d9cfd9a925f28cb2c93daeda3865a64e)
This commit is contained in:
@@ -1 +1 @@
|
||||
f87e97a0a67fa7cfd7e6f2ec985621c0e825cb23
|
||||
b12bea62d9cfd9a925f28cb2c93daeda3865a64e
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-bcc00dd5";
|
||||
var ReactVersion = "18.3.0-www-modern-3898c4ac";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-0a3d97ff";
|
||||
var ReactVersion = "18.3.0-www-classic-4e446d05";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -3847,7 +3847,7 @@ function isRootDehydrated(root) {
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -3901,24 +3901,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -7714,8 +7711,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -7724,81 +7733,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -8258,6 +8320,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -8325,11 +8388,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -8339,7 +8403,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -8921,11 +8985,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -9795,14 +9859,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$2.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -9818,16 +9888,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -9872,7 +9942,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -23900,9 +23970,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -24652,7 +24722,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -24709,10 +24779,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -25473,7 +25543,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -25519,7 +25589,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -26697,7 +26767,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-85c16289";
|
||||
var ReactVersion = "18.3.0-www-modern-c4f3054f";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -3603,7 +3603,7 @@ function isRootDehydrated(root) {
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -3657,24 +3657,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -7470,8 +7467,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -7480,81 +7489,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -8014,6 +8076,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -8081,11 +8144,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -8095,7 +8159,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -8677,11 +8741,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -9551,14 +9615,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$2.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -9574,16 +9644,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -9628,7 +9698,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -23565,9 +23635,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -24317,7 +24387,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -24374,10 +24444,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -25133,7 +25203,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -25179,7 +25249,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -26357,7 +26427,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
|
||||
@@ -2462,57 +2462,80 @@ function requestTransitionLane() {
|
||||
(currentEventTransitionLane = claimNextTransitionLane());
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
var currentEntangledListeners = null,
|
||||
currentEntangledPendingCount = 0,
|
||||
currentEntangledLane = 0;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
null !== actionReturnValue &&
|
||||
"object" === typeof actionReturnValue &&
|
||||
"function" === typeof actionReturnValue.then
|
||||
) {
|
||||
if (null === currentAsyncAction) {
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: !1,
|
||||
reason: void 0,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(actionReturnValue, asyncAction);
|
||||
return (currentAsyncAction = asyncAction);
|
||||
}
|
||||
var asyncAction$28 = currentAsyncAction;
|
||||
attachPingListeners(actionReturnValue, asyncAction$28);
|
||||
return asyncAction$28;
|
||||
if (null === currentEntangledListeners) {
|
||||
var entangledListeners = (currentEntangledListeners = []);
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else entangledListeners = currentEntangledListeners;
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending",
|
||||
rejectedReason;
|
||||
actionReturnValue.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
);
|
||||
var resultThenable = createResultThenable(entangledListeners);
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled":
|
||||
resultThenable.status = "fulfilled";
|
||||
resultThenable.value = finishedState;
|
||||
break;
|
||||
case "rejected":
|
||||
resultThenable.status = "rejected";
|
||||
resultThenable.reason = rejectedReason;
|
||||
break;
|
||||
default:
|
||||
throw Error(formatProdErrorMessage(478));
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
}
|
||||
return null === currentAsyncAction ? !1 : currentAsyncAction;
|
||||
if (null === currentEntangledListeners) return finishedState;
|
||||
actionReturnValue = currentEntangledListeners;
|
||||
var resultThenable$29 = createResultThenable(actionReturnValue);
|
||||
actionReturnValue.push(function () {
|
||||
resultThenable$29.status = "fulfilled";
|
||||
resultThenable$29.value = finishedState;
|
||||
});
|
||||
return resultThenable$29;
|
||||
}
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
0 === --asyncAction.count &&
|
||||
((asyncAction.status = "fulfilled"),
|
||||
completeAsyncActionScope(asyncAction));
|
||||
},
|
||||
function (error) {
|
||||
0 === --asyncAction.count &&
|
||||
((asyncAction.status = "rejected"),
|
||||
(asyncAction.reason = error),
|
||||
completeAsyncActionScope(asyncAction));
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
null !== currentEntangledListeners &&
|
||||
0 === --currentEntangledPendingCount
|
||||
) {
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
for (var i = (currentEntangledLane = 0); i < listeners.length; i++)
|
||||
(0, listeners[i])();
|
||||
}
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
return {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
entangledListeners.push(resolve);
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
function completeAsyncActionScope(action) {
|
||||
currentAsyncAction === action && (currentAsyncAction = null);
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
for (action = 0; action < listeners.length; action++)
|
||||
(0, listeners[action])(!1);
|
||||
};
|
||||
}
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
|
||||
@@ -2583,6 +2606,7 @@ function finishRenderingHooks(current) {
|
||||
(didReceiveUpdate = !0));
|
||||
}
|
||||
function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
do {
|
||||
didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
|
||||
@@ -2602,12 +2626,16 @@ function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.flags &= -2053;
|
||||
current.lanes &= ~lanes;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) {
|
||||
var queue = hook.queue;
|
||||
for (
|
||||
workInProgress = workInProgress.memoizedState;
|
||||
null !== workInProgress;
|
||||
|
||||
) {
|
||||
var queue = workInProgress.queue;
|
||||
null !== queue && (queue.pending = null);
|
||||
hook = hook.next;
|
||||
workInProgress = workInProgress.next;
|
||||
}
|
||||
didScheduleRenderPhaseUpdate = !1;
|
||||
}
|
||||
@@ -2842,12 +2870,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var getVersion = source._getVersion,
|
||||
version = getVersion(source._source),
|
||||
dispatcher = ReactCurrentDispatcher$1.current,
|
||||
_dispatcher$useState = dispatcher.useState(function () {
|
||||
_dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
setSnapshot = _dispatcher$useState[1],
|
||||
snapshot = _dispatcher$useState[0];
|
||||
_dispatcher$useState = workInProgressHook;
|
||||
setSnapshot = _dispatcher$useState2[1],
|
||||
snapshot = _dispatcher$useState2[0];
|
||||
_dispatcher$useState2 = workInProgressHook;
|
||||
var memoizedState = hook.memoizedState,
|
||||
refs = memoizedState.refs,
|
||||
prevGetSnapshot = refs.getSnapshot,
|
||||
@@ -2900,10 +2928,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
}),
|
||||
(hook.dispatch = setSnapshot =
|
||||
dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)),
|
||||
(_dispatcher$useState.queue = hook),
|
||||
(_dispatcher$useState.baseQueue = null),
|
||||
(_dispatcher$useState2.queue = hook),
|
||||
(_dispatcher$useState2.baseQueue = null),
|
||||
(snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)),
|
||||
(_dispatcher$useState.memoizedState = _dispatcher$useState.baseState =
|
||||
(_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState =
|
||||
snapshot));
|
||||
return snapshot;
|
||||
}
|
||||
@@ -3130,13 +3158,19 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
(hook.baseState = !0));
|
||||
return prevValue;
|
||||
}
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = currentUpdatePriority;
|
||||
currentUpdatePriority =
|
||||
0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(!0);
|
||||
setPending(pendingState);
|
||||
ReactCurrentBatchConfig$2.transition = {};
|
||||
enableTransitionTracing &&
|
||||
void 0 !== options &&
|
||||
@@ -3146,9 +3180,9 @@ function startTransition(setPending, callback, options) {
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(),
|
||||
isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
} else setPending(!1), callback();
|
||||
maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else setPending(finishedState), callback();
|
||||
} catch (error) {
|
||||
if (enableAsyncActions)
|
||||
setPending({ then: function () {}, status: "rejected", reason: error });
|
||||
@@ -3359,7 +3393,7 @@ var HooksDispatcherOnMount = {
|
||||
},
|
||||
useTransition: function () {
|
||||
var setPending = mountState(!1)[1];
|
||||
setPending = startTransition.bind(null, setPending);
|
||||
setPending = startTransition.bind(null, !0, !1, setPending);
|
||||
mountWorkInProgressHook().memoizedState = setPending;
|
||||
return [!1, setPending];
|
||||
},
|
||||
@@ -5525,14 +5559,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$73 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode),
|
||||
for (var lastTailNode$74 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$74 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$73
|
||||
null === lastTailNode$74
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$73.sibling = null);
|
||||
: (lastTailNode$74.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -5542,19 +5576,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$74 = completedWork.child; null !== child$74; )
|
||||
(newChildLanes |= child$74.lanes | child$74.childLanes),
|
||||
(subtreeFlags |= child$74.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$74.flags & 31457280),
|
||||
(child$74.return = completedWork),
|
||||
(child$74 = child$74.sibling);
|
||||
for (var child$75 = completedWork.child; null !== child$75; )
|
||||
(newChildLanes |= child$75.lanes | child$75.childLanes),
|
||||
(subtreeFlags |= child$75.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$75.flags & 31457280),
|
||||
(child$75.return = completedWork),
|
||||
(child$75 = child$75.sibling);
|
||||
else
|
||||
for (child$74 = completedWork.child; null !== child$74; )
|
||||
(newChildLanes |= child$74.lanes | child$74.childLanes),
|
||||
(subtreeFlags |= child$74.subtreeFlags),
|
||||
(subtreeFlags |= child$74.flags),
|
||||
(child$74.return = completedWork),
|
||||
(child$74 = child$74.sibling);
|
||||
for (child$75 = completedWork.child; null !== child$75; )
|
||||
(newChildLanes |= child$75.lanes | child$75.childLanes),
|
||||
(subtreeFlags |= child$75.subtreeFlags),
|
||||
(subtreeFlags |= child$75.flags),
|
||||
(child$75.return = completedWork),
|
||||
(child$75 = child$75.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -5736,11 +5770,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$78 = null;
|
||||
var cache$79 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$78 = newProps.memoizedState.cachePool.pool);
|
||||
cache$78 !== instance && (newProps.flags |= 2048);
|
||||
(cache$79 = newProps.memoizedState.cachePool.pool);
|
||||
cache$79 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -5770,8 +5804,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$78 = instance.rendering;
|
||||
if (null === cache$78)
|
||||
cache$79 = instance.rendering;
|
||||
if (null === cache$79)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -5779,11 +5813,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$78 = findFirstSuspended(current);
|
||||
if (null !== cache$78) {
|
||||
cache$79 = findFirstSuspended(current);
|
||||
if (null !== cache$79) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$78.updateQueue;
|
||||
current = cache$79.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -5808,7 +5842,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$78)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$79)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -5818,7 +5852,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$78.alternate)
|
||||
!cache$79.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -5830,13 +5864,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 8388608));
|
||||
instance.isBackwards
|
||||
? ((cache$78.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$78))
|
||||
? ((cache$79.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$79))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$78)
|
||||
: (workInProgress.child = cache$78),
|
||||
(instance.last = cache$78));
|
||||
? (current.sibling = cache$79)
|
||||
: (workInProgress.child = cache$79),
|
||||
(instance.last = cache$79));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -6096,8 +6130,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$96) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$96);
|
||||
} catch (error$97) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$97);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6299,11 +6333,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$97) {
|
||||
} catch (error$98) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$97
|
||||
error$98
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6896,8 +6930,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$105) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
|
||||
} catch (error$106) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$106);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -6933,11 +6967,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (null !== updatePayload || diffInCommitPhase)
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$108) {
|
||||
} catch (error$109) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$108
|
||||
error$109
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6974,8 +7008,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$110) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -7115,12 +7149,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$100 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$101 = getHostSibling(finishedWork);
|
||||
var parent$101 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$102 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$101,
|
||||
parent$100
|
||||
before$102,
|
||||
parent$101
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -7581,9 +7615,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$119 = finishedWork.stateNode;
|
||||
var instance$120 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$119._visibility & 4
|
||||
? instance$120._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7596,7 +7630,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$119._visibility |= 4),
|
||||
: ((instance$120._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7604,7 +7638,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$119._visibility |= 4),
|
||||
: ((instance$120._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7617,7 +7651,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$119
|
||||
instance$120
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -8028,8 +8062,8 @@ function requestUpdateLane(fiber) {
|
||||
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
|
||||
if (null !== ReactCurrentBatchConfig$1.transition)
|
||||
return (
|
||||
(fiber = currentAsyncAction),
|
||||
null !== fiber ? fiber.lane : requestTransitionLane()
|
||||
(fiber = currentEntangledLane),
|
||||
0 !== fiber ? fiber : requestTransitionLane()
|
||||
);
|
||||
fiber = currentUpdatePriority;
|
||||
return 0 !== fiber ? fiber : 32;
|
||||
@@ -8122,16 +8156,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
exitStatus = renderRootSync(root, lanes);
|
||||
if (2 === exitStatus) {
|
||||
errorRetryLanes = lanes;
|
||||
var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError(
|
||||
var errorRetryLanes$129 = getLanesToRetrySynchronouslyOnError(
|
||||
root,
|
||||
errorRetryLanes
|
||||
);
|
||||
0 !== errorRetryLanes$128 &&
|
||||
((lanes = errorRetryLanes$128),
|
||||
0 !== errorRetryLanes$129 &&
|
||||
((lanes = errorRetryLanes$129),
|
||||
(exitStatus = recoverFromConcurrentError(
|
||||
root,
|
||||
errorRetryLanes,
|
||||
errorRetryLanes$128
|
||||
errorRetryLanes$129
|
||||
)));
|
||||
}
|
||||
if (1 === exitStatus)
|
||||
@@ -8294,8 +8328,9 @@ function resetWorkInProgressStack() {
|
||||
if (0 === workInProgressSuspendedReason)
|
||||
var interruptedWork = workInProgress.return;
|
||||
else
|
||||
resetContextDependencies(),
|
||||
resetHooksOnUnwind(),
|
||||
(interruptedWork = workInProgress),
|
||||
resetContextDependencies(),
|
||||
resetHooksOnUnwind(interruptedWork),
|
||||
(thenableState$1 = null),
|
||||
(thenableIndexCounter$1 = 0),
|
||||
(interruptedWork = workInProgress);
|
||||
@@ -8333,6 +8368,7 @@ function prepareFreshStack(root, lanes) {
|
||||
return root;
|
||||
}
|
||||
function handleThrow(root, thrownValue) {
|
||||
currentlyRenderingFiber$1 = null;
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
ReactCurrentOwner.current = null;
|
||||
thrownValue === SuspenseException
|
||||
@@ -8413,8 +8449,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$130) {
|
||||
handleThrow(root, thrownValue$130);
|
||||
} catch (thrownValue$131) {
|
||||
handleThrow(root, thrownValue$131);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -8518,8 +8554,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$132) {
|
||||
handleThrow(root, thrownValue$132);
|
||||
} catch (thrownValue$133) {
|
||||
handleThrow(root, thrownValue$133);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -8585,7 +8621,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
);
|
||||
break;
|
||||
case 5:
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(unitOfWork);
|
||||
default:
|
||||
unwindInterruptedWork(current, unitOfWork),
|
||||
(unitOfWork = workInProgress =
|
||||
@@ -8600,7 +8636,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
}
|
||||
function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(unitOfWork);
|
||||
thenableState$1 = null;
|
||||
thenableIndexCounter$1 = 0;
|
||||
var returnFiber = unitOfWork.return;
|
||||
@@ -8698,10 +8734,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
};
|
||||
suspenseBoundary.updateQueue = newOffscreenQueue;
|
||||
} else {
|
||||
var retryQueue$35 = offscreenQueue.retryQueue;
|
||||
null === retryQueue$35
|
||||
var retryQueue$36 = offscreenQueue.retryQueue;
|
||||
null === retryQueue$36
|
||||
? (offscreenQueue.retryQueue = new Set([wakeable]))
|
||||
: retryQueue$35.add(wakeable);
|
||||
: retryQueue$36.add(wakeable);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -10046,19 +10082,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1170 = {
|
||||
devToolsConfig$jscomp$inline_1173 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-f817b2e4",
|
||||
version: "18.3.0-www-classic-976d3052",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1335 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1170.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1170.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1170.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1170.rendererConfig,
|
||||
var internals$jscomp$inline_1338 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1173.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1173.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1173.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1173.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10075,26 +10111,26 @@ var internals$jscomp$inline_1335 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1170.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1173.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-f817b2e4"
|
||||
reconcilerVersion: "18.3.0-www-classic-976d3052"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1336 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1339 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1336.isDisabled &&
|
||||
hook$jscomp$inline_1336.supportsFiber
|
||||
!hook$jscomp$inline_1339.isDisabled &&
|
||||
hook$jscomp$inline_1339.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1336.inject(
|
||||
internals$jscomp$inline_1335
|
||||
(rendererID = hook$jscomp$inline_1339.inject(
|
||||
internals$jscomp$inline_1338
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1336);
|
||||
(injectedHook = hook$jscomp$inline_1339);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -2268,57 +2268,80 @@ function requestTransitionLane() {
|
||||
(currentEventTransitionLane = claimNextTransitionLane());
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
var currentEntangledListeners = null,
|
||||
currentEntangledPendingCount = 0,
|
||||
currentEntangledLane = 0;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
null !== actionReturnValue &&
|
||||
"object" === typeof actionReturnValue &&
|
||||
"function" === typeof actionReturnValue.then
|
||||
) {
|
||||
if (null === currentAsyncAction) {
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: !1,
|
||||
reason: void 0,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(actionReturnValue, asyncAction);
|
||||
return (currentAsyncAction = asyncAction);
|
||||
}
|
||||
var asyncAction$28 = currentAsyncAction;
|
||||
attachPingListeners(actionReturnValue, asyncAction$28);
|
||||
return asyncAction$28;
|
||||
if (null === currentEntangledListeners) {
|
||||
var entangledListeners = (currentEntangledListeners = []);
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else entangledListeners = currentEntangledListeners;
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending",
|
||||
rejectedReason;
|
||||
actionReturnValue.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
);
|
||||
var resultThenable = createResultThenable(entangledListeners);
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled":
|
||||
resultThenable.status = "fulfilled";
|
||||
resultThenable.value = finishedState;
|
||||
break;
|
||||
case "rejected":
|
||||
resultThenable.status = "rejected";
|
||||
resultThenable.reason = rejectedReason;
|
||||
break;
|
||||
default:
|
||||
throw Error(formatProdErrorMessage(478));
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
}
|
||||
return null === currentAsyncAction ? !1 : currentAsyncAction;
|
||||
if (null === currentEntangledListeners) return finishedState;
|
||||
actionReturnValue = currentEntangledListeners;
|
||||
var resultThenable$29 = createResultThenable(actionReturnValue);
|
||||
actionReturnValue.push(function () {
|
||||
resultThenable$29.status = "fulfilled";
|
||||
resultThenable$29.value = finishedState;
|
||||
});
|
||||
return resultThenable$29;
|
||||
}
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
0 === --asyncAction.count &&
|
||||
((asyncAction.status = "fulfilled"),
|
||||
completeAsyncActionScope(asyncAction));
|
||||
},
|
||||
function (error) {
|
||||
0 === --asyncAction.count &&
|
||||
((asyncAction.status = "rejected"),
|
||||
(asyncAction.reason = error),
|
||||
completeAsyncActionScope(asyncAction));
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
null !== currentEntangledListeners &&
|
||||
0 === --currentEntangledPendingCount
|
||||
) {
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
for (var i = (currentEntangledLane = 0); i < listeners.length; i++)
|
||||
(0, listeners[i])();
|
||||
}
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
return {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
entangledListeners.push(resolve);
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
function completeAsyncActionScope(action) {
|
||||
currentAsyncAction === action && (currentAsyncAction = null);
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
for (action = 0; action < listeners.length; action++)
|
||||
(0, listeners[action])(!1);
|
||||
};
|
||||
}
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
|
||||
@@ -2389,6 +2412,7 @@ function finishRenderingHooks(current) {
|
||||
(didReceiveUpdate = !0));
|
||||
}
|
||||
function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
do {
|
||||
didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);
|
||||
@@ -2408,12 +2432,16 @@ function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.flags &= -2053;
|
||||
current.lanes &= ~lanes;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook; ) {
|
||||
var queue = hook.queue;
|
||||
for (
|
||||
workInProgress = workInProgress.memoizedState;
|
||||
null !== workInProgress;
|
||||
|
||||
) {
|
||||
var queue = workInProgress.queue;
|
||||
null !== queue && (queue.pending = null);
|
||||
hook = hook.next;
|
||||
workInProgress = workInProgress.next;
|
||||
}
|
||||
didScheduleRenderPhaseUpdate = !1;
|
||||
}
|
||||
@@ -2648,12 +2676,12 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var getVersion = source._getVersion,
|
||||
version = getVersion(source._source),
|
||||
dispatcher = ReactCurrentDispatcher$1.current,
|
||||
_dispatcher$useState = dispatcher.useState(function () {
|
||||
_dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
setSnapshot = _dispatcher$useState[1],
|
||||
snapshot = _dispatcher$useState[0];
|
||||
_dispatcher$useState = workInProgressHook;
|
||||
setSnapshot = _dispatcher$useState2[1],
|
||||
snapshot = _dispatcher$useState2[0];
|
||||
_dispatcher$useState2 = workInProgressHook;
|
||||
var memoizedState = hook.memoizedState,
|
||||
refs = memoizedState.refs,
|
||||
prevGetSnapshot = refs.getSnapshot,
|
||||
@@ -2706,10 +2734,10 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
}),
|
||||
(hook.dispatch = setSnapshot =
|
||||
dispatchSetState.bind(null, currentlyRenderingFiber$1, hook)),
|
||||
(_dispatcher$useState.queue = hook),
|
||||
(_dispatcher$useState.baseQueue = null),
|
||||
(_dispatcher$useState2.queue = hook),
|
||||
(_dispatcher$useState2.baseQueue = null),
|
||||
(snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot)),
|
||||
(_dispatcher$useState.memoizedState = _dispatcher$useState.baseState =
|
||||
(_dispatcher$useState2.memoizedState = _dispatcher$useState2.baseState =
|
||||
snapshot));
|
||||
return snapshot;
|
||||
}
|
||||
@@ -2936,13 +2964,19 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
(hook.baseState = !0));
|
||||
return prevValue;
|
||||
}
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = currentUpdatePriority;
|
||||
currentUpdatePriority =
|
||||
0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(!0);
|
||||
setPending(pendingState);
|
||||
ReactCurrentBatchConfig$2.transition = {};
|
||||
enableTransitionTracing &&
|
||||
void 0 !== options &&
|
||||
@@ -2952,9 +2986,9 @@ function startTransition(setPending, callback, options) {
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(),
|
||||
isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
} else setPending(!1), callback();
|
||||
maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else setPending(finishedState), callback();
|
||||
} catch (error) {
|
||||
if (enableAsyncActions)
|
||||
setPending({ then: function () {}, status: "rejected", reason: error });
|
||||
@@ -3165,7 +3199,7 @@ var HooksDispatcherOnMount = {
|
||||
},
|
||||
useTransition: function () {
|
||||
var setPending = mountState(!1)[1];
|
||||
setPending = startTransition.bind(null, setPending);
|
||||
setPending = startTransition.bind(null, !0, !1, setPending);
|
||||
mountWorkInProgressHook().memoizedState = setPending;
|
||||
return [!1, setPending];
|
||||
},
|
||||
@@ -5280,14 +5314,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$73 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$73 = lastTailNode),
|
||||
for (var lastTailNode$74 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$74 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$73
|
||||
null === lastTailNode$74
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$73.sibling = null);
|
||||
: (lastTailNode$74.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -5297,19 +5331,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$74 = completedWork.child; null !== child$74; )
|
||||
(newChildLanes |= child$74.lanes | child$74.childLanes),
|
||||
(subtreeFlags |= child$74.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$74.flags & 31457280),
|
||||
(child$74.return = completedWork),
|
||||
(child$74 = child$74.sibling);
|
||||
for (var child$75 = completedWork.child; null !== child$75; )
|
||||
(newChildLanes |= child$75.lanes | child$75.childLanes),
|
||||
(subtreeFlags |= child$75.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$75.flags & 31457280),
|
||||
(child$75.return = completedWork),
|
||||
(child$75 = child$75.sibling);
|
||||
else
|
||||
for (child$74 = completedWork.child; null !== child$74; )
|
||||
(newChildLanes |= child$74.lanes | child$74.childLanes),
|
||||
(subtreeFlags |= child$74.subtreeFlags),
|
||||
(subtreeFlags |= child$74.flags),
|
||||
(child$74.return = completedWork),
|
||||
(child$74 = child$74.sibling);
|
||||
for (child$75 = completedWork.child; null !== child$75; )
|
||||
(newChildLanes |= child$75.lanes | child$75.childLanes),
|
||||
(subtreeFlags |= child$75.subtreeFlags),
|
||||
(subtreeFlags |= child$75.flags),
|
||||
(child$75.return = completedWork),
|
||||
(child$75 = child$75.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -5485,11 +5519,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$78 = null;
|
||||
var cache$79 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$78 = newProps.memoizedState.cachePool.pool);
|
||||
cache$78 !== instance && (newProps.flags |= 2048);
|
||||
(cache$79 = newProps.memoizedState.cachePool.pool);
|
||||
cache$79 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -5515,8 +5549,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$78 = instance.rendering;
|
||||
if (null === cache$78)
|
||||
cache$79 = instance.rendering;
|
||||
if (null === cache$79)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -5524,11 +5558,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$78 = findFirstSuspended(current);
|
||||
if (null !== cache$78) {
|
||||
cache$79 = findFirstSuspended(current);
|
||||
if (null !== cache$79) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$78.updateQueue;
|
||||
current = cache$79.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -5553,7 +5587,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$78)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$79)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -5563,7 +5597,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$78.alternate)
|
||||
!cache$79.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -5575,13 +5609,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 8388608));
|
||||
instance.isBackwards
|
||||
? ((cache$78.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$78))
|
||||
? ((cache$79.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$79))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$78)
|
||||
: (workInProgress.child = cache$78),
|
||||
(instance.last = cache$78));
|
||||
? (current.sibling = cache$79)
|
||||
: (workInProgress.child = cache$79),
|
||||
(instance.last = cache$79));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -5832,8 +5866,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$95) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$95);
|
||||
} catch (error$96) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$96);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6035,11 +6069,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$96) {
|
||||
} catch (error$97) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$96
|
||||
error$97
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6632,8 +6666,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$104) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$104);
|
||||
} catch (error$105) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -6669,11 +6703,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (null !== updatePayload || diffInCommitPhase)
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$107) {
|
||||
} catch (error$108) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$107
|
||||
error$108
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6710,8 +6744,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$109) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
|
||||
} catch (error$110) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -6851,12 +6885,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$99 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$100 = getHostSibling(finishedWork);
|
||||
var parent$100 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$101 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$100,
|
||||
parent$99
|
||||
before$101,
|
||||
parent$100
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -7317,9 +7351,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$118 = finishedWork.stateNode;
|
||||
var instance$119 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$118._visibility & 4
|
||||
? instance$119._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7332,7 +7366,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$118._visibility |= 4),
|
||||
: ((instance$119._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7340,7 +7374,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$118._visibility |= 4),
|
||||
: ((instance$119._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7353,7 +7387,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$118
|
||||
instance$119
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -7764,8 +7798,8 @@ function requestUpdateLane(fiber) {
|
||||
return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
|
||||
if (null !== ReactCurrentBatchConfig$1.transition)
|
||||
return (
|
||||
(fiber = currentAsyncAction),
|
||||
null !== fiber ? fiber.lane : requestTransitionLane()
|
||||
(fiber = currentEntangledLane),
|
||||
0 !== fiber ? fiber : requestTransitionLane()
|
||||
);
|
||||
fiber = currentUpdatePriority;
|
||||
return 0 !== fiber ? fiber : 32;
|
||||
@@ -7858,16 +7892,16 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
exitStatus = renderRootSync(root, lanes);
|
||||
if (2 === exitStatus) {
|
||||
errorRetryLanes = lanes;
|
||||
var errorRetryLanes$127 = getLanesToRetrySynchronouslyOnError(
|
||||
var errorRetryLanes$128 = getLanesToRetrySynchronouslyOnError(
|
||||
root,
|
||||
errorRetryLanes
|
||||
);
|
||||
0 !== errorRetryLanes$127 &&
|
||||
((lanes = errorRetryLanes$127),
|
||||
0 !== errorRetryLanes$128 &&
|
||||
((lanes = errorRetryLanes$128),
|
||||
(exitStatus = recoverFromConcurrentError(
|
||||
root,
|
||||
errorRetryLanes,
|
||||
errorRetryLanes$127
|
||||
errorRetryLanes$128
|
||||
)));
|
||||
}
|
||||
if (1 === exitStatus)
|
||||
@@ -8030,8 +8064,9 @@ function resetWorkInProgressStack() {
|
||||
if (0 === workInProgressSuspendedReason)
|
||||
var interruptedWork = workInProgress.return;
|
||||
else
|
||||
resetContextDependencies(),
|
||||
resetHooksOnUnwind(),
|
||||
(interruptedWork = workInProgress),
|
||||
resetContextDependencies(),
|
||||
resetHooksOnUnwind(interruptedWork),
|
||||
(thenableState$1 = null),
|
||||
(thenableIndexCounter$1 = 0),
|
||||
(interruptedWork = workInProgress);
|
||||
@@ -8069,6 +8104,7 @@ function prepareFreshStack(root, lanes) {
|
||||
return root;
|
||||
}
|
||||
function handleThrow(root, thrownValue) {
|
||||
currentlyRenderingFiber$1 = null;
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
ReactCurrentOwner.current = null;
|
||||
thrownValue === SuspenseException
|
||||
@@ -8149,8 +8185,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$129) {
|
||||
handleThrow(root, thrownValue$129);
|
||||
} catch (thrownValue$130) {
|
||||
handleThrow(root, thrownValue$130);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -8254,8 +8290,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$131) {
|
||||
handleThrow(root, thrownValue$131);
|
||||
} catch (thrownValue$132) {
|
||||
handleThrow(root, thrownValue$132);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -8317,7 +8353,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
);
|
||||
break;
|
||||
case 5:
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(unitOfWork);
|
||||
default:
|
||||
unwindInterruptedWork(current, unitOfWork),
|
||||
(unitOfWork = workInProgress =
|
||||
@@ -8332,7 +8368,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
}
|
||||
function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(unitOfWork);
|
||||
thenableState$1 = null;
|
||||
thenableIndexCounter$1 = 0;
|
||||
var returnFiber = unitOfWork.return;
|
||||
@@ -8430,10 +8466,10 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
};
|
||||
suspenseBoundary.updateQueue = newOffscreenQueue;
|
||||
} else {
|
||||
var retryQueue$35 = offscreenQueue.retryQueue;
|
||||
null === retryQueue$35
|
||||
var retryQueue$36 = offscreenQueue.retryQueue;
|
||||
null === retryQueue$36
|
||||
? (offscreenQueue.retryQueue = new Set([wakeable]))
|
||||
: retryQueue$35.add(wakeable);
|
||||
: retryQueue$36.add(wakeable);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -9711,19 +9747,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1150 = {
|
||||
devToolsConfig$jscomp$inline_1153 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-cbca888b",
|
||||
version: "18.3.0-www-modern-f1029d9d",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1315 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1150.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1150.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1150.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1150.rendererConfig,
|
||||
var internals$jscomp$inline_1318 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1153.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1153.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1153.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1153.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -9740,26 +9776,26 @@ var internals$jscomp$inline_1315 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1150.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1153.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-cbca888b"
|
||||
reconcilerVersion: "18.3.0-www-modern-f1029d9d"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1316 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1316.isDisabled &&
|
||||
hook$jscomp$inline_1316.supportsFiber
|
||||
!hook$jscomp$inline_1319.isDisabled &&
|
||||
hook$jscomp$inline_1319.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1316.inject(
|
||||
internals$jscomp$inline_1315
|
||||
(rendererID = hook$jscomp$inline_1319.inject(
|
||||
internals$jscomp$inline_1318
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1316);
|
||||
(injectedHook = hook$jscomp$inline_1319);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -974,6 +974,12 @@ function isReplayingEvent(event) {
|
||||
return event === currentReplayingEvent;
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
var valueStack = [];
|
||||
var fiberStack;
|
||||
|
||||
@@ -1027,7 +1033,7 @@ function push(cursor, value, fiber) {
|
||||
|
||||
var contextStackCursor$1 = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -1085,24 +1091,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor$1.current);
|
||||
var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor$1, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor$1, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor$1, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor$1, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
// This module only exists as an ESM wrapper around the external CommonJS
|
||||
@@ -12284,8 +12287,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -12294,81 +12309,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -12830,6 +12898,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -12905,11 +12974,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -12919,7 +12989,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -13502,11 +13572,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -14398,14 +14468,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
||||
ReactCurrentBatchConfig$3.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$3.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -14421,16 +14497,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -14475,7 +14551,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -29453,9 +29529,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -30261,7 +30337,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -30318,10 +30394,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -31082,7 +31158,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -31128,7 +31204,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -32353,7 +32429,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
@@ -33891,7 +33967,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-bb796e31";
|
||||
var ReactVersion = "18.3.0-www-classic-841db413";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -43458,9 +43534,12 @@ function preload$1(href, options) {
|
||||
var as = options.as;
|
||||
var limitedEscapedHref =
|
||||
escapeSelectorAttributeValueInsideDoubleQuotes(href);
|
||||
var preloadKey =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]';
|
||||
var key = preloadKey;
|
||||
var preloadSelector =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for
|
||||
// an arbitrary type. Other preloads are keyed under the resource key they represent a preload for.
|
||||
// Here we figure out which key to use to determine if we have a preload already.
|
||||
|
||||
var key = preloadSelector;
|
||||
|
||||
switch (as) {
|
||||
case "style":
|
||||
@@ -43476,7 +43555,21 @@ function preload$1(href, options) {
|
||||
var preloadProps = preloadPropsFromPreloadOptions(href, as, options);
|
||||
preloadPropsMap.set(key, preloadProps);
|
||||
|
||||
if (null === ownerDocument.querySelector(preloadKey)) {
|
||||
if (null === ownerDocument.querySelector(preloadSelector)) {
|
||||
if (
|
||||
as === "style" &&
|
||||
ownerDocument.querySelector(getStylesheetSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
} else if (
|
||||
as === "script" &&
|
||||
ownerDocument.querySelector(getScriptSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
}
|
||||
|
||||
var instance = ownerDocument.createElement("link");
|
||||
setInitialProperties(instance, "link", preloadProps);
|
||||
markNodeAsHoistable(instance);
|
||||
@@ -43638,7 +43731,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
} // This function is called in begin work and we should always have a currentDocument set
|
||||
|
||||
@@ -46566,12 +46660,6 @@ function preinit(href, options) {
|
||||
// so we favor silent bailout over warning or erroring.
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (
|
||||
typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype
|
||||
|
||||
@@ -107,6 +107,51 @@ function printWarning(level, format, args) {
|
||||
|
||||
var assign = Object.assign;
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.disableInputAttributeSyncing,
|
||||
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
|
||||
enableTrustedTypesIntegration =
|
||||
dynamicFeatureFlags.enableTrustedTypesIntegration,
|
||||
replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
||||
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
|
||||
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
|
||||
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
|
||||
enableLazyContextPropagation =
|
||||
dynamicFeatureFlags.enableLazyContextPropagation,
|
||||
enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates,
|
||||
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build.
|
||||
var enableProfilerTimer = true;
|
||||
var enableProfilerCommitHooks = true;
|
||||
var enableProfilerNestedUpdatePhase = true;
|
||||
var enableProfilerNestedUpdateScheduledHook =
|
||||
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableClientRenderFallbackOnTextMismatch = false;
|
||||
|
||||
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
|
||||
var enableSuspenseCallback = true;
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
var valueStack = [];
|
||||
var fiberStack;
|
||||
|
||||
@@ -158,9 +203,54 @@ function push(cursor, value, fiber) {
|
||||
cursor.current = value;
|
||||
}
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
||||
// The Symbol used to tag the ReactElement-like types.
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
||||
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||
var REACT_SCOPE_TYPE = Symbol.for("react.scope");
|
||||
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
|
||||
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
|
||||
var REACT_CACHE_TYPE = Symbol.for("react.cache");
|
||||
var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
|
||||
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for(
|
||||
"react.default_value"
|
||||
);
|
||||
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
||||
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||
return null;
|
||||
}
|
||||
|
||||
var maybeIterator =
|
||||
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
||||
maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||
|
||||
if (typeof maybeIterator === "function") {
|
||||
return maybeIterator;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -218,62 +308,23 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.disableInputAttributeSyncing,
|
||||
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
|
||||
enableTrustedTypesIntegration =
|
||||
dynamicFeatureFlags.enableTrustedTypesIntegration,
|
||||
replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
||||
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
|
||||
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
|
||||
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
|
||||
enableLazyContextPropagation =
|
||||
dynamicFeatureFlags.enableLazyContextPropagation,
|
||||
enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates,
|
||||
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build.
|
||||
var enableProfilerTimer = true;
|
||||
var enableProfilerCommitHooks = true;
|
||||
var enableProfilerNestedUpdatePhase = true;
|
||||
var enableProfilerNestedUpdateScheduledHook =
|
||||
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableClientRenderFallbackOnTextMismatch = false;
|
||||
|
||||
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
|
||||
var enableSuspenseCallback = true;
|
||||
|
||||
var NoFlags$1 =
|
||||
/* */
|
||||
0;
|
||||
@@ -2745,54 +2796,6 @@ function setValueForPropertyOnCustomComponent(node, name, value) {
|
||||
setValueForAttribute(node, name, value);
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
||||
// The Symbol used to tag the ReactElement-like types.
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
||||
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||
var REACT_SCOPE_TYPE = Symbol.for("react.scope");
|
||||
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
|
||||
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
|
||||
var REACT_CACHE_TYPE = Symbol.for("react.cache");
|
||||
var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
|
||||
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for(
|
||||
"react.default_value"
|
||||
);
|
||||
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
||||
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||
return null;
|
||||
}
|
||||
|
||||
var maybeIterator =
|
||||
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
||||
maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||
|
||||
if (typeof maybeIterator === "function") {
|
||||
return maybeIterator;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||
@@ -12225,8 +12228,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -12235,81 +12250,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -12771,6 +12839,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -12846,11 +12915,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -12860,7 +12930,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -13443,11 +13513,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -14339,14 +14409,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
||||
ReactCurrentBatchConfig$3.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$3.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -14362,16 +14438,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -14416,7 +14492,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -29303,9 +29379,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -30111,7 +30187,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -30168,10 +30244,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -30927,7 +31003,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -30973,7 +31049,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -32198,7 +32274,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
@@ -33736,7 +33812,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-cbca888b";
|
||||
var ReactVersion = "18.3.0-www-modern-f1029d9d";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -43968,9 +44044,12 @@ function preload$1(href, options) {
|
||||
var as = options.as;
|
||||
var limitedEscapedHref =
|
||||
escapeSelectorAttributeValueInsideDoubleQuotes(href);
|
||||
var preloadKey =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]';
|
||||
var key = preloadKey;
|
||||
var preloadSelector =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for
|
||||
// an arbitrary type. Other preloads are keyed under the resource key they represent a preload for.
|
||||
// Here we figure out which key to use to determine if we have a preload already.
|
||||
|
||||
var key = preloadSelector;
|
||||
|
||||
switch (as) {
|
||||
case "style":
|
||||
@@ -43986,7 +44065,21 @@ function preload$1(href, options) {
|
||||
var preloadProps = preloadPropsFromPreloadOptions(href, as, options);
|
||||
preloadPropsMap.set(key, preloadProps);
|
||||
|
||||
if (null === ownerDocument.querySelector(preloadKey)) {
|
||||
if (null === ownerDocument.querySelector(preloadSelector)) {
|
||||
if (
|
||||
as === "style" &&
|
||||
ownerDocument.querySelector(getStylesheetSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
} else if (
|
||||
as === "script" &&
|
||||
ownerDocument.querySelector(getScriptSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
}
|
||||
|
||||
var instance = ownerDocument.createElement("link");
|
||||
setInitialProperties(instance, "link", preloadProps);
|
||||
markNodeAsHoistable(instance);
|
||||
@@ -44148,7 +44241,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
} // This function is called in begin work and we should always have a currentDocument set
|
||||
|
||||
@@ -45655,12 +45749,6 @@ function preinit(href, options) {
|
||||
// so we favor silent bailout over warning or erroring.
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (
|
||||
typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-86d152c3";
|
||||
var ReactVersion = "18.3.0-www-classic-40ef305a";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -2329,6 +2329,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) {
|
||||
return description;
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -4084,6 +4087,7 @@ function pushLink(
|
||||
if (!_resource) {
|
||||
var resourceProps = stylesheetPropsFromRawProps(props);
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
var state = NoState;
|
||||
|
||||
if (preloadResource) {
|
||||
// If we already had a preload we don't want that resource to flush directly.
|
||||
@@ -4093,12 +4097,16 @@ function pushLink(
|
||||
resourceProps,
|
||||
preloadResource.props
|
||||
);
|
||||
|
||||
if (preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
}
|
||||
|
||||
_resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: resourceProps
|
||||
};
|
||||
resources.stylesMap.set(key, _resource);
|
||||
@@ -6129,12 +6137,9 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
|
||||
function preloadLateStyle(resource) {
|
||||
{
|
||||
if (resource.state & PreloadFlushed) {
|
||||
error(
|
||||
"React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React."
|
||||
);
|
||||
}
|
||||
if (resource.state & PreloadFlushed) {
|
||||
// This resource has already had a preload flushed
|
||||
return;
|
||||
}
|
||||
|
||||
if (resource.type === "style") {
|
||||
@@ -7241,10 +7246,17 @@ function preinit(href, options) {
|
||||
}
|
||||
|
||||
if (!resource) {
|
||||
var state = NoState;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
|
||||
if (preloadResource && preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: stylesheetPropsFromPreinitOptions(href, precedence, options)
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
@@ -7487,7 +7499,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7944,9 +7957,6 @@ function reenableLogs() {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-a23c15ee";
|
||||
var ReactVersion = "18.3.0-www-modern-b7ba1a13";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -2329,6 +2329,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) {
|
||||
return description;
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -4084,6 +4087,7 @@ function pushLink(
|
||||
if (!_resource) {
|
||||
var resourceProps = stylesheetPropsFromRawProps(props);
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
var state = NoState;
|
||||
|
||||
if (preloadResource) {
|
||||
// If we already had a preload we don't want that resource to flush directly.
|
||||
@@ -4093,12 +4097,16 @@ function pushLink(
|
||||
resourceProps,
|
||||
preloadResource.props
|
||||
);
|
||||
|
||||
if (preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
}
|
||||
|
||||
_resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: resourceProps
|
||||
};
|
||||
resources.stylesMap.set(key, _resource);
|
||||
@@ -6129,12 +6137,9 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
|
||||
function preloadLateStyle(resource) {
|
||||
{
|
||||
if (resource.state & PreloadFlushed) {
|
||||
error(
|
||||
"React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React."
|
||||
);
|
||||
}
|
||||
if (resource.state & PreloadFlushed) {
|
||||
// This resource has already had a preload flushed
|
||||
return;
|
||||
}
|
||||
|
||||
if (resource.type === "style") {
|
||||
@@ -7241,10 +7246,17 @@ function preinit(href, options) {
|
||||
}
|
||||
|
||||
if (!resource) {
|
||||
var state = NoState;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
|
||||
if (preloadResource && preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: stylesheetPropsFromPreinitOptions(href, precedence, options)
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
@@ -7487,7 +7499,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7944,9 +7957,6 @@ function reenableLogs() {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||
|
||||
@@ -184,6 +184,8 @@ function sanitizeURL(url) {
|
||||
: url;
|
||||
}
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -531,19 +533,29 @@ function pushLink(
|
||||
pushLinkImpl(target, props)
|
||||
);
|
||||
href = resources.stylesMap.get(responseState);
|
||||
if (!href) {
|
||||
props = assign({}, props, {
|
||||
href ||
|
||||
((props = assign({}, props, {
|
||||
"data-precedence": props.precedence,
|
||||
precedence: null
|
||||
});
|
||||
if ((href = resources.preloadsMap.get(responseState)))
|
||||
(href.state |= 4),
|
||||
(href = href.props),
|
||||
null == props.crossOrigin && (props.crossOrigin = href.crossOrigin),
|
||||
null == props.integrity && (props.integrity = href.integrity);
|
||||
href = { type: "stylesheet", chunks: [], state: 0, props: props };
|
||||
resources.stylesMap.set(responseState, href);
|
||||
props = resources.precedences.get(precedence);
|
||||
})),
|
||||
(href = resources.preloadsMap.get(responseState)),
|
||||
(insertionMode = 0),
|
||||
href &&
|
||||
((href.state |= 4),
|
||||
(noscriptTagInScope = href.props),
|
||||
null == props.crossOrigin &&
|
||||
(props.crossOrigin = noscriptTagInScope.crossOrigin),
|
||||
null == props.integrity &&
|
||||
(props.integrity = noscriptTagInScope.integrity),
|
||||
href.state & 3 && (insertionMode = 8)),
|
||||
(href = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: insertionMode,
|
||||
props: props
|
||||
}),
|
||||
resources.stylesMap.set(responseState, href),
|
||||
(props = resources.precedences.get(precedence)),
|
||||
props ||
|
||||
((props = new Set()),
|
||||
resources.precedences.set(precedence, props),
|
||||
@@ -554,9 +566,8 @@ function pushLink(
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
}),
|
||||
props.add(responseState),
|
||||
resources.stylePrecedences.set(precedence, responseState));
|
||||
props.add(href);
|
||||
}
|
||||
resources.stylePrecedences.set(precedence, responseState)),
|
||||
props.add(href));
|
||||
resources.boundaryResources && resources.boundaryResources.add(href);
|
||||
textEmbedded && target.push("\x3c!-- --\x3e");
|
||||
return null;
|
||||
@@ -1587,7 +1598,7 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
}
|
||||
function preloadLateStyle(resource) {
|
||||
if ("style" !== resource.type) {
|
||||
if (!(resource.state & 8) && "style" !== resource.type) {
|
||||
var chunks = resource.chunks,
|
||||
preloadProps = preloadAsStylePropsFromProps(
|
||||
resource.props.href,
|
||||
@@ -2011,49 +2022,54 @@ function preinit(href, options) {
|
||||
var as = options.as;
|
||||
switch (as) {
|
||||
case "style":
|
||||
var key = "[" + as + "]" + href;
|
||||
as = resources.stylesMap.get(key);
|
||||
var precedence = options.precedence || "default";
|
||||
as ||
|
||||
((as = {
|
||||
var key = "[" + as + "]" + href,
|
||||
resource = resources.stylesMap.get(key);
|
||||
as = options.precedence || "default";
|
||||
if (!resource) {
|
||||
resource = 0;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
preloadResource && preloadResource.state & 3 && (resource = 8);
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
state: resource,
|
||||
props: {
|
||||
rel: "stylesheet",
|
||||
href: href,
|
||||
"data-precedence": precedence,
|
||||
"data-precedence": as,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
}
|
||||
}),
|
||||
resources.stylesMap.set(key, as),
|
||||
(href = resources.precedences.get(precedence)),
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
href = resources.precedences.get(as);
|
||||
href ||
|
||||
((href = new Set()),
|
||||
resources.precedences.set(precedence, href),
|
||||
resources.precedences.set(as, href),
|
||||
(options = {
|
||||
type: "style",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
props: { precedence: as, hrefs: [] }
|
||||
}),
|
||||
href.add(options),
|
||||
resources.stylePrecedences.set(precedence, options)),
|
||||
href.add(as),
|
||||
enqueueFlush(request));
|
||||
resources.stylePrecedences.set(as, options));
|
||||
href.add(resource);
|
||||
enqueueFlush(request);
|
||||
}
|
||||
break;
|
||||
case "script":
|
||||
(precedence = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(precedence)),
|
||||
(key = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(key)),
|
||||
as ||
|
||||
((as = { type: "script", chunks: [], state: 0, props: null }),
|
||||
resources.scriptsMap.set(precedence, as),
|
||||
resources.scriptsMap.set(key, as),
|
||||
(href = {
|
||||
src: href,
|
||||
async: !0,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
}),
|
||||
resources.scripts.add(as),
|
||||
pushScriptImpl(as.chunks, href),
|
||||
@@ -2215,9 +2231,7 @@ function getComponentNameFromType(type) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
emptyContextObject = {};
|
||||
var emptyContextObject = {};
|
||||
function getMaskedContext(type, unmaskedContext) {
|
||||
type = type.contextTypes;
|
||||
if (!type) return emptyContextObject;
|
||||
@@ -3960,4 +3974,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-c76bb5a5";
|
||||
exports.version = "18.3.0-www-classic-dcd0808f";
|
||||
|
||||
@@ -182,6 +182,8 @@ function sanitizeURL(url) {
|
||||
: url;
|
||||
}
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -529,19 +531,29 @@ function pushLink(
|
||||
pushLinkImpl(target, props)
|
||||
);
|
||||
href = resources.stylesMap.get(responseState);
|
||||
if (!href) {
|
||||
props = assign({}, props, {
|
||||
href ||
|
||||
((props = assign({}, props, {
|
||||
"data-precedence": props.precedence,
|
||||
precedence: null
|
||||
});
|
||||
if ((href = resources.preloadsMap.get(responseState)))
|
||||
(href.state |= 4),
|
||||
(href = href.props),
|
||||
null == props.crossOrigin && (props.crossOrigin = href.crossOrigin),
|
||||
null == props.integrity && (props.integrity = href.integrity);
|
||||
href = { type: "stylesheet", chunks: [], state: 0, props: props };
|
||||
resources.stylesMap.set(responseState, href);
|
||||
props = resources.precedences.get(precedence);
|
||||
})),
|
||||
(href = resources.preloadsMap.get(responseState)),
|
||||
(insertionMode = 0),
|
||||
href &&
|
||||
((href.state |= 4),
|
||||
(noscriptTagInScope = href.props),
|
||||
null == props.crossOrigin &&
|
||||
(props.crossOrigin = noscriptTagInScope.crossOrigin),
|
||||
null == props.integrity &&
|
||||
(props.integrity = noscriptTagInScope.integrity),
|
||||
href.state & 3 && (insertionMode = 8)),
|
||||
(href = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: insertionMode,
|
||||
props: props
|
||||
}),
|
||||
resources.stylesMap.set(responseState, href),
|
||||
(props = resources.precedences.get(precedence)),
|
||||
props ||
|
||||
((props = new Set()),
|
||||
resources.precedences.set(precedence, props),
|
||||
@@ -552,9 +564,8 @@ function pushLink(
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
}),
|
||||
props.add(responseState),
|
||||
resources.stylePrecedences.set(precedence, responseState));
|
||||
props.add(href);
|
||||
}
|
||||
resources.stylePrecedences.set(precedence, responseState)),
|
||||
props.add(href));
|
||||
resources.boundaryResources && resources.boundaryResources.add(href);
|
||||
textEmbedded && target.push("\x3c!-- --\x3e");
|
||||
return null;
|
||||
@@ -1585,7 +1596,7 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
}
|
||||
function preloadLateStyle(resource) {
|
||||
if ("style" !== resource.type) {
|
||||
if (!(resource.state & 8) && "style" !== resource.type) {
|
||||
var chunks = resource.chunks,
|
||||
preloadProps = preloadAsStylePropsFromProps(
|
||||
resource.props.href,
|
||||
@@ -2009,49 +2020,54 @@ function preinit(href, options) {
|
||||
var as = options.as;
|
||||
switch (as) {
|
||||
case "style":
|
||||
var key = "[" + as + "]" + href;
|
||||
as = resources.stylesMap.get(key);
|
||||
var precedence = options.precedence || "default";
|
||||
as ||
|
||||
((as = {
|
||||
var key = "[" + as + "]" + href,
|
||||
resource = resources.stylesMap.get(key);
|
||||
as = options.precedence || "default";
|
||||
if (!resource) {
|
||||
resource = 0;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
preloadResource && preloadResource.state & 3 && (resource = 8);
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
state: resource,
|
||||
props: {
|
||||
rel: "stylesheet",
|
||||
href: href,
|
||||
"data-precedence": precedence,
|
||||
"data-precedence": as,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
}
|
||||
}),
|
||||
resources.stylesMap.set(key, as),
|
||||
(href = resources.precedences.get(precedence)),
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
href = resources.precedences.get(as);
|
||||
href ||
|
||||
((href = new Set()),
|
||||
resources.precedences.set(precedence, href),
|
||||
resources.precedences.set(as, href),
|
||||
(options = {
|
||||
type: "style",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
props: { precedence: as, hrefs: [] }
|
||||
}),
|
||||
href.add(options),
|
||||
resources.stylePrecedences.set(precedence, options)),
|
||||
href.add(as),
|
||||
enqueueFlush(request));
|
||||
resources.stylePrecedences.set(as, options));
|
||||
href.add(resource);
|
||||
enqueueFlush(request);
|
||||
}
|
||||
break;
|
||||
case "script":
|
||||
(precedence = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(precedence)),
|
||||
(key = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(key)),
|
||||
as ||
|
||||
((as = { type: "script", chunks: [], state: 0, props: null }),
|
||||
resources.scriptsMap.set(precedence, as),
|
||||
resources.scriptsMap.set(key, as),
|
||||
(href = {
|
||||
src: href,
|
||||
async: !0,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
}),
|
||||
resources.scripts.add(as),
|
||||
pushScriptImpl(as.chunks, href),
|
||||
@@ -2156,8 +2172,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
|
||||
),
|
||||
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
|
||||
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
emptyContextObject = {},
|
||||
currentActiveSnapshot = null;
|
||||
function popToNearestCommonAncestor(prev, next) {
|
||||
@@ -3857,4 +3871,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-86ff718c";
|
||||
exports.version = "18.3.0-www-modern-9c1f7368";
|
||||
|
||||
@@ -2326,6 +2326,9 @@ function describeDifferencesForPreinitOverScript(newProps, currentProps) {
|
||||
return description;
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -4091,6 +4094,7 @@ function pushLink(
|
||||
if (!_resource) {
|
||||
var resourceProps = stylesheetPropsFromRawProps(props);
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
var state = NoState;
|
||||
|
||||
if (preloadResource) {
|
||||
// If we already had a preload we don't want that resource to flush directly.
|
||||
@@ -4100,12 +4104,16 @@ function pushLink(
|
||||
resourceProps,
|
||||
preloadResource.props
|
||||
);
|
||||
|
||||
if (preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
}
|
||||
|
||||
_resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: resourceProps
|
||||
};
|
||||
resources.stylesMap.set(key, _resource);
|
||||
@@ -6136,12 +6144,9 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
|
||||
function preloadLateStyle(resource) {
|
||||
{
|
||||
if (resource.state & PreloadFlushed) {
|
||||
error(
|
||||
"React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React."
|
||||
);
|
||||
}
|
||||
if (resource.state & PreloadFlushed) {
|
||||
// This resource has already had a preload flushed
|
||||
return;
|
||||
}
|
||||
|
||||
if (resource.type === "style") {
|
||||
@@ -7248,10 +7253,17 @@ function preinit(href, options) {
|
||||
}
|
||||
|
||||
if (!resource) {
|
||||
var state = NoState;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
|
||||
if (preloadResource && preloadResource.state & Flushed) {
|
||||
state = PreloadFlushed;
|
||||
}
|
||||
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: NoState,
|
||||
state: state,
|
||||
props: stylesheetPropsFromPreinitOptions(href, precedence, options)
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
@@ -7494,7 +7506,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7836,9 +7849,6 @@ function reenableLogs() {
|
||||
}
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||
|
||||
@@ -170,6 +170,8 @@ function sanitizeURL(url) {
|
||||
: url;
|
||||
}
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -535,19 +537,29 @@ function pushLink(
|
||||
pushLinkImpl(target, props)
|
||||
);
|
||||
href = resources.stylesMap.get(responseState);
|
||||
if (!href) {
|
||||
props = assign({}, props, {
|
||||
href ||
|
||||
((props = assign({}, props, {
|
||||
"data-precedence": props.precedence,
|
||||
precedence: null
|
||||
});
|
||||
if ((href = resources.preloadsMap.get(responseState)))
|
||||
(href.state |= 4),
|
||||
(href = href.props),
|
||||
null == props.crossOrigin && (props.crossOrigin = href.crossOrigin),
|
||||
null == props.integrity && (props.integrity = href.integrity);
|
||||
href = { type: "stylesheet", chunks: [], state: 0, props: props };
|
||||
resources.stylesMap.set(responseState, href);
|
||||
props = resources.precedences.get(precedence);
|
||||
})),
|
||||
(href = resources.preloadsMap.get(responseState)),
|
||||
(insertionMode = 0),
|
||||
href &&
|
||||
((href.state |= 4),
|
||||
(noscriptTagInScope = href.props),
|
||||
null == props.crossOrigin &&
|
||||
(props.crossOrigin = noscriptTagInScope.crossOrigin),
|
||||
null == props.integrity &&
|
||||
(props.integrity = noscriptTagInScope.integrity),
|
||||
href.state & 3 && (insertionMode = 8)),
|
||||
(href = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: insertionMode,
|
||||
props: props
|
||||
}),
|
||||
resources.stylesMap.set(responseState, href),
|
||||
(props = resources.precedences.get(precedence)),
|
||||
props ||
|
||||
((props = new Set()),
|
||||
resources.precedences.set(precedence, props),
|
||||
@@ -558,9 +570,8 @@ function pushLink(
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
}),
|
||||
props.add(responseState),
|
||||
resources.stylePrecedences.set(precedence, responseState));
|
||||
props.add(href);
|
||||
}
|
||||
resources.stylePrecedences.set(precedence, responseState)),
|
||||
props.add(href));
|
||||
resources.boundaryResources && resources.boundaryResources.add(href);
|
||||
textEmbedded && target.push("\x3c!-- --\x3e");
|
||||
return null;
|
||||
@@ -1616,7 +1627,7 @@ function flushAllStylesInPreamble(set, precedence) {
|
||||
}
|
||||
}
|
||||
function preloadLateStyle(resource) {
|
||||
if ("style" !== resource.type) {
|
||||
if (!(resource.state & 8) && "style" !== resource.type) {
|
||||
var chunks = resource.chunks,
|
||||
preloadProps = preloadAsStylePropsFromProps(
|
||||
resource.props.href,
|
||||
@@ -2061,49 +2072,54 @@ function preinit(href, options) {
|
||||
var as = options.as;
|
||||
switch (as) {
|
||||
case "style":
|
||||
var key = "[" + as + "]" + href;
|
||||
as = resources.stylesMap.get(key);
|
||||
var precedence = options.precedence || "default";
|
||||
as ||
|
||||
((as = {
|
||||
var key = "[" + as + "]" + href,
|
||||
resource = resources.stylesMap.get(key);
|
||||
as = options.precedence || "default";
|
||||
if (!resource) {
|
||||
resource = 0;
|
||||
var preloadResource = resources.preloadsMap.get(key);
|
||||
preloadResource && preloadResource.state & 3 && (resource = 8);
|
||||
resource = {
|
||||
type: "stylesheet",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
state: resource,
|
||||
props: {
|
||||
rel: "stylesheet",
|
||||
href: href,
|
||||
"data-precedence": precedence,
|
||||
"data-precedence": as,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
}
|
||||
}),
|
||||
resources.stylesMap.set(key, as),
|
||||
(href = resources.precedences.get(precedence)),
|
||||
};
|
||||
resources.stylesMap.set(key, resource);
|
||||
href = resources.precedences.get(as);
|
||||
href ||
|
||||
((href = new Set()),
|
||||
resources.precedences.set(precedence, href),
|
||||
resources.precedences.set(as, href),
|
||||
(options = {
|
||||
type: "style",
|
||||
chunks: [],
|
||||
state: 0,
|
||||
props: { precedence: precedence, hrefs: [] }
|
||||
props: { precedence: as, hrefs: [] }
|
||||
}),
|
||||
href.add(options),
|
||||
resources.stylePrecedences.set(precedence, options)),
|
||||
href.add(as),
|
||||
enqueueFlush(request));
|
||||
resources.stylePrecedences.set(as, options));
|
||||
href.add(resource);
|
||||
enqueueFlush(request);
|
||||
}
|
||||
break;
|
||||
case "script":
|
||||
(precedence = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(precedence)),
|
||||
(key = "[" + as + "]" + href),
|
||||
(as = resources.scriptsMap.get(key)),
|
||||
as ||
|
||||
((as = { type: "script", chunks: [], state: 0, props: null }),
|
||||
resources.scriptsMap.set(precedence, as),
|
||||
resources.scriptsMap.set(key, as),
|
||||
(href = {
|
||||
src: href,
|
||||
async: !0,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
}),
|
||||
resources.scripts.add(as),
|
||||
pushScriptImpl(as.chunks, href),
|
||||
@@ -2162,8 +2178,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
|
||||
),
|
||||
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
|
||||
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
emptyContextObject = {},
|
||||
currentActiveSnapshot = null;
|
||||
function popToNearestCommonAncestor(prev, next) {
|
||||
|
||||
@@ -963,6 +963,12 @@ function isReplayingEvent(event) {
|
||||
return event === currentReplayingEvent;
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
var valueStack = [];
|
||||
var fiberStack;
|
||||
|
||||
@@ -1016,7 +1022,7 @@ function push(cursor, value, fiber) {
|
||||
|
||||
var contextStackCursor$1 = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -1074,24 +1080,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor$1.current);
|
||||
var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor$1, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor$1, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor$1, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor$1, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
// This module only exists as an ESM wrapper around the external CommonJS
|
||||
@@ -12418,8 +12421,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -12428,81 +12443,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -12964,6 +13032,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -13039,11 +13108,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -13053,7 +13123,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -13636,11 +13706,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -14532,14 +14602,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
||||
ReactCurrentBatchConfig$3.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$3.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -14555,16 +14631,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -14609,7 +14685,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -30070,9 +30146,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -30878,7 +30954,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -30935,10 +31011,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -31699,7 +31775,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -31745,7 +31821,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -32970,7 +33046,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
@@ -34508,7 +34584,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-cbba93aa";
|
||||
var ReactVersion = "18.3.0-www-classic-03a5fb2c";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -44207,9 +44283,12 @@ function preload$1(href, options) {
|
||||
var as = options.as;
|
||||
var limitedEscapedHref =
|
||||
escapeSelectorAttributeValueInsideDoubleQuotes(href);
|
||||
var preloadKey =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]';
|
||||
var key = preloadKey;
|
||||
var preloadSelector =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for
|
||||
// an arbitrary type. Other preloads are keyed under the resource key they represent a preload for.
|
||||
// Here we figure out which key to use to determine if we have a preload already.
|
||||
|
||||
var key = preloadSelector;
|
||||
|
||||
switch (as) {
|
||||
case "style":
|
||||
@@ -44225,7 +44304,21 @@ function preload$1(href, options) {
|
||||
var preloadProps = preloadPropsFromPreloadOptions(href, as, options);
|
||||
preloadPropsMap.set(key, preloadProps);
|
||||
|
||||
if (null === ownerDocument.querySelector(preloadKey)) {
|
||||
if (null === ownerDocument.querySelector(preloadSelector)) {
|
||||
if (
|
||||
as === "style" &&
|
||||
ownerDocument.querySelector(getStylesheetSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
} else if (
|
||||
as === "script" &&
|
||||
ownerDocument.querySelector(getScriptSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
}
|
||||
|
||||
var instance = ownerDocument.createElement("link");
|
||||
setInitialProperties(instance, "link", preloadProps);
|
||||
markNodeAsHoistable(instance);
|
||||
@@ -44387,7 +44480,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
} // This function is called in begin work and we should always have a currentDocument set
|
||||
|
||||
@@ -47317,12 +47411,6 @@ function preinit(href, options) {
|
||||
// so we favor silent bailout over warning or erroring.
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (
|
||||
typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype
|
||||
|
||||
@@ -96,6 +96,51 @@ function printWarning(level, format, args) {
|
||||
|
||||
var assign = Object.assign;
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.disableInputAttributeSyncing,
|
||||
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
|
||||
enableTrustedTypesIntegration =
|
||||
dynamicFeatureFlags.enableTrustedTypesIntegration,
|
||||
replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
||||
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
|
||||
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
|
||||
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
|
||||
enableLazyContextPropagation =
|
||||
dynamicFeatureFlags.enableLazyContextPropagation,
|
||||
enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates,
|
||||
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build.
|
||||
var enableProfilerTimer = true;
|
||||
var enableProfilerCommitHooks = true;
|
||||
var enableProfilerNestedUpdatePhase = true;
|
||||
var enableProfilerNestedUpdateScheduledHook =
|
||||
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableClientRenderFallbackOnTextMismatch = false;
|
||||
|
||||
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
|
||||
var enableSuspenseCallback = true;
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
var valueStack = [];
|
||||
var fiberStack;
|
||||
|
||||
@@ -147,9 +192,54 @@ function push(cursor, value, fiber) {
|
||||
cursor.current = value;
|
||||
}
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
||||
// The Symbol used to tag the ReactElement-like types.
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
||||
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||
var REACT_SCOPE_TYPE = Symbol.for("react.scope");
|
||||
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
|
||||
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
|
||||
var REACT_CACHE_TYPE = Symbol.for("react.cache");
|
||||
var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
|
||||
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for(
|
||||
"react.default_value"
|
||||
);
|
||||
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
||||
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||
return null;
|
||||
}
|
||||
|
||||
var maybeIterator =
|
||||
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
||||
maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||
|
||||
if (typeof maybeIterator === "function") {
|
||||
return maybeIterator;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -207,62 +297,23 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.disableInputAttributeSyncing,
|
||||
disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds,
|
||||
enableTrustedTypesIntegration =
|
||||
dynamicFeatureFlags.enableTrustedTypesIntegration,
|
||||
replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
|
||||
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
|
||||
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
|
||||
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
|
||||
enableLazyContextPropagation =
|
||||
dynamicFeatureFlags.enableLazyContextPropagation,
|
||||
enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates,
|
||||
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries; // On WWW, true is used for a new modern build.
|
||||
var enableProfilerTimer = true;
|
||||
var enableProfilerCommitHooks = true;
|
||||
var enableProfilerNestedUpdatePhase = true;
|
||||
var enableProfilerNestedUpdateScheduledHook =
|
||||
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableClientRenderFallbackOnTextMismatch = false;
|
||||
|
||||
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
|
||||
var enableSuspenseCallback = true;
|
||||
|
||||
var NoFlags$1 =
|
||||
/* */
|
||||
0;
|
||||
@@ -2879,54 +2930,6 @@ function setValueForPropertyOnCustomComponent(node, name, value) {
|
||||
setValueForAttribute(node, name, value);
|
||||
}
|
||||
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
||||
// The Symbol used to tag the ReactElement-like types.
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
||||
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
||||
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
||||
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
||||
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
||||
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
||||
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
||||
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
||||
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
||||
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
||||
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
||||
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
||||
var REACT_SCOPE_TYPE = Symbol.for("react.scope");
|
||||
var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
|
||||
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
||||
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
|
||||
var REACT_CACHE_TYPE = Symbol.for("react.cache");
|
||||
var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
|
||||
var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for(
|
||||
"react.default_value"
|
||||
);
|
||||
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
||||
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
||||
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
||||
return null;
|
||||
}
|
||||
|
||||
var maybeIterator =
|
||||
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
||||
maybeIterable[FAUX_ITERATOR_SYMBOL];
|
||||
|
||||
if (typeof maybeIterator === "function") {
|
||||
return maybeIterator;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
||||
@@ -12359,8 +12362,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -12369,81 +12384,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -12905,6 +12973,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -12980,11 +13049,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -12994,7 +13064,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -13577,11 +13647,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -14473,14 +14543,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$3.transition;
|
||||
ReactCurrentBatchConfig$3.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$3.transition = {});
|
||||
|
||||
if (enableTransitionTracing) {
|
||||
@@ -14496,16 +14572,16 @@ function startTransition(setPending, callback, options) {
|
||||
|
||||
try {
|
||||
if (enableAsyncActions) {
|
||||
var returnValue = callback(); // `isPending` is either `false` or a thenable that resolves to `false`,
|
||||
// depending on whether the action scope is an async function. In the
|
||||
// async case, the resulting render will suspend until the async action
|
||||
// scope has finished.
|
||||
var returnValue = callback(); // This is either `finishedState` or a thenable that resolves to
|
||||
// `finishedState`, depending on whether the action scope is an async
|
||||
// function. In the async case, the resulting render will suspend until
|
||||
// the async action scope has finished.
|
||||
|
||||
var isPending = requestAsyncActionContext(returnValue);
|
||||
setPending(isPending);
|
||||
var maybeThenable = requestAsyncActionContext(returnValue, finishedState);
|
||||
setPending(maybeThenable);
|
||||
} else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -14550,7 +14626,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -29920,9 +29996,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -30728,7 +30804,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -30785,10 +30861,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -31544,7 +31620,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -31590,7 +31666,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -32815,7 +32891,7 @@ if (replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
||||
// same fiber again.
|
||||
// Unwind the failed stack frame
|
||||
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber.
|
||||
|
||||
assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
|
||||
@@ -34353,7 +34429,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-c0c40983";
|
||||
var ReactVersion = "18.3.0-www-modern-cf89ed45";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -44717,9 +44793,12 @@ function preload$1(href, options) {
|
||||
var as = options.as;
|
||||
var limitedEscapedHref =
|
||||
escapeSelectorAttributeValueInsideDoubleQuotes(href);
|
||||
var preloadKey =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]';
|
||||
var key = preloadKey;
|
||||
var preloadSelector =
|
||||
'link[rel="preload"][as="' + as + '"][href="' + limitedEscapedHref + '"]'; // Some preloads are keyed under their selector. This happens when the preload is for
|
||||
// an arbitrary type. Other preloads are keyed under the resource key they represent a preload for.
|
||||
// Here we figure out which key to use to determine if we have a preload already.
|
||||
|
||||
var key = preloadSelector;
|
||||
|
||||
switch (as) {
|
||||
case "style":
|
||||
@@ -44735,7 +44814,21 @@ function preload$1(href, options) {
|
||||
var preloadProps = preloadPropsFromPreloadOptions(href, as, options);
|
||||
preloadPropsMap.set(key, preloadProps);
|
||||
|
||||
if (null === ownerDocument.querySelector(preloadKey)) {
|
||||
if (null === ownerDocument.querySelector(preloadSelector)) {
|
||||
if (
|
||||
as === "style" &&
|
||||
ownerDocument.querySelector(getStylesheetSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
} else if (
|
||||
as === "script" &&
|
||||
ownerDocument.querySelector(getScriptSelectorFromKey(key))
|
||||
) {
|
||||
// We already have a stylesheet for this key. We don't need to preload it.
|
||||
return;
|
||||
}
|
||||
|
||||
var instance = ownerDocument.createElement("link");
|
||||
setInitialProperties(instance, "link", preloadProps);
|
||||
markNodeAsHoistable(instance);
|
||||
@@ -44897,7 +44990,8 @@ function scriptPropsFromPreinitOptions(src, options) {
|
||||
src: src,
|
||||
async: true,
|
||||
crossOrigin: options.crossOrigin,
|
||||
integrity: options.integrity
|
||||
integrity: options.integrity,
|
||||
nonce: options.nonce
|
||||
};
|
||||
} // This function is called in begin work and we should always have a currentDocument set
|
||||
|
||||
@@ -46406,12 +46500,6 @@ function preinit(href, options) {
|
||||
// so we favor silent bailout over warning or erroring.
|
||||
}
|
||||
|
||||
function useFormStatus() {
|
||||
{
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (
|
||||
typeof Map !== "function" || // $FlowFixMe[prop-missing] Flow incorrectly thinks Map has no prototype
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2837,7 +2837,7 @@ function isRootDehydrated(root) {
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -2891,24 +2891,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -6668,8 +6665,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -6678,81 +6687,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -7173,6 +7235,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -7240,11 +7303,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -7254,7 +7318,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -7768,11 +7832,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -8510,14 +8574,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$2.transition = {});
|
||||
|
||||
{
|
||||
@@ -8525,11 +8595,11 @@ function startTransition(setPending, callback, options) {
|
||||
}
|
||||
|
||||
try {
|
||||
var returnValue, isPending;
|
||||
var returnValue, maybeThenable;
|
||||
if (enableAsyncActions);
|
||||
else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -8564,7 +8634,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -20600,9 +20670,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -21318,7 +21388,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -21375,10 +21445,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -22033,7 +22103,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -22079,7 +22149,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -24455,7 +24525,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-3c32bc8c";
|
||||
var ReactVersion = "18.3.0-www-classic-59dc1008";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -2837,7 +2837,7 @@ function isRootDehydrated(root) {
|
||||
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -2891,24 +2891,21 @@ function pushHostContext(fiber) {
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
if (context === nextContext) {
|
||||
return;
|
||||
} // Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
if (context !== nextContext) {
|
||||
// Track the context and the Fiber that provided it.
|
||||
// This enables us to pop only Fibers that provide unique contexts.
|
||||
push(contextFiberStackCursor, fiber, fiber);
|
||||
push(contextStackCursor, nextContext, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
function popHostContext(fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
if (contextFiberStackCursor.current !== fiber) {
|
||||
return;
|
||||
if (contextFiberStackCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context.
|
||||
// pushHostContext() only pushes Fibers that provide unique contexts.
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -6668,8 +6665,20 @@ function requestTransitionLane() {
|
||||
return currentEventTransitionLane;
|
||||
}
|
||||
|
||||
var currentAsyncAction = null;
|
||||
function requestAsyncActionContext(actionReturnValue) {
|
||||
// transition updates that occur while the async action is still in progress
|
||||
// are treated as part of the action.
|
||||
//
|
||||
// The ideal behavior would be to treat each async function as an independent
|
||||
// action. However, without a mechanism like AsyncContext, we can't tell which
|
||||
// action an update corresponds to. So instead, we entangle them all into one.
|
||||
// The listeners to notify once the entangled scope completes.
|
||||
|
||||
var currentEntangledListeners = null; // The number of pending async actions in the entangled scope.
|
||||
|
||||
var currentEntangledPendingCount = 0; // The transition lane shared by all updates in the entangled scope.
|
||||
|
||||
var currentEntangledLane = NoLane;
|
||||
function requestAsyncActionContext(actionReturnValue, finishedState) {
|
||||
if (
|
||||
actionReturnValue !== null &&
|
||||
typeof actionReturnValue === "object" &&
|
||||
@@ -6678,81 +6687,134 @@ function requestAsyncActionContext(actionReturnValue) {
|
||||
// This is an async action.
|
||||
//
|
||||
// Return a thenable that resolves once the action scope (i.e. the async
|
||||
// function passed to startTransition) has finished running. The fulfilled
|
||||
// value is `false` to represent that the action is not pending.
|
||||
// function passed to startTransition) has finished running.
|
||||
var thenable = actionReturnValue;
|
||||
var entangledListeners;
|
||||
|
||||
if (currentAsyncAction === null) {
|
||||
if (currentEntangledListeners === null) {
|
||||
// There's no outer async action scope. Create a new one.
|
||||
var asyncAction = {
|
||||
lane: requestTransitionLane(),
|
||||
listeners: [],
|
||||
count: 0,
|
||||
status: "pending",
|
||||
value: false,
|
||||
reason: undefined,
|
||||
then: function (resolve) {
|
||||
asyncAction.listeners.push(resolve);
|
||||
}
|
||||
};
|
||||
attachPingListeners(thenable, asyncAction);
|
||||
currentAsyncAction = asyncAction;
|
||||
return asyncAction;
|
||||
entangledListeners = currentEntangledListeners = [];
|
||||
currentEntangledPendingCount = 0;
|
||||
currentEntangledLane = requestTransitionLane();
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
var _asyncAction = currentAsyncAction;
|
||||
attachPingListeners(thenable, _asyncAction);
|
||||
return _asyncAction;
|
||||
entangledListeners = currentEntangledListeners;
|
||||
}
|
||||
|
||||
currentEntangledPendingCount++;
|
||||
var resultStatus = "pending";
|
||||
var rejectedReason;
|
||||
thenable.then(
|
||||
function () {
|
||||
resultStatus = "fulfilled";
|
||||
pingEngtangledActionScope();
|
||||
},
|
||||
function (error) {
|
||||
resultStatus = "rejected";
|
||||
rejectedReason = error;
|
||||
pingEngtangledActionScope();
|
||||
}
|
||||
); // Create a thenable that represents the result of this action, but doesn't
|
||||
// resolve until the entire entangled scope has finished.
|
||||
//
|
||||
// Expressed using promises:
|
||||
// const [thisResult] = await Promise.all([thisAction, entangledAction]);
|
||||
// return thisResult;
|
||||
|
||||
var resultThenable = createResultThenable(entangledListeners); // Attach a listener to fill in the result.
|
||||
|
||||
entangledListeners.push(function () {
|
||||
switch (resultStatus) {
|
||||
case "fulfilled": {
|
||||
var fulfilledThenable = resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
break;
|
||||
}
|
||||
|
||||
case "rejected": {
|
||||
var rejectedThenable = resultThenable;
|
||||
rejectedThenable.status = "rejected";
|
||||
rejectedThenable.reason = rejectedReason;
|
||||
break;
|
||||
}
|
||||
|
||||
case "pending":
|
||||
default: {
|
||||
// The listener above should have been called first, so `resultStatus`
|
||||
// should already be set to the correct value.
|
||||
throw new Error(
|
||||
"Thenable should have already resolved. This " +
|
||||
"is a bug in React."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultThenable;
|
||||
} else {
|
||||
// This is not an async action, but it may be part of an outer async action.
|
||||
if (currentAsyncAction === null) {
|
||||
// There's no outer async action scope.
|
||||
return false;
|
||||
if (currentEntangledListeners === null) {
|
||||
return finishedState;
|
||||
} else {
|
||||
// Inherit the outer scope.
|
||||
return currentAsyncAction;
|
||||
// Return a thenable that does not resolve until the entangled actions
|
||||
// have finished.
|
||||
var _entangledListeners = currentEntangledListeners;
|
||||
|
||||
var _resultThenable = createResultThenable(_entangledListeners);
|
||||
|
||||
_entangledListeners.push(function () {
|
||||
var fulfilledThenable = _resultThenable;
|
||||
fulfilledThenable.status = "fulfilled";
|
||||
fulfilledThenable.value = finishedState;
|
||||
});
|
||||
|
||||
return _resultThenable;
|
||||
}
|
||||
}
|
||||
}
|
||||
function peekAsyncActionContext() {
|
||||
return currentAsyncAction;
|
||||
}
|
||||
|
||||
function attachPingListeners(thenable, asyncAction) {
|
||||
asyncAction.count++;
|
||||
thenable.then(
|
||||
function () {
|
||||
if (--asyncAction.count === 0) {
|
||||
var fulfilledAsyncAction = asyncAction;
|
||||
fulfilledAsyncAction.status = "fulfilled";
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
if (--asyncAction.count === 0) {
|
||||
var rejectedAsyncAction = asyncAction;
|
||||
rejectedAsyncAction.status = "rejected";
|
||||
rejectedAsyncAction.reason = error;
|
||||
completeAsyncActionScope(asyncAction);
|
||||
}
|
||||
function pingEngtangledActionScope() {
|
||||
if (
|
||||
currentEntangledListeners !== null &&
|
||||
--currentEntangledPendingCount === 0
|
||||
) {
|
||||
// All the actions have finished. Close the entangled async action scope
|
||||
// and notify all the listeners.
|
||||
var listeners = currentEntangledListeners;
|
||||
currentEntangledListeners = null;
|
||||
currentEntangledLane = NoLane;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
);
|
||||
return asyncAction;
|
||||
}
|
||||
}
|
||||
|
||||
function completeAsyncActionScope(action) {
|
||||
if (currentAsyncAction === action) {
|
||||
currentAsyncAction = null;
|
||||
}
|
||||
function createResultThenable(entangledListeners) {
|
||||
// Waits for the entangled async action to complete, then resolves to the
|
||||
// result of an individual action.
|
||||
var resultThenable = {
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
then: function (resolve) {
|
||||
// This is a bit of a cheat. `resolve` expects a value of type `S` to be
|
||||
// passed, but because we're instrumenting the `status` field ourselves,
|
||||
// and we know this thenable will only be used by React, we also know
|
||||
// the value isn't actually needed. So we add the resolve function
|
||||
// directly to the entangled listeners.
|
||||
//
|
||||
// This is also why we don't need to check if the thenable is still
|
||||
// pending; the Suspense implementation already performs that check.
|
||||
var ping = resolve;
|
||||
entangledListeners.push(ping);
|
||||
}
|
||||
};
|
||||
return resultThenable;
|
||||
}
|
||||
|
||||
var listeners = action.listeners;
|
||||
action.listeners = [];
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var listener = listeners[i];
|
||||
listener(false);
|
||||
}
|
||||
function peekEntangledActionLane() {
|
||||
return currentEntangledLane;
|
||||
}
|
||||
|
||||
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
||||
@@ -7173,6 +7235,7 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
//
|
||||
// Keep rendering in a loop for as long as render phase updates continue to
|
||||
// be scheduled. Use a counter to prevent infinite loops.
|
||||
currentlyRenderingFiber$1 = workInProgress;
|
||||
var numberOfReRenders = 0;
|
||||
var children;
|
||||
|
||||
@@ -7240,11 +7303,12 @@ function resetHooksAfterThrow() {
|
||||
//
|
||||
// It should only reset things like the current dispatcher, to prevent hooks
|
||||
// from being called outside of a component.
|
||||
// We can assume the previous dispatcher is always this one, since we set it
|
||||
currentlyRenderingFiber$1 = null; // We can assume the previous dispatcher is always this one, since we set it
|
||||
// at the beginning of the render phase and there's no re-entrance.
|
||||
|
||||
ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
|
||||
}
|
||||
function resetHooksOnUnwind() {
|
||||
function resetHooksOnUnwind(workInProgress) {
|
||||
if (didScheduleRenderPhaseUpdate) {
|
||||
// There were render phase updates. These are only valid for this render
|
||||
// phase, which we are now aborting. Remove the updates from the queues so
|
||||
@@ -7254,7 +7318,7 @@ function resetHooksOnUnwind() {
|
||||
// Only reset the updates from the queue if it has a clone. If it does
|
||||
// not have a clone, that means it wasn't processed, and the updates were
|
||||
// scheduled before we entered the render phase.
|
||||
var hook = currentlyRenderingFiber$1.memoizedState;
|
||||
var hook = workInProgress.memoizedState;
|
||||
|
||||
while (hook !== null) {
|
||||
var queue = hook.queue;
|
||||
@@ -7768,11 +7832,11 @@ function useMutableSource(hook, source, getSnapshot, subscribe) {
|
||||
var version = getVersion(source._source);
|
||||
var dispatcher = ReactCurrentDispatcher$1.current; // eslint-disable-next-line prefer-const
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(function () {
|
||||
var _dispatcher$useState2 = dispatcher.useState(function () {
|
||||
return readFromUnsubscribedMutableSource(root, source, getSnapshot);
|
||||
}),
|
||||
currentSnapshot = _dispatcher$useState[0],
|
||||
setSnapshot = _dispatcher$useState[1];
|
||||
currentSnapshot = _dispatcher$useState2[0],
|
||||
setSnapshot = _dispatcher$useState2[1];
|
||||
|
||||
var snapshot = currentSnapshot; // Grab a handle to the state hook as well.
|
||||
// We use it to clear the pending update queue if we have a new source.
|
||||
@@ -8510,14 +8574,20 @@ function updateDeferredValueImpl(hook, prevValue, value) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTransition(setPending, callback, options) {
|
||||
function startTransition(
|
||||
pendingState,
|
||||
finishedState,
|
||||
setPending,
|
||||
callback,
|
||||
options
|
||||
) {
|
||||
var previousPriority = getCurrentUpdatePriority();
|
||||
setCurrentUpdatePriority(
|
||||
higherEventPriority(previousPriority, ContinuousEventPriority)
|
||||
);
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
ReactCurrentBatchConfig$2.transition = null;
|
||||
setPending(true);
|
||||
setPending(pendingState);
|
||||
var currentTransition = (ReactCurrentBatchConfig$2.transition = {});
|
||||
|
||||
{
|
||||
@@ -8525,11 +8595,11 @@ function startTransition(setPending, callback, options) {
|
||||
}
|
||||
|
||||
try {
|
||||
var returnValue, isPending;
|
||||
var returnValue, maybeThenable;
|
||||
if (enableAsyncActions);
|
||||
else {
|
||||
// Async actions are not enabled.
|
||||
setPending(false);
|
||||
setPending(finishedState);
|
||||
callback();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -8564,7 +8634,7 @@ function mountTransition() {
|
||||
var _mountState = mountState(false),
|
||||
setPending = _mountState[1]; // The `start` method never changes.
|
||||
|
||||
var start = startTransition.bind(null, setPending);
|
||||
var start = startTransition.bind(null, true, false, setPending);
|
||||
var hook = mountWorkInProgressHook();
|
||||
hook.memoizedState = start;
|
||||
return [false, start];
|
||||
@@ -20600,9 +20670,9 @@ function requestUpdateLane(fiber) {
|
||||
transition._updatedFibers.add(fiber);
|
||||
}
|
||||
|
||||
var asyncAction = peekAsyncActionContext();
|
||||
return asyncAction !== null // We're inside an async action scope. Reuse the same lane.
|
||||
? asyncAction.lane // We may or may not be inside an async action scope. If we are, this
|
||||
var actionScopeLane = peekEntangledActionLane();
|
||||
return actionScopeLane !== NoLane // We're inside an async action scope. Reuse the same lane.
|
||||
? actionScopeLane // We may or may not be inside an async action scope. If we are, this
|
||||
: // is the first update in that scope. Either way, we need to get a
|
||||
// fresh transition lane.
|
||||
requestTransitionLane();
|
||||
@@ -21318,7 +21388,7 @@ function resetWorkInProgressStack() {
|
||||
} else {
|
||||
// Work-in-progress is in suspended state. Reset the work loop and unwind
|
||||
// both the suspended fiber and all its parents.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(workInProgress);
|
||||
interruptedWork = workInProgress;
|
||||
}
|
||||
|
||||
@@ -21375,10 +21445,10 @@ function prepareFreshStack(root, lanes) {
|
||||
return rootWorkInProgress;
|
||||
}
|
||||
|
||||
function resetSuspendedWorkLoopOnUnwind() {
|
||||
function resetSuspendedWorkLoopOnUnwind(fiber) {
|
||||
// Reset module-level state that was set during the render phase.
|
||||
resetContextDependencies();
|
||||
resetHooksOnUnwind();
|
||||
resetHooksOnUnwind(fiber);
|
||||
resetChildReconcilerOnUnwind();
|
||||
}
|
||||
|
||||
@@ -22033,7 +22103,7 @@ function replaySuspendedUnitOfWork(unitOfWork) {
|
||||
// is to reuse uncached promises, but we happen to know that the only
|
||||
// promises that a host component might suspend on are definitely cached
|
||||
// because they are controlled by us. So don't bother.
|
||||
resetHooksOnUnwind(); // Fallthrough to the next branch.
|
||||
resetHooksOnUnwind(unitOfWork); // Fallthrough to the next branch.
|
||||
}
|
||||
|
||||
default: {
|
||||
@@ -22079,7 +22149,7 @@ function throwAndUnwindWorkLoop(unitOfWork, thrownValue) {
|
||||
//
|
||||
// Return to the normal work loop. This will unwind the stack, and potentially
|
||||
// result in showing a fallback.
|
||||
resetSuspendedWorkLoopOnUnwind();
|
||||
resetSuspendedWorkLoopOnUnwind(unitOfWork);
|
||||
var returnFiber = unitOfWork.return;
|
||||
|
||||
if (returnFiber === null || workInProgressRoot === null) {
|
||||
@@ -24455,7 +24525,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-bcc00dd5";
|
||||
var ReactVersion = "18.3.0-www-modern-3898c4ac";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -213,7 +213,6 @@
|
||||
"React encountered a <link rel=\"stylesheet\" precedence=\"%s\" href=\"%s\" .../> with props that conflict with the options provided to `ReactDOM.preinit(\"%s\", { as: \"style\", ... })`. React will use the first props or preinitialization options encountered when rendering a hoistable stylesheet with a particular `href` and will ignore any newer props or options. The first instance of this stylesheet resource was created using the `ReactDOM.preinit()` function. Please note, `ReactDOM.preinit()` is modeled off of module import assertions capabilities and does not support arbitrary props. If you need to have props not included with the preinit options you will need to rely on rendering <link> tags only.%s"
|
||||
"React encountered a <script async={true} src=\"%s\" .../> that has props that conflict with another hoistable script with the same `src`. When rendering hoistable scripts (async scripts without any loading handlers) the props from the first encountered instance will be used and props from later instances will be ignored. Update the props on both <script async={true} .../> instance so they agree.%s"
|
||||
"React encountered a <script async={true} src=\"%s\" .../> with props that conflict with the options provided to `ReactDOM.preinit(\"%s\", { as: \"script\", ... })`. React will use the first props or preinitialization options encountered when rendering a hoistable script with a particular `src` and will ignore any newer props or options. The first instance of this script resource was created using the `ReactDOM.preinit()` function. Please note, `ReactDOM.preinit()` is modeled off of module import assertions capabilities and does not support arbitrary props. If you need to have props not included with the preinit options you will need to rely on rendering <script> tags only.%s"
|
||||
"React encountered a Stylesheet Resource that already flushed a Preload when it was not expected to. This is a bug in React."
|
||||
"React encountered a `<link rel=\"stylesheet\" .../>` with a `precedence` prop and %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop."
|
||||
"React encountered a `<link rel=\"stylesheet\" .../>` with a `precedence` prop and a `disabled` prop. The presence of the `disabled` prop indicates an intent to manage the stylesheet active state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the `disabled` prop, otherwise remove the `precedence` prop."
|
||||
"React encountered a `<link rel=\"stylesheet\" .../>` with a `precedence` prop and expected the `href` prop to be a non-empty string but ecountered %s instead. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop ensure there is a non-empty string `href` prop as well, otherwise remove the `precedence` prop."
|
||||
|
||||
Reference in New Issue
Block a user