mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
useActionState: Transfer transition context (#29694)
Mini-refactor of useActionState to only wrap the action in a transition
context if the dispatch is called during a transition. Conceptually, the
action starts as soon as the dispatch is called, even if the action is
queued until earlier ones finish.
We will also warn if an async action is dispatched outside of a
transition, since that is almost certainly a mistake. Ideally we would
automatically upgrade these to a transition, but we don't have a great
way to tell if the action is async until after it's already run.
DiffTrain build for [67b05be0d2](https://github.com/facebook/react/commit/67b05be0d216c4efebc4bb5acb12c861a18bd87c)
This commit is contained in:
@@ -1 +1 @@
|
||||
def67b9b329c8aa204e611cd510c5a64680aee58
|
||||
67b05be0d216c4efebc4bb5acb12c861a18bd87c
|
||||
|
||||
@@ -1 +1 @@
|
||||
def67b9b329c8aa204e611cd510c5a64680aee58
|
||||
67b05be0d216c4efebc4bb5acb12c861a18bd87c
|
||||
|
||||
@@ -22,7 +22,7 @@ if (
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require('ReactFeatureFlags');
|
||||
|
||||
@@ -22,7 +22,7 @@ if (
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
// Re-export dynamic flags from the www version.
|
||||
var dynamicFeatureFlags = require('ReactFeatureFlags');
|
||||
|
||||
@@ -684,4 +684,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-www-classic-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
|
||||
|
||||
@@ -684,4 +684,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-www-modern-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
|
||||
|
||||
@@ -688,7 +688,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-www-classic-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
@@ -688,7 +688,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.0.0-www-modern-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
@@ -60,7 +60,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -9272,112 +9272,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -9391,11 +9427,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -9061,112 +9061,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -9180,11 +9216,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
|
||||
@@ -3018,72 +3018,101 @@ function dispatchActionState(
|
||||
payload
|
||||
) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
isTransition: !0,
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
};
|
||||
null !== ReactSharedInternals.T
|
||||
? setPendingState(!0)
|
||||
: (actionNode.isTransition = !1);
|
||||
setState(actionNode);
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((payload = { payload: payload, action: actionQueue.action, next: null }),
|
||||
(payload.next = actionQueue.pending = payload),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, action: actionQueue.action, next: fiber.next });
|
||||
? ((actionNode.next = actionQueue.pending = actionNode),
|
||||
runActionStateAction(actionQueue, actionNode))
|
||||
: ((actionNode.next = fiber.next),
|
||||
(actionQueue.pending = fiber.next = actionNode));
|
||||
}
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
setPendingState(!0);
|
||||
var action = node.action;
|
||||
node = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
try {
|
||||
var returnValue = action(prevState, node),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
},
|
||||
function () {
|
||||
return finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
var action = node.action,
|
||||
payload = node.payload,
|
||||
prevState = actionQueue.state;
|
||||
if (node.isTransition) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
} else
|
||||
try {
|
||||
(prevTransition = action(prevState, payload)),
|
||||
handleActionReturnValue(actionQueue, node, prevTransition);
|
||||
} catch (error$39) {
|
||||
onActionError(actionQueue, node, error$39);
|
||||
}
|
||||
}
|
||||
function finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? returnValue.then(
|
||||
function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
},
|
||||
function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
}
|
||||
)
|
||||
: onActionSuccess(actionQueue, node, returnValue);
|
||||
}
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
actionNode.status = "fulfilled";
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState;
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((nextState = actionNode.next),
|
||||
nextState === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, first));
|
||||
}
|
||||
: ((nextState = nextState.next),
|
||||
(actionNode.next = nextState),
|
||||
runActionStateAction(actionQueue, nextState)));
|
||||
}
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = "rejected";
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode);
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((error = actionNode.next),
|
||||
error === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((error = error.next),
|
||||
(actionNode.next = error),
|
||||
runActionStateAction(actionQueue, error)));
|
||||
}
|
||||
function notifyActionListeners(actionNode) {
|
||||
actionNode = actionNode.listeners;
|
||||
for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
|
||||
}
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
@@ -3955,9 +3984,9 @@ function resolveClassComponentProps(
|
||||
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
|
||||
) {
|
||||
newProps === baseProps && (newProps = assign({}, newProps));
|
||||
for (var propName$40 in Component)
|
||||
void 0 === newProps[propName$40] &&
|
||||
(newProps[propName$40] = Component[propName$40]);
|
||||
for (var propName$41 in Component)
|
||||
void 0 === newProps[propName$41] &&
|
||||
(newProps[propName$41] = Component[propName$41]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
@@ -6538,14 +6567,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$87 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$87 = lastTailNode),
|
||||
for (var lastTailNode$88 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$88 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$87
|
||||
null === lastTailNode$88
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$87.sibling = null);
|
||||
: (lastTailNode$88.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -6555,19 +6584,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$88 = completedWork.child; null !== child$88; )
|
||||
(newChildLanes |= child$88.lanes | child$88.childLanes),
|
||||
(subtreeFlags |= child$88.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$88.flags & 31457280),
|
||||
(child$88.return = completedWork),
|
||||
(child$88 = child$88.sibling);
|
||||
for (var child$89 = completedWork.child; null !== child$89; )
|
||||
(newChildLanes |= child$89.lanes | child$89.childLanes),
|
||||
(subtreeFlags |= child$89.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$89.flags & 31457280),
|
||||
(child$89.return = completedWork),
|
||||
(child$89 = child$89.sibling);
|
||||
else
|
||||
for (child$88 = completedWork.child; null !== child$88; )
|
||||
(newChildLanes |= child$88.lanes | child$88.childLanes),
|
||||
(subtreeFlags |= child$88.subtreeFlags),
|
||||
(subtreeFlags |= child$88.flags),
|
||||
(child$88.return = completedWork),
|
||||
(child$88 = child$88.sibling);
|
||||
for (child$89 = completedWork.child; null !== child$89; )
|
||||
(newChildLanes |= child$89.lanes | child$89.childLanes),
|
||||
(subtreeFlags |= child$89.subtreeFlags),
|
||||
(subtreeFlags |= child$89.flags),
|
||||
(child$89.return = completedWork),
|
||||
(child$89 = child$89.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -6745,11 +6774,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$92 = null;
|
||||
var cache$93 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$92 = newProps.memoizedState.cachePool.pool);
|
||||
cache$92 !== instance && (newProps.flags |= 2048);
|
||||
(cache$93 = newProps.memoizedState.cachePool.pool);
|
||||
cache$93 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -6783,8 +6812,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$92 = instance.rendering;
|
||||
if (null === cache$92)
|
||||
cache$93 = instance.rendering;
|
||||
if (null === cache$93)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -6792,11 +6821,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$92 = findFirstSuspended(current);
|
||||
if (null !== cache$92) {
|
||||
cache$93 = findFirstSuspended(current);
|
||||
if (null !== cache$93) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$92.updateQueue;
|
||||
current = cache$93.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -6821,7 +6850,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$92)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$93)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -6831,7 +6860,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$92.alternate)
|
||||
!cache$93.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -6843,13 +6872,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
instance.isBackwards
|
||||
? ((cache$92.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$92))
|
||||
? ((cache$93.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$93))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$92)
|
||||
: (workInProgress.child = cache$92),
|
||||
(instance.last = cache$92));
|
||||
? (current.sibling = cache$93)
|
||||
: (workInProgress.child = cache$93),
|
||||
(instance.last = cache$93));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -7121,8 +7150,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$110) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$110);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$111);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -7326,11 +7355,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$111) {
|
||||
} catch (error$112) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$111
|
||||
error$112
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7921,8 +7950,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$119) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$119);
|
||||
} catch (error$120) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$120);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7955,8 +7984,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
current = null !== current ? current.memoizedProps : newProps;
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$122) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$122);
|
||||
} catch (error$123) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$123);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7992,8 +8021,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$124) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$124);
|
||||
} catch (error$125) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$125);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -8133,12 +8162,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$114 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$115 = getHostSibling(finishedWork);
|
||||
var parent$115 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$116 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$115,
|
||||
parent$114
|
||||
before$116,
|
||||
parent$115
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -8596,9 +8625,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$134 = finishedWork.stateNode;
|
||||
var instance$135 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$134._visibility & 4
|
||||
? instance$135._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8611,7 +8640,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$134._visibility |= 4),
|
||||
: ((instance$135._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8619,7 +8648,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$134._visibility |= 4),
|
||||
: ((instance$135._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8632,7 +8661,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$134
|
||||
instance$135
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -8726,12 +8755,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) {
|
||||
break;
|
||||
case 22:
|
||||
if (null === fiber.memoizedState) {
|
||||
var current$139 = fiber.alternate;
|
||||
null !== current$139 && null !== current$139.memoizedState
|
||||
? ((current$139 = suspenseyCommitFlag),
|
||||
var current$140 = fiber.alternate;
|
||||
null !== current$140 && null !== current$140.memoizedState
|
||||
? ((current$140 = suspenseyCommitFlag),
|
||||
(suspenseyCommitFlag = 16777216),
|
||||
recursivelyAccumulateSuspenseyCommit(fiber),
|
||||
(suspenseyCommitFlag = current$139))
|
||||
(suspenseyCommitFlag = current$140))
|
||||
: recursivelyAccumulateSuspenseyCommit(fiber);
|
||||
}
|
||||
break;
|
||||
@@ -9539,8 +9568,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$145) {
|
||||
handleThrow(root, thrownValue$145);
|
||||
} catch (thrownValue$146) {
|
||||
handleThrow(root, thrownValue$146);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -9649,8 +9678,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$147) {
|
||||
handleThrow(root, thrownValue$147);
|
||||
} catch (thrownValue$148) {
|
||||
handleThrow(root, thrownValue$148);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10640,19 +10669,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1158 = {
|
||||
devToolsConfig$jscomp$inline_1159 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "19.0.0-www-classic-def67b9b32-20240603",
|
||||
version: "19.0.0-www-classic-67b05be0d2-20240603",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1370 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1158.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1158.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1158.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1158.rendererConfig,
|
||||
var internals$jscomp$inline_1371 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1159.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1159.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1159.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1159.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10669,26 +10698,26 @@ var internals$jscomp$inline_1370 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1158.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1159.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603"
|
||||
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1371 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1372 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1371.isDisabled &&
|
||||
hook$jscomp$inline_1371.supportsFiber
|
||||
!hook$jscomp$inline_1372.isDisabled &&
|
||||
hook$jscomp$inline_1372.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1371.inject(
|
||||
internals$jscomp$inline_1370
|
||||
(rendererID = hook$jscomp$inline_1372.inject(
|
||||
internals$jscomp$inline_1371
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1371);
|
||||
(injectedHook = hook$jscomp$inline_1372);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -2816,72 +2816,101 @@ function dispatchActionState(
|
||||
payload
|
||||
) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
isTransition: !0,
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
};
|
||||
null !== ReactSharedInternals.T
|
||||
? setPendingState(!0)
|
||||
: (actionNode.isTransition = !1);
|
||||
setState(actionNode);
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((payload = { payload: payload, action: actionQueue.action, next: null }),
|
||||
(payload.next = actionQueue.pending = payload),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, action: actionQueue.action, next: fiber.next });
|
||||
? ((actionNode.next = actionQueue.pending = actionNode),
|
||||
runActionStateAction(actionQueue, actionNode))
|
||||
: ((actionNode.next = fiber.next),
|
||||
(actionQueue.pending = fiber.next = actionNode));
|
||||
}
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
setPendingState(!0);
|
||||
var action = node.action;
|
||||
node = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
try {
|
||||
var returnValue = action(prevState, node),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
},
|
||||
function () {
|
||||
return finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
var action = node.action,
|
||||
payload = node.payload,
|
||||
prevState = actionQueue.state;
|
||||
if (node.isTransition) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
} else
|
||||
try {
|
||||
(prevTransition = action(prevState, payload)),
|
||||
handleActionReturnValue(actionQueue, node, prevTransition);
|
||||
} catch (error$39) {
|
||||
onActionError(actionQueue, node, error$39);
|
||||
}
|
||||
}
|
||||
function finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? returnValue.then(
|
||||
function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
},
|
||||
function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
}
|
||||
)
|
||||
: onActionSuccess(actionQueue, node, returnValue);
|
||||
}
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
actionNode.status = "fulfilled";
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState;
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((nextState = actionNode.next),
|
||||
nextState === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, first));
|
||||
}
|
||||
: ((nextState = nextState.next),
|
||||
(actionNode.next = nextState),
|
||||
runActionStateAction(actionQueue, nextState)));
|
||||
}
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = "rejected";
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode);
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((error = actionNode.next),
|
||||
error === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((error = error.next),
|
||||
(actionNode.next = error),
|
||||
runActionStateAction(actionQueue, error)));
|
||||
}
|
||||
function notifyActionListeners(actionNode) {
|
||||
actionNode = actionNode.listeners;
|
||||
for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
|
||||
}
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
@@ -3691,9 +3720,9 @@ function resolveClassComponentProps(
|
||||
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
|
||||
) {
|
||||
newProps === baseProps && (newProps = assign({}, newProps));
|
||||
for (var propName$40 in Component)
|
||||
void 0 === newProps[propName$40] &&
|
||||
(newProps[propName$40] = Component[propName$40]);
|
||||
for (var propName$41 in Component)
|
||||
void 0 === newProps[propName$41] &&
|
||||
(newProps[propName$41] = Component[propName$41]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
@@ -6122,14 +6151,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$79 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$79 = lastTailNode),
|
||||
for (var lastTailNode$80 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$80 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$79
|
||||
null === lastTailNode$80
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$79.sibling = null);
|
||||
: (lastTailNode$80.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -6139,19 +6168,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$80 = completedWork.child; null !== child$80; )
|
||||
(newChildLanes |= child$80.lanes | child$80.childLanes),
|
||||
(subtreeFlags |= child$80.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$80.flags & 31457280),
|
||||
(child$80.return = completedWork),
|
||||
(child$80 = child$80.sibling);
|
||||
for (var child$81 = completedWork.child; null !== child$81; )
|
||||
(newChildLanes |= child$81.lanes | child$81.childLanes),
|
||||
(subtreeFlags |= child$81.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$81.flags & 31457280),
|
||||
(child$81.return = completedWork),
|
||||
(child$81 = child$81.sibling);
|
||||
else
|
||||
for (child$80 = completedWork.child; null !== child$80; )
|
||||
(newChildLanes |= child$80.lanes | child$80.childLanes),
|
||||
(subtreeFlags |= child$80.subtreeFlags),
|
||||
(subtreeFlags |= child$80.flags),
|
||||
(child$80.return = completedWork),
|
||||
(child$80 = child$80.sibling);
|
||||
for (child$81 = completedWork.child; null !== child$81; )
|
||||
(newChildLanes |= child$81.lanes | child$81.childLanes),
|
||||
(subtreeFlags |= child$81.subtreeFlags),
|
||||
(subtreeFlags |= child$81.flags),
|
||||
(child$81.return = completedWork),
|
||||
(child$81 = child$81.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -6322,11 +6351,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$84 = null;
|
||||
var cache$85 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$84 = newProps.memoizedState.cachePool.pool);
|
||||
cache$84 !== instance && (newProps.flags |= 2048);
|
||||
(cache$85 = newProps.memoizedState.cachePool.pool);
|
||||
cache$85 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -6354,8 +6383,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$84 = instance.rendering;
|
||||
if (null === cache$84)
|
||||
cache$85 = instance.rendering;
|
||||
if (null === cache$85)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -6363,11 +6392,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$84 = findFirstSuspended(current);
|
||||
if (null !== cache$84) {
|
||||
cache$85 = findFirstSuspended(current);
|
||||
if (null !== cache$85) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$84.updateQueue;
|
||||
current = cache$85.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -6392,7 +6421,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$84)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$85)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -6402,7 +6431,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$84.alternate)
|
||||
!cache$85.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -6414,13 +6443,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
instance.isBackwards
|
||||
? ((cache$84.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$84))
|
||||
? ((cache$85.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$85))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$84)
|
||||
: (workInProgress.child = cache$84),
|
||||
(instance.last = cache$84));
|
||||
? (current.sibling = cache$85)
|
||||
: (workInProgress.child = cache$85),
|
||||
(instance.last = cache$85));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -6683,8 +6712,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$101);
|
||||
} catch (error$102) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$102);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6888,11 +6917,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$102) {
|
||||
} catch (error$103) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$102
|
||||
error$103
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7472,8 +7501,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$110) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7506,8 +7535,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
current = null !== current ? current.memoizedProps : newProps;
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$113) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$113);
|
||||
} catch (error$114) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$114);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7543,8 +7572,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$115) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$115);
|
||||
} catch (error$116) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$116);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -7681,12 +7710,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$105 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$106 = getHostSibling(finishedWork);
|
||||
var parent$106 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$107 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$106,
|
||||
parent$105
|
||||
before$107,
|
||||
parent$106
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -8136,9 +8165,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$125 = finishedWork.stateNode;
|
||||
var instance$126 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$125._visibility & 4
|
||||
? instance$126._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8150,7 +8179,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$125._visibility |= 4),
|
||||
: ((instance$126._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8163,7 +8192,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$125
|
||||
instance$126
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -8257,12 +8286,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) {
|
||||
break;
|
||||
case 22:
|
||||
if (null === fiber.memoizedState) {
|
||||
var current$130 = fiber.alternate;
|
||||
null !== current$130 && null !== current$130.memoizedState
|
||||
? ((current$130 = suspenseyCommitFlag),
|
||||
var current$131 = fiber.alternate;
|
||||
null !== current$131 && null !== current$131.memoizedState
|
||||
? ((current$131 = suspenseyCommitFlag),
|
||||
(suspenseyCommitFlag = 16777216),
|
||||
recursivelyAccumulateSuspenseyCommit(fiber),
|
||||
(suspenseyCommitFlag = current$130))
|
||||
(suspenseyCommitFlag = current$131))
|
||||
: recursivelyAccumulateSuspenseyCommit(fiber);
|
||||
}
|
||||
break;
|
||||
@@ -9063,8 +9092,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$136) {
|
||||
handleThrow(root, thrownValue$136);
|
||||
} catch (thrownValue$137) {
|
||||
handleThrow(root, thrownValue$137);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -9173,8 +9202,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$138) {
|
||||
handleThrow(root, thrownValue$138);
|
||||
} catch (thrownValue$139) {
|
||||
handleThrow(root, thrownValue$139);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10115,19 +10144,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1122 = {
|
||||
devToolsConfig$jscomp$inline_1123 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "19.0.0-www-modern-def67b9b32-20240603",
|
||||
version: "19.0.0-www-modern-67b05be0d2-20240603",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1356 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1122.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1122.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1122.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1122.rendererConfig,
|
||||
var internals$jscomp$inline_1357 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1123.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1123.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1123.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1123.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10144,26 +10173,26 @@ var internals$jscomp$inline_1356 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1122.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1123.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603"
|
||||
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1357 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1358 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1357.isDisabled &&
|
||||
hook$jscomp$inline_1357.supportsFiber
|
||||
!hook$jscomp$inline_1358.isDisabled &&
|
||||
hook$jscomp$inline_1358.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1357.inject(
|
||||
internals$jscomp$inline_1356
|
||||
(rendererID = hook$jscomp$inline_1358.inject(
|
||||
internals$jscomp$inline_1357
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1357);
|
||||
(injectedHook = hook$jscomp$inline_1358);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -12972,112 +12972,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -13091,11 +13127,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -31090,7 +31163,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
||||
implementation) {
|
||||
|
||||
@@ -12713,112 +12713,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -12832,11 +12868,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -30267,7 +30340,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
||||
implementation) {
|
||||
|
||||
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 = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require('warning');
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require('warning');
|
||||
|
||||
@@ -5699,4 +5699,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 = "19.0.0-www-classic-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-classic-67b05be0d2-20240603";
|
||||
|
||||
@@ -5677,4 +5677,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 = "19.0.0-www-modern-def67b9b32-20240603";
|
||||
exports.version = "19.0.0-www-modern-67b05be0d2-20240603";
|
||||
|
||||
@@ -13113,112 +13113,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -13232,11 +13268,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -31656,7 +31729,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
||||
implementation) {
|
||||
|
||||
@@ -12854,112 +12854,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -12973,11 +13009,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -30833,7 +30906,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
||||
implementation) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -9873,112 +9873,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -9992,11 +10028,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -28858,7 +28931,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
|
||||
@@ -9664,112 +9664,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -9783,11 +9819,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -28126,7 +28199,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
|
||||
@@ -2881,80 +2881,101 @@ module.exports = function ($$$config) {
|
||||
payload
|
||||
) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
isTransition: !0,
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
};
|
||||
null !== ReactSharedInternals.T
|
||||
? setPendingState(!0)
|
||||
: (actionNode.isTransition = !1);
|
||||
setState(actionNode);
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((payload = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null
|
||||
}),
|
||||
(payload.next = actionQueue.pending = payload),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, action: actionQueue.action, next: fiber.next });
|
||||
? ((actionNode.next = actionQueue.pending = actionNode),
|
||||
runActionStateAction(actionQueue, actionNode))
|
||||
: ((actionNode.next = fiber.next),
|
||||
(actionQueue.pending = fiber.next = actionNode));
|
||||
}
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
setPendingState(!0);
|
||||
var action = node.action;
|
||||
node = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
try {
|
||||
var returnValue = action(prevState, node),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
},
|
||||
function () {
|
||||
return finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
var action = node.action,
|
||||
payload = node.payload,
|
||||
prevState = actionQueue.state;
|
||||
if (node.isTransition) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
} else
|
||||
try {
|
||||
(prevTransition = action(prevState, payload)),
|
||||
handleActionReturnValue(actionQueue, node, prevTransition);
|
||||
} catch (error$47) {
|
||||
onActionError(actionQueue, node, error$47);
|
||||
}
|
||||
}
|
||||
function finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? returnValue.then(
|
||||
function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
},
|
||||
function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
}
|
||||
)
|
||||
: onActionSuccess(actionQueue, node, returnValue);
|
||||
}
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
actionNode.status = "fulfilled";
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState;
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((nextState = actionNode.next),
|
||||
nextState === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, first));
|
||||
}
|
||||
: ((nextState = nextState.next),
|
||||
(actionNode.next = nextState),
|
||||
runActionStateAction(actionQueue, nextState)));
|
||||
}
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = "rejected";
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode);
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((error = actionNode.next),
|
||||
error === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((error = error.next),
|
||||
(actionNode.next = error),
|
||||
runActionStateAction(actionQueue, error)));
|
||||
}
|
||||
function notifyActionListeners(actionNode) {
|
||||
actionNode = actionNode.listeners;
|
||||
for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
|
||||
}
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
@@ -3573,9 +3594,9 @@ module.exports = function ($$$config) {
|
||||
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
|
||||
) {
|
||||
newProps === baseProps && (newProps = assign({}, newProps));
|
||||
for (var propName$48 in Component)
|
||||
void 0 === newProps[propName$48] &&
|
||||
(newProps[propName$48] = Component[propName$48]);
|
||||
for (var propName$49 in Component)
|
||||
void 0 === newProps[propName$49] &&
|
||||
(newProps[propName$49] = Component[propName$49]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
@@ -6508,44 +6529,44 @@ module.exports = function ($$$config) {
|
||||
needsVisibilityToggle = needsVisibilityToggle.sibling;
|
||||
}
|
||||
else if (supportsPersistence)
|
||||
for (var node$101 = workInProgress.child; null !== node$101; ) {
|
||||
if (5 === node$101.tag) {
|
||||
var instance = node$101.stateNode;
|
||||
for (var node$102 = workInProgress.child; null !== node$102; ) {
|
||||
if (5 === node$102.tag) {
|
||||
var instance = node$102.stateNode;
|
||||
needsVisibilityToggle &&
|
||||
isHidden &&
|
||||
(instance = cloneHiddenInstance(
|
||||
instance,
|
||||
node$101.type,
|
||||
node$101.memoizedProps
|
||||
node$102.type,
|
||||
node$102.memoizedProps
|
||||
));
|
||||
appendInitialChild(parent, instance);
|
||||
} else if (6 === node$101.tag)
|
||||
(instance = node$101.stateNode),
|
||||
} else if (6 === node$102.tag)
|
||||
(instance = node$102.stateNode),
|
||||
needsVisibilityToggle &&
|
||||
isHidden &&
|
||||
(instance = cloneHiddenTextInstance(
|
||||
instance,
|
||||
node$101.memoizedProps
|
||||
node$102.memoizedProps
|
||||
)),
|
||||
appendInitialChild(parent, instance);
|
||||
else if (4 !== node$101.tag)
|
||||
if (22 === node$101.tag && null !== node$101.memoizedState)
|
||||
(instance = node$101.child),
|
||||
null !== instance && (instance.return = node$101),
|
||||
appendAllChildren(parent, node$101, !0, !0);
|
||||
else if (null !== node$101.child) {
|
||||
node$101.child.return = node$101;
|
||||
node$101 = node$101.child;
|
||||
else if (4 !== node$102.tag)
|
||||
if (22 === node$102.tag && null !== node$102.memoizedState)
|
||||
(instance = node$102.child),
|
||||
null !== instance && (instance.return = node$102),
|
||||
appendAllChildren(parent, node$102, !0, !0);
|
||||
else if (null !== node$102.child) {
|
||||
node$102.child.return = node$102;
|
||||
node$102 = node$102.child;
|
||||
continue;
|
||||
}
|
||||
if (node$101 === workInProgress) break;
|
||||
for (; null === node$101.sibling; ) {
|
||||
if (null === node$101.return || node$101.return === workInProgress)
|
||||
if (node$102 === workInProgress) break;
|
||||
for (; null === node$102.sibling; ) {
|
||||
if (null === node$102.return || node$102.return === workInProgress)
|
||||
return;
|
||||
node$101 = node$101.return;
|
||||
node$102 = node$102.return;
|
||||
}
|
||||
node$101.sibling.return = node$101.return;
|
||||
node$101 = node$101.sibling;
|
||||
node$102.sibling.return = node$102.return;
|
||||
node$102 = node$102.sibling;
|
||||
}
|
||||
}
|
||||
function appendAllChildrenToContainer(
|
||||
@@ -6618,31 +6639,31 @@ module.exports = function ($$$config) {
|
||||
current.memoizedProps !== newProps && markUpdate(workInProgress);
|
||||
else if (supportsPersistence) {
|
||||
var currentInstance = current.stateNode,
|
||||
oldProps$104 = current.memoizedProps;
|
||||
oldProps$105 = current.memoizedProps;
|
||||
if (
|
||||
(current = doesRequireClone(current, workInProgress)) ||
|
||||
oldProps$104 !== newProps
|
||||
oldProps$105 !== newProps
|
||||
) {
|
||||
var currentHostContext = contextStackCursor.current;
|
||||
oldProps$104 = cloneInstance(
|
||||
oldProps$105 = cloneInstance(
|
||||
currentInstance,
|
||||
type,
|
||||
oldProps$104,
|
||||
oldProps$105,
|
||||
newProps,
|
||||
!current,
|
||||
null
|
||||
);
|
||||
oldProps$104 === currentInstance
|
||||
oldProps$105 === currentInstance
|
||||
? (workInProgress.stateNode = currentInstance)
|
||||
: (finalizeInitialChildren(
|
||||
oldProps$104,
|
||||
oldProps$105,
|
||||
type,
|
||||
newProps,
|
||||
currentHostContext
|
||||
) && markUpdate(workInProgress),
|
||||
(workInProgress.stateNode = oldProps$104),
|
||||
(workInProgress.stateNode = oldProps$105),
|
||||
current
|
||||
? appendAllChildren(oldProps$104, workInProgress, !1, !1)
|
||||
? appendAllChildren(oldProps$105, workInProgress, !1, !1)
|
||||
: markUpdate(workInProgress));
|
||||
} else workInProgress.stateNode = currentInstance;
|
||||
}
|
||||
@@ -6692,15 +6713,15 @@ module.exports = function ($$$config) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$106 = null; null !== lastTailNode; )
|
||||
for (var lastTailNode$107 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate &&
|
||||
(lastTailNode$106 = lastTailNode),
|
||||
(lastTailNode$107 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$106
|
||||
null === lastTailNode$107
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$106.sibling = null);
|
||||
: (lastTailNode$107.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -6710,19 +6731,19 @@ module.exports = function ($$$config) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$107 = completedWork.child; null !== child$107; )
|
||||
(newChildLanes |= child$107.lanes | child$107.childLanes),
|
||||
(subtreeFlags |= child$107.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$107.flags & 31457280),
|
||||
(child$107.return = completedWork),
|
||||
(child$107 = child$107.sibling);
|
||||
for (var child$108 = completedWork.child; null !== child$108; )
|
||||
(newChildLanes |= child$108.lanes | child$108.childLanes),
|
||||
(subtreeFlags |= child$108.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$108.flags & 31457280),
|
||||
(child$108.return = completedWork),
|
||||
(child$108 = child$108.sibling);
|
||||
else
|
||||
for (child$107 = completedWork.child; null !== child$107; )
|
||||
(newChildLanes |= child$107.lanes | child$107.childLanes),
|
||||
(subtreeFlags |= child$107.subtreeFlags),
|
||||
(subtreeFlags |= child$107.flags),
|
||||
(child$107.return = completedWork),
|
||||
(child$107 = child$107.sibling);
|
||||
for (child$108 = completedWork.child; null !== child$108; )
|
||||
(newChildLanes |= child$108.lanes | child$108.childLanes),
|
||||
(subtreeFlags |= child$108.subtreeFlags),
|
||||
(subtreeFlags |= child$108.flags),
|
||||
(child$108.return = completedWork),
|
||||
(child$108 = child$108.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -6999,11 +7020,11 @@ module.exports = function ($$$config) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(nextResource = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$120 = null;
|
||||
var cache$121 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$120 = newProps.memoizedState.cachePool.pool);
|
||||
cache$120 !== nextResource && (newProps.flags |= 2048);
|
||||
(cache$121 = newProps.memoizedState.cachePool.pool);
|
||||
cache$121 !== nextResource && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -7045,8 +7066,8 @@ module.exports = function ($$$config) {
|
||||
if (null === nextResource)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$120 = nextResource.rendering;
|
||||
if (null === cache$120)
|
||||
cache$121 = nextResource.rendering;
|
||||
if (null === cache$121)
|
||||
if (newProps) cutOffTailIfNeeded(nextResource, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -7054,11 +7075,11 @@ module.exports = function ($$$config) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$120 = findFirstSuspended(current);
|
||||
if (null !== cache$120) {
|
||||
cache$121 = findFirstSuspended(current);
|
||||
if (null !== cache$121) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(nextResource, !1);
|
||||
current = cache$120.updateQueue;
|
||||
current = cache$121.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -7087,7 +7108,7 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$120)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$121)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -7097,7 +7118,7 @@ module.exports = function ($$$config) {
|
||||
cutOffTailIfNeeded(nextResource, !0),
|
||||
null === nextResource.tail &&
|
||||
"hidden" === nextResource.tailMode &&
|
||||
!cache$120.alternate &&
|
||||
!cache$121.alternate &&
|
||||
!isHydrating)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
@@ -7110,13 +7131,13 @@ module.exports = function ($$$config) {
|
||||
cutOffTailIfNeeded(nextResource, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
nextResource.isBackwards
|
||||
? ((cache$120.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$120))
|
||||
? ((cache$121.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$121))
|
||||
: ((current = nextResource.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$120)
|
||||
: (workInProgress.child = cache$120),
|
||||
(nextResource.last = cache$120));
|
||||
? (current.sibling = cache$121)
|
||||
: (workInProgress.child = cache$121),
|
||||
(nextResource.last = cache$121));
|
||||
}
|
||||
if (null !== nextResource.tail)
|
||||
return (
|
||||
@@ -7392,8 +7413,8 @@ module.exports = function ($$$config) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$138) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$138);
|
||||
} catch (error$139) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$139);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -7616,11 +7637,11 @@ module.exports = function ($$$config) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$139) {
|
||||
} catch (error$140) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$139
|
||||
error$140
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8193,19 +8214,19 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
|
||||
if (supportsHydration && null === finishedWork.memoizedState) {
|
||||
var current$150 = finishedWork.alternate;
|
||||
var current$151 = finishedWork.alternate;
|
||||
if (
|
||||
null !== current$150 &&
|
||||
((current$150 = current$150.memoizedState),
|
||||
null !== current$150 &&
|
||||
((current$150 = current$150.dehydrated), null !== current$150))
|
||||
null !== current$151 &&
|
||||
((current$151 = current$151.memoizedState),
|
||||
null !== current$151 &&
|
||||
((current$151 = current$151.dehydrated), null !== current$151))
|
||||
)
|
||||
try {
|
||||
commitHydratedSuspenseInstance(current$150);
|
||||
commitHydratedSuspenseInstance(current$151);
|
||||
var hydrationCallbacks = finishedRoot.hydrationCallbacks;
|
||||
if (null !== hydrationCallbacks) {
|
||||
var onHydrated = hydrationCallbacks.onHydrated;
|
||||
onHydrated && onHydrated(current$150);
|
||||
onHydrated && onHydrated(current$151);
|
||||
}
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
@@ -8324,11 +8345,11 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$152) {
|
||||
} catch (error$153) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$152
|
||||
error$153
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8406,11 +8427,11 @@ module.exports = function ($$$config) {
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error$153) {
|
||||
} catch (error$154) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$153
|
||||
error$154
|
||||
);
|
||||
}
|
||||
break;
|
||||
@@ -8442,11 +8463,11 @@ module.exports = function ($$$config) {
|
||||
root = finishedWork.stateNode;
|
||||
try {
|
||||
resetTextContent(root);
|
||||
} catch (error$154) {
|
||||
} catch (error$155) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$154
|
||||
error$155
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8456,11 +8477,11 @@ module.exports = function ($$$config) {
|
||||
props = finishedWork.type;
|
||||
try {
|
||||
commitUpdate(root, props, current, hoistableRoot, finishedWork);
|
||||
} catch (error$156) {
|
||||
} catch (error$157) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$156
|
||||
error$157
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8478,11 +8499,11 @@ module.exports = function ($$$config) {
|
||||
current = null !== current ? current.memoizedProps : root;
|
||||
try {
|
||||
commitTextUpdate(flags, current, root);
|
||||
} catch (error$157) {
|
||||
} catch (error$158) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$157
|
||||
error$158
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8505,11 +8526,11 @@ module.exports = function ($$$config) {
|
||||
)
|
||||
try {
|
||||
commitHydratedContainer(root.containerInfo);
|
||||
} catch (error$158) {
|
||||
} catch (error$159) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$158
|
||||
error$159
|
||||
);
|
||||
}
|
||||
if (supportsPersistence) {
|
||||
@@ -8517,11 +8538,11 @@ module.exports = function ($$$config) {
|
||||
current = root.pendingChildren;
|
||||
try {
|
||||
replaceContainerChildren(flags, current);
|
||||
} catch (error$159) {
|
||||
} catch (error$160) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$159
|
||||
error$160
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8546,11 +8567,11 @@ module.exports = function ($$$config) {
|
||||
current = current.pendingChildren;
|
||||
try {
|
||||
replaceContainerChildren(flags, current);
|
||||
} catch (error$163) {
|
||||
} catch (error$164) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$163
|
||||
error$164
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8574,11 +8595,11 @@ module.exports = function ($$$config) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$164) {
|
||||
} catch (error$165) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$164
|
||||
error$165
|
||||
);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
@@ -8654,11 +8675,11 @@ module.exports = function ($$$config) {
|
||||
suspenseCallback
|
||||
? hideTextInstance(props)
|
||||
: unhideTextInstance(props, root.memoizedProps);
|
||||
} catch (error$141) {
|
||||
} catch (error$142) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$141
|
||||
error$142
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
@@ -8744,21 +8765,21 @@ module.exports = function ($$$config) {
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
var parent$142 = JSCompiler_inline_result.stateNode;
|
||||
var parent$143 = JSCompiler_inline_result.stateNode;
|
||||
JSCompiler_inline_result.flags & 32 &&
|
||||
(resetTextContent(parent$142),
|
||||
(resetTextContent(parent$143),
|
||||
(JSCompiler_inline_result.flags &= -33));
|
||||
var before$143 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNode(finishedWork, before$143, parent$142);
|
||||
var before$144 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNode(finishedWork, before$144, parent$143);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$144 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$145 = getHostSibling(finishedWork);
|
||||
var parent$145 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$146 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$145,
|
||||
parent$144
|
||||
before$146,
|
||||
parent$145
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -8839,7 +8860,7 @@ module.exports = function ($$$config) {
|
||||
includeWorkInProgressEffects =
|
||||
includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
|
||||
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
||||
var current$168 = parentFiber.alternate,
|
||||
var current$169 = parentFiber.alternate,
|
||||
finishedRoot = finishedRoot$jscomp$0,
|
||||
finishedWork = parentFiber,
|
||||
flags = finishedWork.flags;
|
||||
@@ -8867,16 +8888,16 @@ module.exports = function ($$$config) {
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
current$168 = finishedWork.updateQueue;
|
||||
if (null !== current$168) {
|
||||
var hiddenCallbacks = current$168.shared.hiddenCallbacks;
|
||||
current$169 = finishedWork.updateQueue;
|
||||
if (null !== current$169) {
|
||||
var hiddenCallbacks = current$169.shared.hiddenCallbacks;
|
||||
if (null !== hiddenCallbacks)
|
||||
for (
|
||||
current$168.shared.hiddenCallbacks = null, current$168 = 0;
|
||||
current$168 < hiddenCallbacks.length;
|
||||
current$168++
|
||||
current$169.shared.hiddenCallbacks = null, current$169 = 0;
|
||||
current$169 < hiddenCallbacks.length;
|
||||
current$169++
|
||||
)
|
||||
callCallback(hiddenCallbacks[current$168], finishedRoot);
|
||||
callCallback(hiddenCallbacks[current$169], finishedRoot);
|
||||
}
|
||||
includeWorkInProgressEffects &&
|
||||
flags & 64 &&
|
||||
@@ -8892,7 +8913,7 @@ module.exports = function ($$$config) {
|
||||
includeWorkInProgressEffects
|
||||
);
|
||||
includeWorkInProgressEffects &&
|
||||
null === current$168 &&
|
||||
null === current$169 &&
|
||||
flags & 4 &&
|
||||
commitHostComponentMount(finishedWork);
|
||||
safelyAttachRef(finishedWork, finishedWork.return);
|
||||
@@ -9243,9 +9264,9 @@ module.exports = function ($$$config) {
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$174 = finishedWork.stateNode;
|
||||
var instance$175 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$174._visibility & 4
|
||||
? instance$175._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -9258,7 +9279,7 @@ module.exports = function ($$$config) {
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$174._visibility |= 4),
|
||||
: ((instance$175._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -9266,7 +9287,7 @@ module.exports = function ($$$config) {
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$174._visibility |= 4),
|
||||
: ((instance$175._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -9279,7 +9300,7 @@ module.exports = function ($$$config) {
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$174
|
||||
instance$175
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -10343,8 +10364,8 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$188) {
|
||||
handleThrow(root, thrownValue$188);
|
||||
} catch (thrownValue$189) {
|
||||
handleThrow(root, thrownValue$189);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -10459,8 +10480,8 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$190) {
|
||||
handleThrow(root, thrownValue$190);
|
||||
} catch (thrownValue$191) {
|
||||
handleThrow(root, thrownValue$191);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10695,12 +10716,12 @@ module.exports = function ($$$config) {
|
||||
setCurrentUpdatePriority(2);
|
||||
var prevExecutionContext = executionContext;
|
||||
executionContext |= 4;
|
||||
var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects(
|
||||
var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects(
|
||||
root,
|
||||
finishedWork
|
||||
);
|
||||
commitMutationEffectsOnFiber(finishedWork, root);
|
||||
shouldFireAfterActiveInstanceBlur$196 && afterActiveInstanceBlur();
|
||||
shouldFireAfterActiveInstanceBlur$197 && afterActiveInstanceBlur();
|
||||
resetAfterCommit(root.containerInfo);
|
||||
root.current = finishedWork;
|
||||
commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork);
|
||||
@@ -12640,7 +12661,7 @@ module.exports = function ($$$config) {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-www-classic-def67b9b32-20240603"
|
||||
reconcilerVersion: "19.0.0-www-classic-67b05be0d2-20240603"
|
||||
};
|
||||
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)
|
||||
devToolsConfig = !1;
|
||||
|
||||
@@ -2741,80 +2741,101 @@ module.exports = function ($$$config) {
|
||||
payload
|
||||
) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
isTransition: !0,
|
||||
status: "pending",
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
};
|
||||
null !== ReactSharedInternals.T
|
||||
? setPendingState(!0)
|
||||
: (actionNode.isTransition = !1);
|
||||
setState(actionNode);
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((payload = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null
|
||||
}),
|
||||
(payload.next = actionQueue.pending = payload),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, action: actionQueue.action, next: fiber.next });
|
||||
? ((actionNode.next = actionQueue.pending = actionNode),
|
||||
runActionStateAction(actionQueue, actionNode))
|
||||
: ((actionNode.next = fiber.next),
|
||||
(actionQueue.pending = fiber.next = actionNode));
|
||||
}
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
setPendingState(!0);
|
||||
var action = node.action;
|
||||
node = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
try {
|
||||
var returnValue = action(prevState, node),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
},
|
||||
function () {
|
||||
return finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
var action = node.action,
|
||||
payload = node.payload,
|
||||
prevState = actionQueue.state;
|
||||
if (node.isTransition) {
|
||||
var prevTransition = ReactSharedInternals.T,
|
||||
currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload),
|
||||
onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish &&
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
} else
|
||||
try {
|
||||
(prevTransition = action(prevState, payload)),
|
||||
handleActionReturnValue(actionQueue, node, prevTransition);
|
||||
} catch (error$47) {
|
||||
onActionError(actionQueue, node, error$47);
|
||||
}
|
||||
}
|
||||
function finishRunningActionStateAction(
|
||||
actionQueue,
|
||||
setPendingState,
|
||||
setState
|
||||
) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? returnValue.then(
|
||||
function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
},
|
||||
function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
}
|
||||
)
|
||||
: onActionSuccess(actionQueue, node, returnValue);
|
||||
}
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
actionNode.status = "fulfilled";
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState;
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((nextState = actionNode.next),
|
||||
nextState === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runActionStateAction(actionQueue, setPendingState, setState, first));
|
||||
}
|
||||
: ((nextState = nextState.next),
|
||||
(actionNode.next = nextState),
|
||||
runActionStateAction(actionQueue, nextState)));
|
||||
}
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = "rejected";
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode);
|
||||
actionNode = actionQueue.pending;
|
||||
null !== actionNode &&
|
||||
((error = actionNode.next),
|
||||
error === actionNode
|
||||
? (actionQueue.pending = null)
|
||||
: ((error = error.next),
|
||||
(actionNode.next = error),
|
||||
runActionStateAction(actionQueue, error)));
|
||||
}
|
||||
function notifyActionListeners(actionNode) {
|
||||
actionNode = actionNode.listeners;
|
||||
for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
|
||||
}
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
@@ -3366,9 +3387,9 @@ module.exports = function ($$$config) {
|
||||
(disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps)
|
||||
) {
|
||||
newProps === baseProps && (newProps = assign({}, newProps));
|
||||
for (var propName$48 in Component)
|
||||
void 0 === newProps[propName$48] &&
|
||||
(newProps[propName$48] = Component[propName$48]);
|
||||
for (var propName$49 in Component)
|
||||
void 0 === newProps[propName$49] &&
|
||||
(newProps[propName$49] = Component[propName$49]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
@@ -6142,44 +6163,44 @@ module.exports = function ($$$config) {
|
||||
needsVisibilityToggle = needsVisibilityToggle.sibling;
|
||||
}
|
||||
else if (supportsPersistence)
|
||||
for (var node$93 = workInProgress.child; null !== node$93; ) {
|
||||
if (5 === node$93.tag) {
|
||||
var instance = node$93.stateNode;
|
||||
for (var node$94 = workInProgress.child; null !== node$94; ) {
|
||||
if (5 === node$94.tag) {
|
||||
var instance = node$94.stateNode;
|
||||
needsVisibilityToggle &&
|
||||
isHidden &&
|
||||
(instance = cloneHiddenInstance(
|
||||
instance,
|
||||
node$93.type,
|
||||
node$93.memoizedProps
|
||||
node$94.type,
|
||||
node$94.memoizedProps
|
||||
));
|
||||
appendInitialChild(parent, instance);
|
||||
} else if (6 === node$93.tag)
|
||||
(instance = node$93.stateNode),
|
||||
} else if (6 === node$94.tag)
|
||||
(instance = node$94.stateNode),
|
||||
needsVisibilityToggle &&
|
||||
isHidden &&
|
||||
(instance = cloneHiddenTextInstance(
|
||||
instance,
|
||||
node$93.memoizedProps
|
||||
node$94.memoizedProps
|
||||
)),
|
||||
appendInitialChild(parent, instance);
|
||||
else if (4 !== node$93.tag)
|
||||
if (22 === node$93.tag && null !== node$93.memoizedState)
|
||||
(instance = node$93.child),
|
||||
null !== instance && (instance.return = node$93),
|
||||
appendAllChildren(parent, node$93, !0, !0);
|
||||
else if (null !== node$93.child) {
|
||||
node$93.child.return = node$93;
|
||||
node$93 = node$93.child;
|
||||
else if (4 !== node$94.tag)
|
||||
if (22 === node$94.tag && null !== node$94.memoizedState)
|
||||
(instance = node$94.child),
|
||||
null !== instance && (instance.return = node$94),
|
||||
appendAllChildren(parent, node$94, !0, !0);
|
||||
else if (null !== node$94.child) {
|
||||
node$94.child.return = node$94;
|
||||
node$94 = node$94.child;
|
||||
continue;
|
||||
}
|
||||
if (node$93 === workInProgress) break;
|
||||
for (; null === node$93.sibling; ) {
|
||||
if (null === node$93.return || node$93.return === workInProgress)
|
||||
if (node$94 === workInProgress) break;
|
||||
for (; null === node$94.sibling; ) {
|
||||
if (null === node$94.return || node$94.return === workInProgress)
|
||||
return;
|
||||
node$93 = node$93.return;
|
||||
node$94 = node$94.return;
|
||||
}
|
||||
node$93.sibling.return = node$93.return;
|
||||
node$93 = node$93.sibling;
|
||||
node$94.sibling.return = node$94.return;
|
||||
node$94 = node$94.sibling;
|
||||
}
|
||||
}
|
||||
function appendAllChildrenToContainer(
|
||||
@@ -6252,31 +6273,31 @@ module.exports = function ($$$config) {
|
||||
current.memoizedProps !== newProps && markUpdate(workInProgress);
|
||||
else if (supportsPersistence) {
|
||||
var currentInstance = current.stateNode,
|
||||
oldProps$96 = current.memoizedProps;
|
||||
oldProps$97 = current.memoizedProps;
|
||||
if (
|
||||
(current = doesRequireClone(current, workInProgress)) ||
|
||||
oldProps$96 !== newProps
|
||||
oldProps$97 !== newProps
|
||||
) {
|
||||
var currentHostContext = contextStackCursor.current;
|
||||
oldProps$96 = cloneInstance(
|
||||
oldProps$97 = cloneInstance(
|
||||
currentInstance,
|
||||
type,
|
||||
oldProps$96,
|
||||
oldProps$97,
|
||||
newProps,
|
||||
!current,
|
||||
null
|
||||
);
|
||||
oldProps$96 === currentInstance
|
||||
oldProps$97 === currentInstance
|
||||
? (workInProgress.stateNode = currentInstance)
|
||||
: (finalizeInitialChildren(
|
||||
oldProps$96,
|
||||
oldProps$97,
|
||||
type,
|
||||
newProps,
|
||||
currentHostContext
|
||||
) && markUpdate(workInProgress),
|
||||
(workInProgress.stateNode = oldProps$96),
|
||||
(workInProgress.stateNode = oldProps$97),
|
||||
current
|
||||
? appendAllChildren(oldProps$96, workInProgress, !1, !1)
|
||||
? appendAllChildren(oldProps$97, workInProgress, !1, !1)
|
||||
: markUpdate(workInProgress));
|
||||
} else workInProgress.stateNode = currentInstance;
|
||||
}
|
||||
@@ -6326,14 +6347,14 @@ module.exports = function ($$$config) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$98 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$98 = lastTailNode),
|
||||
for (var lastTailNode$99 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$99 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$98
|
||||
null === lastTailNode$99
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$98.sibling = null);
|
||||
: (lastTailNode$99.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -6343,19 +6364,19 @@ module.exports = function ($$$config) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$99 = completedWork.child; null !== child$99; )
|
||||
(newChildLanes |= child$99.lanes | child$99.childLanes),
|
||||
(subtreeFlags |= child$99.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$99.flags & 31457280),
|
||||
(child$99.return = completedWork),
|
||||
(child$99 = child$99.sibling);
|
||||
for (var child$100 = completedWork.child; null !== child$100; )
|
||||
(newChildLanes |= child$100.lanes | child$100.childLanes),
|
||||
(subtreeFlags |= child$100.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$100.flags & 31457280),
|
||||
(child$100.return = completedWork),
|
||||
(child$100 = child$100.sibling);
|
||||
else
|
||||
for (child$99 = completedWork.child; null !== child$99; )
|
||||
(newChildLanes |= child$99.lanes | child$99.childLanes),
|
||||
(subtreeFlags |= child$99.subtreeFlags),
|
||||
(subtreeFlags |= child$99.flags),
|
||||
(child$99.return = completedWork),
|
||||
(child$99 = child$99.sibling);
|
||||
for (child$100 = completedWork.child; null !== child$100; )
|
||||
(newChildLanes |= child$100.lanes | child$100.childLanes),
|
||||
(subtreeFlags |= child$100.subtreeFlags),
|
||||
(subtreeFlags |= child$100.flags),
|
||||
(child$100.return = completedWork),
|
||||
(child$100 = child$100.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -6625,11 +6646,11 @@ module.exports = function ($$$config) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(nextResource = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$112 = null;
|
||||
var cache$113 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$112 = newProps.memoizedState.cachePool.pool);
|
||||
cache$112 !== nextResource && (newProps.flags |= 2048);
|
||||
(cache$113 = newProps.memoizedState.cachePool.pool);
|
||||
cache$113 !== nextResource && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -6665,8 +6686,8 @@ module.exports = function ($$$config) {
|
||||
if (null === nextResource)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$112 = nextResource.rendering;
|
||||
if (null === cache$112)
|
||||
cache$113 = nextResource.rendering;
|
||||
if (null === cache$113)
|
||||
if (newProps) cutOffTailIfNeeded(nextResource, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -6674,11 +6695,11 @@ module.exports = function ($$$config) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$112 = findFirstSuspended(current);
|
||||
if (null !== cache$112) {
|
||||
cache$113 = findFirstSuspended(current);
|
||||
if (null !== cache$113) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(nextResource, !1);
|
||||
current = cache$112.updateQueue;
|
||||
current = cache$113.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -6707,7 +6728,7 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$112)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$113)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -6717,7 +6738,7 @@ module.exports = function ($$$config) {
|
||||
cutOffTailIfNeeded(nextResource, !0),
|
||||
null === nextResource.tail &&
|
||||
"hidden" === nextResource.tailMode &&
|
||||
!cache$112.alternate &&
|
||||
!cache$113.alternate &&
|
||||
!isHydrating)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
@@ -6730,13 +6751,13 @@ module.exports = function ($$$config) {
|
||||
cutOffTailIfNeeded(nextResource, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
nextResource.isBackwards
|
||||
? ((cache$112.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$112))
|
||||
? ((cache$113.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$113))
|
||||
: ((current = nextResource.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$112)
|
||||
: (workInProgress.child = cache$112),
|
||||
(nextResource.last = cache$112));
|
||||
? (current.sibling = cache$113)
|
||||
: (workInProgress.child = cache$113),
|
||||
(nextResource.last = cache$113));
|
||||
}
|
||||
if (null !== nextResource.tail)
|
||||
return (
|
||||
@@ -7003,8 +7024,8 @@ module.exports = function ($$$config) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$129) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$129);
|
||||
} catch (error$130) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$130);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -7227,11 +7248,11 @@ module.exports = function ($$$config) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$130) {
|
||||
} catch (error$131) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$130
|
||||
error$131
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7794,19 +7815,19 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
|
||||
if (supportsHydration && null === finishedWork.memoizedState) {
|
||||
var current$141 = finishedWork.alternate;
|
||||
var current$142 = finishedWork.alternate;
|
||||
if (
|
||||
null !== current$141 &&
|
||||
((current$141 = current$141.memoizedState),
|
||||
null !== current$141 &&
|
||||
((current$141 = current$141.dehydrated), null !== current$141))
|
||||
null !== current$142 &&
|
||||
((current$142 = current$142.memoizedState),
|
||||
null !== current$142 &&
|
||||
((current$142 = current$142.dehydrated), null !== current$142))
|
||||
)
|
||||
try {
|
||||
commitHydratedSuspenseInstance(current$141);
|
||||
commitHydratedSuspenseInstance(current$142);
|
||||
var hydrationCallbacks = finishedRoot.hydrationCallbacks;
|
||||
if (null !== hydrationCallbacks) {
|
||||
var onHydrated = hydrationCallbacks.onHydrated;
|
||||
onHydrated && onHydrated(current$141);
|
||||
onHydrated && onHydrated(current$142);
|
||||
}
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
@@ -7925,11 +7946,11 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$143) {
|
||||
} catch (error$144) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$143
|
||||
error$144
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8007,11 +8028,11 @@ module.exports = function ($$$config) {
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error$144) {
|
||||
} catch (error$145) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$144
|
||||
error$145
|
||||
);
|
||||
}
|
||||
break;
|
||||
@@ -8043,11 +8064,11 @@ module.exports = function ($$$config) {
|
||||
root = finishedWork.stateNode;
|
||||
try {
|
||||
resetTextContent(root);
|
||||
} catch (error$145) {
|
||||
} catch (error$146) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$145
|
||||
error$146
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8057,11 +8078,11 @@ module.exports = function ($$$config) {
|
||||
props = finishedWork.type;
|
||||
try {
|
||||
commitUpdate(root, props, current, hoistableRoot, finishedWork);
|
||||
} catch (error$147) {
|
||||
} catch (error$148) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$147
|
||||
error$148
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8079,11 +8100,11 @@ module.exports = function ($$$config) {
|
||||
current = null !== current ? current.memoizedProps : root;
|
||||
try {
|
||||
commitTextUpdate(flags, current, root);
|
||||
} catch (error$148) {
|
||||
} catch (error$149) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$148
|
||||
error$149
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8106,11 +8127,11 @@ module.exports = function ($$$config) {
|
||||
)
|
||||
try {
|
||||
commitHydratedContainer(root.containerInfo);
|
||||
} catch (error$149) {
|
||||
} catch (error$150) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$149
|
||||
error$150
|
||||
);
|
||||
}
|
||||
if (supportsPersistence) {
|
||||
@@ -8118,11 +8139,11 @@ module.exports = function ($$$config) {
|
||||
current = root.pendingChildren;
|
||||
try {
|
||||
replaceContainerChildren(flags, current);
|
||||
} catch (error$150) {
|
||||
} catch (error$151) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$150
|
||||
error$151
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8147,11 +8168,11 @@ module.exports = function ($$$config) {
|
||||
current = current.pendingChildren;
|
||||
try {
|
||||
replaceContainerChildren(flags, current);
|
||||
} catch (error$154) {
|
||||
} catch (error$155) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$154
|
||||
error$155
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8175,11 +8196,11 @@ module.exports = function ($$$config) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$155) {
|
||||
} catch (error$156) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$155
|
||||
error$156
|
||||
);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
@@ -8251,11 +8272,11 @@ module.exports = function ($$$config) {
|
||||
suspenseCallback
|
||||
? hideTextInstance(props)
|
||||
: unhideTextInstance(props, root.memoizedProps);
|
||||
} catch (error$132) {
|
||||
} catch (error$133) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$132
|
||||
error$133
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
@@ -8341,21 +8362,21 @@ module.exports = function ($$$config) {
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
var parent$133 = JSCompiler_inline_result.stateNode;
|
||||
var parent$134 = JSCompiler_inline_result.stateNode;
|
||||
JSCompiler_inline_result.flags & 32 &&
|
||||
(resetTextContent(parent$133),
|
||||
(resetTextContent(parent$134),
|
||||
(JSCompiler_inline_result.flags &= -33));
|
||||
var before$134 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNode(finishedWork, before$134, parent$133);
|
||||
var before$135 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNode(finishedWork, before$135, parent$134);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$135 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$136 = getHostSibling(finishedWork);
|
||||
var parent$136 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$137 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$136,
|
||||
parent$135
|
||||
before$137,
|
||||
parent$136
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -8436,7 +8457,7 @@ module.exports = function ($$$config) {
|
||||
includeWorkInProgressEffects =
|
||||
includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
|
||||
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
|
||||
var current$159 = parentFiber.alternate,
|
||||
var current$160 = parentFiber.alternate,
|
||||
finishedRoot = finishedRoot$jscomp$0,
|
||||
finishedWork = parentFiber,
|
||||
flags = finishedWork.flags;
|
||||
@@ -8464,16 +8485,16 @@ module.exports = function ($$$config) {
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
current$159 = finishedWork.updateQueue;
|
||||
if (null !== current$159) {
|
||||
var hiddenCallbacks = current$159.shared.hiddenCallbacks;
|
||||
current$160 = finishedWork.updateQueue;
|
||||
if (null !== current$160) {
|
||||
var hiddenCallbacks = current$160.shared.hiddenCallbacks;
|
||||
if (null !== hiddenCallbacks)
|
||||
for (
|
||||
current$159.shared.hiddenCallbacks = null, current$159 = 0;
|
||||
current$159 < hiddenCallbacks.length;
|
||||
current$159++
|
||||
current$160.shared.hiddenCallbacks = null, current$160 = 0;
|
||||
current$160 < hiddenCallbacks.length;
|
||||
current$160++
|
||||
)
|
||||
callCallback(hiddenCallbacks[current$159], finishedRoot);
|
||||
callCallback(hiddenCallbacks[current$160], finishedRoot);
|
||||
}
|
||||
includeWorkInProgressEffects &&
|
||||
flags & 64 &&
|
||||
@@ -8489,7 +8510,7 @@ module.exports = function ($$$config) {
|
||||
includeWorkInProgressEffects
|
||||
);
|
||||
includeWorkInProgressEffects &&
|
||||
null === current$159 &&
|
||||
null === current$160 &&
|
||||
flags & 4 &&
|
||||
commitHostComponentMount(finishedWork);
|
||||
safelyAttachRef(finishedWork, finishedWork.return);
|
||||
@@ -8832,9 +8853,9 @@ module.exports = function ($$$config) {
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$165 = finishedWork.stateNode;
|
||||
var instance$166 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$165._visibility & 4
|
||||
? instance$166._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8846,7 +8867,7 @@ module.exports = function ($$$config) {
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$165._visibility |= 4),
|
||||
: ((instance$166._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -8859,7 +8880,7 @@ module.exports = function ($$$config) {
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$165
|
||||
instance$166
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -9914,8 +9935,8 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$179) {
|
||||
handleThrow(root, thrownValue$179);
|
||||
} catch (thrownValue$180) {
|
||||
handleThrow(root, thrownValue$180);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -10030,8 +10051,8 @@ module.exports = function ($$$config) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$181) {
|
||||
handleThrow(root, thrownValue$181);
|
||||
} catch (thrownValue$182) {
|
||||
handleThrow(root, thrownValue$182);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10262,12 +10283,12 @@ module.exports = function ($$$config) {
|
||||
setCurrentUpdatePriority(2);
|
||||
var prevExecutionContext = executionContext;
|
||||
executionContext |= 4;
|
||||
var shouldFireAfterActiveInstanceBlur$187 = commitBeforeMutationEffects(
|
||||
var shouldFireAfterActiveInstanceBlur$188 = commitBeforeMutationEffects(
|
||||
root,
|
||||
finishedWork
|
||||
);
|
||||
commitMutationEffectsOnFiber(finishedWork, root);
|
||||
shouldFireAfterActiveInstanceBlur$187 && afterActiveInstanceBlur();
|
||||
shouldFireAfterActiveInstanceBlur$188 && afterActiveInstanceBlur();
|
||||
resetAfterCommit(root.containerInfo);
|
||||
root.current = finishedWork;
|
||||
commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork);
|
||||
@@ -12153,7 +12174,7 @@ module.exports = function ($$$config) {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-www-modern-def67b9b32-20240603"
|
||||
reconcilerVersion: "19.0.0-www-modern-67b05be0d2-20240603"
|
||||
};
|
||||
if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)
|
||||
devToolsConfig = !1;
|
||||
|
||||
@@ -8403,112 +8403,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -8522,11 +8558,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -23337,7 +23410,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-classic-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-classic-67b05be0d2-20240603';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
|
||||
@@ -8403,112 +8403,148 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl
|
||||
throw new Error('Cannot update form state while rendering.');
|
||||
}
|
||||
|
||||
var actionNode = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null,
|
||||
// circular
|
||||
isTransition: true,
|
||||
status: 'pending',
|
||||
value: null,
|
||||
reason: null,
|
||||
listeners: [],
|
||||
then: function (listener) {
|
||||
// We know the only thing that subscribes to these promises is `use` so
|
||||
// this implementation is simpler than a generic thenable. E.g. we don't
|
||||
// bother to check if the thenable is still pending because `use` already
|
||||
// does that.
|
||||
actionNode.listeners.push(listener);
|
||||
}
|
||||
}; // Check if we're inside a transition. If so, we'll need to restore the
|
||||
// transition context when the action is run.
|
||||
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
|
||||
if (prevTransition !== null) {
|
||||
// Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
setPendingState(true); // `actionNode` is a thenable that resolves to the return value of
|
||||
// the action.
|
||||
|
||||
setState(actionNode);
|
||||
} else {
|
||||
// This is not a transition.
|
||||
actionNode.isTransition = false;
|
||||
setState(actionNode);
|
||||
}
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last === null) {
|
||||
// There are no pending actions; this is the first one. We can run
|
||||
// it immediately.
|
||||
var newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: null // circular
|
||||
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runActionStateAction(actionQueue, setPendingState, setState, newLast);
|
||||
actionNode.next = actionQueue.pending = actionNode;
|
||||
runActionStateAction(actionQueue, actionNode);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
action: actionQueue.action,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
actionNode.next = first;
|
||||
actionQueue.pending = last.next = actionNode;
|
||||
}
|
||||
}
|
||||
|
||||
function runActionStateAction(actionQueue, setPendingState, setState, node) {
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
} // Optimistically update the pending state, similar to useTransition.
|
||||
// This will be reverted automatically when all actions are finished.
|
||||
|
||||
|
||||
setPendingState(true); // `node.action` represents the action function at the time it was dispatched.
|
||||
function runActionStateAction(actionQueue, node) {
|
||||
// `node.action` represents the action function at the time it was dispatched.
|
||||
// If this action was queued, it might be stale, i.e. it's not necessarily the
|
||||
// most current implementation of the action, stored on `actionQueue`. This is
|
||||
// intentional. The conceptual model for queued actions is that they are
|
||||
// queued in a remote worker; the dispatch happens immediately, only the
|
||||
// execution is delayed.
|
||||
|
||||
var action = node.action;
|
||||
var payload = node.payload;
|
||||
var prevState = actionQueue.state;
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}, function () {
|
||||
return finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
});
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useActionState` hook to rethrow the error.
|
||||
// When it unwraps the thenable with the `use` algorithm, the error
|
||||
// will be thrown.
|
||||
var rejectedThenable = {
|
||||
then: function () {},
|
||||
status: 'rejected',
|
||||
reason: error // $FlowFixMe: Not sure why this doesn't work
|
||||
|
||||
};
|
||||
setState(rejectedThenable);
|
||||
finishRunningActionStateAction(actionQueue, setPendingState, setState);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
if (node.isTransition) {
|
||||
// The original dispatch was part of a transition. We restore its
|
||||
// transition context here.
|
||||
// This is a fork of startTransition
|
||||
var prevTransition = ReactSharedInternals.T;
|
||||
var currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
ReactSharedInternals.T._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
var onStartTransitionFinish = ReactSharedInternals.S;
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
if (onStartTransitionFinish !== null) {
|
||||
onStartTransitionFinish(currentTransition, returnValue);
|
||||
}
|
||||
|
||||
handleActionReturnValue(actionQueue, node, returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
} finally {
|
||||
ReactSharedInternals.T = prevTransition;
|
||||
|
||||
{
|
||||
if (prevTransition === null && currentTransition._updatedFibers) {
|
||||
var updatedFibersCount = currentTransition._updatedFibers.size;
|
||||
|
||||
currentTransition._updatedFibers.clear();
|
||||
|
||||
if (updatedFibersCount > 10) {
|
||||
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// The original dispatch was not part of a transition.
|
||||
try {
|
||||
var _returnValue = action(prevState, payload);
|
||||
|
||||
handleActionReturnValue(actionQueue, node, _returnValue);
|
||||
} catch (error) {
|
||||
onActionError(actionQueue, node, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningActionStateAction(actionQueue, setPendingState, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
function handleActionReturnValue(actionQueue, node, returnValue) {
|
||||
if (returnValue !== null && typeof returnValue === 'object' && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === 'function') {
|
||||
var thenable = returnValue; // Attach a listener to read the return state of the action. As soon as
|
||||
// this resolves, we can run the next action in the sequence.
|
||||
|
||||
thenable.then(function (nextState) {
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}, function (error) {
|
||||
return onActionError(actionQueue, node, error);
|
||||
});
|
||||
|
||||
{
|
||||
if (!node.isTransition) {
|
||||
error('An async function was passed to useActionState, but it was ' + 'dispatched outside of an action context. This is likely not ' + 'what you intended. Either pass the dispatch function to an ' + '`action` prop, or dispatch manually inside `startTransition`');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var nextState = returnValue;
|
||||
onActionSuccess(actionQueue, node, nextState);
|
||||
}
|
||||
}
|
||||
|
||||
function onActionSuccess(actionQueue, actionNode, nextState) {
|
||||
// The action finished running.
|
||||
actionNode.status = 'fulfilled';
|
||||
actionNode.value = nextState;
|
||||
notifyActionListeners(actionNode);
|
||||
actionQueue.state = nextState; // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
@@ -8522,11 +8558,48 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState)
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, setPendingState, setState, next);
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onActionError(actionQueue, actionNode, error) {
|
||||
actionNode.status = 'rejected';
|
||||
actionNode.reason = error;
|
||||
notifyActionListeners(actionNode); // Pop the action from the queue and run the next pending action, if there
|
||||
// are any.
|
||||
// TODO: We should instead abort all the remaining actions in the queue.
|
||||
|
||||
var last = actionQueue.pending;
|
||||
|
||||
if (last !== null) {
|
||||
var first = last.next;
|
||||
|
||||
if (first === last) {
|
||||
// This was the last action in the queue.
|
||||
actionQueue.pending = null;
|
||||
} else {
|
||||
// Remove the first node from the circular queue.
|
||||
var next = first.next;
|
||||
last.next = next; // Run the next action.
|
||||
|
||||
runActionStateAction(actionQueue, next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function notifyActionListeners(actionNode) {
|
||||
// Notify React that the action has finished.
|
||||
var listeners = actionNode.listeners;
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
// This is always a React internal listener, so we don't need to worry
|
||||
// about it throwing.
|
||||
var listener = listeners[i];
|
||||
listener();
|
||||
}
|
||||
}
|
||||
|
||||
function actionStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
@@ -23337,7 +23410,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = '19.0.0-www-modern-def67b9b32-20240603';
|
||||
var ReactVersion = '19.0.0-www-modern-67b05be0d2-20240603';
|
||||
|
||||
/*
|
||||
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
||||
|
||||
@@ -1 +1 @@
|
||||
19.0.0-www-classic-def67b9b32-20240603
|
||||
19.0.0-www-classic-67b05be0d2-20240603
|
||||
@@ -1 +1 @@
|
||||
19.0.0-www-modern-def67b9b32-20240603
|
||||
19.0.0-www-modern-67b05be0d2-20240603
|
||||
@@ -82,6 +82,7 @@ export default [
|
||||
"A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
|
||||
"A view is reporting that a touch occurred on tag zero.",
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.",
|
||||
"An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`",
|
||||
"An empty string (\"\") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.",
|
||||
"An empty string (\"\") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.",
|
||||
"An input can only specify a formAction along with type=\"submit\" or type=\"image\".",
|
||||
|
||||
Reference in New Issue
Block a user