xstate 6.0.0-alpha.13 → 6.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{StateMachine-193c2d4d.development.esm.js → StateMachine-0fa9c094.development.esm.js} +1 -1
- package/dist/{StateMachine-614c0f36.esm.js → StateMachine-8dbd20ad.esm.js} +1 -1
- package/dist/{StateMachine-3120a7ff.development.cjs.js → StateMachine-98411dc5.development.cjs.js} +1 -1
- package/dist/{StateMachine-1b26c5de.cjs.js → StateMachine-e3b1aa2d.cjs.js} +1 -1
- package/dist/declarations/src/State.d.ts +13 -2
- package/dist/declarations/src/setup.d.ts +30 -1
- package/dist/declarations/src/types.d.ts +18 -2
- package/dist/{index-08d86676.development.cjs.js → index-07b19ed0.development.cjs.js} +2 -3
- package/dist/{index-32631949.cjs.js → index-0d940f2c.cjs.js} +2 -3
- package/dist/{index-603c1cda.esm.js → index-2635a437.esm.js} +2 -3
- package/dist/{index-7081e0c9.development.esm.js → index-362125ce.development.esm.js} +2 -3
- package/dist/xstate-actors.cjs.js +1 -1
- package/dist/xstate-actors.development.cjs.js +1 -1
- package/dist/xstate-actors.development.esm.js +1 -1
- package/dist/xstate-actors.esm.js +1 -1
- package/dist/xstate-graph.cjs.js +2 -2
- package/dist/xstate-graph.development.cjs.js +2 -2
- package/dist/xstate-graph.development.esm.js +2 -2
- package/dist/xstate-graph.esm.js +2 -2
- package/dist/xstate-graph.umd.min.js +1 -1
- package/dist/xstate-graph.umd.min.js.map +1 -1
- package/dist/xstate.cjs.js +26 -4
- package/dist/xstate.development.cjs.js +26 -4
- package/dist/xstate.development.esm.js +28 -6
- package/dist/xstate.esm.js +28 -6
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/{StateMachine-193c2d4d.development.esm.js → StateMachine-0fa9c094.development.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ProcessingStatus, G as resolveReferencedActor, d as createActor, S as STATE_DELIMITER, H as mapValues, t as toArray, I as createInvokeId, J as getDelayedTransitions, K as evaluateCandidate, L as formatTransition, N as NULL_EVENT, M as toTransitionConfigArray, O as createInvokeTimeoutEvent, Q as getCandidates, R as formatRouteTransitions, U as resolveStateValue, V as getAllStateNodes, k as getStateNodes, W as createMachineSnapshot, Y as isInFinalState, e as macrostep, Z as cloneMachineSnapshot, _ as transitionNode, m as matchesEventDescriptor, r as resolveActionsWithContext, f as createInitEvent, g as initialMicrostep, $ as toStatePath, a0 as isStateId, a1 as getStateNodeByPath, a2 as getPersistedSnapshot, a3 as $$ACTOR_TYPE } from './index-
|
|
1
|
+
import { P as ProcessingStatus, G as resolveReferencedActor, d as createActor, S as STATE_DELIMITER, H as mapValues, t as toArray, I as createInvokeId, J as getDelayedTransitions, K as evaluateCandidate, L as formatTransition, N as NULL_EVENT, M as toTransitionConfigArray, O as createInvokeTimeoutEvent, Q as getCandidates, R as formatRouteTransitions, U as resolveStateValue, V as getAllStateNodes, k as getStateNodes, W as createMachineSnapshot, Y as isInFinalState, e as macrostep, Z as cloneMachineSnapshot, _ as transitionNode, m as matchesEventDescriptor, r as resolveActionsWithContext, f as createInitEvent, g as initialMicrostep, $ as toStatePath, a0 as isStateId, a1 as getStateNodeByPath, a2 as getPersistedSnapshot, a3 as $$ACTOR_TYPE } from './index-362125ce.development.esm.js';
|
|
2
2
|
|
|
3
3
|
function createSpawner(actorScope, {
|
|
4
4
|
machine,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as ProcessingStatus, G as resolveReferencedActor, d as createActor, S as STATE_DELIMITER, H as mapValues, t as toArray, I as createInvokeId, J as getDelayedTransitions, K as evaluateCandidate, L as formatTransition, N as NULL_EVENT, M as toTransitionConfigArray, O as createInvokeTimeoutEvent, Q as getCandidates, R as formatRouteTransitions, U as resolveStateValue, V as getAllStateNodes, k as getStateNodes, W as createMachineSnapshot, Y as isInFinalState, e as macrostep, Z as cloneMachineSnapshot, _ as transitionNode, m as matchesEventDescriptor, r as resolveActionsWithContext, f as createInitEvent, g as initialMicrostep, $ as toStatePath, a0 as isStateId, a1 as getStateNodeByPath, a2 as getPersistedSnapshot, a3 as $$ACTOR_TYPE } from './index-
|
|
1
|
+
import { P as ProcessingStatus, G as resolveReferencedActor, d as createActor, S as STATE_DELIMITER, H as mapValues, t as toArray, I as createInvokeId, J as getDelayedTransitions, K as evaluateCandidate, L as formatTransition, N as NULL_EVENT, M as toTransitionConfigArray, O as createInvokeTimeoutEvent, Q as getCandidates, R as formatRouteTransitions, U as resolveStateValue, V as getAllStateNodes, k as getStateNodes, W as createMachineSnapshot, Y as isInFinalState, e as macrostep, Z as cloneMachineSnapshot, _ as transitionNode, m as matchesEventDescriptor, r as resolveActionsWithContext, f as createInitEvent, g as initialMicrostep, $ as toStatePath, a0 as isStateId, a1 as getStateNodeByPath, a2 as getPersistedSnapshot, a3 as $$ACTOR_TYPE } from './index-2635a437.esm.js';
|
|
2
2
|
|
|
3
3
|
function createSpawner(actorScope, {
|
|
4
4
|
machine,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { AnyMachineSnapshot, AnyStateMachine, EventObject, HistoryValue, MachineContext, StateConfig, StateValue, AnyActorRef, Snapshot, MetaObject, StateSchema, StateId, StateIdInputs, StateContextFromStateValue, SnapshotStatus, AnyStateNode } from "./types.js";
|
|
1
|
+
import type { AnyMachineSnapshot, AnyStateMachine, EventObject, HistoryValue, MachineContext, StateConfig, StateValue, StateValueMap, AnyActorRef, Snapshot, MetaObject, StateSchema, StateId, StateIdInputs, StateContextFromStateValue, SnapshotStatus, AnyStateNode } from "./types.js";
|
|
2
2
|
export declare function isMachineSnapshot(value: unknown): value is AnyMachineSnapshot;
|
|
3
|
+
type Values<T> = T[keyof T];
|
|
4
|
+
type MatchingObjectStateValue<TStateValue extends Record<string, unknown>, TTestStateValue extends Record<string, unknown>> = false extends Values<{
|
|
5
|
+
[K in keyof TTestStateValue]: K extends keyof TStateValue ? NonNullable<TStateValue[K]> extends StateValue ? NonNullable<TTestStateValue[K]> extends StateValue ? [
|
|
6
|
+
MatchingStateValue<NonNullable<TStateValue[K]>, NonNullable<TTestStateValue[K]>>
|
|
7
|
+
] extends [never] ? false : true : false : false : false;
|
|
8
|
+
}> ? never : {
|
|
9
|
+
[K in keyof TStateValue]: K extends keyof TTestStateValue ? MatchingStateValue<NonNullable<TStateValue[K]>, NonNullable<TTestStateValue[K]>> : TStateValue[K];
|
|
10
|
+
};
|
|
11
|
+
type MatchingStateValue<TStateValue extends StateValue, TTestStateValue extends StateValue> = StateValue extends TTestStateValue ? TStateValue : string extends TTestStateValue ? TStateValue : TStateValue extends unknown ? TTestStateValue extends string ? TStateValue extends string ? TTestStateValue extends TStateValue ? TTestStateValue : Extract<TStateValue, TTestStateValue> : TStateValue extends Record<string, unknown> ? TStateValue & Record<TTestStateValue, StateValue | undefined> : never : TTestStateValue extends Record<string, unknown> ? TStateValue extends Record<string, unknown> ? MatchingObjectStateValue<TStateValue, TTestStateValue> : never : never : never;
|
|
3
12
|
interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, _TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema = StateSchema> {
|
|
4
13
|
/** The state machine that produced this state snapshot. */
|
|
5
14
|
machine: AnyStateMachine;
|
|
@@ -42,7 +51,9 @@ interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends Ev
|
|
|
42
51
|
*
|
|
43
52
|
* @param partialStateValue
|
|
44
53
|
*/
|
|
45
|
-
matches<const TTestStateValue extends
|
|
54
|
+
matches<const TTestStateValue extends string>(partialStateValue: TTestStateValue, ...args: string extends TTestStateValue ? [never] : []): this is MachineSnapshot<StateContextFromStateValue<TStateSchema, TContext, TTestStateValue>, TEvent, TChildren, MatchingStateValue<TStateValue, TTestStateValue>, TTag, _TOutput, TMeta, TStateSchema>;
|
|
55
|
+
matches<const TTestStateValue extends StateValueMap>(partialStateValue: TTestStateValue, ...args: string extends keyof TTestStateValue ? [never] : []): this is MachineSnapshot<StateContextFromStateValue<TStateSchema, TContext, TTestStateValue>, TEvent, TChildren, MatchingStateValue<TStateValue, TTestStateValue>, TTag, _TOutput, TMeta, TStateSchema>;
|
|
56
|
+
matches(partialStateValue: StateValue): boolean;
|
|
46
57
|
/**
|
|
47
58
|
* Whether the current state nodes has a state node with the specified `tag`.
|
|
48
59
|
*
|
|
@@ -80,6 +80,29 @@ type SetupOrConfigSchemaMap<TSchemas, TKey extends 'events' | 'emitted' | 'child
|
|
|
80
80
|
type SetupStateKeys<TStateSchemas extends Record<string, SetupStateSchema>> = keyof TStateSchemas & string;
|
|
81
81
|
type SetupStateKey<TStateSchemas extends Record<string, SetupStateSchema>> = string extends SetupStateKeys<TStateSchemas> ? string : [SetupStateKeys<TStateSchemas>] extends [never] ? string : SetupStateKeys<TStateSchemas>;
|
|
82
82
|
type SetupStateTarget<TStateSchemas extends Record<string, SetupStateSchema>> = string extends SetupStateKeys<TStateSchemas> ? string : [SetupStateKeys<TStateSchemas>] extends [never] ? string : SetupStateKeys<TStateSchemas> | `.${string}` | `#${string}`;
|
|
83
|
+
/**
|
|
84
|
+
* The sibling state schemas of a dotted path: the children of the path's
|
|
85
|
+
* parent. A bare transition target resolves relative to the parent, so the
|
|
86
|
+
* valid targets for a path's config are its siblings. For a dotless (top-level)
|
|
87
|
+
* path the siblings are the root states.
|
|
88
|
+
*/
|
|
89
|
+
type ResolveStateSiblings<TStates extends Record<string, SetupStateSchema>, TPath extends string> = TPath extends `${infer Head}.${infer Rest}` ? Head extends keyof TStates ? TStates[Head]['states'] extends Record<string, SetupStateSchema> ? ResolveStateSiblings<TStates[Head]['states'], Rest> : never : never : TStates;
|
|
90
|
+
/**
|
|
91
|
+
* Resolves a dotted state path (e.g. `'parent.child'`) into the leaf
|
|
92
|
+
* `SetupStateSchema` it addresses, or `never` if any segment is missing.
|
|
93
|
+
*/
|
|
94
|
+
type ResolveStatePath<TStates extends Record<string, SetupStateSchema>, TPath extends string> = TPath extends `${infer Head}.${infer Rest}` ? Head extends keyof TStates ? TStates[Head]['states'] extends Record<string, SetupStateSchema> ? ResolveStatePath<TStates[Head]['states'], Rest> : never : never : TPath extends keyof TStates ? TStates[TPath] : never;
|
|
95
|
+
/** Union of every addressable dotted path into a setup states tree */
|
|
96
|
+
type StatePathsInner<TStates extends Record<string, SetupStateSchema>> = {
|
|
97
|
+
[K in SetupStateKeys<TStates>]: K | (TStates[K]['states'] extends Record<string, SetupStateSchema> ? `${K}.${StatePathsInner<TStates[K]['states']>}` : never);
|
|
98
|
+
}[SetupStateKeys<TStates>];
|
|
99
|
+
type StatePaths<TStates extends Record<string, SetupStateSchema>> = string extends SetupStateKeys<TStates> ? string : [SetupStateKeys<TStates>] extends [never] ? string : StatePathsInner<TStates>;
|
|
100
|
+
/**
|
|
101
|
+
* Shared body of both `createStateConfig` overloads: the
|
|
102
|
+
* `StateNodeConfigWithNestedInput` instantiation whose only varying parts are
|
|
103
|
+
* the leading sibling-schemas and state-schema arguments.
|
|
104
|
+
*/
|
|
105
|
+
type SetupStateNodeConfig<TStates extends Record<string, SetupStateSchema>, TStateSchema extends SetupStateSchema, TSchemas extends SetupSchemas, TSetupActionMap extends Implementations['actions'], TSetupActorMap extends Implementations['actorSources'], TSetupGuardMap extends Implementations['guards'], TSetupDelayMap extends Implementations['delays'], TSystemRegistry extends SystemRegistry> = StateNodeConfigWithNestedInput<TStates, TStateSchema, SetupContext<TSchemas, StandardSchemaV1>, SetupContextShape<TSchemas, StandardSchemaV1, SetupContext<TSchemas, StandardSchemaV1>>, SetupEvents<TSchemas, Record<string, StandardSchemaV1>>, Cast<SetupChildren<TSchemas, Record<string, StandardSchemaV1>>, Record<string, AnyActorRef | undefined>>, string, SetupTags<TSchemas, StandardSchemaV1>, SetupOutput<TSchemas, StandardSchemaV1>, SetupEmitted<TSchemas, Record<string, StandardSchemaV1>>, SetupMeta<TSchemas, StandardSchemaV1>, SetupActions<TSchemas, TSetupActionMap>, TSetupActorMap, SetupGuards<TSchemas, TSetupGuardMap>, TSetupDelayMap, TSystemRegistry>;
|
|
83
106
|
type InvalidSetupStateKeys<TConfig, TStateSchemas extends Record<string, SetupStateSchema>> = string extends SetupStateKeys<TStateSchemas> ? never : [SetupStateKeys<TStateSchemas>] extends [never] ? never : TConfig extends {
|
|
84
107
|
states: infer TStates;
|
|
85
108
|
} ? Exclude<keyof TStates & string, SetupStateKeys<TStateSchemas>> : never;
|
|
@@ -357,8 +380,14 @@ export interface SetupReturn<TStates extends Record<string, SetupStateSchema> =
|
|
|
357
380
|
}), Cast<MergeChildren<SetupChildren<TSchemas, TChildrenSchemaMap>, TActor>, Record<string, AnyActorRef | undefined>>, StateValue, TTag & string, [
|
|
358
381
|
SetupSchema<TSchemas, 'input'>
|
|
359
382
|
] extends [never] ? TInput : SetupInput<TSchemas, TInputSchema>, SetupOutput<TSchemas, TOutputSchema>, SetupEmitted<TSchemas, TEmittedSchemaMap>, SetupMeta<TSchemas, TMetaSchema>, MergeStateSchema<Cast<TConfig, StateSchema>, SetupStatesToStateSchema<TStates>>, MergeImplementationMaps<SetupActions<TSchemas, TSetupActionMap>, MergeImplementationMaps<InferActions<TActionSchemaMap>, TActionMap>>, MergeImplementationMaps<TSetupActorMap, TActorMap>, MergeImplementationMaps<SetupGuards<TSchemas, TSetupGuardMap>, MergeImplementationMaps<InferGuards<TGuardSchemaMap>, TGuardMap>>, DelayMapFromNames<TSetupDelays | TDelays, MergeImplementationMaps<TSetupDelayMap, TDelayMap>>>;
|
|
383
|
+
/**
|
|
384
|
+
* Creates a state node config bound to a specific setup-declared state,
|
|
385
|
+
* addressed by a dotted path (e.g. `'loading'` or `'parent.child'`). The
|
|
386
|
+
* addressed state's own `input` schema is typed inside `entry`/`exit` args.
|
|
387
|
+
*/
|
|
388
|
+
createStateConfig<const TPath extends StatePaths<TStates>, const TConfig extends SetupStateNodeConfig<ResolveStateSiblings<TStates, TPath>, ResolveStatePath<TStates, TPath>, TSchemas, TSetupActionMap, TSetupActorMap, TSetupGuardMap, TSetupDelayMap, TSystemRegistry>>(path: TPath, config: TConfig): TConfig;
|
|
360
389
|
/** Creates a state node config with the setup configuration */
|
|
361
|
-
createStateConfig<const TConfig extends
|
|
390
|
+
createStateConfig<const TConfig extends SetupStateNodeConfig<TStates, SetupStateSchema, TSchemas, TSetupActionMap, TSetupActorMap, TSetupGuardMap, TSetupDelayMap, TSystemRegistry>>(config: TConfig): TConfig;
|
|
362
391
|
/** State input schemas from setup config */
|
|
363
392
|
states: TStates;
|
|
364
393
|
}
|
|
@@ -209,6 +209,7 @@ export type TransitionConfigFunction<TContext extends MachineContext, TCurrentEv
|
|
|
209
209
|
context?: TransitionContextPatch<_TCtx>;
|
|
210
210
|
reenter?: boolean;
|
|
211
211
|
meta?: TMeta;
|
|
212
|
+
input?: Record<string, unknown>;
|
|
212
213
|
} | void;
|
|
213
214
|
type TransitionFunctionArgs<TContext, TCurrentEvent extends EventObject, TEvent extends EventObject, TActionMap extends Implementations['actions'], TActorMap extends Implementations['actorSources'], TGuardMap extends Implementations['guards'], TDelayMap extends Implementations['delays']> = {
|
|
214
215
|
context: TContext;
|
|
@@ -385,7 +386,20 @@ export type PersistedHistoryValue = Record<string, Array<{
|
|
|
385
386
|
id: string;
|
|
386
387
|
}>>;
|
|
387
388
|
export type AnyHistoryValue = HistoryValue;
|
|
388
|
-
export type StateFrom<T extends AnyStateMachine | ((...args: any[]) => AnyStateMachine)> = T extends AnyStateMachine ?
|
|
389
|
+
export type StateFrom<T extends AnyStateMachine | ((...args: any[]) => AnyStateMachine)> = T extends AnyStateMachine ? StateSnapshotFromMachine<T> : T extends (...args: any[]) => AnyStateMachine ? StateSnapshotFromMachine<ReturnType<T>> : never;
|
|
390
|
+
type StateValueFromStateSchema<T extends StateSchema> = StateSchema extends T ? StateValue : ToStateValue<T> extends infer TStateValue ? TStateValue extends StateValue ? TStateValue : StateValue : StateValue;
|
|
391
|
+
type MatchingStateValueForStateFrom<TStateValue extends StateValue, TTestStateValue extends StateValue> = TStateValue extends unknown ? TTestStateValue extends string ? TStateValue extends string ? TTestStateValue extends TStateValue ? TTestStateValue : Extract<TStateValue, TTestStateValue> : TStateValue extends StateValueMap ? TStateValue & Record<TTestStateValue, StateValue | undefined> : never : TTestStateValue extends StateValueMap ? TStateValue extends StateValueMap ? MatchingStateValueMapForStateFrom<TStateValue, TTestStateValue> : never : never : never;
|
|
392
|
+
type MatchingStateValueMapForStateFrom<TStateValue extends StateValueMap, TTestStateValue extends StateValueMap> = false extends {
|
|
393
|
+
[K in keyof TTestStateValue & string]: K extends keyof TStateValue ? IsNever<MatchingStateValueForStateFrom<NonNullable<TStateValue[K]>, NonNullable<TTestStateValue[K]>>> extends true ? false : true : false;
|
|
394
|
+
}[keyof TTestStateValue & string] ? never : {
|
|
395
|
+
[K in keyof TStateValue]: K extends keyof TTestStateValue ? MatchingStateValueForStateFrom<NonNullable<TStateValue[K]>, NonNullable<TTestStateValue[K]>> : TStateValue[K];
|
|
396
|
+
};
|
|
397
|
+
type StateSnapshotFromStateValue<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema, TAllStateValue extends StateValue = TStateValue> = TStateValue extends unknown ? Omit<MachineSnapshot<StateContextFromStateValue<TStateSchema, TContext, TStateValue>, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, 'matches'> & {
|
|
398
|
+
matches<const TTestStateValue extends string>(partialStateValue: TTestStateValue, ...args: string extends TTestStateValue ? [never] : []): this is StateSnapshotFromStateValue<StateContextFromStateValue<TStateSchema, TContext, TTestStateValue>, TEvent, TChildren, MatchingStateValueForStateFrom<TAllStateValue, TTestStateValue>, TTag, TOutput, TMeta, TStateSchema, TAllStateValue>;
|
|
399
|
+
matches<const TTestStateValue extends StateValueMap>(partialStateValue: TTestStateValue, ...args: string extends keyof TTestStateValue ? [never] : []): this is StateSnapshotFromStateValue<StateContextFromStateValue<TStateSchema, TContext, TTestStateValue>, TEvent, TChildren, MatchingStateValueForStateFrom<TAllStateValue, TTestStateValue>, TTag, TOutput, TMeta, TStateSchema, TAllStateValue>;
|
|
400
|
+
matches(partialStateValue: StateValue): boolean;
|
|
401
|
+
} : never;
|
|
402
|
+
type StateSnapshotFromMachine<T extends AnyStateMachine> = SnapshotFrom<T> extends MachineSnapshot<infer TContext, infer TEvent, infer TChildren, infer _TStateValue, infer TTag, infer TOutput, infer TMeta, infer TStateSchema> ? StateSnapshotFromStateValue<TContext, TEvent, TChildren, StateValueFromStateSchema<TStateSchema>, TTag, TOutput, TMeta, TStateSchema, StateValueFromStateSchema<TStateSchema>> : SnapshotFrom<T>;
|
|
389
403
|
export interface DoneActorEvent<TOutput = unknown, TId extends string = string> extends EventObject {
|
|
390
404
|
type: `xstate.done.actor.${TId}`;
|
|
391
405
|
output: TOutput;
|
|
@@ -973,7 +987,9 @@ type _GroupStateKeys<T extends StateSchema, S extends keyof T['states']> = S ext
|
|
|
973
987
|
type: 'history';
|
|
974
988
|
} ? [never, never] : T extends {
|
|
975
989
|
type: 'parallel';
|
|
976
|
-
} ? [S, never] :
|
|
990
|
+
} ? [S, never] : T['states'][S] extends {
|
|
991
|
+
states: Record<string, StateSchema>;
|
|
992
|
+
} ? [S, never] : [never, S] : never;
|
|
977
993
|
type GroupStateKeys<T extends StateSchema, S extends keyof T['states']> = {
|
|
978
994
|
nonLeaf: _GroupStateKeys<T, S & string>[0];
|
|
979
995
|
leaf: _GroupStateKeys<T, S & string>[1];
|
|
@@ -1730,12 +1730,11 @@ function getTransitionResult(transition, snapshot, event, actorScope, options) {
|
|
|
1730
1730
|
const enqueue = createTransitionEnqueue(actorScope, actions, internalEvents, false, options?.resolveActions ?? true);
|
|
1731
1731
|
const res = transition.to(transitionArgs, enqueue);
|
|
1732
1732
|
const targets = res?.target ? resolveTarget(transition.source, toArray(res.target)) : undefined;
|
|
1733
|
-
|
|
1734
|
-
const resolvedInput = typeof transition.input === 'function' ? transition.input({
|
|
1733
|
+
const resolvedInput = res?.input ?? (typeof transition.input === 'function' ? transition.input({
|
|
1735
1734
|
context: snapshot.context,
|
|
1736
1735
|
event,
|
|
1737
1736
|
output: getEventOutput(event)
|
|
1738
|
-
}) : transition.input;
|
|
1737
|
+
}) : transition.input);
|
|
1739
1738
|
return {
|
|
1740
1739
|
targets: targets,
|
|
1741
1740
|
context: res?.context,
|
|
@@ -1719,12 +1719,11 @@ function getTransitionResult(transition, snapshot, event, actorScope, options) {
|
|
|
1719
1719
|
const enqueue = createTransitionEnqueue(actorScope, actions, internalEvents, false, options?.resolveActions ?? true);
|
|
1720
1720
|
const res = transition.to(transitionArgs, enqueue);
|
|
1721
1721
|
const targets = res?.target ? resolveTarget(transition.source, toArray(res.target)) : undefined;
|
|
1722
|
-
|
|
1723
|
-
const resolvedInput = typeof transition.input === 'function' ? transition.input({
|
|
1722
|
+
const resolvedInput = res?.input ?? (typeof transition.input === 'function' ? transition.input({
|
|
1724
1723
|
context: snapshot.context,
|
|
1725
1724
|
event,
|
|
1726
1725
|
output: getEventOutput(event)
|
|
1727
|
-
}) : transition.input;
|
|
1726
|
+
}) : transition.input);
|
|
1728
1727
|
return {
|
|
1729
1728
|
targets: targets,
|
|
1730
1729
|
context: res?.context,
|
|
@@ -1717,12 +1717,11 @@ function getTransitionResult(transition, snapshot, event, actorScope, options) {
|
|
|
1717
1717
|
const enqueue = createTransitionEnqueue(actorScope, actions, internalEvents, false, options?.resolveActions ?? true);
|
|
1718
1718
|
const res = transition.to(transitionArgs, enqueue);
|
|
1719
1719
|
const targets = res?.target ? resolveTarget(transition.source, toArray(res.target)) : undefined;
|
|
1720
|
-
|
|
1721
|
-
const resolvedInput = typeof transition.input === 'function' ? transition.input({
|
|
1720
|
+
const resolvedInput = res?.input ?? (typeof transition.input === 'function' ? transition.input({
|
|
1722
1721
|
context: snapshot.context,
|
|
1723
1722
|
event,
|
|
1724
1723
|
output: getEventOutput(event)
|
|
1725
|
-
}) : transition.input;
|
|
1724
|
+
}) : transition.input);
|
|
1726
1725
|
return {
|
|
1727
1726
|
targets: targets,
|
|
1728
1727
|
context: res?.context,
|
|
@@ -1728,12 +1728,11 @@ function getTransitionResult(transition, snapshot, event, actorScope, options) {
|
|
|
1728
1728
|
const enqueue = createTransitionEnqueue(actorScope, actions, internalEvents, false, options?.resolveActions ?? true);
|
|
1729
1729
|
const res = transition.to(transitionArgs, enqueue);
|
|
1730
1730
|
const targets = res?.target ? resolveTarget(transition.source, toArray(res.target)) : undefined;
|
|
1731
|
-
|
|
1732
|
-
const resolvedInput = typeof transition.input === 'function' ? transition.input({
|
|
1731
|
+
const resolvedInput = res?.input ?? (typeof transition.input === 'function' ? transition.input({
|
|
1733
1732
|
context: snapshot.context,
|
|
1734
1733
|
event,
|
|
1735
1734
|
output: getEventOutput(event)
|
|
1736
|
-
}) : transition.input;
|
|
1735
|
+
}) : transition.input);
|
|
1737
1736
|
return {
|
|
1738
1737
|
targets: targets,
|
|
1739
1738
|
context: res?.context,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { T as TimeoutError, B as createAsyncLogic, w as createCallbackLogic, v as createEmptyActor, y as createEventObservableLogic, C as createListenerLogic, z as createLogic, x as createObservableLogic, E as createSubscriptionLogic, D as listenerLogic, F as subscriptionLogic } from './index-
|
|
1
|
+
export { T as TimeoutError, B as createAsyncLogic, w as createCallbackLogic, v as createEmptyActor, y as createEventObservableLogic, C as createListenerLogic, z as createLogic, x as createObservableLogic, E as createSubscriptionLogic, D as listenerLogic, F as subscriptionLogic } from './index-362125ce.development.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { T as TimeoutError, B as createAsyncLogic, w as createCallbackLogic, v as createEmptyActor, y as createEventObservableLogic, C as createListenerLogic, z as createLogic, x as createObservableLogic, E as createSubscriptionLogic, D as listenerLogic, F as subscriptionLogic } from './index-
|
|
1
|
+
export { T as TimeoutError, B as createAsyncLogic, w as createCallbackLogic, v as createEmptyActor, y as createEventObservableLogic, C as createListenerLogic, z as createLogic, x as createObservableLogic, E as createSubscriptionLogic, D as listenerLogic, F as subscriptionLogic } from './index-2635a437.esm.js';
|
package/dist/xstate-graph.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_xstateActors = require('./index-
|
|
6
|
-
var StateMachine = require('./StateMachine-
|
|
5
|
+
var dist_xstateActors = require('./index-0d940f2c.cjs.js');
|
|
6
|
+
var StateMachine = require('./StateMachine-e3b1aa2d.cjs.js');
|
|
7
7
|
|
|
8
8
|
function simpleStringify(value) {
|
|
9
9
|
return JSON.stringify(value);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_xstateActors = require('./index-
|
|
6
|
-
var StateMachine = require('./StateMachine-
|
|
5
|
+
var dist_xstateActors = require('./index-07b19ed0.development.cjs.js');
|
|
6
|
+
var StateMachine = require('./StateMachine-98411dc5.development.cjs.js');
|
|
7
7
|
|
|
8
8
|
function simpleStringify(value) {
|
|
9
9
|
return JSON.stringify(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as isMachineSnapshot, l as getAllOwnEventDescriptors, v as createEmptyActor, X as XSTATE_INIT } from './index-
|
|
2
|
-
import { S as StateMachine } from './StateMachine-
|
|
1
|
+
import { j as isMachineSnapshot, l as getAllOwnEventDescriptors, v as createEmptyActor, X as XSTATE_INIT } from './index-362125ce.development.esm.js';
|
|
2
|
+
import { S as StateMachine } from './StateMachine-0fa9c094.development.esm.js';
|
|
3
3
|
|
|
4
4
|
function simpleStringify(value) {
|
|
5
5
|
return JSON.stringify(value);
|
package/dist/xstate-graph.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as isMachineSnapshot, l as getAllOwnEventDescriptors, v as createEmptyActor, X as XSTATE_INIT } from './index-
|
|
2
|
-
import { S as StateMachine } from './StateMachine-
|
|
1
|
+
import { j as isMachineSnapshot, l as getAllOwnEventDescriptors, v as createEmptyActor, X as XSTATE_INIT } from './index-2635a437.esm.js';
|
|
2
|
+
import { S as StateMachine } from './StateMachine-8dbd20ad.esm.js';
|
|
3
3
|
|
|
4
4
|
function simpleStringify(value) {
|
|
5
5
|
return JSON.stringify(value);
|