mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Update www flags (#28150)
Adds an experiment for `enableFormActions` and hardcodes
`enableCustomElementPropertySupport` on www since this is shipped.
DiffTrain build for [417188314d](https://github.com/facebook/react/commit/417188314dd1d6df54efc8cd6a0c5d4830615888)
This commit is contained in:
@@ -1 +1 @@
|
||||
178f4351947a842ff0b56700e9115b25ae8f20d0
|
||||
417188314dd1d6df54efc8cd6a0c5d4830615888
|
||||
|
||||
@@ -24,7 +24,7 @@ if (__DEV__) {
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var ReactVersion = "18.3.0-www-classic-8a9e991a";
|
||||
var ReactVersion = "18.3.0-www-classic-5e99f036";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -24,7 +24,7 @@ if (__DEV__) {
|
||||
) {
|
||||
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
||||
}
|
||||
var ReactVersion = "18.3.0-www-modern-afe290cd";
|
||||
var ReactVersion = "18.3.0-www-modern-d235b405";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -66,7 +66,7 @@ if (__DEV__) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-909c7c72";
|
||||
var ReactVersion = "18.3.0-www-classic-ffbafb55";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -175,6 +175,7 @@ if (__DEV__) {
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect,
|
||||
@@ -3001,6 +3002,7 @@ if (__DEV__) {
|
||||
function waitForCommitToBeReady() {
|
||||
return null;
|
||||
}
|
||||
var NotPendingTransition = null;
|
||||
|
||||
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
@@ -4041,6 +4043,27 @@ if (__DEV__) {
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
// NOTE: Since forms cannot be nested, and this feature is only implemented by
|
||||
// React DOM, we don't technically need this to be a stack. It could be a single
|
||||
// module variable instead.
|
||||
|
||||
var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant
|
||||
// imported from the fiber config. However, because of a cycle in the module
|
||||
// graph, that value isn't defined during this module's initialization. I can't
|
||||
// think of a way to work around this without moving that value out of the
|
||||
// fiber config. For now, the "no provider" case is handled when reading,
|
||||
// inside useHostTransitionStatus.
|
||||
|
||||
var HostTransitionContext = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: null,
|
||||
_currentValue2: null,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null,
|
||||
_defaultValue: null,
|
||||
_globalName: null
|
||||
};
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -4060,6 +4083,10 @@ if (__DEV__) {
|
||||
return rootInstance;
|
||||
}
|
||||
|
||||
function getHostTransitionProvider() {
|
||||
return hostTransitionProviderCursor.current;
|
||||
}
|
||||
|
||||
function pushHostContainer(fiber, nextRootInstance) {
|
||||
// Push current root instance onto the stack;
|
||||
// This allows us to reset root when portals are popped.
|
||||
@@ -4091,6 +4118,16 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
function pushHostContext(fiber) {
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
var stateHook = fiber.memoizedState;
|
||||
|
||||
if (stateHook !== null) {
|
||||
// Only provide context if this fiber has been upgraded by a host
|
||||
// transition. We use the same optimization for regular host context below.
|
||||
push(hostTransitionProviderCursor, fiber, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
@@ -4109,6 +4146,25 @@ if (__DEV__) {
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
if (hostTransitionProviderCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context. This is mostly
|
||||
// a performance optimization, but conveniently it also prevents a potential
|
||||
// data race where a host provider is upgraded (i.e. memoizedState becomes
|
||||
// non-null) during a concurrent event. This is a bit of a flaw in the way
|
||||
// we upgrade host components, but because we're accounting for it here, it
|
||||
// should be fine.
|
||||
pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back
|
||||
// to `null`. We can do this because you're not allowd to nest forms. If
|
||||
// we allowed for multiple nested host transition providers, then we'd
|
||||
// need to reset this to the parent provider's status.
|
||||
|
||||
{
|
||||
HostTransitionContext._currentValue2 = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -8690,6 +8746,43 @@ if (__DEV__) {
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
function renderTransitionAwareHostComponentWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
lanes
|
||||
) {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
return renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
null,
|
||||
null,
|
||||
lanes
|
||||
);
|
||||
}
|
||||
function TransitionAwareHostComponent() {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
var dispatcher = ReactCurrentDispatcher$1.current;
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(),
|
||||
maybeThenable = _dispatcher$useState[0];
|
||||
|
||||
if (typeof maybeThenable.then === "function") {
|
||||
var thenable = maybeThenable;
|
||||
return useThenable(thenable);
|
||||
} else {
|
||||
var status = maybeThenable;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the
|
||||
// complete phase (bubbleProperties).
|
||||
@@ -9644,6 +9737,256 @@ if (__DEV__) {
|
||||
var dispatch = hook.queue.dispatch;
|
||||
return [passthrough, dispatch];
|
||||
} // useFormState actions run sequentially, because each action receives the
|
||||
// previous state as an argument. We store pending actions on a queue.
|
||||
|
||||
function dispatchFormState(fiber, actionQueue, setState, payload) {
|
||||
if (isRenderPhaseUpdate(fiber)) {
|
||||
throw new Error("Cannot update form state while rendering.");
|
||||
}
|
||||
|
||||
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,
|
||||
next: null // circular
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runFormStateAction(actionQueue, setState, payload);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
}
|
||||
}
|
||||
|
||||
function runFormStateAction(actionQueue, setState, payload) {
|
||||
var action = actionQueue.action;
|
||||
var prevState = actionQueue.state; // This is a fork of startTransition
|
||||
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
var currentTransition = {
|
||||
_callbacks: new Set()
|
||||
};
|
||||
ReactCurrentBatchConfig$2.transition = currentTransition;
|
||||
|
||||
{
|
||||
ReactCurrentBatchConfig$2.transition._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
|
||||
if (
|
||||
returnValue !== null &&
|
||||
typeof returnValue === "object" && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === "function"
|
||||
) {
|
||||
var thenable = returnValue;
|
||||
notifyTransitionCallbacks(currentTransition, thenable); // 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;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
},
|
||||
function () {
|
||||
return finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
);
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useFormState` 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);
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
} finally {
|
||||
ReactCurrentBatchConfig$2.transition = 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."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningFormStateAction(actionQueue, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
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.
|
||||
|
||||
runFormStateAction(actionQueue, setState, next.payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
|
||||
function mountFormState(action, initialStateProp, permalink) {
|
||||
var initialState = initialStateProp;
|
||||
// the `use` algorithm during render.
|
||||
|
||||
var stateHook = mountWorkInProgressHook();
|
||||
stateHook.memoizedState = stateHook.baseState = initialState; // TODO: Typing this "correctly" results in recursion limit errors
|
||||
// const stateQueue: UpdateQueue<S | Awaited<S>, S | Awaited<S>> = {
|
||||
|
||||
var stateQueue = {
|
||||
pending: null,
|
||||
lanes: NoLanes,
|
||||
dispatch: null,
|
||||
lastRenderedReducer: formStateReducer,
|
||||
lastRenderedState: initialState
|
||||
};
|
||||
stateHook.queue = stateQueue;
|
||||
var setState = dispatchSetState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
stateQueue
|
||||
);
|
||||
stateQueue.dispatch = setState; // Action queue hook. This is used to queue pending actions. The queue is
|
||||
// shared between all instances of the hook. Similar to a regular state queue,
|
||||
// but different because the actions are run sequentially, and they run in
|
||||
// an event instead of during render.
|
||||
|
||||
var actionQueueHook = mountWorkInProgressHook();
|
||||
var actionQueue = {
|
||||
state: initialState,
|
||||
dispatch: null,
|
||||
// circular
|
||||
action: action,
|
||||
pending: null
|
||||
};
|
||||
actionQueueHook.queue = actionQueue;
|
||||
var dispatch = dispatchFormState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
actionQueue,
|
||||
setState
|
||||
);
|
||||
actionQueue.dispatch = dispatch; // Stash the action function on the memoized state of the hook. We'll use this
|
||||
// to detect when the action function changes so we can update it in
|
||||
// an effect.
|
||||
|
||||
actionQueueHook.memoizedState = action;
|
||||
return [initialState, dispatch];
|
||||
}
|
||||
|
||||
function updateFormState(action, initialState, permalink) {
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
var currentStateHook = currentHook;
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
}
|
||||
|
||||
function updateFormStateImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
var _updateReducerImpl = updateReducerImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
formStateReducer
|
||||
),
|
||||
actionResult = _updateReducerImpl[0]; // This will suspend until the action finishes.
|
||||
|
||||
var state =
|
||||
typeof actionResult === "object" &&
|
||||
actionResult !== null && // $FlowFixMe[method-unbinding]
|
||||
typeof actionResult.then === "function"
|
||||
? useThenable(actionResult)
|
||||
: actionResult;
|
||||
var actionQueueHook = updateWorkInProgressHook();
|
||||
var actionQueue = actionQueueHook.queue;
|
||||
var dispatch = actionQueue.dispatch; // Check if a new action was passed. If so, update it in an effect.
|
||||
|
||||
var prevAction = actionQueueHook.memoizedState;
|
||||
|
||||
if (action !== prevAction) {
|
||||
currentlyRenderingFiber$1.flags |= Passive$1;
|
||||
pushEffect(
|
||||
HasEffect | Passive,
|
||||
formStateActionEffect.bind(null, actionQueue, action),
|
||||
createEffectInstance(),
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
return [state, dispatch];
|
||||
}
|
||||
|
||||
function formStateActionEffect(actionQueue, action) {
|
||||
actionQueue.action = action;
|
||||
}
|
||||
|
||||
function rerenderFormState(action, initialState, permalink) {
|
||||
// Unlike useState, useFormState doesn't support render phase updates.
|
||||
// Also unlike useState, we need to replay all pending updates again in case
|
||||
// the passthrough value changed.
|
||||
//
|
||||
// So instead of a forked re-render implementation that knows how to handle
|
||||
// render phase udpates, we can use the same implementation as during a
|
||||
// regular mount or update.
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
var currentStateHook = currentHook;
|
||||
|
||||
if (currentStateHook !== null) {
|
||||
// This is an update. Process the update queue.
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
} // This is a mount. No updates to process.
|
||||
|
||||
var state = stateHook.memoizedState;
|
||||
var actionQueueHook = updateWorkInProgressHook();
|
||||
var actionQueue = actionQueueHook.queue;
|
||||
var dispatch = actionQueue.dispatch; // This may have changed during the rerender.
|
||||
|
||||
actionQueueHook.memoizedState = action;
|
||||
return [state, dispatch];
|
||||
}
|
||||
|
||||
function pushEffect(tag, create, inst, deps) {
|
||||
var effect = {
|
||||
@@ -10313,6 +10656,15 @@ if (__DEV__) {
|
||||
return [isPending, start];
|
||||
}
|
||||
|
||||
function useHostTransitionStatus() {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
var status = readContext(HostTransitionContext);
|
||||
return status !== null ? status : NotPendingTransition;
|
||||
}
|
||||
|
||||
function mountId() {
|
||||
var hook = mountWorkInProgressHook();
|
||||
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
|
||||
@@ -10697,6 +11049,11 @@ if (__DEV__) {
|
||||
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useFormState = throwInvalidHookError;
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
|
||||
}
|
||||
@@ -10867,6 +11224,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnMountInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnMountInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
mountHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -11010,6 +11382,18 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -11152,6 +11536,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnUpdateInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return updateFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -11296,6 +11695,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnRerenderInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return rerenderFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -11464,6 +11878,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
mountHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -11631,6 +12058,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
updateHookTypesDev();
|
||||
return updateFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -11798,6 +12238,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
updateHookTypesDev();
|
||||
return rerenderFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -15231,6 +15684,58 @@ if (__DEV__) {
|
||||
workInProgress.flags |= ContentReset;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
var memoizedState = workInProgress.memoizedState;
|
||||
|
||||
if (memoizedState !== null) {
|
||||
// This fiber has been upgraded to a stateful component. The only way
|
||||
// happens currently is for form actions. We use hooks to track the
|
||||
// pending and error state of the form.
|
||||
//
|
||||
// Once a fiber is upgraded to be stateful, it remains stateful for the
|
||||
// rest of its lifetime.
|
||||
var newState = renderTransitionAwareHostComponentWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
renderLanes
|
||||
); // If the transition state changed, propagate the change to all the
|
||||
// descendents. We use Context as an implementation detail for this.
|
||||
//
|
||||
// This is intentionally set here instead of pushHostContext because
|
||||
// pushHostContext gets called before we process the state hook, to avoid
|
||||
// a state mismatch in the event that something suspends.
|
||||
//
|
||||
// NOTE: This assumes that there cannot be nested transition providers,
|
||||
// because the only renderer that implements this feature is React DOM,
|
||||
// and forms cannot be nested. If we did support nested providers, then
|
||||
// we would need to push a context value even for host fibers that
|
||||
// haven't been upgraded yet.
|
||||
|
||||
{
|
||||
HostTransitionContext._currentValue2 = newState;
|
||||
}
|
||||
|
||||
if (enableLazyContextPropagation);
|
||||
else {
|
||||
if (didReceiveUpdate) {
|
||||
if (current !== null) {
|
||||
var oldStateHook = current.memoizedState;
|
||||
var oldState = oldStateHook.memoizedState; // This uses regular equality instead of Object.is because we assume
|
||||
// that host transition state doesn't include NaN as a valid type.
|
||||
|
||||
if (oldState !== newState) {
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
markRef$1(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
||||
return workInProgress.child;
|
||||
@@ -18207,6 +18712,34 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
parent === getHostTransitionProvider()
|
||||
) {
|
||||
// During a host transition, a host component can act like a context
|
||||
// provider. E.g. in React DOM, this would be a <form />.
|
||||
var _currentParent = parent.alternate;
|
||||
|
||||
if (_currentParent === null) {
|
||||
throw new Error(
|
||||
"Should have a current fiber. This is a bug in React."
|
||||
);
|
||||
}
|
||||
|
||||
var oldStateHook = _currentParent.memoizedState;
|
||||
var oldState = oldStateHook.memoizedState;
|
||||
var newStateHook = parent.memoizedState;
|
||||
var newState = newStateHook.memoizedState; // This uses regular equality instead of Object.is because we assume that
|
||||
// host transition state doesn't include NaN as a valid type.
|
||||
|
||||
if (oldState !== newState) {
|
||||
if (contexts !== null) {
|
||||
contexts.push(HostTransitionContext);
|
||||
} else {
|
||||
contexts = [HostTransitionContext];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent = parent.return;
|
||||
|
||||
@@ -66,7 +66,7 @@ if (__DEV__) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f70a13e";
|
||||
var ReactVersion = "18.3.0-www-modern-4fcabd82";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -175,6 +175,7 @@ if (__DEV__) {
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect,
|
||||
@@ -2998,6 +2999,7 @@ if (__DEV__) {
|
||||
function waitForCommitToBeReady() {
|
||||
return null;
|
||||
}
|
||||
var NotPendingTransition = null;
|
||||
|
||||
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher;
|
||||
var prefix;
|
||||
@@ -3791,6 +3793,27 @@ if (__DEV__) {
|
||||
var contextStackCursor = createCursor(null);
|
||||
var contextFiberStackCursor = createCursor(null);
|
||||
var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a <form />)
|
||||
// NOTE: Since forms cannot be nested, and this feature is only implemented by
|
||||
// React DOM, we don't technically need this to be a stack. It could be a single
|
||||
// module variable instead.
|
||||
|
||||
var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant
|
||||
// imported from the fiber config. However, because of a cycle in the module
|
||||
// graph, that value isn't defined during this module's initialization. I can't
|
||||
// think of a way to work around this without moving that value out of the
|
||||
// fiber config. For now, the "no provider" case is handled when reading,
|
||||
// inside useHostTransitionStatus.
|
||||
|
||||
var HostTransitionContext = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: null,
|
||||
_currentValue2: null,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null,
|
||||
_defaultValue: null,
|
||||
_globalName: null
|
||||
};
|
||||
|
||||
function requiredContext(c) {
|
||||
{
|
||||
@@ -3810,6 +3833,10 @@ if (__DEV__) {
|
||||
return rootInstance;
|
||||
}
|
||||
|
||||
function getHostTransitionProvider() {
|
||||
return hostTransitionProviderCursor.current;
|
||||
}
|
||||
|
||||
function pushHostContainer(fiber, nextRootInstance) {
|
||||
// Push current root instance onto the stack;
|
||||
// This allows us to reset root when portals are popped.
|
||||
@@ -3841,6 +3868,16 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
function pushHostContext(fiber) {
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
var stateHook = fiber.memoizedState;
|
||||
|
||||
if (stateHook !== null) {
|
||||
// Only provide context if this fiber has been upgraded by a host
|
||||
// transition. We use the same optimization for regular host context below.
|
||||
push(hostTransitionProviderCursor, fiber, fiber);
|
||||
}
|
||||
}
|
||||
|
||||
var context = requiredContext(contextStackCursor.current);
|
||||
var nextContext = getChildHostContext(); // Don't push this Fiber's context unless it's unique.
|
||||
|
||||
@@ -3859,6 +3896,25 @@ if (__DEV__) {
|
||||
pop(contextStackCursor, fiber);
|
||||
pop(contextFiberStackCursor, fiber);
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
if (hostTransitionProviderCursor.current === fiber) {
|
||||
// Do not pop unless this Fiber provided the current context. This is mostly
|
||||
// a performance optimization, but conveniently it also prevents a potential
|
||||
// data race where a host provider is upgraded (i.e. memoizedState becomes
|
||||
// non-null) during a concurrent event. This is a bit of a flaw in the way
|
||||
// we upgrade host components, but because we're accounting for it here, it
|
||||
// should be fine.
|
||||
pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back
|
||||
// to `null`. We can do this because you're not allowd to nest forms. If
|
||||
// we allowed for multiple nested host transition providers, then we'd
|
||||
// need to reset this to the parent provider's status.
|
||||
|
||||
{
|
||||
HostTransitionContext._currentValue2 = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches
|
||||
@@ -8440,6 +8496,43 @@ if (__DEV__) {
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
function renderTransitionAwareHostComponentWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
lanes
|
||||
) {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
return renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
null,
|
||||
null,
|
||||
lanes
|
||||
);
|
||||
}
|
||||
function TransitionAwareHostComponent() {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
var dispatcher = ReactCurrentDispatcher$1.current;
|
||||
|
||||
var _dispatcher$useState = dispatcher.useState(),
|
||||
maybeThenable = _dispatcher$useState[0];
|
||||
|
||||
if (typeof maybeThenable.then === "function") {
|
||||
var thenable = maybeThenable;
|
||||
return useThenable(thenable);
|
||||
} else {
|
||||
var status = maybeThenable;
|
||||
return status;
|
||||
}
|
||||
}
|
||||
function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the
|
||||
// complete phase (bubbleProperties).
|
||||
@@ -9394,6 +9487,256 @@ if (__DEV__) {
|
||||
var dispatch = hook.queue.dispatch;
|
||||
return [passthrough, dispatch];
|
||||
} // useFormState actions run sequentially, because each action receives the
|
||||
// previous state as an argument. We store pending actions on a queue.
|
||||
|
||||
function dispatchFormState(fiber, actionQueue, setState, payload) {
|
||||
if (isRenderPhaseUpdate(fiber)) {
|
||||
throw new Error("Cannot update form state while rendering.");
|
||||
}
|
||||
|
||||
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,
|
||||
next: null // circular
|
||||
};
|
||||
newLast.next = actionQueue.pending = newLast;
|
||||
runFormStateAction(actionQueue, setState, payload);
|
||||
} else {
|
||||
// There's already an action running. Add to the queue.
|
||||
var first = last.next;
|
||||
var _newLast = {
|
||||
payload: payload,
|
||||
next: first
|
||||
};
|
||||
actionQueue.pending = last.next = _newLast;
|
||||
}
|
||||
}
|
||||
|
||||
function runFormStateAction(actionQueue, setState, payload) {
|
||||
var action = actionQueue.action;
|
||||
var prevState = actionQueue.state; // This is a fork of startTransition
|
||||
|
||||
var prevTransition = ReactCurrentBatchConfig$2.transition;
|
||||
var currentTransition = {
|
||||
_callbacks: new Set()
|
||||
};
|
||||
ReactCurrentBatchConfig$2.transition = currentTransition;
|
||||
|
||||
{
|
||||
ReactCurrentBatchConfig$2.transition._updatedFibers = new Set();
|
||||
}
|
||||
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
|
||||
if (
|
||||
returnValue !== null &&
|
||||
typeof returnValue === "object" && // $FlowFixMe[method-unbinding]
|
||||
typeof returnValue.then === "function"
|
||||
) {
|
||||
var thenable = returnValue;
|
||||
notifyTransitionCallbacks(currentTransition, thenable); // 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;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
},
|
||||
function () {
|
||||
return finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
);
|
||||
setState(thenable);
|
||||
} else {
|
||||
setState(returnValue);
|
||||
var nextState = returnValue;
|
||||
actionQueue.state = nextState;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
} catch (error) {
|
||||
// This is a trick to get the `useFormState` 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);
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
} finally {
|
||||
ReactCurrentBatchConfig$2.transition = 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."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finishRunningFormStateAction(actionQueue, setState) {
|
||||
// The action finished running. Pop it from the queue and run the next pending
|
||||
// action, if there are any.
|
||||
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.
|
||||
|
||||
runFormStateAction(actionQueue, setState, next.payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function formStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
|
||||
function mountFormState(action, initialStateProp, permalink) {
|
||||
var initialState = initialStateProp;
|
||||
// the `use` algorithm during render.
|
||||
|
||||
var stateHook = mountWorkInProgressHook();
|
||||
stateHook.memoizedState = stateHook.baseState = initialState; // TODO: Typing this "correctly" results in recursion limit errors
|
||||
// const stateQueue: UpdateQueue<S | Awaited<S>, S | Awaited<S>> = {
|
||||
|
||||
var stateQueue = {
|
||||
pending: null,
|
||||
lanes: NoLanes,
|
||||
dispatch: null,
|
||||
lastRenderedReducer: formStateReducer,
|
||||
lastRenderedState: initialState
|
||||
};
|
||||
stateHook.queue = stateQueue;
|
||||
var setState = dispatchSetState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
stateQueue
|
||||
);
|
||||
stateQueue.dispatch = setState; // Action queue hook. This is used to queue pending actions. The queue is
|
||||
// shared between all instances of the hook. Similar to a regular state queue,
|
||||
// but different because the actions are run sequentially, and they run in
|
||||
// an event instead of during render.
|
||||
|
||||
var actionQueueHook = mountWorkInProgressHook();
|
||||
var actionQueue = {
|
||||
state: initialState,
|
||||
dispatch: null,
|
||||
// circular
|
||||
action: action,
|
||||
pending: null
|
||||
};
|
||||
actionQueueHook.queue = actionQueue;
|
||||
var dispatch = dispatchFormState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
actionQueue,
|
||||
setState
|
||||
);
|
||||
actionQueue.dispatch = dispatch; // Stash the action function on the memoized state of the hook. We'll use this
|
||||
// to detect when the action function changes so we can update it in
|
||||
// an effect.
|
||||
|
||||
actionQueueHook.memoizedState = action;
|
||||
return [initialState, dispatch];
|
||||
}
|
||||
|
||||
function updateFormState(action, initialState, permalink) {
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
var currentStateHook = currentHook;
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
}
|
||||
|
||||
function updateFormStateImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
var _updateReducerImpl = updateReducerImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
formStateReducer
|
||||
),
|
||||
actionResult = _updateReducerImpl[0]; // This will suspend until the action finishes.
|
||||
|
||||
var state =
|
||||
typeof actionResult === "object" &&
|
||||
actionResult !== null && // $FlowFixMe[method-unbinding]
|
||||
typeof actionResult.then === "function"
|
||||
? useThenable(actionResult)
|
||||
: actionResult;
|
||||
var actionQueueHook = updateWorkInProgressHook();
|
||||
var actionQueue = actionQueueHook.queue;
|
||||
var dispatch = actionQueue.dispatch; // Check if a new action was passed. If so, update it in an effect.
|
||||
|
||||
var prevAction = actionQueueHook.memoizedState;
|
||||
|
||||
if (action !== prevAction) {
|
||||
currentlyRenderingFiber$1.flags |= Passive$1;
|
||||
pushEffect(
|
||||
HasEffect | Passive,
|
||||
formStateActionEffect.bind(null, actionQueue, action),
|
||||
createEffectInstance(),
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
return [state, dispatch];
|
||||
}
|
||||
|
||||
function formStateActionEffect(actionQueue, action) {
|
||||
actionQueue.action = action;
|
||||
}
|
||||
|
||||
function rerenderFormState(action, initialState, permalink) {
|
||||
// Unlike useState, useFormState doesn't support render phase updates.
|
||||
// Also unlike useState, we need to replay all pending updates again in case
|
||||
// the passthrough value changed.
|
||||
//
|
||||
// So instead of a forked re-render implementation that knows how to handle
|
||||
// render phase udpates, we can use the same implementation as during a
|
||||
// regular mount or update.
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
var currentStateHook = currentHook;
|
||||
|
||||
if (currentStateHook !== null) {
|
||||
// This is an update. Process the update queue.
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
} // This is a mount. No updates to process.
|
||||
|
||||
var state = stateHook.memoizedState;
|
||||
var actionQueueHook = updateWorkInProgressHook();
|
||||
var actionQueue = actionQueueHook.queue;
|
||||
var dispatch = actionQueue.dispatch; // This may have changed during the rerender.
|
||||
|
||||
actionQueueHook.memoizedState = action;
|
||||
return [state, dispatch];
|
||||
}
|
||||
|
||||
function pushEffect(tag, create, inst, deps) {
|
||||
var effect = {
|
||||
@@ -10063,6 +10406,15 @@ if (__DEV__) {
|
||||
return [isPending, start];
|
||||
}
|
||||
|
||||
function useHostTransitionStatus() {
|
||||
if (!(enableFormActions && enableAsyncActions)) {
|
||||
throw new Error("Not implemented.");
|
||||
}
|
||||
|
||||
var status = readContext(HostTransitionContext);
|
||||
return status !== null ? status : NotPendingTransition;
|
||||
}
|
||||
|
||||
function mountId() {
|
||||
var hook = mountWorkInProgressHook();
|
||||
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
|
||||
@@ -10447,6 +10799,11 @@ if (__DEV__) {
|
||||
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useFormState = throwInvalidHookError;
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
|
||||
}
|
||||
@@ -10617,6 +10974,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnMountInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnMountInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
mountHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnMountInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -10760,6 +11132,18 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -10902,6 +11286,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnUpdateInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return updateFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnUpdateInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -11046,6 +11445,21 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
HooksDispatcherOnRerenderInDEV.useFormState = function useFormState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
updateHookTypesDev();
|
||||
return rerenderFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcherOnRerenderInDEV.useOptimistic = function useOptimistic(
|
||||
passthrough,
|
||||
@@ -11214,6 +11628,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
mountHookTypesDev();
|
||||
return mountFormState(action, initialState);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -11381,6 +11808,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
updateHookTypesDev();
|
||||
return updateFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -11548,6 +11988,19 @@ if (__DEV__) {
|
||||
};
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
|
||||
useHostTransitionStatus;
|
||||
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState =
|
||||
function useFormState(action, initialState, permalink) {
|
||||
currentHookNameInDev = "useFormState";
|
||||
warnInvalidHookAccess();
|
||||
updateHookTypesDev();
|
||||
return rerenderFormState(action);
|
||||
};
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic =
|
||||
function useOptimistic(passthrough, reducer) {
|
||||
@@ -14910,6 +15363,58 @@ if (__DEV__) {
|
||||
workInProgress.flags |= ContentReset;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
var memoizedState = workInProgress.memoizedState;
|
||||
|
||||
if (memoizedState !== null) {
|
||||
// This fiber has been upgraded to a stateful component. The only way
|
||||
// happens currently is for form actions. We use hooks to track the
|
||||
// pending and error state of the form.
|
||||
//
|
||||
// Once a fiber is upgraded to be stateful, it remains stateful for the
|
||||
// rest of its lifetime.
|
||||
var newState = renderTransitionAwareHostComponentWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
renderLanes
|
||||
); // If the transition state changed, propagate the change to all the
|
||||
// descendents. We use Context as an implementation detail for this.
|
||||
//
|
||||
// This is intentionally set here instead of pushHostContext because
|
||||
// pushHostContext gets called before we process the state hook, to avoid
|
||||
// a state mismatch in the event that something suspends.
|
||||
//
|
||||
// NOTE: This assumes that there cannot be nested transition providers,
|
||||
// because the only renderer that implements this feature is React DOM,
|
||||
// and forms cannot be nested. If we did support nested providers, then
|
||||
// we would need to push a context value even for host fibers that
|
||||
// haven't been upgraded yet.
|
||||
|
||||
{
|
||||
HostTransitionContext._currentValue2 = newState;
|
||||
}
|
||||
|
||||
if (enableLazyContextPropagation);
|
||||
else {
|
||||
if (didReceiveUpdate) {
|
||||
if (current !== null) {
|
||||
var oldStateHook = current.memoizedState;
|
||||
var oldState = oldStateHook.memoizedState; // This uses regular equality instead of Object.is because we assume
|
||||
// that host transition state doesn't include NaN as a valid type.
|
||||
|
||||
if (oldState !== newState) {
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
markRef$1(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
||||
return workInProgress.child;
|
||||
@@ -17880,6 +18385,34 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
parent === getHostTransitionProvider()
|
||||
) {
|
||||
// During a host transition, a host component can act like a context
|
||||
// provider. E.g. in React DOM, this would be a <form />.
|
||||
var _currentParent = parent.alternate;
|
||||
|
||||
if (_currentParent === null) {
|
||||
throw new Error(
|
||||
"Should have a current fiber. This is a bug in React."
|
||||
);
|
||||
}
|
||||
|
||||
var oldStateHook = _currentParent.memoizedState;
|
||||
var oldState = oldStateHook.memoizedState;
|
||||
var newStateHook = parent.memoizedState;
|
||||
var newState = newStateHook.memoizedState; // This uses regular equality instead of Object.is because we assume that
|
||||
// host transition state doesn't include NaN as a valid type.
|
||||
|
||||
if (oldState !== newState) {
|
||||
if (contexts !== null) {
|
||||
contexts.push(HostTransitionContext);
|
||||
} else {
|
||||
contexts = [HostTransitionContext];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent = parent.return;
|
||||
|
||||
@@ -72,6 +72,7 @@ var ReactSharedInternals =
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect,
|
||||
@@ -1053,7 +1054,18 @@ function is(x, y) {
|
||||
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
||||
contextStackCursor = createCursor(null),
|
||||
contextFiberStackCursor = createCursor(null),
|
||||
rootInstanceStackCursor = createCursor(null);
|
||||
rootInstanceStackCursor = createCursor(null),
|
||||
hostTransitionProviderCursor = createCursor(null),
|
||||
HostTransitionContext = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: null,
|
||||
_currentValue2: null,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null,
|
||||
_defaultValue: null,
|
||||
_globalName: null
|
||||
};
|
||||
function pushHostContainer(fiber, nextRootInstance) {
|
||||
push(rootInstanceStackCursor, nextRootInstance);
|
||||
push(contextFiberStackCursor, fiber);
|
||||
@@ -1067,6 +1079,10 @@ function popHostContainer() {
|
||||
pop(rootInstanceStackCursor);
|
||||
}
|
||||
function pushHostContext(fiber) {
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
null !== fiber.memoizedState &&
|
||||
push(hostTransitionProviderCursor, fiber);
|
||||
contextStackCursor.current !== NO_CONTEXT &&
|
||||
(push(contextFiberStackCursor, fiber),
|
||||
push(contextStackCursor, NO_CONTEXT));
|
||||
@@ -1074,6 +1090,11 @@ function pushHostContext(fiber) {
|
||||
function popHostContext(fiber) {
|
||||
contextFiberStackCursor.current === fiber &&
|
||||
(pop(contextStackCursor), pop(contextFiberStackCursor));
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
hostTransitionProviderCursor.current === fiber &&
|
||||
(pop(hostTransitionProviderCursor),
|
||||
(HostTransitionContext._currentValue2 = null));
|
||||
}
|
||||
var hydrationErrors = null,
|
||||
concurrentQueues = [],
|
||||
@@ -2703,6 +2724,14 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
||||
return children;
|
||||
}
|
||||
function TransitionAwareHostComponent() {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
var maybeThenable = ReactCurrentDispatcher$1.current.useState()[0];
|
||||
return "function" === typeof maybeThenable.then
|
||||
? useThenable(maybeThenable)
|
||||
: maybeThenable;
|
||||
}
|
||||
function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.updateQueue = current.updateQueue;
|
||||
workInProgress.flags &= -2053;
|
||||
@@ -3090,6 +3119,140 @@ function rerenderOptimistic(passthrough, reducer) {
|
||||
hook.baseState = passthrough;
|
||||
return [passthrough, hook.queue.dispatch];
|
||||
}
|
||||
function dispatchFormState(fiber, actionQueue, setState, payload) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((fiber = { payload: payload, next: null }),
|
||||
(fiber.next = actionQueue.pending = fiber),
|
||||
runFormStateAction(actionQueue, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, next: fiber.next });
|
||||
}
|
||||
function runFormStateAction(actionQueue, setState, payload) {
|
||||
var action = actionQueue.action,
|
||||
prevState = actionQueue.state,
|
||||
prevTransition = ReactCurrentBatchConfig$2.transition,
|
||||
currentTransition = { _callbacks: new Set() };
|
||||
ReactCurrentBatchConfig$2.transition = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (notifyTransitionCallbacks(currentTransition, returnValue),
|
||||
returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
},
|
||||
function () {
|
||||
return finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningFormStateAction(actionQueue, setState));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
} finally {
|
||||
ReactCurrentBatchConfig$2.transition = prevTransition;
|
||||
}
|
||||
}
|
||||
function finishRunningFormStateAction(actionQueue, setState) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runFormStateAction(actionQueue, setState, first.payload));
|
||||
}
|
||||
}
|
||||
function formStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
function mountFormState(action, initialStateProp) {
|
||||
var stateHook = mountWorkInProgressHook();
|
||||
stateHook.memoizedState = stateHook.baseState = initialStateProp;
|
||||
var stateQueue = {
|
||||
pending: null,
|
||||
lanes: 0,
|
||||
dispatch: null,
|
||||
lastRenderedReducer: formStateReducer,
|
||||
lastRenderedState: initialStateProp
|
||||
};
|
||||
stateHook.queue = stateQueue;
|
||||
stateHook = dispatchSetState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
stateQueue
|
||||
);
|
||||
stateQueue.dispatch = stateHook;
|
||||
stateQueue = mountWorkInProgressHook();
|
||||
var actionQueue = {
|
||||
state: initialStateProp,
|
||||
dispatch: null,
|
||||
action: action,
|
||||
pending: null
|
||||
};
|
||||
stateQueue.queue = actionQueue;
|
||||
stateHook = dispatchFormState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
actionQueue,
|
||||
stateHook
|
||||
);
|
||||
actionQueue.dispatch = stateHook;
|
||||
stateQueue.memoizedState = action;
|
||||
return [initialStateProp, stateHook];
|
||||
}
|
||||
function updateFormState(action) {
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
return updateFormStateImpl(stateHook, currentHook, action);
|
||||
}
|
||||
function updateFormStateImpl(stateHook, currentStateHook, action) {
|
||||
stateHook = updateReducerImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
formStateReducer
|
||||
)[0];
|
||||
stateHook =
|
||||
"object" === typeof stateHook &&
|
||||
null !== stateHook &&
|
||||
"function" === typeof stateHook.then
|
||||
? useThenable(stateHook)
|
||||
: stateHook;
|
||||
currentStateHook = updateWorkInProgressHook();
|
||||
var actionQueue = currentStateHook.queue,
|
||||
dispatch = actionQueue.dispatch;
|
||||
action !== currentStateHook.memoizedState &&
|
||||
((currentlyRenderingFiber$1.flags |= 2048),
|
||||
pushEffect(
|
||||
9,
|
||||
formStateActionEffect.bind(null, actionQueue, action),
|
||||
{ destroy: void 0 },
|
||||
null
|
||||
));
|
||||
return [stateHook, dispatch];
|
||||
}
|
||||
function formStateActionEffect(actionQueue, action) {
|
||||
actionQueue.action = action;
|
||||
}
|
||||
function rerenderFormState(action) {
|
||||
var stateHook = updateWorkInProgressHook(),
|
||||
currentStateHook = currentHook;
|
||||
if (null !== currentStateHook)
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
stateHook = stateHook.memoizedState;
|
||||
currentStateHook = updateWorkInProgressHook();
|
||||
var dispatch = currentStateHook.queue.dispatch;
|
||||
currentStateHook.memoizedState = action;
|
||||
return [stateHook, dispatch];
|
||||
}
|
||||
function pushEffect(tag, create, inst, deps) {
|
||||
tag = { tag: tag, create: create, inst: inst, deps: deps, next: null };
|
||||
create = currentlyRenderingFiber$1.updateQueue;
|
||||
@@ -3286,6 +3449,12 @@ function startTransition(
|
||||
(ReactCurrentBatchConfig$2.transition = prevTransition);
|
||||
}
|
||||
}
|
||||
function useHostTransitionStatus() {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
var status = readContext(HostTransitionContext);
|
||||
return null !== status ? status : null;
|
||||
}
|
||||
function updateId() {
|
||||
return updateWorkInProgressHook().memoizedState;
|
||||
}
|
||||
@@ -3437,6 +3606,10 @@ var ContextOnlyDispatcher = {
|
||||
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError),
|
||||
(ContextOnlyDispatcher.useFormState = throwInvalidHookError));
|
||||
enableAsyncActions &&
|
||||
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
|
||||
var HooksDispatcherOnMount = {
|
||||
@@ -3575,6 +3748,10 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
|
||||
return ref.impl.apply(void 0, arguments);
|
||||
};
|
||||
};
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus),
|
||||
(HooksDispatcherOnMount.useFormState = mountFormState));
|
||||
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
|
||||
var HooksDispatcherOnUpdate = {
|
||||
readContext: readContext,
|
||||
@@ -3617,6 +3794,10 @@ var HooksDispatcherOnUpdate = {
|
||||
HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
|
||||
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
|
||||
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus),
|
||||
(HooksDispatcherOnUpdate.useFormState = updateFormState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
|
||||
var HooksDispatcherOnRerender = {
|
||||
@@ -3662,6 +3843,11 @@ var HooksDispatcherOnRerender = {
|
||||
HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
|
||||
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
|
||||
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnRerender.useHostTransitionStatus =
|
||||
useHostTransitionStatus),
|
||||
(HooksDispatcherOnRerender.useFormState = rerenderFormState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
@@ -5625,6 +5811,18 @@ function propagateParentContextChanges(
|
||||
objectIs(parent.pendingProps.value, currentParent.value) ||
|
||||
(null !== current ? current.push(context) : (current = [context]));
|
||||
}
|
||||
} else if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
parent === hostTransitionProviderCursor.current
|
||||
) {
|
||||
currentParent = parent.alternate;
|
||||
if (null === currentParent) throw Error(formatProdErrorMessage(387));
|
||||
currentParent.memoizedState.memoizedState !==
|
||||
parent.memoizedState.memoizedState &&
|
||||
(null !== current
|
||||
? current.push(HostTransitionContext)
|
||||
: (current = [HostTransitionContext]));
|
||||
}
|
||||
parent = parent.return;
|
||||
}
|
||||
@@ -5900,14 +6098,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$75 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$75 = lastTailNode),
|
||||
for (var lastTailNode$77 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$77 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$75
|
||||
null === lastTailNode$77
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$75.sibling = null);
|
||||
: (lastTailNode$77.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -5917,19 +6115,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$76.flags & 31457280),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (var child$78 = completedWork.child; null !== child$78; )
|
||||
(newChildLanes |= child$78.lanes | child$78.childLanes),
|
||||
(subtreeFlags |= child$78.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$78.flags & 31457280),
|
||||
(child$78.return = completedWork),
|
||||
(child$78 = child$78.sibling);
|
||||
else
|
||||
for (child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags),
|
||||
(subtreeFlags |= child$76.flags),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (child$78 = completedWork.child; null !== child$78; )
|
||||
(newChildLanes |= child$78.lanes | child$78.childLanes),
|
||||
(subtreeFlags |= child$78.subtreeFlags),
|
||||
(subtreeFlags |= child$78.flags),
|
||||
(child$78.return = completedWork),
|
||||
(child$78 = child$78.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -6106,11 +6304,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$80 = null;
|
||||
var cache$82 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$80 = newProps.memoizedState.cachePool.pool);
|
||||
cache$80 !== instance && (newProps.flags |= 2048);
|
||||
(cache$82 = newProps.memoizedState.cachePool.pool);
|
||||
cache$82 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -6140,8 +6338,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$80 = instance.rendering;
|
||||
if (null === cache$80)
|
||||
cache$82 = instance.rendering;
|
||||
if (null === cache$82)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -6149,11 +6347,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$80 = findFirstSuspended(current);
|
||||
if (null !== cache$80) {
|
||||
cache$82 = findFirstSuspended(current);
|
||||
if (null !== cache$82) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$80.updateQueue;
|
||||
current = cache$82.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -6178,7 +6376,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$80)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$82)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -6188,7 +6386,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$80.alternate)
|
||||
!cache$82.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -6200,13 +6398,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
instance.isBackwards
|
||||
? ((cache$80.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$80))
|
||||
? ((cache$82.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$82))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$80)
|
||||
: (workInProgress.child = cache$80),
|
||||
(instance.last = cache$80));
|
||||
? (current.sibling = cache$82)
|
||||
: (workInProgress.child = cache$82),
|
||||
(instance.last = cache$82));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -6464,8 +6662,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$98) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$98);
|
||||
} catch (error$100) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$100);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6667,11 +6865,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$99) {
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$99
|
||||
error$101
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7264,8 +7462,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$107) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$107);
|
||||
} catch (error$109) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7299,8 +7497,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
finishedWork.updateQueue = null;
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$110) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$110);
|
||||
} catch (error$112) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$112);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7336,8 +7534,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$112) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$112);
|
||||
} catch (error$114) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$114);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -7477,12 +7675,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$102 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$103 = getHostSibling(finishedWork);
|
||||
var parent$104 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$105 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$103,
|
||||
parent$102
|
||||
before$105,
|
||||
parent$104
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -7943,9 +8141,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$118 = finishedWork.stateNode;
|
||||
var instance$120 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$118._visibility & 4
|
||||
? instance$120._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7958,7 +8156,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$118._visibility |= 4),
|
||||
: ((instance$120._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7966,7 +8164,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$118._visibility |= 4),
|
||||
: ((instance$120._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7979,7 +8177,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$118
|
||||
instance$120
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -8819,8 +9017,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$126) {
|
||||
handleThrow(root, thrownValue$126);
|
||||
} catch (thrownValue$128) {
|
||||
handleThrow(root, thrownValue$128);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -8925,8 +9123,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$128) {
|
||||
handleThrow(root, thrownValue$128);
|
||||
} catch (thrownValue$130) {
|
||||
handleThrow(root, thrownValue$130);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -9529,21 +9727,45 @@ beginWork = function (current, workInProgress, renderLanes) {
|
||||
case 26:
|
||||
case 27:
|
||||
case 5:
|
||||
return (
|
||||
pushHostContext(workInProgress),
|
||||
(Component = workInProgress.type),
|
||||
(context = workInProgress.pendingProps),
|
||||
(nextProps = null !== current ? current.memoizedProps : null),
|
||||
(nextCache = context.children),
|
||||
shouldSetTextContent(Component, context)
|
||||
? (nextCache = null)
|
||||
: null !== nextProps &&
|
||||
shouldSetTextContent(Component, nextProps) &&
|
||||
(workInProgress.flags |= 32),
|
||||
markRef$1(current, workInProgress),
|
||||
reconcileChildren(current, workInProgress, nextCache, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
pushHostContext(workInProgress);
|
||||
context = workInProgress.type;
|
||||
nextProps = workInProgress.pendingProps;
|
||||
nextCache = null !== current ? current.memoizedProps : null;
|
||||
Component = nextProps.children;
|
||||
shouldSetTextContent(context, nextProps)
|
||||
? (Component = null)
|
||||
: null !== nextCache &&
|
||||
shouldSetTextContent(context, nextCache) &&
|
||||
(workInProgress.flags |= 32);
|
||||
if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
null !== workInProgress.memoizedState
|
||||
) {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
context = renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
null,
|
||||
null,
|
||||
renderLanes
|
||||
);
|
||||
HostTransitionContext._currentValue2 = context;
|
||||
enableLazyContextPropagation ||
|
||||
(didReceiveUpdate &&
|
||||
null !== current &&
|
||||
current.memoizedState.memoizedState !== context &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
renderLanes
|
||||
));
|
||||
}
|
||||
markRef$1(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, Component, renderLanes);
|
||||
return workInProgress.child;
|
||||
case 6:
|
||||
return null;
|
||||
case 13:
|
||||
@@ -10321,19 +10543,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1146 = {
|
||||
devToolsConfig$jscomp$inline_1152 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-625f3aa2",
|
||||
version: "18.3.0-www-classic-871e6cd4",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1312 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1146.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1146.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1146.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1146.rendererConfig,
|
||||
var internals$jscomp$inline_1323 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1152.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1152.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1152.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1152.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10350,26 +10572,26 @@ var internals$jscomp$inline_1312 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1146.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1152.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-625f3aa2"
|
||||
reconcilerVersion: "18.3.0-www-classic-871e6cd4"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1313 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1324 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1313.isDisabled &&
|
||||
hook$jscomp$inline_1313.supportsFiber
|
||||
!hook$jscomp$inline_1324.isDisabled &&
|
||||
hook$jscomp$inline_1324.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1313.inject(
|
||||
internals$jscomp$inline_1312
|
||||
(rendererID = hook$jscomp$inline_1324.inject(
|
||||
internals$jscomp$inline_1323
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1313);
|
||||
(injectedHook = hook$jscomp$inline_1324);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -72,6 +72,7 @@ var ReactSharedInternals =
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect,
|
||||
@@ -860,7 +861,18 @@ function is(x, y) {
|
||||
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
||||
contextStackCursor = createCursor(null),
|
||||
contextFiberStackCursor = createCursor(null),
|
||||
rootInstanceStackCursor = createCursor(null);
|
||||
rootInstanceStackCursor = createCursor(null),
|
||||
hostTransitionProviderCursor = createCursor(null),
|
||||
HostTransitionContext = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: null,
|
||||
_currentValue2: null,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null,
|
||||
_defaultValue: null,
|
||||
_globalName: null
|
||||
};
|
||||
function pushHostContainer(fiber, nextRootInstance) {
|
||||
push(rootInstanceStackCursor, nextRootInstance);
|
||||
push(contextFiberStackCursor, fiber);
|
||||
@@ -874,6 +886,10 @@ function popHostContainer() {
|
||||
pop(rootInstanceStackCursor);
|
||||
}
|
||||
function pushHostContext(fiber) {
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
null !== fiber.memoizedState &&
|
||||
push(hostTransitionProviderCursor, fiber);
|
||||
contextStackCursor.current !== NO_CONTEXT &&
|
||||
(push(contextFiberStackCursor, fiber),
|
||||
push(contextStackCursor, NO_CONTEXT));
|
||||
@@ -881,6 +897,11 @@ function pushHostContext(fiber) {
|
||||
function popHostContext(fiber) {
|
||||
contextFiberStackCursor.current === fiber &&
|
||||
(pop(contextStackCursor), pop(contextFiberStackCursor));
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
hostTransitionProviderCursor.current === fiber &&
|
||||
(pop(hostTransitionProviderCursor),
|
||||
(HostTransitionContext._currentValue2 = null));
|
||||
}
|
||||
var hydrationErrors = null,
|
||||
concurrentQueues = [],
|
||||
@@ -2510,6 +2531,14 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
|
||||
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
||||
return children;
|
||||
}
|
||||
function TransitionAwareHostComponent() {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
var maybeThenable = ReactCurrentDispatcher$1.current.useState()[0];
|
||||
return "function" === typeof maybeThenable.then
|
||||
? useThenable(maybeThenable)
|
||||
: maybeThenable;
|
||||
}
|
||||
function bailoutHooks(current, workInProgress, lanes) {
|
||||
workInProgress.updateQueue = current.updateQueue;
|
||||
workInProgress.flags &= -2053;
|
||||
@@ -2897,6 +2926,140 @@ function rerenderOptimistic(passthrough, reducer) {
|
||||
hook.baseState = passthrough;
|
||||
return [passthrough, hook.queue.dispatch];
|
||||
}
|
||||
function dispatchFormState(fiber, actionQueue, setState, payload) {
|
||||
if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
|
||||
fiber = actionQueue.pending;
|
||||
null === fiber
|
||||
? ((fiber = { payload: payload, next: null }),
|
||||
(fiber.next = actionQueue.pending = fiber),
|
||||
runFormStateAction(actionQueue, setState, payload))
|
||||
: (actionQueue.pending = fiber.next =
|
||||
{ payload: payload, next: fiber.next });
|
||||
}
|
||||
function runFormStateAction(actionQueue, setState, payload) {
|
||||
var action = actionQueue.action,
|
||||
prevState = actionQueue.state,
|
||||
prevTransition = ReactCurrentBatchConfig$2.transition,
|
||||
currentTransition = { _callbacks: new Set() };
|
||||
ReactCurrentBatchConfig$2.transition = currentTransition;
|
||||
try {
|
||||
var returnValue = action(prevState, payload);
|
||||
null !== returnValue &&
|
||||
"object" === typeof returnValue &&
|
||||
"function" === typeof returnValue.then
|
||||
? (notifyTransitionCallbacks(currentTransition, returnValue),
|
||||
returnValue.then(
|
||||
function (nextState) {
|
||||
actionQueue.state = nextState;
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
},
|
||||
function () {
|
||||
return finishRunningFormStateAction(actionQueue, setState);
|
||||
}
|
||||
),
|
||||
setState(returnValue))
|
||||
: (setState(returnValue),
|
||||
(actionQueue.state = returnValue),
|
||||
finishRunningFormStateAction(actionQueue, setState));
|
||||
} catch (error) {
|
||||
setState({ then: function () {}, status: "rejected", reason: error }),
|
||||
finishRunningFormStateAction(actionQueue, setState);
|
||||
} finally {
|
||||
ReactCurrentBatchConfig$2.transition = prevTransition;
|
||||
}
|
||||
}
|
||||
function finishRunningFormStateAction(actionQueue, setState) {
|
||||
var last = actionQueue.pending;
|
||||
if (null !== last) {
|
||||
var first = last.next;
|
||||
first === last
|
||||
? (actionQueue.pending = null)
|
||||
: ((first = first.next),
|
||||
(last.next = first),
|
||||
runFormStateAction(actionQueue, setState, first.payload));
|
||||
}
|
||||
}
|
||||
function formStateReducer(oldState, newState) {
|
||||
return newState;
|
||||
}
|
||||
function mountFormState(action, initialStateProp) {
|
||||
var stateHook = mountWorkInProgressHook();
|
||||
stateHook.memoizedState = stateHook.baseState = initialStateProp;
|
||||
var stateQueue = {
|
||||
pending: null,
|
||||
lanes: 0,
|
||||
dispatch: null,
|
||||
lastRenderedReducer: formStateReducer,
|
||||
lastRenderedState: initialStateProp
|
||||
};
|
||||
stateHook.queue = stateQueue;
|
||||
stateHook = dispatchSetState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
stateQueue
|
||||
);
|
||||
stateQueue.dispatch = stateHook;
|
||||
stateQueue = mountWorkInProgressHook();
|
||||
var actionQueue = {
|
||||
state: initialStateProp,
|
||||
dispatch: null,
|
||||
action: action,
|
||||
pending: null
|
||||
};
|
||||
stateQueue.queue = actionQueue;
|
||||
stateHook = dispatchFormState.bind(
|
||||
null,
|
||||
currentlyRenderingFiber$1,
|
||||
actionQueue,
|
||||
stateHook
|
||||
);
|
||||
actionQueue.dispatch = stateHook;
|
||||
stateQueue.memoizedState = action;
|
||||
return [initialStateProp, stateHook];
|
||||
}
|
||||
function updateFormState(action) {
|
||||
var stateHook = updateWorkInProgressHook();
|
||||
return updateFormStateImpl(stateHook, currentHook, action);
|
||||
}
|
||||
function updateFormStateImpl(stateHook, currentStateHook, action) {
|
||||
stateHook = updateReducerImpl(
|
||||
stateHook,
|
||||
currentStateHook,
|
||||
formStateReducer
|
||||
)[0];
|
||||
stateHook =
|
||||
"object" === typeof stateHook &&
|
||||
null !== stateHook &&
|
||||
"function" === typeof stateHook.then
|
||||
? useThenable(stateHook)
|
||||
: stateHook;
|
||||
currentStateHook = updateWorkInProgressHook();
|
||||
var actionQueue = currentStateHook.queue,
|
||||
dispatch = actionQueue.dispatch;
|
||||
action !== currentStateHook.memoizedState &&
|
||||
((currentlyRenderingFiber$1.flags |= 2048),
|
||||
pushEffect(
|
||||
9,
|
||||
formStateActionEffect.bind(null, actionQueue, action),
|
||||
{ destroy: void 0 },
|
||||
null
|
||||
));
|
||||
return [stateHook, dispatch];
|
||||
}
|
||||
function formStateActionEffect(actionQueue, action) {
|
||||
actionQueue.action = action;
|
||||
}
|
||||
function rerenderFormState(action) {
|
||||
var stateHook = updateWorkInProgressHook(),
|
||||
currentStateHook = currentHook;
|
||||
if (null !== currentStateHook)
|
||||
return updateFormStateImpl(stateHook, currentStateHook, action);
|
||||
stateHook = stateHook.memoizedState;
|
||||
currentStateHook = updateWorkInProgressHook();
|
||||
var dispatch = currentStateHook.queue.dispatch;
|
||||
currentStateHook.memoizedState = action;
|
||||
return [stateHook, dispatch];
|
||||
}
|
||||
function pushEffect(tag, create, inst, deps) {
|
||||
tag = { tag: tag, create: create, inst: inst, deps: deps, next: null };
|
||||
create = currentlyRenderingFiber$1.updateQueue;
|
||||
@@ -3093,6 +3256,12 @@ function startTransition(
|
||||
(ReactCurrentBatchConfig$2.transition = prevTransition);
|
||||
}
|
||||
}
|
||||
function useHostTransitionStatus() {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
var status = readContext(HostTransitionContext);
|
||||
return null !== status ? status : null;
|
||||
}
|
||||
function updateId() {
|
||||
return updateWorkInProgressHook().memoizedState;
|
||||
}
|
||||
@@ -3244,6 +3413,10 @@ var ContextOnlyDispatcher = {
|
||||
ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
|
||||
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError),
|
||||
(ContextOnlyDispatcher.useFormState = throwInvalidHookError));
|
||||
enableAsyncActions &&
|
||||
(ContextOnlyDispatcher.useOptimistic = throwInvalidHookError);
|
||||
var HooksDispatcherOnMount = {
|
||||
@@ -3382,6 +3555,10 @@ HooksDispatcherOnMount.useEffectEvent = function (callback) {
|
||||
return ref.impl.apply(void 0, arguments);
|
||||
};
|
||||
};
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus),
|
||||
(HooksDispatcherOnMount.useFormState = mountFormState));
|
||||
enableAsyncActions && (HooksDispatcherOnMount.useOptimistic = mountOptimistic);
|
||||
var HooksDispatcherOnUpdate = {
|
||||
readContext: readContext,
|
||||
@@ -3424,6 +3601,10 @@ var HooksDispatcherOnUpdate = {
|
||||
HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
|
||||
HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
|
||||
HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus),
|
||||
(HooksDispatcherOnUpdate.useFormState = updateFormState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnUpdate.useOptimistic = updateOptimistic);
|
||||
var HooksDispatcherOnRerender = {
|
||||
@@ -3469,6 +3650,11 @@ var HooksDispatcherOnRerender = {
|
||||
HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
|
||||
HooksDispatcherOnRerender.useMemoCache = useMemoCache;
|
||||
HooksDispatcherOnRerender.useEffectEvent = updateEvent;
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcherOnRerender.useHostTransitionStatus =
|
||||
useHostTransitionStatus),
|
||||
(HooksDispatcherOnRerender.useFormState = rerenderFormState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
@@ -5381,6 +5567,18 @@ function propagateParentContextChanges(
|
||||
objectIs(parent.pendingProps.value, currentParent.value) ||
|
||||
(null !== current ? current.push(context) : (current = [context]));
|
||||
}
|
||||
} else if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
parent === hostTransitionProviderCursor.current
|
||||
) {
|
||||
currentParent = parent.alternate;
|
||||
if (null === currentParent) throw Error(formatProdErrorMessage(387));
|
||||
currentParent.memoizedState.memoizedState !==
|
||||
parent.memoizedState.memoizedState &&
|
||||
(null !== current
|
||||
? current.push(HostTransitionContext)
|
||||
: (current = [HostTransitionContext]));
|
||||
}
|
||||
parent = parent.return;
|
||||
}
|
||||
@@ -5656,14 +5854,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$75 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$75 = lastTailNode),
|
||||
for (var lastTailNode$77 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$77 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$75
|
||||
null === lastTailNode$77
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$75.sibling = null);
|
||||
: (lastTailNode$77.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -5673,19 +5871,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$76.flags & 31457280),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (var child$78 = completedWork.child; null !== child$78; )
|
||||
(newChildLanes |= child$78.lanes | child$78.childLanes),
|
||||
(subtreeFlags |= child$78.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$78.flags & 31457280),
|
||||
(child$78.return = completedWork),
|
||||
(child$78 = child$78.sibling);
|
||||
else
|
||||
for (child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags),
|
||||
(subtreeFlags |= child$76.flags),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (child$78 = completedWork.child; null !== child$78; )
|
||||
(newChildLanes |= child$78.lanes | child$78.childLanes),
|
||||
(subtreeFlags |= child$78.subtreeFlags),
|
||||
(subtreeFlags |= child$78.flags),
|
||||
(child$78.return = completedWork),
|
||||
(child$78 = child$78.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -5856,11 +6054,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(instance = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$80 = null;
|
||||
var cache$82 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$80 = newProps.memoizedState.cachePool.pool);
|
||||
cache$80 !== instance && (newProps.flags |= 2048);
|
||||
(cache$82 = newProps.memoizedState.cachePool.pool);
|
||||
cache$82 !== instance && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
(enableTransitionTracing && (workInProgress.child.flags |= 2048),
|
||||
@@ -5886,8 +6084,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
instance = workInProgress.memoizedState;
|
||||
if (null === instance) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$80 = instance.rendering;
|
||||
if (null === cache$80)
|
||||
cache$82 = instance.rendering;
|
||||
if (null === cache$82)
|
||||
if (newProps) cutOffTailIfNeeded(instance, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -5895,11 +6093,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$80 = findFirstSuspended(current);
|
||||
if (null !== cache$80) {
|
||||
cache$82 = findFirstSuspended(current);
|
||||
if (null !== cache$82) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(instance, !1);
|
||||
current = cache$80.updateQueue;
|
||||
current = cache$82.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -5924,7 +6122,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$80)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$82)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -5934,7 +6132,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !0),
|
||||
null === instance.tail &&
|
||||
"hidden" === instance.tailMode &&
|
||||
!cache$80.alternate)
|
||||
!cache$82.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -5946,13 +6144,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(instance, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
instance.isBackwards
|
||||
? ((cache$80.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$80))
|
||||
? ((cache$82.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$82))
|
||||
: ((current = instance.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$80)
|
||||
: (workInProgress.child = cache$80),
|
||||
(instance.last = cache$80));
|
||||
? (current.sibling = cache$82)
|
||||
: (workInProgress.child = cache$82),
|
||||
(instance.last = cache$82));
|
||||
}
|
||||
if (null !== instance.tail)
|
||||
return (
|
||||
@@ -6201,8 +6399,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$97) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$97);
|
||||
} catch (error$99) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$99);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6404,11 +6602,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$98) {
|
||||
} catch (error$100) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$98
|
||||
error$100
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7001,8 +7199,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$106) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$106);
|
||||
} catch (error$108) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$108);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7036,8 +7234,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
finishedWork.updateQueue = null;
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$109) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$109);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7073,8 +7271,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
null !== retryQueue && suspenseCallback(new Set(retryQueue));
|
||||
}
|
||||
}
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
} catch (error$113) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$113);
|
||||
}
|
||||
flags = finishedWork.updateQueue;
|
||||
null !== flags &&
|
||||
@@ -7214,12 +7412,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$101 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$102 = getHostSibling(finishedWork);
|
||||
var parent$103 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$104 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$102,
|
||||
parent$101
|
||||
before$104,
|
||||
parent$103
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -7680,9 +7878,9 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
);
|
||||
break;
|
||||
case 22:
|
||||
var instance$117 = finishedWork.stateNode;
|
||||
var instance$119 = finishedWork.stateNode;
|
||||
null !== finishedWork.memoizedState
|
||||
? instance$117._visibility & 4
|
||||
? instance$119._visibility & 4
|
||||
? recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7695,7 +7893,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork
|
||||
)
|
||||
: ((instance$117._visibility |= 4),
|
||||
: ((instance$119._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7703,7 +7901,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
committedTransitions,
|
||||
includeWorkInProgressEffects
|
||||
))
|
||||
: ((instance$117._visibility |= 4),
|
||||
: ((instance$119._visibility |= 4),
|
||||
recursivelyTraverseReconnectPassiveEffects(
|
||||
finishedRoot,
|
||||
finishedWork,
|
||||
@@ -7716,7 +7914,7 @@ function recursivelyTraverseReconnectPassiveEffects(
|
||||
commitOffscreenPassiveMountEffects(
|
||||
finishedWork.alternate,
|
||||
finishedWork,
|
||||
instance$117
|
||||
instance$119
|
||||
);
|
||||
break;
|
||||
case 24:
|
||||
@@ -8556,8 +8754,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$125) {
|
||||
handleThrow(root, thrownValue$125);
|
||||
} catch (thrownValue$127) {
|
||||
handleThrow(root, thrownValue$127);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -8662,8 +8860,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$127) {
|
||||
handleThrow(root, thrownValue$127);
|
||||
} catch (thrownValue$129) {
|
||||
handleThrow(root, thrownValue$129);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -9255,21 +9453,45 @@ beginWork = function (current, workInProgress, renderLanes) {
|
||||
case 26:
|
||||
case 27:
|
||||
case 5:
|
||||
return (
|
||||
pushHostContext(workInProgress),
|
||||
(Component = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(nextProps = null !== current ? current.memoizedProps : null),
|
||||
(nextCache = init.children),
|
||||
shouldSetTextContent(Component, init)
|
||||
? (nextCache = null)
|
||||
: null !== nextProps &&
|
||||
shouldSetTextContent(Component, nextProps) &&
|
||||
(workInProgress.flags |= 32),
|
||||
markRef$1(current, workInProgress),
|
||||
reconcileChildren(current, workInProgress, nextCache, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
pushHostContext(workInProgress);
|
||||
init = workInProgress.type;
|
||||
nextProps = workInProgress.pendingProps;
|
||||
nextCache = null !== current ? current.memoizedProps : null;
|
||||
Component = nextProps.children;
|
||||
shouldSetTextContent(init, nextProps)
|
||||
? (Component = null)
|
||||
: null !== nextCache &&
|
||||
shouldSetTextContent(init, nextCache) &&
|
||||
(workInProgress.flags |= 32);
|
||||
if (
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
null !== workInProgress.memoizedState
|
||||
) {
|
||||
if (!enableFormActions || !enableAsyncActions)
|
||||
throw Error(formatProdErrorMessage(248));
|
||||
init = renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
null,
|
||||
null,
|
||||
renderLanes
|
||||
);
|
||||
HostTransitionContext._currentValue2 = init;
|
||||
enableLazyContextPropagation ||
|
||||
(didReceiveUpdate &&
|
||||
null !== current &&
|
||||
current.memoizedState.memoizedState !== init &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
renderLanes
|
||||
));
|
||||
}
|
||||
markRef$1(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, Component, renderLanes);
|
||||
return workInProgress.child;
|
||||
case 6:
|
||||
return null;
|
||||
case 13:
|
||||
@@ -9987,19 +10209,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1126 = {
|
||||
devToolsConfig$jscomp$inline_1132 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-5679160e",
|
||||
version: "18.3.0-www-modern-83468ada",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1292 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1126.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1126.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1126.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1126.rendererConfig,
|
||||
var internals$jscomp$inline_1303 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1132.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1132.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1132.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1132.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10016,26 +10238,26 @@ var internals$jscomp$inline_1292 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1126.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1132.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-5679160e"
|
||||
reconcilerVersion: "18.3.0-www-modern-83468ada"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1293 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1304 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1293.isDisabled &&
|
||||
hook$jscomp$inline_1293.supportsFiber
|
||||
!hook$jscomp$inline_1304.isDisabled &&
|
||||
hook$jscomp$inline_1304.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1293.inject(
|
||||
internals$jscomp$inline_1292
|
||||
(rendererID = hook$jscomp$inline_1304.inject(
|
||||
internals$jscomp$inline_1303
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1293);
|
||||
(injectedHook = hook$jscomp$inline_1304);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
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
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-ac038d0e";
|
||||
var ReactVersion = "18.3.0-www-classic-59dbb481";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -346,9 +346,8 @@ if (__DEV__) {
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg;
|
||||
// On WWW, false is used for a new modern build.
|
||||
@@ -1359,6 +1358,23 @@ if (__DEV__) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (enableFormActions) {
|
||||
// Actions are special because unlike events they can have other value types.
|
||||
if (typeof value === "function") {
|
||||
if (tagName === "form" && name === "action") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "input" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "button" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // We can't rely on the event system being injected on the server.
|
||||
|
||||
if (eventRegistry != null) {
|
||||
var registrationNameDependencies =
|
||||
eventRegistry.registrationNameDependencies,
|
||||
@@ -1507,10 +1523,9 @@ if (__DEV__) {
|
||||
|
||||
case "innerText": // Properties
|
||||
|
||||
case "textContent":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
return true;
|
||||
}
|
||||
case "textContent": {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (typeof value) {
|
||||
@@ -1998,6 +2013,8 @@ if (__DEV__) {
|
||||
'$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};';
|
||||
var completeSegment =
|
||||
"$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};";
|
||||
var formReplaying =
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});';
|
||||
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return thing === null
|
||||
@@ -2012,6 +2029,16 @@ if (__DEV__) {
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// same object across all transitions.
|
||||
|
||||
var sharedNotPendingObject = {
|
||||
pending: false,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
};
|
||||
var NotPending = Object.freeze(sharedNotPendingObject);
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -2045,6 +2072,9 @@ if (__DEV__) {
|
||||
var SentStyleInsertionFunction =
|
||||
/* */
|
||||
8;
|
||||
var SentFormReplayingRuntime =
|
||||
/* */
|
||||
16; // Per request, global state that is not contextual to the rendering subtree.
|
||||
// This cannot be resumed and therefore should only contain things that are
|
||||
// temporary working state or are never used in the prerender pass.
|
||||
// Credentials here are things that affect whether a browser will make a request
|
||||
@@ -2751,9 +2781,14 @@ if (__DEV__) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
} // Since this will likely be repeated a lot in the HTML, we use a more concise message
|
||||
// than on the client and hopefully it's googleable.
|
||||
|
||||
stringToPrecomputedChunk(
|
||||
var actionJavaScriptURL = stringToPrecomputedChunk(
|
||||
escapeTextForBrowser(
|
||||
// eslint-disable-next-line no-script-url
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
@@ -2798,6 +2833,75 @@ if (__DEV__) {
|
||||
) {
|
||||
var formData = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (name !== null && !didWarnFormActionName) {
|
||||
didWarnFormActionName = true;
|
||||
|
||||
error(
|
||||
'Cannot specify a "name" prop for a button that specifies a function as a formAction. ' +
|
||||
"React needs it to encode which action should be invoked. It will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formEncType or formMethod for a button that specifies a " +
|
||||
"function as a formAction. React provides those automatically. They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formTarget for a button that specifies a function as a formAction. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
name = customFields.name;
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("formAction"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
name = null;
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
pushAttribute(target, "name", name);
|
||||
}
|
||||
@@ -3197,6 +3301,9 @@ if (__DEV__) {
|
||||
var didWarnInvalidOptionInnerHTML = false;
|
||||
var didWarnSelectedSetOnOption = false;
|
||||
var didWarnFormActionType = false;
|
||||
var didWarnFormActionName = false;
|
||||
var didWarnFormActionTarget = false;
|
||||
var didWarnFormActionMethod = false;
|
||||
|
||||
function checkSelectProp(props, propName) {
|
||||
{
|
||||
@@ -3428,6 +3535,26 @@ if (__DEV__) {
|
||||
return children;
|
||||
}
|
||||
|
||||
var formReplayingRuntimeScript = stringToPrecomputedChunk(formReplaying);
|
||||
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
// If we haven't sent it yet, inject the runtime that tracks submitted JS actions
|
||||
// for later replaying by Fiber. If we use an external runtime, we don't need
|
||||
// to emit anything. It's always used.
|
||||
if (
|
||||
(resumableState.instructions & SentFormReplayingRuntime) ===
|
||||
NothingSent &&
|
||||
!renderState.externalRuntimeScript
|
||||
) {
|
||||
resumableState.instructions |= SentFormReplayingRuntime;
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
formReplayingRuntimeScript,
|
||||
endInlineScript
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var formStateMarkerIsMatching = stringToPrecomputedChunk("<!--F!-->");
|
||||
var formStateMarkerIsNotMatching = stringToPrecomputedChunk("<!--F-->");
|
||||
function pushFormStateMarkerIsMatching(target) {
|
||||
@@ -3486,6 +3613,69 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var formData = null;
|
||||
var formActionName = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a encType or method for a form that specifies a " +
|
||||
"function as the action. React provides those automatically. " +
|
||||
"They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a target for a form that specifies a function as the action. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("action"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (formAction != null) {
|
||||
pushAttribute(target, "action", formAction);
|
||||
}
|
||||
@@ -3504,6 +3694,13 @@ if (__DEV__) {
|
||||
|
||||
target.push(endOfStartTag);
|
||||
|
||||
if (formActionName !== null) {
|
||||
target.push(startHiddenInputChunk);
|
||||
pushStringAttribute(target, "name", formActionName);
|
||||
target.push(endOfStartTagSelfClosing);
|
||||
pushAdditionalFormFields(target, formData);
|
||||
}
|
||||
|
||||
pushInnerHTML(target, innerHTML, children);
|
||||
|
||||
if (typeof children === "string") {
|
||||
@@ -4954,12 +5151,11 @@ if (__DEV__) {
|
||||
// Ignored. These are built-in to React on the client.
|
||||
break;
|
||||
|
||||
case "className":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
case "className": {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
|
||||
// intentional fallthrough
|
||||
|
||||
@@ -4969,7 +5165,7 @@ if (__DEV__) {
|
||||
typeof propValue !== "function" &&
|
||||
typeof propValue !== "symbol"
|
||||
) {
|
||||
if (enableCustomElementPropertySupport) {
|
||||
{
|
||||
if (propValue === false) {
|
||||
continue;
|
||||
} else if (propValue === true) {
|
||||
@@ -5172,7 +5368,7 @@ if (__DEV__) {
|
||||
return pushStartButton(target, props, resumableState, renderState);
|
||||
|
||||
case "form":
|
||||
return pushStartForm(target, props);
|
||||
return pushStartForm(target, props, resumableState, renderState);
|
||||
|
||||
case "menuitem":
|
||||
return pushStartMenuItem(target, props);
|
||||
@@ -7895,6 +8091,7 @@ if (__DEV__) {
|
||||
|
||||
return writeEndClientRenderedSuspenseBoundary$1(destination);
|
||||
}
|
||||
var NotPendingTransition = NotPending;
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
@@ -10418,6 +10615,11 @@ if (__DEV__) {
|
||||
return [false, unsupportedStartTransition];
|
||||
}
|
||||
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return NotPendingTransition;
|
||||
}
|
||||
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw new Error("Cannot update optimistic state while rendering.");
|
||||
}
|
||||
@@ -10661,6 +10863,10 @@ if (__DEV__) {
|
||||
HooksDispatcher.useMemoCache = useMemoCache;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcher.useOptimistic = useOptimistic;
|
||||
HooksDispatcher.useFormState = useFormState;
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-c10a0d4f";
|
||||
var ReactVersion = "18.3.0-www-modern-66f563f5";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
@@ -346,9 +346,8 @@ if (__DEV__) {
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg;
|
||||
// On WWW, true is used for a new modern build.
|
||||
@@ -1359,6 +1358,23 @@ if (__DEV__) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (enableFormActions) {
|
||||
// Actions are special because unlike events they can have other value types.
|
||||
if (typeof value === "function") {
|
||||
if (tagName === "form" && name === "action") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "input" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "button" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // We can't rely on the event system being injected on the server.
|
||||
|
||||
if (eventRegistry != null) {
|
||||
var registrationNameDependencies =
|
||||
eventRegistry.registrationNameDependencies,
|
||||
@@ -1507,10 +1523,9 @@ if (__DEV__) {
|
||||
|
||||
case "innerText": // Properties
|
||||
|
||||
case "textContent":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
return true;
|
||||
}
|
||||
case "textContent": {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (typeof value) {
|
||||
@@ -1998,6 +2013,8 @@ if (__DEV__) {
|
||||
'$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};';
|
||||
var completeSegment =
|
||||
"$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};";
|
||||
var formReplaying =
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});';
|
||||
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return thing === null
|
||||
@@ -2012,6 +2029,16 @@ if (__DEV__) {
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// same object across all transitions.
|
||||
|
||||
var sharedNotPendingObject = {
|
||||
pending: false,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
};
|
||||
var NotPending = Object.freeze(sharedNotPendingObject);
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -2045,6 +2072,9 @@ if (__DEV__) {
|
||||
var SentStyleInsertionFunction =
|
||||
/* */
|
||||
8;
|
||||
var SentFormReplayingRuntime =
|
||||
/* */
|
||||
16; // Per request, global state that is not contextual to the rendering subtree.
|
||||
// This cannot be resumed and therefore should only contain things that are
|
||||
// temporary working state or are never used in the prerender pass.
|
||||
// Credentials here are things that affect whether a browser will make a request
|
||||
@@ -2751,9 +2781,14 @@ if (__DEV__) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
} // Since this will likely be repeated a lot in the HTML, we use a more concise message
|
||||
// than on the client and hopefully it's googleable.
|
||||
|
||||
stringToPrecomputedChunk(
|
||||
var actionJavaScriptURL = stringToPrecomputedChunk(
|
||||
escapeTextForBrowser(
|
||||
// eslint-disable-next-line no-script-url
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
@@ -2798,6 +2833,75 @@ if (__DEV__) {
|
||||
) {
|
||||
var formData = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (name !== null && !didWarnFormActionName) {
|
||||
didWarnFormActionName = true;
|
||||
|
||||
error(
|
||||
'Cannot specify a "name" prop for a button that specifies a function as a formAction. ' +
|
||||
"React needs it to encode which action should be invoked. It will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formEncType or formMethod for a button that specifies a " +
|
||||
"function as a formAction. React provides those automatically. They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formTarget for a button that specifies a function as a formAction. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
name = customFields.name;
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("formAction"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
name = null;
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
pushAttribute(target, "name", name);
|
||||
}
|
||||
@@ -3197,6 +3301,9 @@ if (__DEV__) {
|
||||
var didWarnInvalidOptionInnerHTML = false;
|
||||
var didWarnSelectedSetOnOption = false;
|
||||
var didWarnFormActionType = false;
|
||||
var didWarnFormActionName = false;
|
||||
var didWarnFormActionTarget = false;
|
||||
var didWarnFormActionMethod = false;
|
||||
|
||||
function checkSelectProp(props, propName) {
|
||||
{
|
||||
@@ -3428,6 +3535,26 @@ if (__DEV__) {
|
||||
return children;
|
||||
}
|
||||
|
||||
var formReplayingRuntimeScript = stringToPrecomputedChunk(formReplaying);
|
||||
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
// If we haven't sent it yet, inject the runtime that tracks submitted JS actions
|
||||
// for later replaying by Fiber. If we use an external runtime, we don't need
|
||||
// to emit anything. It's always used.
|
||||
if (
|
||||
(resumableState.instructions & SentFormReplayingRuntime) ===
|
||||
NothingSent &&
|
||||
!renderState.externalRuntimeScript
|
||||
) {
|
||||
resumableState.instructions |= SentFormReplayingRuntime;
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
formReplayingRuntimeScript,
|
||||
endInlineScript
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var formStateMarkerIsMatching = stringToPrecomputedChunk("<!--F!-->");
|
||||
var formStateMarkerIsNotMatching = stringToPrecomputedChunk("<!--F-->");
|
||||
function pushFormStateMarkerIsMatching(target) {
|
||||
@@ -3486,6 +3613,69 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var formData = null;
|
||||
var formActionName = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a encType or method for a form that specifies a " +
|
||||
"function as the action. React provides those automatically. " +
|
||||
"They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a target for a form that specifies a function as the action. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("action"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (formAction != null) {
|
||||
pushAttribute(target, "action", formAction);
|
||||
}
|
||||
@@ -3504,6 +3694,13 @@ if (__DEV__) {
|
||||
|
||||
target.push(endOfStartTag);
|
||||
|
||||
if (formActionName !== null) {
|
||||
target.push(startHiddenInputChunk);
|
||||
pushStringAttribute(target, "name", formActionName);
|
||||
target.push(endOfStartTagSelfClosing);
|
||||
pushAdditionalFormFields(target, formData);
|
||||
}
|
||||
|
||||
pushInnerHTML(target, innerHTML, children);
|
||||
|
||||
if (typeof children === "string") {
|
||||
@@ -4954,12 +5151,11 @@ if (__DEV__) {
|
||||
// Ignored. These are built-in to React on the client.
|
||||
break;
|
||||
|
||||
case "className":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
case "className": {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
|
||||
// intentional fallthrough
|
||||
|
||||
@@ -4969,7 +5165,7 @@ if (__DEV__) {
|
||||
typeof propValue !== "function" &&
|
||||
typeof propValue !== "symbol"
|
||||
) {
|
||||
if (enableCustomElementPropertySupport) {
|
||||
{
|
||||
if (propValue === false) {
|
||||
continue;
|
||||
} else if (propValue === true) {
|
||||
@@ -5172,7 +5368,7 @@ if (__DEV__) {
|
||||
return pushStartButton(target, props, resumableState, renderState);
|
||||
|
||||
case "form":
|
||||
return pushStartForm(target, props);
|
||||
return pushStartForm(target, props, resumableState, renderState);
|
||||
|
||||
case "menuitem":
|
||||
return pushStartMenuItem(target, props);
|
||||
@@ -7895,6 +8091,7 @@ if (__DEV__) {
|
||||
|
||||
return writeEndClientRenderedSuspenseBoundary$1(destination);
|
||||
}
|
||||
var NotPendingTransition = NotPending;
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
@@ -10157,6 +10354,11 @@ if (__DEV__) {
|
||||
return [false, unsupportedStartTransition];
|
||||
}
|
||||
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return NotPendingTransition;
|
||||
}
|
||||
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw new Error("Cannot update optimistic state while rendering.");
|
||||
}
|
||||
@@ -10400,6 +10602,10 @@ if (__DEV__) {
|
||||
HooksDispatcher.useMemoCache = useMemoCache;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcher.useOptimistic = useOptimistic;
|
||||
HooksDispatcher.useFormState = useFormState;
|
||||
|
||||
@@ -108,9 +108,8 @@ function murmurhash3_32_gc(key, seed) {
|
||||
var assign = Object.assign,
|
||||
dynamicFeatureFlags = require("ReactFeatureFlags"),
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
|
||||
hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
@@ -262,6 +261,12 @@ function sanitizeURL(url) {
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
sharedNotPendingObject = {
|
||||
pending: !1,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
},
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -405,7 +410,11 @@ function pushStringAttribute(target, name, value) {
|
||||
"boolean" !== typeof value &&
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
escapeTextForBrowser(
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
}
|
||||
var actionJavaScriptURL = escapeTextForBrowser(
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
);
|
||||
function pushAdditionalFormField(value, key) {
|
||||
@@ -425,12 +434,27 @@ function pushFormActionAttribute(
|
||||
formTarget,
|
||||
name
|
||||
) {
|
||||
var formData = null;
|
||||
enableFormActions &&
|
||||
"function" === typeof formAction &&
|
||||
("function" === typeof formAction.$$FORM_ACTION
|
||||
? ((formEncType = makeFormFieldPrefix(resumableState)),
|
||||
(resumableState = formAction.$$FORM_ACTION(formEncType)),
|
||||
(name = resumableState.name),
|
||||
(formAction = resumableState.action || ""),
|
||||
(formEncType = resumableState.encType),
|
||||
(formMethod = resumableState.method),
|
||||
(formTarget = resumableState.target),
|
||||
(formData = resumableState.data))
|
||||
: (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget = formMethod = formEncType = formAction = name = null),
|
||||
injectFormReplayingRuntime(resumableState, renderState)));
|
||||
null != name && pushAttribute(target, "name", name);
|
||||
null != formAction && pushAttribute(target, "formAction", formAction);
|
||||
null != formEncType && pushAttribute(target, "formEncType", formEncType);
|
||||
null != formMethod && pushAttribute(target, "formMethod", formMethod);
|
||||
null != formTarget && pushAttribute(target, "formTarget", formTarget);
|
||||
return null;
|
||||
return formData;
|
||||
}
|
||||
function pushAttribute(target, name, value) {
|
||||
switch (name) {
|
||||
@@ -590,8 +614,8 @@ function pushAttribute(target, name, value) {
|
||||
case "symbol":
|
||||
return;
|
||||
case "boolean":
|
||||
var prefix$7 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$7 && "aria-" !== prefix$7) return;
|
||||
var prefix$8 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
|
||||
}
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
@@ -613,6 +637,16 @@ function flattenOptionChildren(children) {
|
||||
});
|
||||
return content;
|
||||
}
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
0 !== (resumableState.instructions & 16) ||
|
||||
renderState.externalRuntimeScript ||
|
||||
((resumableState.instructions |= 16),
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});',
|
||||
"\x3c/script>"
|
||||
));
|
||||
}
|
||||
function pushLinkImpl(target, props) {
|
||||
target.push(startChunkForTag("link"));
|
||||
for (var propKey in props)
|
||||
@@ -1072,6 +1106,26 @@ function pushStartInstance(
|
||||
);
|
||||
}
|
||||
}
|
||||
var formData$jscomp$1 = null,
|
||||
formActionName = null;
|
||||
if (enableFormActions && "function" === typeof formAction$jscomp$1)
|
||||
if ("function" === typeof formAction$jscomp$1.$$FORM_ACTION) {
|
||||
var prefix$9 = makeFormFieldPrefix(resumableState),
|
||||
customFields = formAction$jscomp$1.$$FORM_ACTION(prefix$9);
|
||||
formAction$jscomp$1 = customFields.action || "";
|
||||
formEncType$jscomp$1 = customFields.encType;
|
||||
formMethod$jscomp$1 = customFields.method;
|
||||
formTarget$jscomp$1 = customFields.target;
|
||||
formData$jscomp$1 = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else
|
||||
target$jscomp$0.push(" ", "action", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget$jscomp$1 =
|
||||
formMethod$jscomp$1 =
|
||||
formEncType$jscomp$1 =
|
||||
formAction$jscomp$1 =
|
||||
null),
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
null != formAction$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "action", formAction$jscomp$1);
|
||||
null != formEncType$jscomp$1 &&
|
||||
@@ -1081,6 +1135,12 @@ function pushStartInstance(
|
||||
null != formTarget$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "target", formTarget$jscomp$1);
|
||||
target$jscomp$0.push(">");
|
||||
null !== formActionName &&
|
||||
(target$jscomp$0.push('<input type="hidden"'),
|
||||
pushStringAttribute(target$jscomp$0, "name", formActionName),
|
||||
target$jscomp$0.push("/>"),
|
||||
null !== formData$jscomp$1 &&
|
||||
formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));
|
||||
pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);
|
||||
if ("string" === typeof children$jscomp$3) {
|
||||
target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));
|
||||
@@ -1181,10 +1241,10 @@ function pushStartInstance(
|
||||
styleQueue.sheets.set(href, resource);
|
||||
hoistableState && hoistableState.stylesheets.add(resource);
|
||||
} else if (styleQueue) {
|
||||
var resource$8 = styleQueue.sheets.get(href);
|
||||
resource$8 &&
|
||||
var resource$10 = styleQueue.sheets.get(href);
|
||||
resource$10 &&
|
||||
hoistableState &&
|
||||
hoistableState.stylesheets.add(resource$8);
|
||||
hoistableState.stylesheets.add(resource$10);
|
||||
}
|
||||
textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
||||
JSCompiler_inline_result$jscomp$2 = null;
|
||||
@@ -1582,19 +1642,16 @@ function pushStartInstance(
|
||||
case "suppressHydrationWarning":
|
||||
break;
|
||||
case "className":
|
||||
enableCustomElementPropertySupport &&
|
||||
(attributeName = "class");
|
||||
attributeName = "class";
|
||||
default:
|
||||
if (
|
||||
isAttributeNameSafe(propKey$jscomp$9) &&
|
||||
"function" !== typeof propValue$jscomp$9 &&
|
||||
"symbol" !== typeof propValue$jscomp$9
|
||||
"symbol" !== typeof propValue$jscomp$9 &&
|
||||
!1 !== propValue$jscomp$9
|
||||
) {
|
||||
if (enableCustomElementPropertySupport)
|
||||
if (!1 === propValue$jscomp$9) continue;
|
||||
else if (!0 === propValue$jscomp$9)
|
||||
propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
if (!0 === propValue$jscomp$9) propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
target$jscomp$0.push(
|
||||
" ",
|
||||
attributeName,
|
||||
@@ -2476,16 +2533,16 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
"\x3c/script>"
|
||||
);
|
||||
bootstrapScriptContent = idPrefix + "P:";
|
||||
var JSCompiler_object_inline_segmentPrefix_1594 = idPrefix + "S:";
|
||||
var JSCompiler_object_inline_segmentPrefix_1604 = idPrefix + "S:";
|
||||
idPrefix += "B:";
|
||||
var JSCompiler_object_inline_preconnects_1608 = new Set(),
|
||||
JSCompiler_object_inline_fontPreloads_1609 = new Set(),
|
||||
JSCompiler_object_inline_highImagePreloads_1610 = new Set(),
|
||||
JSCompiler_object_inline_styles_1611 = new Map(),
|
||||
JSCompiler_object_inline_bootstrapScripts_1612 = new Set(),
|
||||
JSCompiler_object_inline_scripts_1613 = new Set(),
|
||||
JSCompiler_object_inline_bulkPreloads_1614 = new Set(),
|
||||
JSCompiler_object_inline_preloads_1615 = {
|
||||
var JSCompiler_object_inline_preconnects_1618 = new Set(),
|
||||
JSCompiler_object_inline_fontPreloads_1619 = new Set(),
|
||||
JSCompiler_object_inline_highImagePreloads_1620 = new Set(),
|
||||
JSCompiler_object_inline_styles_1621 = new Map(),
|
||||
JSCompiler_object_inline_bootstrapScripts_1622 = new Set(),
|
||||
JSCompiler_object_inline_scripts_1623 = new Set(),
|
||||
JSCompiler_object_inline_bulkPreloads_1624 = new Set(),
|
||||
JSCompiler_object_inline_preloads_1625 = {
|
||||
images: new Map(),
|
||||
stylesheets: new Map(),
|
||||
scripts: new Map(),
|
||||
@@ -2522,7 +2579,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
scriptConfig.moduleScriptResources[href] = null;
|
||||
scriptConfig = [];
|
||||
pushLinkImpl(scriptConfig, props);
|
||||
JSCompiler_object_inline_bootstrapScripts_1612.add(scriptConfig);
|
||||
JSCompiler_object_inline_bootstrapScripts_1622.add(scriptConfig);
|
||||
bootstrapChunks.push('<script src="', escapeTextForBrowser(src));
|
||||
"string" === typeof integrity &&
|
||||
bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity));
|
||||
@@ -2563,7 +2620,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
(props.moduleScriptResources[scriptConfig] = null),
|
||||
(props = []),
|
||||
pushLinkImpl(props, integrity),
|
||||
JSCompiler_object_inline_bootstrapScripts_1612.add(props),
|
||||
JSCompiler_object_inline_bootstrapScripts_1622.add(props),
|
||||
bootstrapChunks.push(
|
||||
'<script type="module" src="',
|
||||
escapeTextForBrowser(i)
|
||||
@@ -2578,7 +2635,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
bootstrapChunks.push('" async="">\x3c/script>');
|
||||
return {
|
||||
placeholderPrefix: bootstrapScriptContent,
|
||||
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1594,
|
||||
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1604,
|
||||
boundaryPrefix: idPrefix,
|
||||
startInlineScript: "<script>",
|
||||
htmlChunks: null,
|
||||
@@ -2598,14 +2655,14 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
charsetChunks: [],
|
||||
viewportChunks: [],
|
||||
hoistableChunks: [],
|
||||
preconnects: JSCompiler_object_inline_preconnects_1608,
|
||||
fontPreloads: JSCompiler_object_inline_fontPreloads_1609,
|
||||
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1610,
|
||||
styles: JSCompiler_object_inline_styles_1611,
|
||||
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1612,
|
||||
scripts: JSCompiler_object_inline_scripts_1613,
|
||||
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1614,
|
||||
preloads: JSCompiler_object_inline_preloads_1615,
|
||||
preconnects: JSCompiler_object_inline_preconnects_1618,
|
||||
fontPreloads: JSCompiler_object_inline_fontPreloads_1619,
|
||||
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1620,
|
||||
styles: JSCompiler_object_inline_styles_1621,
|
||||
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1622,
|
||||
scripts: JSCompiler_object_inline_scripts_1623,
|
||||
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1624,
|
||||
preloads: JSCompiler_object_inline_preloads_1625,
|
||||
stylesToHoist: !1,
|
||||
generateStaticMarkup: generateStaticMarkup
|
||||
};
|
||||
@@ -2738,16 +2795,16 @@ function describeNativeComponentFrame(fn, construct) {
|
||||
} else {
|
||||
try {
|
||||
Fake.call();
|
||||
} catch (x$17) {
|
||||
control = x$17;
|
||||
} catch (x$19) {
|
||||
control = x$19;
|
||||
}
|
||||
fn.call(Fake.prototype);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Error();
|
||||
} catch (x$18) {
|
||||
control = x$18;
|
||||
} catch (x$20) {
|
||||
control = x$20;
|
||||
}
|
||||
(Fake = fn()) &&
|
||||
"function" === typeof Fake.catch &&
|
||||
@@ -3149,6 +3206,10 @@ function throwOnUseEffectEventCall() {
|
||||
function unsupportedStartTransition() {
|
||||
throw Error(formatProdErrorMessage(394));
|
||||
}
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return sharedNotPendingObject;
|
||||
}
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw Error(formatProdErrorMessage(479));
|
||||
}
|
||||
@@ -3209,11 +3270,11 @@ function useFormState(action, initialState, permalink) {
|
||||
});
|
||||
return [initialState, action];
|
||||
}
|
||||
var boundAction$23 = action.bind(null, initialState);
|
||||
var boundAction$25 = action.bind(null, initialState);
|
||||
return [
|
||||
initialState,
|
||||
function (payload) {
|
||||
boundAction$23(payload);
|
||||
boundAction$25(payload);
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -3315,6 +3376,9 @@ var HooksDispatcher = {
|
||||
return data;
|
||||
}
|
||||
};
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus);
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcher.useOptimistic = useOptimistic),
|
||||
(HooksDispatcher.useFormState = useFormState));
|
||||
@@ -4544,15 +4608,15 @@ function renderNode(request, task, node, childIndex) {
|
||||
chunkLength = segment.chunks.length;
|
||||
try {
|
||||
return renderNodeDestructive(request, task, node, childIndex);
|
||||
} catch (thrownValue$38) {
|
||||
} catch (thrownValue$40) {
|
||||
if (
|
||||
(resetHooksState(),
|
||||
(segment.children.length = childrenLength),
|
||||
(segment.chunks.length = chunkLength),
|
||||
(node =
|
||||
thrownValue$38 === SuspenseException
|
||||
thrownValue$40 === SuspenseException
|
||||
? getSuspendedThenable()
|
||||
: thrownValue$38),
|
||||
: thrownValue$40),
|
||||
"object" === typeof node &&
|
||||
null !== node &&
|
||||
"function" === typeof node.then)
|
||||
@@ -5395,11 +5459,11 @@ function flushCompletedQueues(request, destination) {
|
||||
completedBoundaries.splice(0, i);
|
||||
var partialBoundaries = request.partialBoundaries;
|
||||
for (i = 0; i < partialBoundaries.length; i++) {
|
||||
var boundary$42 = partialBoundaries[i];
|
||||
var boundary$44 = partialBoundaries[i];
|
||||
a: {
|
||||
clientRenderedBoundaries = request;
|
||||
boundary = destination;
|
||||
var completedSegments = boundary$42.completedSegments;
|
||||
var completedSegments = boundary$44.completedSegments;
|
||||
for (
|
||||
resumableState$jscomp$0 = 0;
|
||||
resumableState$jscomp$0 < completedSegments.length;
|
||||
@@ -5409,7 +5473,7 @@ function flushCompletedQueues(request, destination) {
|
||||
!flushPartiallyCompletedSegment(
|
||||
clientRenderedBoundaries,
|
||||
boundary,
|
||||
boundary$42,
|
||||
boundary$44,
|
||||
completedSegments[resumableState$jscomp$0]
|
||||
)
|
||||
) {
|
||||
@@ -5421,7 +5485,7 @@ function flushCompletedQueues(request, destination) {
|
||||
completedSegments.splice(0, resumableState$jscomp$0);
|
||||
JSCompiler_inline_result = writeHoistablesForBoundary(
|
||||
boundary,
|
||||
boundary$42.contentState,
|
||||
boundary$44.contentState,
|
||||
clientRenderedBoundaries.renderState
|
||||
);
|
||||
}
|
||||
@@ -5495,8 +5559,8 @@ function abort(request, reason) {
|
||||
}
|
||||
null !== request.destination &&
|
||||
flushCompletedQueues(request, request.destination);
|
||||
} catch (error$44) {
|
||||
logRecoverableError(request, error$44, {}), fatalError(request, error$44);
|
||||
} catch (error$46) {
|
||||
logRecoverableError(request, error$46, {}), fatalError(request, error$46);
|
||||
}
|
||||
}
|
||||
function onError() {}
|
||||
@@ -5570,4 +5634,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-3af911e0";
|
||||
exports.version = "18.3.0-www-classic-93e9ff3e";
|
||||
|
||||
@@ -108,9 +108,8 @@ function murmurhash3_32_gc(key, seed) {
|
||||
var assign = Object.assign,
|
||||
dynamicFeatureFlags = require("ReactFeatureFlags"),
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
|
||||
hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
@@ -262,6 +261,12 @@ function sanitizeURL(url) {
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
sharedNotPendingObject = {
|
||||
pending: !1,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
},
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -405,7 +410,11 @@ function pushStringAttribute(target, name, value) {
|
||||
"boolean" !== typeof value &&
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
escapeTextForBrowser(
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
}
|
||||
var actionJavaScriptURL = escapeTextForBrowser(
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
);
|
||||
function pushAdditionalFormField(value, key) {
|
||||
@@ -425,12 +434,27 @@ function pushFormActionAttribute(
|
||||
formTarget,
|
||||
name
|
||||
) {
|
||||
var formData = null;
|
||||
enableFormActions &&
|
||||
"function" === typeof formAction &&
|
||||
("function" === typeof formAction.$$FORM_ACTION
|
||||
? ((formEncType = makeFormFieldPrefix(resumableState)),
|
||||
(resumableState = formAction.$$FORM_ACTION(formEncType)),
|
||||
(name = resumableState.name),
|
||||
(formAction = resumableState.action || ""),
|
||||
(formEncType = resumableState.encType),
|
||||
(formMethod = resumableState.method),
|
||||
(formTarget = resumableState.target),
|
||||
(formData = resumableState.data))
|
||||
: (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget = formMethod = formEncType = formAction = name = null),
|
||||
injectFormReplayingRuntime(resumableState, renderState)));
|
||||
null != name && pushAttribute(target, "name", name);
|
||||
null != formAction && pushAttribute(target, "formAction", formAction);
|
||||
null != formEncType && pushAttribute(target, "formEncType", formEncType);
|
||||
null != formMethod && pushAttribute(target, "formMethod", formMethod);
|
||||
null != formTarget && pushAttribute(target, "formTarget", formTarget);
|
||||
return null;
|
||||
return formData;
|
||||
}
|
||||
function pushAttribute(target, name, value) {
|
||||
switch (name) {
|
||||
@@ -590,8 +614,8 @@ function pushAttribute(target, name, value) {
|
||||
case "symbol":
|
||||
return;
|
||||
case "boolean":
|
||||
var prefix$7 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$7 && "aria-" !== prefix$7) return;
|
||||
var prefix$8 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
|
||||
}
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
@@ -613,6 +637,16 @@ function flattenOptionChildren(children) {
|
||||
});
|
||||
return content;
|
||||
}
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
0 !== (resumableState.instructions & 16) ||
|
||||
renderState.externalRuntimeScript ||
|
||||
((resumableState.instructions |= 16),
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});',
|
||||
"\x3c/script>"
|
||||
));
|
||||
}
|
||||
function pushLinkImpl(target, props) {
|
||||
target.push(startChunkForTag("link"));
|
||||
for (var propKey in props)
|
||||
@@ -1072,6 +1106,26 @@ function pushStartInstance(
|
||||
);
|
||||
}
|
||||
}
|
||||
var formData$jscomp$1 = null,
|
||||
formActionName = null;
|
||||
if (enableFormActions && "function" === typeof formAction$jscomp$1)
|
||||
if ("function" === typeof formAction$jscomp$1.$$FORM_ACTION) {
|
||||
var prefix$9 = makeFormFieldPrefix(resumableState),
|
||||
customFields = formAction$jscomp$1.$$FORM_ACTION(prefix$9);
|
||||
formAction$jscomp$1 = customFields.action || "";
|
||||
formEncType$jscomp$1 = customFields.encType;
|
||||
formMethod$jscomp$1 = customFields.method;
|
||||
formTarget$jscomp$1 = customFields.target;
|
||||
formData$jscomp$1 = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else
|
||||
target$jscomp$0.push(" ", "action", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget$jscomp$1 =
|
||||
formMethod$jscomp$1 =
|
||||
formEncType$jscomp$1 =
|
||||
formAction$jscomp$1 =
|
||||
null),
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
null != formAction$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "action", formAction$jscomp$1);
|
||||
null != formEncType$jscomp$1 &&
|
||||
@@ -1081,6 +1135,12 @@ function pushStartInstance(
|
||||
null != formTarget$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "target", formTarget$jscomp$1);
|
||||
target$jscomp$0.push(">");
|
||||
null !== formActionName &&
|
||||
(target$jscomp$0.push('<input type="hidden"'),
|
||||
pushStringAttribute(target$jscomp$0, "name", formActionName),
|
||||
target$jscomp$0.push("/>"),
|
||||
null !== formData$jscomp$1 &&
|
||||
formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));
|
||||
pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);
|
||||
if ("string" === typeof children$jscomp$3) {
|
||||
target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));
|
||||
@@ -1181,10 +1241,10 @@ function pushStartInstance(
|
||||
styleQueue.sheets.set(href, resource);
|
||||
hoistableState && hoistableState.stylesheets.add(resource);
|
||||
} else if (styleQueue) {
|
||||
var resource$8 = styleQueue.sheets.get(href);
|
||||
resource$8 &&
|
||||
var resource$10 = styleQueue.sheets.get(href);
|
||||
resource$10 &&
|
||||
hoistableState &&
|
||||
hoistableState.stylesheets.add(resource$8);
|
||||
hoistableState.stylesheets.add(resource$10);
|
||||
}
|
||||
textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
||||
JSCompiler_inline_result$jscomp$2 = null;
|
||||
@@ -1582,19 +1642,16 @@ function pushStartInstance(
|
||||
case "suppressHydrationWarning":
|
||||
break;
|
||||
case "className":
|
||||
enableCustomElementPropertySupport &&
|
||||
(attributeName = "class");
|
||||
attributeName = "class";
|
||||
default:
|
||||
if (
|
||||
isAttributeNameSafe(propKey$jscomp$9) &&
|
||||
"function" !== typeof propValue$jscomp$9 &&
|
||||
"symbol" !== typeof propValue$jscomp$9
|
||||
"symbol" !== typeof propValue$jscomp$9 &&
|
||||
!1 !== propValue$jscomp$9
|
||||
) {
|
||||
if (enableCustomElementPropertySupport)
|
||||
if (!1 === propValue$jscomp$9) continue;
|
||||
else if (!0 === propValue$jscomp$9)
|
||||
propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
if (!0 === propValue$jscomp$9) propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
target$jscomp$0.push(
|
||||
" ",
|
||||
attributeName,
|
||||
@@ -2476,16 +2533,16 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
"\x3c/script>"
|
||||
);
|
||||
bootstrapScriptContent = idPrefix + "P:";
|
||||
var JSCompiler_object_inline_segmentPrefix_1581 = idPrefix + "S:";
|
||||
var JSCompiler_object_inline_segmentPrefix_1591 = idPrefix + "S:";
|
||||
idPrefix += "B:";
|
||||
var JSCompiler_object_inline_preconnects_1595 = new Set(),
|
||||
JSCompiler_object_inline_fontPreloads_1596 = new Set(),
|
||||
JSCompiler_object_inline_highImagePreloads_1597 = new Set(),
|
||||
JSCompiler_object_inline_styles_1598 = new Map(),
|
||||
JSCompiler_object_inline_bootstrapScripts_1599 = new Set(),
|
||||
JSCompiler_object_inline_scripts_1600 = new Set(),
|
||||
JSCompiler_object_inline_bulkPreloads_1601 = new Set(),
|
||||
JSCompiler_object_inline_preloads_1602 = {
|
||||
var JSCompiler_object_inline_preconnects_1605 = new Set(),
|
||||
JSCompiler_object_inline_fontPreloads_1606 = new Set(),
|
||||
JSCompiler_object_inline_highImagePreloads_1607 = new Set(),
|
||||
JSCompiler_object_inline_styles_1608 = new Map(),
|
||||
JSCompiler_object_inline_bootstrapScripts_1609 = new Set(),
|
||||
JSCompiler_object_inline_scripts_1610 = new Set(),
|
||||
JSCompiler_object_inline_bulkPreloads_1611 = new Set(),
|
||||
JSCompiler_object_inline_preloads_1612 = {
|
||||
images: new Map(),
|
||||
stylesheets: new Map(),
|
||||
scripts: new Map(),
|
||||
@@ -2522,7 +2579,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
scriptConfig.moduleScriptResources[href] = null;
|
||||
scriptConfig = [];
|
||||
pushLinkImpl(scriptConfig, props);
|
||||
JSCompiler_object_inline_bootstrapScripts_1599.add(scriptConfig);
|
||||
JSCompiler_object_inline_bootstrapScripts_1609.add(scriptConfig);
|
||||
bootstrapChunks.push('<script src="', escapeTextForBrowser(src));
|
||||
"string" === typeof integrity &&
|
||||
bootstrapChunks.push('" integrity="', escapeTextForBrowser(integrity));
|
||||
@@ -2563,7 +2620,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
(props.moduleScriptResources[scriptConfig] = null),
|
||||
(props = []),
|
||||
pushLinkImpl(props, integrity),
|
||||
JSCompiler_object_inline_bootstrapScripts_1599.add(props),
|
||||
JSCompiler_object_inline_bootstrapScripts_1609.add(props),
|
||||
bootstrapChunks.push(
|
||||
'<script type="module" src="',
|
||||
escapeTextForBrowser(i)
|
||||
@@ -2578,7 +2635,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
bootstrapChunks.push('" async="">\x3c/script>');
|
||||
return {
|
||||
placeholderPrefix: bootstrapScriptContent,
|
||||
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1581,
|
||||
segmentPrefix: JSCompiler_object_inline_segmentPrefix_1591,
|
||||
boundaryPrefix: idPrefix,
|
||||
startInlineScript: "<script>",
|
||||
htmlChunks: null,
|
||||
@@ -2598,14 +2655,14 @@ function createRenderState(resumableState, generateStaticMarkup) {
|
||||
charsetChunks: [],
|
||||
viewportChunks: [],
|
||||
hoistableChunks: [],
|
||||
preconnects: JSCompiler_object_inline_preconnects_1595,
|
||||
fontPreloads: JSCompiler_object_inline_fontPreloads_1596,
|
||||
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1597,
|
||||
styles: JSCompiler_object_inline_styles_1598,
|
||||
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1599,
|
||||
scripts: JSCompiler_object_inline_scripts_1600,
|
||||
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1601,
|
||||
preloads: JSCompiler_object_inline_preloads_1602,
|
||||
preconnects: JSCompiler_object_inline_preconnects_1605,
|
||||
fontPreloads: JSCompiler_object_inline_fontPreloads_1606,
|
||||
highImagePreloads: JSCompiler_object_inline_highImagePreloads_1607,
|
||||
styles: JSCompiler_object_inline_styles_1608,
|
||||
bootstrapScripts: JSCompiler_object_inline_bootstrapScripts_1609,
|
||||
scripts: JSCompiler_object_inline_scripts_1610,
|
||||
bulkPreloads: JSCompiler_object_inline_bulkPreloads_1611,
|
||||
preloads: JSCompiler_object_inline_preloads_1612,
|
||||
stylesToHoist: !1,
|
||||
generateStaticMarkup: generateStaticMarkup
|
||||
};
|
||||
@@ -2738,16 +2795,16 @@ function describeNativeComponentFrame(fn, construct) {
|
||||
} else {
|
||||
try {
|
||||
Fake.call();
|
||||
} catch (x$17) {
|
||||
control = x$17;
|
||||
} catch (x$19) {
|
||||
control = x$19;
|
||||
}
|
||||
fn.call(Fake.prototype);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Error();
|
||||
} catch (x$18) {
|
||||
control = x$18;
|
||||
} catch (x$20) {
|
||||
control = x$20;
|
||||
}
|
||||
(Fake = fn()) &&
|
||||
"function" === typeof Fake.catch &&
|
||||
@@ -3141,6 +3198,10 @@ function throwOnUseEffectEventCall() {
|
||||
function unsupportedStartTransition() {
|
||||
throw Error(formatProdErrorMessage(394));
|
||||
}
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return sharedNotPendingObject;
|
||||
}
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw Error(formatProdErrorMessage(479));
|
||||
}
|
||||
@@ -3201,11 +3262,11 @@ function useFormState(action, initialState, permalink) {
|
||||
});
|
||||
return [initialState, action];
|
||||
}
|
||||
var boundAction$23 = action.bind(null, initialState);
|
||||
var boundAction$25 = action.bind(null, initialState);
|
||||
return [
|
||||
initialState,
|
||||
function (payload) {
|
||||
boundAction$23(payload);
|
||||
boundAction$25(payload);
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -3307,6 +3368,9 @@ var HooksDispatcher = {
|
||||
return data;
|
||||
}
|
||||
};
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus);
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcher.useOptimistic = useOptimistic),
|
||||
(HooksDispatcher.useFormState = useFormState));
|
||||
@@ -4503,15 +4567,15 @@ function renderNode(request, task, node, childIndex) {
|
||||
chunkLength = segment.chunks.length;
|
||||
try {
|
||||
return renderNodeDestructive(request, task, node, childIndex);
|
||||
} catch (thrownValue$38) {
|
||||
} catch (thrownValue$40) {
|
||||
if (
|
||||
(resetHooksState(),
|
||||
(segment.children.length = childrenLength),
|
||||
(segment.chunks.length = chunkLength),
|
||||
(node =
|
||||
thrownValue$38 === SuspenseException
|
||||
thrownValue$40 === SuspenseException
|
||||
? getSuspendedThenable()
|
||||
: thrownValue$38),
|
||||
: thrownValue$40),
|
||||
"object" === typeof node &&
|
||||
null !== node &&
|
||||
"function" === typeof node.then)
|
||||
@@ -5354,11 +5418,11 @@ function flushCompletedQueues(request, destination) {
|
||||
completedBoundaries.splice(0, i);
|
||||
var partialBoundaries = request.partialBoundaries;
|
||||
for (i = 0; i < partialBoundaries.length; i++) {
|
||||
var boundary$42 = partialBoundaries[i];
|
||||
var boundary$44 = partialBoundaries[i];
|
||||
a: {
|
||||
clientRenderedBoundaries = request;
|
||||
boundary = destination;
|
||||
var completedSegments = boundary$42.completedSegments;
|
||||
var completedSegments = boundary$44.completedSegments;
|
||||
for (
|
||||
resumableState$jscomp$0 = 0;
|
||||
resumableState$jscomp$0 < completedSegments.length;
|
||||
@@ -5368,7 +5432,7 @@ function flushCompletedQueues(request, destination) {
|
||||
!flushPartiallyCompletedSegment(
|
||||
clientRenderedBoundaries,
|
||||
boundary,
|
||||
boundary$42,
|
||||
boundary$44,
|
||||
completedSegments[resumableState$jscomp$0]
|
||||
)
|
||||
) {
|
||||
@@ -5380,7 +5444,7 @@ function flushCompletedQueues(request, destination) {
|
||||
completedSegments.splice(0, resumableState$jscomp$0);
|
||||
JSCompiler_inline_result = writeHoistablesForBoundary(
|
||||
boundary,
|
||||
boundary$42.contentState,
|
||||
boundary$44.contentState,
|
||||
clientRenderedBoundaries.renderState
|
||||
);
|
||||
}
|
||||
@@ -5454,8 +5518,8 @@ function abort(request, reason) {
|
||||
}
|
||||
null !== request.destination &&
|
||||
flushCompletedQueues(request, request.destination);
|
||||
} catch (error$44) {
|
||||
logRecoverableError(request, error$44, {}), fatalError(request, error$44);
|
||||
} catch (error$46) {
|
||||
logRecoverableError(request, error$46, {}), fatalError(request, error$46);
|
||||
}
|
||||
}
|
||||
function onError() {}
|
||||
@@ -5529,4 +5593,4 @@ exports.renderToString = function (children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-f5721a9d";
|
||||
exports.version = "18.3.0-www-modern-0cda04ef";
|
||||
|
||||
@@ -343,9 +343,8 @@ if (__DEV__) {
|
||||
var dynamicFeatureFlags = require("ReactFeatureFlags");
|
||||
|
||||
var enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg;
|
||||
// On WWW, true is used for a new modern build.
|
||||
@@ -1356,6 +1355,23 @@ if (__DEV__) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (enableFormActions) {
|
||||
// Actions are special because unlike events they can have other value types.
|
||||
if (typeof value === "function") {
|
||||
if (tagName === "form" && name === "action") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "input" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === "button" && name === "formAction") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} // We can't rely on the event system being injected on the server.
|
||||
|
||||
if (eventRegistry != null) {
|
||||
var registrationNameDependencies =
|
||||
eventRegistry.registrationNameDependencies,
|
||||
@@ -1504,10 +1520,9 @@ if (__DEV__) {
|
||||
|
||||
case "innerText": // Properties
|
||||
|
||||
case "textContent":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
return true;
|
||||
}
|
||||
case "textContent": {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
switch (typeof value) {
|
||||
@@ -1995,6 +2010,8 @@ if (__DEV__) {
|
||||
'$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};';
|
||||
var completeSegment =
|
||||
"$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};";
|
||||
var formReplaying =
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});';
|
||||
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return thing === null
|
||||
@@ -2009,6 +2026,16 @@ if (__DEV__) {
|
||||
var ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// same object across all transitions.
|
||||
|
||||
var sharedNotPendingObject = {
|
||||
pending: false,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
};
|
||||
var NotPending = Object.freeze(sharedNotPendingObject);
|
||||
|
||||
var ReactDOMSharedInternals =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
@@ -2042,6 +2069,9 @@ if (__DEV__) {
|
||||
var SentStyleInsertionFunction =
|
||||
/* */
|
||||
8;
|
||||
var SentFormReplayingRuntime =
|
||||
/* */
|
||||
16; // Per request, global state that is not contextual to the rendering subtree.
|
||||
// This cannot be resumed and therefore should only contain things that are
|
||||
// temporary working state or are never used in the prerender pass.
|
||||
// Credentials here are things that affect whether a browser will make a request
|
||||
@@ -2748,9 +2778,14 @@ if (__DEV__) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
} // Since this will likely be repeated a lot in the HTML, we use a more concise message
|
||||
// than on the client and hopefully it's googleable.
|
||||
|
||||
stringToPrecomputedChunk(
|
||||
var actionJavaScriptURL = stringToPrecomputedChunk(
|
||||
escapeTextForBrowser(
|
||||
// eslint-disable-next-line no-script-url
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
@@ -2795,6 +2830,75 @@ if (__DEV__) {
|
||||
) {
|
||||
var formData = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (name !== null && !didWarnFormActionName) {
|
||||
didWarnFormActionName = true;
|
||||
|
||||
error(
|
||||
'Cannot specify a "name" prop for a button that specifies a function as a formAction. ' +
|
||||
"React needs it to encode which action should be invoked. It will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formEncType or formMethod for a button that specifies a " +
|
||||
"function as a formAction. React provides those automatically. They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a formTarget for a button that specifies a function as a formAction. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
name = customFields.name;
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("formAction"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
name = null;
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
pushAttribute(target, "name", name);
|
||||
}
|
||||
@@ -3194,6 +3298,9 @@ if (__DEV__) {
|
||||
var didWarnInvalidOptionInnerHTML = false;
|
||||
var didWarnSelectedSetOnOption = false;
|
||||
var didWarnFormActionType = false;
|
||||
var didWarnFormActionName = false;
|
||||
var didWarnFormActionTarget = false;
|
||||
var didWarnFormActionMethod = false;
|
||||
|
||||
function checkSelectProp(props, propName) {
|
||||
{
|
||||
@@ -3425,6 +3532,26 @@ if (__DEV__) {
|
||||
return children;
|
||||
}
|
||||
|
||||
var formReplayingRuntimeScript = stringToPrecomputedChunk(formReplaying);
|
||||
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
// If we haven't sent it yet, inject the runtime that tracks submitted JS actions
|
||||
// for later replaying by Fiber. If we use an external runtime, we don't need
|
||||
// to emit anything. It's always used.
|
||||
if (
|
||||
(resumableState.instructions & SentFormReplayingRuntime) ===
|
||||
NothingSent &&
|
||||
!renderState.externalRuntimeScript
|
||||
) {
|
||||
resumableState.instructions |= SentFormReplayingRuntime;
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
formReplayingRuntimeScript,
|
||||
endInlineScript
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var formStateMarkerIsMatching = stringToPrecomputedChunk("<!--F!-->");
|
||||
var formStateMarkerIsNotMatching = stringToPrecomputedChunk("<!--F-->");
|
||||
function pushFormStateMarkerIsMatching(target) {
|
||||
@@ -3483,6 +3610,69 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
var formData = null;
|
||||
var formActionName = null;
|
||||
|
||||
if (enableFormActions && typeof formAction === "function") {
|
||||
// Function form actions cannot control the form properties
|
||||
{
|
||||
if (
|
||||
(formEncType !== null || formMethod !== null) &&
|
||||
!didWarnFormActionMethod
|
||||
) {
|
||||
didWarnFormActionMethod = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a encType or method for a form that specifies a " +
|
||||
"function as the action. React provides those automatically. " +
|
||||
"They will get overridden."
|
||||
);
|
||||
}
|
||||
|
||||
if (formTarget !== null && !didWarnFormActionTarget) {
|
||||
didWarnFormActionTarget = true;
|
||||
|
||||
error(
|
||||
"Cannot specify a target for a form that specifies a function as the action. " +
|
||||
"The function will always be executed in the same window."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
var customAction = formAction.$$FORM_ACTION;
|
||||
|
||||
if (typeof customAction === "function") {
|
||||
// This action has a custom progressive enhancement form that can submit the form
|
||||
// back to the server if it's invoked before hydration. Such as a Server Action.
|
||||
var prefix = makeFormFieldPrefix(resumableState);
|
||||
var customFields = formAction.$$FORM_ACTION(prefix);
|
||||
formAction = customFields.action || "";
|
||||
formEncType = customFields.encType;
|
||||
formMethod = customFields.method;
|
||||
formTarget = customFields.target;
|
||||
formData = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else {
|
||||
// Set a javascript URL that doesn't do anything. We don't expect this to be invoked
|
||||
// because we'll preventDefault in the Fizz runtime, but it can happen if a form is
|
||||
// manually submitted or if someone calls stopPropagation before React gets the event.
|
||||
// If CSP is used to block javascript: URLs that's fine too. It just won't show this
|
||||
// error message but the URL will be logged.
|
||||
target.push(
|
||||
attributeSeparator,
|
||||
stringToChunk("action"),
|
||||
attributeAssign,
|
||||
actionJavaScriptURL,
|
||||
attributeEnd
|
||||
);
|
||||
formAction = null;
|
||||
formEncType = null;
|
||||
formMethod = null;
|
||||
formTarget = null;
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
}
|
||||
}
|
||||
|
||||
if (formAction != null) {
|
||||
pushAttribute(target, "action", formAction);
|
||||
}
|
||||
@@ -3501,6 +3691,13 @@ if (__DEV__) {
|
||||
|
||||
target.push(endOfStartTag);
|
||||
|
||||
if (formActionName !== null) {
|
||||
target.push(startHiddenInputChunk);
|
||||
pushStringAttribute(target, "name", formActionName);
|
||||
target.push(endOfStartTagSelfClosing);
|
||||
pushAdditionalFormFields(target, formData);
|
||||
}
|
||||
|
||||
pushInnerHTML(target, innerHTML, children);
|
||||
|
||||
if (typeof children === "string") {
|
||||
@@ -4951,12 +5148,11 @@ if (__DEV__) {
|
||||
// Ignored. These are built-in to React on the client.
|
||||
break;
|
||||
|
||||
case "className":
|
||||
if (enableCustomElementPropertySupport) {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
case "className": {
|
||||
// className gets rendered as class on the client, so it should be
|
||||
// rendered as class on the server.
|
||||
attributeName = "class";
|
||||
}
|
||||
|
||||
// intentional fallthrough
|
||||
|
||||
@@ -4966,7 +5162,7 @@ if (__DEV__) {
|
||||
typeof propValue !== "function" &&
|
||||
typeof propValue !== "symbol"
|
||||
) {
|
||||
if (enableCustomElementPropertySupport) {
|
||||
{
|
||||
if (propValue === false) {
|
||||
continue;
|
||||
} else if (propValue === true) {
|
||||
@@ -5171,7 +5367,7 @@ if (__DEV__) {
|
||||
return pushStartButton(target, props, resumableState, renderState);
|
||||
|
||||
case "form":
|
||||
return pushStartForm(target, props);
|
||||
return pushStartForm(target, props, resumableState, renderState);
|
||||
|
||||
case "menuitem":
|
||||
return pushStartMenuItem(target, props);
|
||||
@@ -7779,6 +7975,7 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
}
|
||||
var NotPendingTransition = NotPending;
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
@@ -10041,6 +10238,11 @@ if (__DEV__) {
|
||||
return [false, unsupportedStartTransition];
|
||||
}
|
||||
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return NotPendingTransition;
|
||||
}
|
||||
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw new Error("Cannot update optimistic state while rendering.");
|
||||
}
|
||||
@@ -10284,6 +10486,10 @@ if (__DEV__) {
|
||||
HooksDispatcher.useMemoCache = useMemoCache;
|
||||
}
|
||||
|
||||
if (enableFormActions && enableAsyncActions) {
|
||||
HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus;
|
||||
}
|
||||
|
||||
if (enableAsyncActions) {
|
||||
HooksDispatcher.useOptimistic = useOptimistic;
|
||||
HooksDispatcher.useFormState = useFormState;
|
||||
|
||||
@@ -100,9 +100,8 @@ function writeChunkAndReturn(destination, chunk) {
|
||||
var assign = Object.assign,
|
||||
dynamicFeatureFlags = require("ReactFeatureFlags"),
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableCustomElementPropertySupport =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
enableFormActions = dynamicFeatureFlags.enableFormActions,
|
||||
enableUseDeferredValueInitialArg =
|
||||
dynamicFeatureFlags.enableUseDeferredValueInitialArg,
|
||||
hasOwnProperty = Object.prototype.hasOwnProperty,
|
||||
@@ -254,6 +253,12 @@ function sanitizeURL(url) {
|
||||
var isArrayImpl = Array.isArray,
|
||||
ReactSharedInternals =
|
||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
|
||||
sharedNotPendingObject = {
|
||||
pending: !1,
|
||||
data: null,
|
||||
method: null,
|
||||
action: null
|
||||
},
|
||||
ReactDOMCurrentDispatcher =
|
||||
ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
|
||||
ReactDOMServerDispatcher = {
|
||||
@@ -377,7 +382,11 @@ function pushStringAttribute(target, name, value) {
|
||||
"boolean" !== typeof value &&
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
escapeTextForBrowser(
|
||||
function makeFormFieldPrefix(resumableState) {
|
||||
var id = resumableState.nextFormID++;
|
||||
return resumableState.idPrefix + id;
|
||||
}
|
||||
var actionJavaScriptURL = escapeTextForBrowser(
|
||||
"javascript:throw new Error('A React form was unexpectedly submitted.')"
|
||||
);
|
||||
function pushAdditionalFormField(value, key) {
|
||||
@@ -400,12 +409,27 @@ function pushFormActionAttribute(
|
||||
formTarget,
|
||||
name
|
||||
) {
|
||||
var formData = null;
|
||||
enableFormActions &&
|
||||
"function" === typeof formAction &&
|
||||
("function" === typeof formAction.$$FORM_ACTION
|
||||
? ((formEncType = makeFormFieldPrefix(resumableState)),
|
||||
(resumableState = formAction.$$FORM_ACTION(formEncType)),
|
||||
(name = resumableState.name),
|
||||
(formAction = resumableState.action || ""),
|
||||
(formEncType = resumableState.encType),
|
||||
(formMethod = resumableState.method),
|
||||
(formTarget = resumableState.target),
|
||||
(formData = resumableState.data))
|
||||
: (target.push(" ", "formAction", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget = formMethod = formEncType = formAction = name = null),
|
||||
injectFormReplayingRuntime(resumableState, renderState)));
|
||||
null != name && pushAttribute(target, "name", name);
|
||||
null != formAction && pushAttribute(target, "formAction", formAction);
|
||||
null != formEncType && pushAttribute(target, "formEncType", formEncType);
|
||||
null != formMethod && pushAttribute(target, "formMethod", formMethod);
|
||||
null != formTarget && pushAttribute(target, "formTarget", formTarget);
|
||||
return null;
|
||||
return formData;
|
||||
}
|
||||
function pushAttribute(target, name, value) {
|
||||
switch (name) {
|
||||
@@ -565,8 +589,8 @@ function pushAttribute(target, name, value) {
|
||||
case "symbol":
|
||||
return;
|
||||
case "boolean":
|
||||
var prefix$7 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$7 && "aria-" !== prefix$7) return;
|
||||
var prefix$8 = name.toLowerCase().slice(0, 5);
|
||||
if ("data-" !== prefix$8 && "aria-" !== prefix$8) return;
|
||||
}
|
||||
target.push(" ", name, '="', escapeTextForBrowser(value), '"');
|
||||
}
|
||||
@@ -593,6 +617,16 @@ function flattenOptionChildren(children) {
|
||||
});
|
||||
return content;
|
||||
}
|
||||
function injectFormReplayingRuntime(resumableState, renderState) {
|
||||
0 !== (resumableState.instructions & 16) ||
|
||||
renderState.externalRuntimeScript ||
|
||||
((resumableState.instructions |= 16),
|
||||
renderState.bootstrapChunks.unshift(
|
||||
renderState.startInlineScript,
|
||||
'addEventListener("submit",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute("formAction");null!=f&&(e=f,b=null)}"javascript:throw new Error(\'A React form was unexpectedly submitted.\')"===e&&(a.preventDefault(),b?(a=document.createElement("input"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.getRootNode(),(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,\nd,b))}});',
|
||||
"\x3c/script>"
|
||||
));
|
||||
}
|
||||
function pushLinkImpl(target, props) {
|
||||
target.push(startChunkForTag("link"));
|
||||
for (var propKey in props)
|
||||
@@ -1063,6 +1097,26 @@ function pushStartInstance(
|
||||
);
|
||||
}
|
||||
}
|
||||
var formData$jscomp$1 = null,
|
||||
formActionName = null;
|
||||
if (enableFormActions && "function" === typeof formAction$jscomp$1)
|
||||
if ("function" === typeof formAction$jscomp$1.$$FORM_ACTION) {
|
||||
var prefix$9 = makeFormFieldPrefix(resumableState),
|
||||
customFields = formAction$jscomp$1.$$FORM_ACTION(prefix$9);
|
||||
formAction$jscomp$1 = customFields.action || "";
|
||||
formEncType$jscomp$1 = customFields.encType;
|
||||
formMethod$jscomp$1 = customFields.method;
|
||||
formTarget$jscomp$1 = customFields.target;
|
||||
formData$jscomp$1 = customFields.data;
|
||||
formActionName = customFields.name;
|
||||
} else
|
||||
target$jscomp$0.push(" ", "action", '="', actionJavaScriptURL, '"'),
|
||||
(formTarget$jscomp$1 =
|
||||
formMethod$jscomp$1 =
|
||||
formEncType$jscomp$1 =
|
||||
formAction$jscomp$1 =
|
||||
null),
|
||||
injectFormReplayingRuntime(resumableState, renderState);
|
||||
null != formAction$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "action", formAction$jscomp$1);
|
||||
null != formEncType$jscomp$1 &&
|
||||
@@ -1072,6 +1126,12 @@ function pushStartInstance(
|
||||
null != formTarget$jscomp$1 &&
|
||||
pushAttribute(target$jscomp$0, "target", formTarget$jscomp$1);
|
||||
target$jscomp$0.push(">");
|
||||
null !== formActionName &&
|
||||
(target$jscomp$0.push('<input type="hidden"'),
|
||||
pushStringAttribute(target$jscomp$0, "name", formActionName),
|
||||
target$jscomp$0.push("/>"),
|
||||
null !== formData$jscomp$1 &&
|
||||
formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));
|
||||
pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);
|
||||
if ("string" === typeof children$jscomp$3) {
|
||||
target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));
|
||||
@@ -1174,10 +1234,10 @@ function pushStartInstance(
|
||||
styleQueue.sheets.set(href, resource);
|
||||
hoistableState && hoistableState.stylesheets.add(resource);
|
||||
} else if (styleQueue) {
|
||||
var resource$8 = styleQueue.sheets.get(href);
|
||||
resource$8 &&
|
||||
var resource$10 = styleQueue.sheets.get(href);
|
||||
resource$10 &&
|
||||
hoistableState &&
|
||||
hoistableState.stylesheets.add(resource$8);
|
||||
hoistableState.stylesheets.add(resource$10);
|
||||
}
|
||||
textEmbedded && target$jscomp$0.push("\x3c!-- --\x3e");
|
||||
JSCompiler_inline_result$jscomp$2 = null;
|
||||
@@ -1580,19 +1640,16 @@ function pushStartInstance(
|
||||
case "suppressHydrationWarning":
|
||||
break;
|
||||
case "className":
|
||||
enableCustomElementPropertySupport &&
|
||||
(attributeName = "class");
|
||||
attributeName = "class";
|
||||
default:
|
||||
if (
|
||||
isAttributeNameSafe(propKey$jscomp$9) &&
|
||||
"function" !== typeof propValue$jscomp$9 &&
|
||||
"symbol" !== typeof propValue$jscomp$9
|
||||
"symbol" !== typeof propValue$jscomp$9 &&
|
||||
!1 !== propValue$jscomp$9
|
||||
) {
|
||||
if (enableCustomElementPropertySupport)
|
||||
if (!1 === propValue$jscomp$9) continue;
|
||||
else if (!0 === propValue$jscomp$9)
|
||||
propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
if (!0 === propValue$jscomp$9) propValue$jscomp$9 = "";
|
||||
else if ("object" === typeof propValue$jscomp$9) continue;
|
||||
target$jscomp$0.push(
|
||||
" ",
|
||||
attributeName,
|
||||
@@ -2598,16 +2655,16 @@ function describeNativeComponentFrame(fn, construct) {
|
||||
} else {
|
||||
try {
|
||||
Fake.call();
|
||||
} catch (x$17) {
|
||||
control = x$17;
|
||||
} catch (x$19) {
|
||||
control = x$19;
|
||||
}
|
||||
fn.call(Fake.prototype);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Error();
|
||||
} catch (x$18) {
|
||||
control = x$18;
|
||||
} catch (x$20) {
|
||||
control = x$20;
|
||||
}
|
||||
(Fake = fn()) &&
|
||||
"function" === typeof Fake.catch &&
|
||||
@@ -3026,6 +3083,10 @@ function throwOnUseEffectEventCall() {
|
||||
function unsupportedStartTransition() {
|
||||
throw Error("startTransition cannot be called during server rendering.");
|
||||
}
|
||||
function useHostTransitionStatus() {
|
||||
resolveCurrentlyRenderingComponent();
|
||||
return sharedNotPendingObject;
|
||||
}
|
||||
function unsupportedSetOptimisticState() {
|
||||
throw Error("Cannot update optimistic state while rendering.");
|
||||
}
|
||||
@@ -3086,11 +3147,11 @@ function useFormState(action, initialState, permalink) {
|
||||
});
|
||||
return [initialState, action];
|
||||
}
|
||||
var boundAction$23 = action.bind(null, initialState);
|
||||
var boundAction$25 = action.bind(null, initialState);
|
||||
return [
|
||||
initialState,
|
||||
function (payload) {
|
||||
boundAction$23(payload);
|
||||
boundAction$25(payload);
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -3198,6 +3259,9 @@ var HooksDispatcher = {
|
||||
return data;
|
||||
}
|
||||
};
|
||||
enableFormActions &&
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcher.useHostTransitionStatus = useHostTransitionStatus);
|
||||
enableAsyncActions &&
|
||||
((HooksDispatcher.useOptimistic = useOptimistic),
|
||||
(HooksDispatcher.useFormState = useFormState));
|
||||
@@ -4337,15 +4401,15 @@ function renderNode(request, task, node, childIndex) {
|
||||
chunkLength = segment.chunks.length;
|
||||
try {
|
||||
return renderNodeDestructive(request, task, node, childIndex);
|
||||
} catch (thrownValue$38) {
|
||||
} catch (thrownValue$40) {
|
||||
if (
|
||||
(resetHooksState(),
|
||||
(segment.children.length = childrenLength),
|
||||
(segment.chunks.length = chunkLength),
|
||||
(node =
|
||||
thrownValue$38 === SuspenseException
|
||||
thrownValue$40 === SuspenseException
|
||||
? getSuspendedThenable()
|
||||
: thrownValue$38),
|
||||
: thrownValue$40),
|
||||
"object" === typeof node &&
|
||||
null !== node &&
|
||||
"function" === typeof node.then)
|
||||
@@ -5026,11 +5090,11 @@ function flushCompletedQueues(request, destination) {
|
||||
completedBoundaries.splice(0, i);
|
||||
var partialBoundaries = request.partialBoundaries;
|
||||
for (i = 0; i < partialBoundaries.length; i++) {
|
||||
var boundary$42 = partialBoundaries[i];
|
||||
var boundary$44 = partialBoundaries[i];
|
||||
a: {
|
||||
clientRenderedBoundaries = request;
|
||||
boundary = destination;
|
||||
var completedSegments = boundary$42.completedSegments;
|
||||
var completedSegments = boundary$44.completedSegments;
|
||||
for (
|
||||
resumableState$jscomp$0 = 0;
|
||||
resumableState$jscomp$0 < completedSegments.length;
|
||||
@@ -5040,7 +5104,7 @@ function flushCompletedQueues(request, destination) {
|
||||
!flushPartiallyCompletedSegment(
|
||||
clientRenderedBoundaries,
|
||||
boundary,
|
||||
boundary$42,
|
||||
boundary$44,
|
||||
completedSegments[resumableState$jscomp$0]
|
||||
)
|
||||
) {
|
||||
@@ -5052,7 +5116,7 @@ function flushCompletedQueues(request, destination) {
|
||||
completedSegments.splice(0, resumableState$jscomp$0);
|
||||
JSCompiler_inline_result = writeHoistablesForBoundary(
|
||||
boundary,
|
||||
boundary$42.contentState,
|
||||
boundary$44.contentState,
|
||||
clientRenderedBoundaries.renderState
|
||||
);
|
||||
}
|
||||
@@ -5107,8 +5171,8 @@ function abort(request, reason) {
|
||||
}
|
||||
null !== request.destination &&
|
||||
flushCompletedQueues(request, request.destination);
|
||||
} catch (error$44) {
|
||||
logRecoverableError(request, error$44, {}), fatalError(request, error$44);
|
||||
} catch (error$46) {
|
||||
logRecoverableError(request, error$46, {}), fatalError(request, error$46);
|
||||
}
|
||||
}
|
||||
exports.abortStream = function (stream, reason) {
|
||||
|
||||
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
@@ -474,4 +474,4 @@ exports.useId = function () {
|
||||
exports.useMemo = function (create, deps) {
|
||||
return ReactCurrentDispatcher.current.useMemo(create, deps);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-c10a0d4f";
|
||||
exports.version = "18.3.0-www-modern-66f563f5";
|
||||
|
||||
Reference in New Issue
Block a user