xstate 6.0.0-alpha.46 → 6.0.0-alpha.47
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-756e1335.cjs.js → StateMachine-7046f677.cjs.js} +7 -3
- package/dist/{StateMachine-fa133051.development.cjs.js → StateMachine-70c06bdd.development.cjs.js} +7 -3
- package/dist/{StateMachine-9509c0bd.esm.js → StateMachine-74929087.esm.js} +7 -3
- package/dist/{StateMachine-a5ede014.development.esm.js → StateMachine-ee10f67e.development.esm.js} +7 -3
- package/dist/{createActor-f6e6146f.development.cjs.js → createActor-6736cbbe.development.cjs.js} +6 -3
- package/dist/{createActor-9523f716.esm.js → createActor-915ea40c.esm.js} +6 -3
- package/dist/{createActor-0816a84b.cjs.js → createActor-bfe8b6bd.cjs.js} +6 -3
- package/dist/{createActor-f5277b31.development.esm.js → createActor-ff132afa.development.esm.js} +6 -3
- package/dist/declarations/src/StateMachine.d.ts +7 -3
- package/dist/declarations/src/durable/index.d.ts +9 -2
- package/dist/declarations/src/setup.d.ts +36 -7
- package/dist/declarations/src/types.d.ts +4 -4
- package/dist/declarations/src/types.v6.d.ts +27 -5
- package/dist/{effectDescriptor-8a5d62e0.development.cjs.js → effectDescriptor-3c699328.development.cjs.js} +4 -1
- package/dist/{effectDescriptor-87826c41.esm.js → effectDescriptor-8be60443.esm.js} +4 -1
- package/dist/{effectDescriptor-3a016bbe.cjs.js → effectDescriptor-a7e2d4d1.cjs.js} +4 -1
- package/dist/{effectDescriptor-9a14147f.development.esm.js → effectDescriptor-fbe67d5a.development.esm.js} +4 -1
- package/dist/{index-1e1e1cba.development.cjs.js → index-0f498ef2.development.cjs.js} +1 -1
- package/dist/{index-3907b7aa.development.esm.js → index-70d56425.development.esm.js} +1 -1
- package/dist/{index-c7431a16.esm.js → index-b051c924.esm.js} +1 -1
- package/dist/{index-7b9c4f77.cjs.js → index-b3fe59bc.cjs.js} +1 -1
- package/dist/xstate-actors.cjs.js +2 -2
- package/dist/xstate-actors.development.cjs.js +2 -2
- package/dist/xstate-actors.development.esm.js +2 -2
- package/dist/xstate-actors.esm.js +2 -2
- package/dist/xstate-actors.umd.min.js.map +1 -1
- package/dist/xstate-durable.cjs.js +9 -6
- package/dist/xstate-durable.development.cjs.js +9 -6
- package/dist/xstate-durable.development.esm.js +9 -6
- package/dist/xstate-durable.esm.js +9 -6
- package/dist/xstate-durable.umd.min.js +1 -1
- package/dist/xstate-durable.umd.min.js.map +1 -1
- package/dist/xstate-graph.cjs.js +3 -3
- package/dist/xstate-graph.development.cjs.js +3 -3
- package/dist/xstate-graph.development.esm.js +3 -3
- package/dist/xstate-graph.esm.js +3 -3
- package/dist/xstate-graph.umd.min.js +1 -1
- package/dist/xstate-graph.umd.min.js.map +1 -1
- package/dist/xstate-validation.cjs.js +1 -1
- package/dist/xstate-validation.development.cjs.js +1 -1
- package/dist/xstate-validation.development.esm.js +1 -1
- package/dist/xstate-validation.esm.js +1 -1
- package/dist/xstate.cjs.js +23 -4
- package/dist/xstate.development.cjs.js +23 -4
- package/dist/xstate.development.esm.js +25 -6
- package/dist/xstate.esm.js +25 -6
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createActor = require('./createActor-
|
|
4
|
-
var dist_xstateActors = require('./index-
|
|
3
|
+
var createActor = require('./createActor-bfe8b6bd.cjs.js');
|
|
4
|
+
var dist_xstateActors = require('./index-b3fe59bc.cjs.js');
|
|
5
5
|
|
|
6
6
|
function createSpawner(actorScope, actors, spawnedChildren) {
|
|
7
7
|
return (src, options) => {
|
|
@@ -1020,7 +1020,11 @@ class StateMachine {
|
|
|
1020
1020
|
restoreSnapshot(snapshot, actorScope) {
|
|
1021
1021
|
const usesInertScope = !actorScope;
|
|
1022
1022
|
const resolvedActorScope = actorScope ?? createActor.createInertActorScope(this);
|
|
1023
|
-
const
|
|
1023
|
+
const snapshotMachine = snapshot.machine;
|
|
1024
|
+
// A live machine snapshot carries its producing machine so helpers such as
|
|
1025
|
+
// `matches()` can resolve state nodes. That runtime association is not the
|
|
1026
|
+
// persisted `{ id, version }` identity written by getPersistedSnapshot().
|
|
1027
|
+
const persistedMachine = snapshotMachine && typeof snapshotMachine === 'object' && typeof snapshotMachine.transition === 'function' && 'root' in snapshotMachine ? undefined : snapshotMachine;
|
|
1024
1028
|
const legacyPersistedVersion = snapshot.version;
|
|
1025
1029
|
const persistedVersion = typeof persistedMachine?.version === 'string' ? persistedMachine.version : legacyPersistedVersion;
|
|
1026
1030
|
if (legacyPersistedVersion !== undefined && persistedMachine?.version !== undefined && persistedMachine.version !== legacyPersistedVersion) {
|
package/dist/{StateMachine-fa133051.development.cjs.js → StateMachine-70c06bdd.development.cjs.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createActor = require('./createActor-
|
|
4
|
-
var dist_xstateActors = require('./index-
|
|
3
|
+
var createActor = require('./createActor-6736cbbe.development.cjs.js');
|
|
4
|
+
var dist_xstateActors = require('./index-0f498ef2.development.cjs.js');
|
|
5
5
|
|
|
6
6
|
function createSpawner(actorScope, actors, spawnedChildren) {
|
|
7
7
|
return (src, options) => {
|
|
@@ -1049,7 +1049,11 @@ class StateMachine {
|
|
|
1049
1049
|
restoreSnapshot(snapshot, actorScope) {
|
|
1050
1050
|
const usesInertScope = !actorScope;
|
|
1051
1051
|
const resolvedActorScope = actorScope ?? createActor.createInertActorScope(this);
|
|
1052
|
-
const
|
|
1052
|
+
const snapshotMachine = snapshot.machine;
|
|
1053
|
+
// A live machine snapshot carries its producing machine so helpers such as
|
|
1054
|
+
// `matches()` can resolve state nodes. That runtime association is not the
|
|
1055
|
+
// persisted `{ id, version }` identity written by getPersistedSnapshot().
|
|
1056
|
+
const persistedMachine = snapshotMachine && typeof snapshotMachine === 'object' && typeof snapshotMachine.transition === 'function' && 'root' in snapshotMachine ? undefined : snapshotMachine;
|
|
1053
1057
|
const legacyPersistedVersion = snapshot.version;
|
|
1054
1058
|
const persistedVersion = typeof persistedMachine?.version === 'string' ? persistedMachine.version : legacyPersistedVersion;
|
|
1055
1059
|
if (legacyPersistedVersion !== undefined && persistedMachine?.version !== undefined && persistedMachine.version !== legacyPersistedVersion) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as resolveRegisteredActorSource, R as allocateChildId, S as assertChildIdFree, T as reserveChildId, U as STATE_DELIMITER, V as mapValues, t as toArray, W as createInvokeId, Y as getDelayedTransitions, Z as getEventDescriptorKey, _ as getCandidates, $ as evaluateCandidate, a0 as formatTransition, a1 as NULL_EVENT, a2 as toTransitionConfigArray, a3 as createInvokeTimeoutEventId, a4 as matchesActorSession, a5 as formatRouteTransitions, a6 as resolveStateValue, a7 as getAllStateNodes, x as getStateNodes, a8 as createMachineSnapshot, a9 as isInFinalState, aa as createInertActorScope, ab as setInertActorScopeSnapshot, a as beginSpawnAllocation, ac as attachSnapshotActorRef, ad as macrostep, ae as isInertActorScope, af as setSnapshotActorRef, ag as cloneMachineSnapshot, ah as transitionNode, g as XSTATE_TIMER, m as matchesEventDescriptor, ai as getTransitionResult, aj as hasEffect, ak as createErrorPlatformEvent, al as withActorSelf, r as resolveActionsWithContext, am as takeSpawnAllocationCounters, an as mergeActorIdCounters, K as createInitEvent, ao as createSpawnEffect, ap as initialMicrostep, aq as toStatePath, ar as isStateId, as as getStateNodeByPath, at as getPersistedSnapshot, au as createRemoteActorRef, av as resolveReferencedActor, aw as createInvokeTimeoutEvent, ax as parseGeneratedActorId, ay as ACTOR_REF_TYPE, k as createActor } from './createActor-
|
|
2
|
-
import { g as assertValid } from './index-
|
|
1
|
+
import { Q as resolveRegisteredActorSource, R as allocateChildId, S as assertChildIdFree, T as reserveChildId, U as STATE_DELIMITER, V as mapValues, t as toArray, W as createInvokeId, Y as getDelayedTransitions, Z as getEventDescriptorKey, _ as getCandidates, $ as evaluateCandidate, a0 as formatTransition, a1 as NULL_EVENT, a2 as toTransitionConfigArray, a3 as createInvokeTimeoutEventId, a4 as matchesActorSession, a5 as formatRouteTransitions, a6 as resolveStateValue, a7 as getAllStateNodes, x as getStateNodes, a8 as createMachineSnapshot, a9 as isInFinalState, aa as createInertActorScope, ab as setInertActorScopeSnapshot, a as beginSpawnAllocation, ac as attachSnapshotActorRef, ad as macrostep, ae as isInertActorScope, af as setSnapshotActorRef, ag as cloneMachineSnapshot, ah as transitionNode, g as XSTATE_TIMER, m as matchesEventDescriptor, ai as getTransitionResult, aj as hasEffect, ak as createErrorPlatformEvent, al as withActorSelf, r as resolveActionsWithContext, am as takeSpawnAllocationCounters, an as mergeActorIdCounters, K as createInitEvent, ao as createSpawnEffect, ap as initialMicrostep, aq as toStatePath, ar as isStateId, as as getStateNodeByPath, at as getPersistedSnapshot, au as createRemoteActorRef, av as resolveReferencedActor, aw as createInvokeTimeoutEvent, ax as parseGeneratedActorId, ay as ACTOR_REF_TYPE, k as createActor } from './createActor-915ea40c.esm.js';
|
|
2
|
+
import { g as assertValid } from './index-b051c924.esm.js';
|
|
3
3
|
|
|
4
4
|
function createSpawner(actorScope, actors, spawnedChildren) {
|
|
5
5
|
return (src, options) => {
|
|
@@ -1018,7 +1018,11 @@ class StateMachine {
|
|
|
1018
1018
|
restoreSnapshot(snapshot, actorScope) {
|
|
1019
1019
|
const usesInertScope = !actorScope;
|
|
1020
1020
|
const resolvedActorScope = actorScope ?? createInertActorScope(this);
|
|
1021
|
-
const
|
|
1021
|
+
const snapshotMachine = snapshot.machine;
|
|
1022
|
+
// A live machine snapshot carries its producing machine so helpers such as
|
|
1023
|
+
// `matches()` can resolve state nodes. That runtime association is not the
|
|
1024
|
+
// persisted `{ id, version }` identity written by getPersistedSnapshot().
|
|
1025
|
+
const persistedMachine = snapshotMachine && typeof snapshotMachine === 'object' && typeof snapshotMachine.transition === 'function' && 'root' in snapshotMachine ? undefined : snapshotMachine;
|
|
1022
1026
|
const legacyPersistedVersion = snapshot.version;
|
|
1023
1027
|
const persistedVersion = typeof persistedMachine?.version === 'string' ? persistedMachine.version : legacyPersistedVersion;
|
|
1024
1028
|
if (legacyPersistedVersion !== undefined && persistedMachine?.version !== undefined && persistedMachine.version !== legacyPersistedVersion) {
|
package/dist/{StateMachine-a5ede014.development.esm.js → StateMachine-ee10f67e.development.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as resolveRegisteredActorSource, R as allocateChildId, S as assertChildIdFree, T as reserveChildId, U as STATE_DELIMITER, V as mapValues, t as toArray, W as createInvokeId, Y as getDelayedTransitions, Z as getEventDescriptorKey, _ as getCandidates, $ as evaluateCandidate, a0 as formatTransition, a1 as NULL_EVENT, a2 as toTransitionConfigArray, a3 as createInvokeTimeoutEventId, a4 as matchesActorSession, a5 as formatRouteTransitions, a6 as resolveStateValue, a7 as getAllStateNodes, x as getStateNodes, a8 as createMachineSnapshot, a9 as isInFinalState, aa as createInertActorScope, ab as setInertActorScopeSnapshot, a as beginSpawnAllocation, ac as attachSnapshotActorRef, ad as macrostep, ae as isInertActorScope, af as setSnapshotActorRef, ag as cloneMachineSnapshot, ah as transitionNode, g as XSTATE_TIMER, m as matchesEventDescriptor, ai as getTransitionResult, aj as hasEffect, ak as createErrorPlatformEvent, al as withActorSelf, r as resolveActionsWithContext, am as takeSpawnAllocationCounters, an as mergeActorIdCounters, K as createInitEvent, ao as createSpawnEffect, ap as initialMicrostep, aq as toStatePath, ar as isStateId, as as getStateNodeByPath, at as getPersistedSnapshot, au as createRemoteActorRef, av as resolveReferencedActor, aw as createInvokeTimeoutEvent, ax as parseGeneratedActorId, ay as ACTOR_REF_TYPE, k as createActor } from './createActor-
|
|
2
|
-
import { g as assertValid } from './index-
|
|
1
|
+
import { Q as resolveRegisteredActorSource, R as allocateChildId, S as assertChildIdFree, T as reserveChildId, U as STATE_DELIMITER, V as mapValues, t as toArray, W as createInvokeId, Y as getDelayedTransitions, Z as getEventDescriptorKey, _ as getCandidates, $ as evaluateCandidate, a0 as formatTransition, a1 as NULL_EVENT, a2 as toTransitionConfigArray, a3 as createInvokeTimeoutEventId, a4 as matchesActorSession, a5 as formatRouteTransitions, a6 as resolveStateValue, a7 as getAllStateNodes, x as getStateNodes, a8 as createMachineSnapshot, a9 as isInFinalState, aa as createInertActorScope, ab as setInertActorScopeSnapshot, a as beginSpawnAllocation, ac as attachSnapshotActorRef, ad as macrostep, ae as isInertActorScope, af as setSnapshotActorRef, ag as cloneMachineSnapshot, ah as transitionNode, g as XSTATE_TIMER, m as matchesEventDescriptor, ai as getTransitionResult, aj as hasEffect, ak as createErrorPlatformEvent, al as withActorSelf, r as resolveActionsWithContext, am as takeSpawnAllocationCounters, an as mergeActorIdCounters, K as createInitEvent, ao as createSpawnEffect, ap as initialMicrostep, aq as toStatePath, ar as isStateId, as as getStateNodeByPath, at as getPersistedSnapshot, au as createRemoteActorRef, av as resolveReferencedActor, aw as createInvokeTimeoutEvent, ax as parseGeneratedActorId, ay as ACTOR_REF_TYPE, k as createActor } from './createActor-ff132afa.development.esm.js';
|
|
2
|
+
import { g as assertValid } from './index-70d56425.development.esm.js';
|
|
3
3
|
|
|
4
4
|
function createSpawner(actorScope, actors, spawnedChildren) {
|
|
5
5
|
return (src, options) => {
|
|
@@ -1047,7 +1047,11 @@ class StateMachine {
|
|
|
1047
1047
|
restoreSnapshot(snapshot, actorScope) {
|
|
1048
1048
|
const usesInertScope = !actorScope;
|
|
1049
1049
|
const resolvedActorScope = actorScope ?? createInertActorScope(this);
|
|
1050
|
-
const
|
|
1050
|
+
const snapshotMachine = snapshot.machine;
|
|
1051
|
+
// A live machine snapshot carries its producing machine so helpers such as
|
|
1052
|
+
// `matches()` can resolve state nodes. That runtime association is not the
|
|
1053
|
+
// persisted `{ id, version }` identity written by getPersistedSnapshot().
|
|
1054
|
+
const persistedMachine = snapshotMachine && typeof snapshotMachine === 'object' && typeof snapshotMachine.transition === 'function' && 'root' in snapshotMachine ? undefined : snapshotMachine;
|
|
1051
1055
|
const legacyPersistedVersion = snapshot.version;
|
|
1052
1056
|
const persistedVersion = typeof persistedMachine?.version === 'string' ? persistedMachine.version : legacyPersistedVersion;
|
|
1053
1057
|
if (legacyPersistedVersion !== undefined && persistedMachine?.version !== undefined && persistedMachine.version !== legacyPersistedVersion) {
|
package/dist/{createActor-f6e6146f.development.cjs.js → createActor-6736cbbe.development.cjs.js}
RENAMED
|
@@ -908,12 +908,15 @@ function createTransitionEnqueue(actorScope, actions, internalEvents, actorSubsc
|
|
|
908
908
|
},
|
|
909
909
|
stop: actor => {
|
|
910
910
|
if (actor) {
|
|
911
|
-
|
|
911
|
+
// enq.stop accepts the consumer ActorRef contract; refs handed to
|
|
912
|
+
// machine code are always full actor instances at runtime.
|
|
913
|
+
const actorInstance = actor;
|
|
914
|
+
const action = pushBuiltInAction(actions, builtInActions['@xstate.stop'], actorScope, actorInstance);
|
|
912
915
|
action.childUpdate = {
|
|
913
916
|
type: 'remove',
|
|
914
|
-
actor
|
|
917
|
+
actor: actorInstance
|
|
915
918
|
};
|
|
916
|
-
recordStoppedChild(actorScope,
|
|
919
|
+
recordStoppedChild(actorScope, actorInstance);
|
|
917
920
|
}
|
|
918
921
|
}
|
|
919
922
|
};
|
|
@@ -898,12 +898,15 @@ function createTransitionEnqueue(actorScope, actions, internalEvents, actorSubsc
|
|
|
898
898
|
},
|
|
899
899
|
stop: actor => {
|
|
900
900
|
if (actor) {
|
|
901
|
-
|
|
901
|
+
// enq.stop accepts the consumer ActorRef contract; refs handed to
|
|
902
|
+
// machine code are always full actor instances at runtime.
|
|
903
|
+
const actorInstance = actor;
|
|
904
|
+
const action = pushBuiltInAction(actions, builtInActions['@xstate.stop'], actorScope, actorInstance);
|
|
902
905
|
action.childUpdate = {
|
|
903
906
|
type: 'remove',
|
|
904
|
-
actor
|
|
907
|
+
actor: actorInstance
|
|
905
908
|
};
|
|
906
|
-
recordStoppedChild(actorScope,
|
|
909
|
+
recordStoppedChild(actorScope, actorInstance);
|
|
907
910
|
}
|
|
908
911
|
}
|
|
909
912
|
};
|
|
@@ -900,12 +900,15 @@ function createTransitionEnqueue(actorScope, actions, internalEvents, actorSubsc
|
|
|
900
900
|
},
|
|
901
901
|
stop: actor => {
|
|
902
902
|
if (actor) {
|
|
903
|
-
|
|
903
|
+
// enq.stop accepts the consumer ActorRef contract; refs handed to
|
|
904
|
+
// machine code are always full actor instances at runtime.
|
|
905
|
+
const actorInstance = actor;
|
|
906
|
+
const action = pushBuiltInAction(actions, builtInActions['@xstate.stop'], actorScope, actorInstance);
|
|
904
907
|
action.childUpdate = {
|
|
905
908
|
type: 'remove',
|
|
906
|
-
actor
|
|
909
|
+
actor: actorInstance
|
|
907
910
|
};
|
|
908
|
-
recordStoppedChild(actorScope,
|
|
911
|
+
recordStoppedChild(actorScope, actorInstance);
|
|
909
912
|
}
|
|
910
913
|
}
|
|
911
914
|
};
|
package/dist/{createActor-f5277b31.development.esm.js → createActor-ff132afa.development.esm.js}
RENAMED
|
@@ -906,12 +906,15 @@ function createTransitionEnqueue(actorScope, actions, internalEvents, actorSubsc
|
|
|
906
906
|
},
|
|
907
907
|
stop: actor => {
|
|
908
908
|
if (actor) {
|
|
909
|
-
|
|
909
|
+
// enq.stop accepts the consumer ActorRef contract; refs handed to
|
|
910
|
+
// machine code are always full actor instances at runtime.
|
|
911
|
+
const actorInstance = actor;
|
|
912
|
+
const action = pushBuiltInAction(actions, builtInActions['@xstate.stop'], actorScope, actorInstance);
|
|
910
913
|
action.childUpdate = {
|
|
911
914
|
type: 'remove',
|
|
912
|
-
actor
|
|
915
|
+
actor: actorInstance
|
|
913
916
|
};
|
|
914
|
-
recordStoppedChild(actorScope,
|
|
917
|
+
recordStoppedChild(actorScope, actorInstance);
|
|
915
918
|
}
|
|
916
919
|
}
|
|
917
920
|
};
|
|
@@ -3,7 +3,7 @@ import { StateNode } from "./StateNode.js";
|
|
|
3
3
|
import { type TransitionSelectionResults } from "./stateUtils.js";
|
|
4
4
|
import { AnyActorSystem } from "./system.js";
|
|
5
5
|
import type { ActorLogic, ActorLogicTransitionResult, ActorScope, AnyActorLogic, AnyActorRef, AnyActorScope, AnyTransitionDefinition, Equals, EventDescriptor, EmittedFrom, EventObject, EventFromLogic, ExecutableActionObjectFromLogic, HistoryValue, InputFrom, IsAny, MachineContext, MetaObject, OutputFrom, Snapshot, SnapshotFrom, StateValue, StateSchema, SnapshotStatus } from "./types.js";
|
|
6
|
-
import { AnyMachineSchemas, Sources, Next_MachineConfig, MachineOptions } from "./types.v6.js";
|
|
6
|
+
import { AnyMachineSchemas, DelaySourceMap, GuardSourceMap, Sources, Next_MachineConfig, MachineOptions } from "./types.v6.js";
|
|
7
7
|
import type { ActorLogicValidator } from "./validation.types.js";
|
|
8
8
|
import type { StandardSchemaV1 } from "./schema.types.js";
|
|
9
9
|
import type { PersistedMachineSnapshot } from "./machineVersion.types.js";
|
|
@@ -53,8 +53,12 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
53
53
|
provide<const TProvidedActorMap extends Partial<Record<keyof TActorMap & string, AnyActorLogic>> = {}>(sources: {
|
|
54
54
|
actions?: Partial<TActionMap>;
|
|
55
55
|
actors?: TProvidedActorMap & ProvidedActors<TActorMap, TProvidedActorMap>;
|
|
56
|
-
guards?: Partial<TGuardMap
|
|
57
|
-
|
|
56
|
+
guards?: Partial<TGuardMap> & {
|
|
57
|
+
[K in keyof TGuardMap]?: GuardSourceMap<TContext, TEvent>[string];
|
|
58
|
+
};
|
|
59
|
+
delays?: {
|
|
60
|
+
[K in keyof TDelayMap]?: DelaySourceMap<TContext, TEvent>[string];
|
|
61
|
+
};
|
|
58
62
|
}): this;
|
|
59
63
|
resolveState(config: {
|
|
60
64
|
value: StateValue;
|
|
@@ -46,10 +46,17 @@ export interface DurableEffect<TEffect> extends DurableEffectMetadata {
|
|
|
46
46
|
* during `executeEffects`: the execution captures and retains them, and the
|
|
47
47
|
* execution's `waitForEvent()` hands them out before deferring to this
|
|
48
48
|
* adapter. While the loop is parked, a root-addressed event reaches
|
|
49
|
-
* `
|
|
50
|
-
* mailbox.
|
|
49
|
+
* `enqueueRootEvent`, or the broader `sendEvent` override when implemented,
|
|
50
|
+
* so the host can place it in its own mailbox.
|
|
51
51
|
*/
|
|
52
52
|
export interface DurableExecutionAdapter<TLogic extends AnyActorLogic> extends Partial<ActorSystemRuntime> {
|
|
53
|
+
/**
|
|
54
|
+
* Enqueues an event addressed to this execution's root while the durable
|
|
55
|
+
* loop is parked in `waitForEvent()`. Use this when the host only owns the
|
|
56
|
+
* root mailbox; implementing `sendEvent` instead takes ownership of delivery
|
|
57
|
+
* for every target and must use `deliverEvent` for co-located actors.
|
|
58
|
+
*/
|
|
59
|
+
enqueueRootEvent?(source: AnyActor | undefined, event: AnyEventObject): void | PromiseLike<void>;
|
|
53
60
|
/**
|
|
54
61
|
* Executes a custom action as a durable host step or activity. The host
|
|
55
62
|
* should identify the action by `type` and memoize or deduplicate it using
|
|
@@ -5,15 +5,41 @@ import { type Actor, type RequiredActorOptionsKeys } from "./createActor.js";
|
|
|
5
5
|
import { AnyActorRef, AnyActorLogic, ActorRefFromLogic, AnyStateNode, EventObject, AnyEventObject, EventDescriptor, ExtractEvent, MachineContext, ProvidedActor, RoutableStateId, StateSchema, StateValue, StateValueFromStateSchema, ToChildren, MetaObject, Cast, Compute, EnqueueObject, DoneActorEvent, DoneStateEvent, ErrorActorEvent, SystemRegistry, RegistryKeyForLogic, ActorOptions, Observer, Subscription, OutputArg, SnapshotEvent, SingleOrArray, AfterEvent, TimeoutEvent, ErrorEvent } from "./types.js";
|
|
6
6
|
import { AnyActorSystem } from "./system.js";
|
|
7
7
|
import { InspectionEvent } from "./inspection.js";
|
|
8
|
-
import { ActionSchemas, DelayMapFromNames, GuardSchemas, InferChildren, InferActions, InferGuards, Sources, InferOutput, InferEvents, InferInternalEvents, Next_MachineConfig, Next_InvokeConfig, Next_StateNodeConfig, Next_TransitionConfigOrTarget, OutputFromConfig, ValidateHistoryDefaults, ValidateStateTargets, WithDefault } from "./types.v6.js";
|
|
8
|
+
import { ActionSchemas, DelayMapFromNames, DelaySourceMap, GuardSourceMap, GuardSchemas, InferChildren, InferActions, InferGuards, Sources, InferOutput, InferEvents, InferInternalEvents, Next_MachineConfig, Next_InvokeConfig, Next_StateNodeConfig, Next_TransitionConfigOrTarget, OutputFromConfig, ValidateHistoryDefaults, ValidateStateTargets, WithDefault } from "./types.v6.js";
|
|
9
9
|
export type SetupConfig<TSchemas extends SetupSchemas, TStates extends Record<string, SetupStateSchema>, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TValidator extends ActorLogicValidator | undefined = ActorLogicValidator | undefined> = {
|
|
10
10
|
validator?: TValidator;
|
|
11
|
-
schemas?: TSchemas
|
|
11
|
+
schemas?: TSchemas;
|
|
12
12
|
states?: TStates;
|
|
13
13
|
actions?: TActionMap;
|
|
14
14
|
actors?: TActorMap;
|
|
15
|
-
guards?: TGuardMap
|
|
16
|
-
delays?: TDelayMap
|
|
15
|
+
guards?: TGuardMap & SetupGuardSources<NoInfer<TSchemas>>;
|
|
16
|
+
delays?: TDelayMap & SetupDelaySources<NoInfer<TSchemas>>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Contextual types for guard/delay source maps passed to `setup()`, derived
|
|
20
|
+
* from the same call's `schemas` (context/events). These intersect the
|
|
21
|
+
* inferred source-map type parameters so inline functions get typed args
|
|
22
|
+
* without hand-annotating.
|
|
23
|
+
*/
|
|
24
|
+
type SetupGuardSources<TSchemas> = GuardSourceMap<SetupContext<TSchemas, StandardSchemaV1>, SetupEvents<TSchemas, Record<string, StandardSchemaV1>>>;
|
|
25
|
+
type SetupDelaySources<TSchemas> = DelaySourceMap<SetupContext<TSchemas, StandardSchemaV1>, SetupEvents<TSchemas, Record<string, StandardSchemaV1>>>;
|
|
26
|
+
/**
|
|
27
|
+
* Contextual companion for the whole-config `setup()` overload: gives inline
|
|
28
|
+
* `guards`/`delays` functions typed args from the config's own `schemas`.
|
|
29
|
+
*/
|
|
30
|
+
type SetupSourceCompanions<TSchemas> = {
|
|
31
|
+
guards?: SetupGuardSources<TSchemas>;
|
|
32
|
+
delays?: SetupDelaySources<TSchemas>;
|
|
33
|
+
};
|
|
34
|
+
type MergeRecord<TBase, TExtend> = Omit<TBase, keyof TExtend> & TExtend;
|
|
35
|
+
/**
|
|
36
|
+
* Mirrors the runtime `mergeSchemas`: scalar schema keys (`context`, `input`,
|
|
37
|
+
* ...) are overridden whole, while map-valued keys (`events`, `emitted`,
|
|
38
|
+
* `children`, `actions`, `guards`) are merged entry-by-entry with extension
|
|
39
|
+
* entries winning, so base-declared entries stay visible to extension sources.
|
|
40
|
+
*/
|
|
41
|
+
type MergedSetupSchemas<TBaseSchemas, TExtendSchemas> = {
|
|
42
|
+
[K in keyof TBaseSchemas | keyof TExtendSchemas]: K extends 'events' | 'emitted' | 'children' | 'actions' | 'guards' ? MergeRecord<K extends keyof TBaseSchemas ? NonNullable<TBaseSchemas[K]> : {}, K extends keyof TExtendSchemas ? NonNullable<TExtendSchemas[K]> : {}> : K extends keyof TExtendSchemas ? TExtendSchemas[K] : K extends keyof TBaseSchemas ? TBaseSchemas[K] : never;
|
|
17
43
|
};
|
|
18
44
|
export type AnySetupConfig = SetupConfig<SetupSchemas, Record<string, SetupStateSchema>, Sources['actions'], Sources['actors'], Sources['guards'], Sources['delays'], ActorLogicValidator | undefined>;
|
|
19
45
|
interface RuntimeValidationDoesNotSupportTransformingSchemas {
|
|
@@ -62,7 +88,10 @@ type ExtendValidatorConfig<TExtension> = [TExtension] extends [
|
|
|
62
88
|
} : {
|
|
63
89
|
validator: TExtension;
|
|
64
90
|
};
|
|
65
|
-
type SetupExtensionConfig<TBaseSchemas, TBaseStates, TBaseValidator, TExtendSchemas extends SetupSchemas, TExtendStates extends Record<string, SetupStateSchema>, TExtendActionMap extends Sources['actions'], TExtendActorMap extends Sources['actors'], TExtendGuardMap extends Sources['guards'], TExtendDelayMap extends Sources['delays'], TExtendValidator extends ActorLogicValidator | undefined | InheritedValidator> = Omit<SetupConfig<TExtendSchemas, TExtendStates, TExtendActionMap, TExtendActorMap, TExtendGuardMap, TExtendDelayMap>, 'validator'
|
|
91
|
+
type SetupExtensionConfig<TBaseSchemas, TBaseStates, TBaseValidator, TExtendSchemas extends SetupSchemas, TExtendStates extends Record<string, SetupStateSchema>, TExtendActionMap extends Sources['actions'], TExtendActorMap extends Sources['actors'], TExtendGuardMap extends Sources['guards'], TExtendDelayMap extends Sources['delays'], TExtendValidator extends ActorLogicValidator | undefined | InheritedValidator> = Omit<SetupConfig<TExtendSchemas, TExtendStates, TExtendActionMap, TExtendActorMap, TExtendGuardMap, TExtendDelayMap>, 'validator' | 'guards' | 'delays'> & {
|
|
92
|
+
guards?: TExtendGuardMap & SetupGuardSources<NoInfer<MergedSetupSchemas<TBaseSchemas, TExtendSchemas>>>;
|
|
93
|
+
delays?: TExtendDelayMap & SetupDelaySources<NoInfer<MergedSetupSchemas<TBaseSchemas, TExtendSchemas>>>;
|
|
94
|
+
} & ExtendValidatorConfig<TExtendValidator> & RuntimeValidationCompatibility<NoInfer<TBaseSchemas>, NoInfer<TBaseStates>, ResolveExtendedValidator<TBaseValidator, TExtendValidator>> & RuntimeValidationConstraint<NoInfer<TExtendSchemas>, NoInfer<TExtendStates>, ResolveExtendedValidator<TBaseValidator, TExtendValidator>>;
|
|
66
95
|
type InlineMachineSchemas<TContextSchema, TEventSchemaMap, TInternalEventSchemaMap, TEmittedSchemaMap, TActionSchemaMap, TGuardSchemaMap, TInputSchema, TOutputSchema, TMetaSchema, TTagSchema, TChildrenSchemaMap> = {
|
|
67
96
|
context?: TContextSchema;
|
|
68
97
|
events?: TEventSchemaMap;
|
|
@@ -330,7 +359,7 @@ type MergeStateSchema<TConfig extends StateSchema, TSetup extends StateSchema> =
|
|
|
330
359
|
type SetupMachineConfig<TStateSchemas extends Record<string, SetupStateSchema>, TStateKeys extends string, TSchemas extends SetupSchemas, TContextSchema extends StandardSchemaV1, TEventSchemaMap extends Record<string, StandardSchemaV1>, TInternalEventSchemaMap extends Record<string, StandardSchemaV1>, TEmittedSchemaMap extends Record<string, StandardSchemaV1>, TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TMetaSchema extends StandardSchemaV1, TTagSchema extends StandardSchemaV1, TChildrenSchemaMap extends Record<string, StandardSchemaV1>, TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TDelays extends string, TTag extends string, TEmitted extends EventObject, TMeta extends MetaObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TSystemRegistry extends SystemRegistry, TContextRequired extends boolean, TRootDelays extends string = TDelays, TRootActionMap extends Sources['actions'] = TActionMap, TRootActorMap extends Sources['actors'] = TActorMap, TRootGuardMap extends Sources['guards'] = TGuardMap> = Omit<Next_MachineConfig<SetupOrConfigSchema<TSchemas, 'context', TContextSchema>, SetupOrConfigSchemaMap<TSchemas, 'events', TEventSchemaMap>, SetupOrConfigSchemaMap<TSchemas, 'internalEvents', TInternalEventSchemaMap>, SetupOrConfigSchemaMap<TSchemas, 'emitted', TEmittedSchemaMap>, SetupOrConfigSchema<TSchemas, 'input', TInputSchema>, SetupOrConfigSchema<TSchemas, 'output', TOutputSchema>, SetupOrConfigSchema<TSchemas, 'meta', TMetaSchema>, SetupOrConfigSchema<TSchemas, 'tags', TTagSchema>, SetupOrConfigSchemaMap<TSchemas, 'children', TChildrenSchemaMap>, TContext, TEvent, TChildren, TDelays, TTag, TActionMap, TActorMap, TGuardMap, TDelayMap, TContextRequired, TSystemRegistry>, 'states' | 'initial' | 'on' | 'always' | 'invoke' | 'actions' | 'actors' | 'guards' | 'delays'> & {
|
|
331
360
|
actions?: TRootActionMap;
|
|
332
361
|
actors?: TRootActorMap;
|
|
333
|
-
guards?: TRootGuardMap
|
|
362
|
+
guards?: TRootGuardMap & GuardSourceMap<TContext, TEvent>;
|
|
334
363
|
delays?: {
|
|
335
364
|
[K in TRootDelays | number]?: number | (({ context, event, stateNode }: {
|
|
336
365
|
context: TContext;
|
|
@@ -537,7 +566,7 @@ export type SetupReturnFromConfig<TConfig extends AnySetupConfig, TSystemRegistr
|
|
|
537
566
|
type SetupFunction<TSystemRegistry extends SystemRegistry = SystemRegistry> = {
|
|
538
567
|
(): SetupReturn<Record<string, SetupStateSchema>, {}, {}, {}, {}, {}, never, TSystemRegistry>;
|
|
539
568
|
<const TSchemas extends SetupSchemas = {}, const TStates extends Record<string, SetupStateSchema> = Record<string, SetupStateSchema>, TActionMap extends Sources['actions'] = {}, TActorMap extends Sources['actors'] = {}, TGuardMap extends Sources['guards'] = {}, TDelayMap extends Sources['delays'] = {}, const TValidator extends ActorLogicValidator | undefined = undefined>(config: SetupConfig<TSchemas, TStates, TActionMap, TActorMap, TGuardMap, TDelayMap, TValidator> & RuntimeValidationConstraint<NoInfer<TSchemas>, NoInfer<TStates>, TValidator>): SetupReturn<TStates, TSchemas, TActionMap, TActorMap, TGuardMap, TDelayMap, Extract<keyof TDelayMap, string>, TSystemRegistry, TValidator>;
|
|
540
|
-
<const TConfig extends AnySetupConfig>(config: TConfig & RuntimeValidationConstraint<NoInfer<SetupConfigSchemas<TConfig>>, NoInfer<SetupConfigStates<TConfig>>, TConfig extends {
|
|
569
|
+
<const TConfig extends AnySetupConfig>(config: TConfig & SetupSourceCompanions<SetupConfigSchemas<TConfig>> & RuntimeValidationConstraint<NoInfer<SetupConfigSchemas<TConfig>>, NoInfer<SetupConfigStates<TConfig>>, TConfig extends {
|
|
541
570
|
validator: infer TValidator;
|
|
542
571
|
} ? TValidator : undefined>): SetupReturnFromConfig<TConfig, TSystemRegistry>;
|
|
543
572
|
};
|
|
@@ -101,7 +101,7 @@ export type OutputArg<TEvent extends EventObject> = TEvent extends {
|
|
|
101
101
|
export type ActionArgs<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject> = UnifiedArg<TContext, TExpressionEvent, TEvent> & {
|
|
102
102
|
children: Record<string, AnyActor>;
|
|
103
103
|
};
|
|
104
|
-
export type InputFrom<T> = T extends
|
|
104
|
+
export type InputFrom<T> = T extends ActorLogic<infer _TSnapshot, infer _TEvent, infer TInput, infer _TSystem, infer _TEmitted> ? TInput : T extends StateMachine<infer _TContext, infer _TEvent, infer _TChildren, infer _TStateValue, infer _TTag, infer TInput, infer _TOutput, infer _TEmitted, infer _TMeta, infer _TStateSchema, infer _TActionMap, infer _TActorMap, infer _TGuardMap, infer _TDelayMap> ? TInput : never;
|
|
105
105
|
export type OutputFrom<T> = T extends ActorLogic<infer TSnapshot, infer _TEvent, infer _TInput, infer _TSystem, infer _TEmitted> ? (TSnapshot & {
|
|
106
106
|
status: 'done';
|
|
107
107
|
})['output'] : T extends ActorRef<infer TSnapshot, infer _TEvent, infer _TEmitted> ? (TSnapshot & {
|
|
@@ -1247,7 +1247,7 @@ export type EnqueueObject<TEvent extends EventObject, TEmittedEvent extends Even
|
|
|
1247
1247
|
id?: string;
|
|
1248
1248
|
delay?: number;
|
|
1249
1249
|
}) => void;
|
|
1250
|
-
stop: (actor?:
|
|
1250
|
+
stop: (actor?: AnyActorRef) => void;
|
|
1251
1251
|
/**
|
|
1252
1252
|
* Listen to emitted events from an actor. Returns a listener actor that can
|
|
1253
1253
|
* be stopped via `enq.stop()`.
|
|
@@ -1257,7 +1257,7 @@ export type EnqueueObject<TEvent extends EventObject, TEmittedEvent extends Even
|
|
|
1257
1257
|
* wildcards: 'event._', '_')
|
|
1258
1258
|
* @param mapper - Function to transform emitted events into machine events
|
|
1259
1259
|
*/
|
|
1260
|
-
listen: <TEmitted extends EventObject, TMappedEvent extends TEvent>(actor:
|
|
1260
|
+
listen: <TEmitted extends EventObject, TMappedEvent extends TEvent>(actor: AnyActorRef, eventType: string, mapper: (event: TEmitted) => TMappedEvent) => AnyActor;
|
|
1261
1261
|
/**
|
|
1262
1262
|
* Subscribe to lifecycle events (done/error/snapshot) from an actor. Returns
|
|
1263
1263
|
* a subscription actor that can be stopped via `enq.stop()`.
|
|
@@ -1266,7 +1266,7 @@ export type EnqueueObject<TEvent extends EventObject, TEmittedEvent extends Even
|
|
|
1266
1266
|
* @param mappers - Object with done/error/snapshot mappers, or a single
|
|
1267
1267
|
* snapshot mapper function
|
|
1268
1268
|
*/
|
|
1269
|
-
subscribeTo: <TActor extends
|
|
1269
|
+
subscribeTo: <TActor extends AnyActorRef, TMappedEvent extends TEvent>(actor: TActor, mappers: SubscribeToMappers<SnapshotFrom<TActor>, OutputFrom<TActor>, TMappedEvent> | ((snapshot: SnapshotFrom<TActor>) => TMappedEvent)) => AnyActor;
|
|
1270
1270
|
};
|
|
1271
1271
|
export type Action<TContext extends MachineContext, TEvent extends EventObject, TEmittedEvent extends EventObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TParams = Record<string, unknown> | undefined, _TCtx = [TContext] extends [never] ? any : TContext> = (_: {
|
|
1272
1272
|
context: _TCtx;
|
|
@@ -132,7 +132,7 @@ export type Next_MachineConfig<TContextSchema extends StandardSchemaV1, TEventSc
|
|
|
132
132
|
internalEvents?: readonly InternalEventDescriptorFor<TEvent>[];
|
|
133
133
|
schemas?: MachineSchemas<TContextSchema, TEventSchemaMap, TInternalEventSchemaMap, TEmittedSchemaMap, TInputSchema, TOutputSchema, TMetaSchema, TTagSchema, TChildrenSchemaMap>;
|
|
134
134
|
actions?: TActionMap;
|
|
135
|
-
guards?: TGuardMap
|
|
135
|
+
guards?: TGuardMap & GuardSourceMap<TContext, TEvent>;
|
|
136
136
|
actors?: TActorMap;
|
|
137
137
|
/** The machine's own version. */
|
|
138
138
|
version?: string;
|
|
@@ -504,12 +504,34 @@ export interface Sources {
|
|
|
504
504
|
context?: any;
|
|
505
505
|
children?: any;
|
|
506
506
|
}>;
|
|
507
|
-
guards: Record<string,
|
|
508
|
-
delays: Record<string, number |
|
|
507
|
+
guards: Record<string, Function>;
|
|
508
|
+
delays: Record<string, number | Function>;
|
|
509
509
|
actors: Record<string, AnyActorLogic>;
|
|
510
510
|
}
|
|
511
|
-
|
|
512
|
-
|
|
511
|
+
/**
|
|
512
|
+
* Contextually types the entries of a `guards: { ... }` source map. Guard
|
|
513
|
+
* sources receive the transition args object first and optional caller-supplied
|
|
514
|
+
* params after it.
|
|
515
|
+
*/
|
|
516
|
+
export type GuardSourceMap<TContext extends MachineContext, TEvent extends EventObject, _TCtx = [TContext] extends [never] ? any : TContext> = Record<string, (args: {
|
|
517
|
+
context: _TCtx;
|
|
518
|
+
event: TEvent;
|
|
519
|
+
self: AnyActorRef;
|
|
520
|
+
parent: AnyActorRef | undefined;
|
|
521
|
+
value: StateValue;
|
|
522
|
+
children: Record<string, AnyActorRef | undefined>;
|
|
523
|
+
}, ...params: any[]) => boolean>;
|
|
524
|
+
/**
|
|
525
|
+
* Contextually types the entries of a `delays: { ... }` source map. Delay
|
|
526
|
+
* functions receive `{ context, event, stateNode }` at runtime.
|
|
527
|
+
*/
|
|
528
|
+
export type DelaySourceMap<TContext extends MachineContext, TEvent extends EventObject, _TCtx = [TContext] extends [never] ? any : TContext> = Record<string, number | ((args: {
|
|
529
|
+
context: _TCtx;
|
|
530
|
+
event: TEvent;
|
|
531
|
+
stateNode: AnyStateNode;
|
|
532
|
+
}) => number)>;
|
|
533
|
+
export type DelayMapFromNames<TDelays extends string, TDelayMap extends Sources['delays']> = string extends TDelays ? Sources['delays'] : {
|
|
534
|
+
[K in TDelays]: K extends keyof TDelayMap ? TDelayMap[K] : number | ((...args: any[]) => number);
|
|
513
535
|
};
|
|
514
536
|
type DelayNamesFromConfig<TConfig> = TConfig extends {
|
|
515
537
|
delays: infer TDelays;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createActor = require('./createActor-
|
|
3
|
+
var createActor = require('./createActor-6736cbbe.development.cjs.js');
|
|
4
4
|
|
|
5
5
|
function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
|
|
6
6
|
if (!microsteps.length) {
|
|
@@ -130,6 +130,9 @@ function getInitialMicrosteps(machine, ...[input]) {
|
|
|
130
130
|
* deterministic order
|
|
131
131
|
*/
|
|
132
132
|
function getNextTransitions(state) {
|
|
133
|
+
if (state.status !== 'active') {
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
133
136
|
const potentialTransitions = [];
|
|
134
137
|
const atomicStates = state.nodes.filter(createActor.isAtomicStateNode);
|
|
135
138
|
const visited = new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aa as createInertActorScope, ab as setInertActorScopeSnapshot, f as finalizeTransitionResult, ac as attachSnapshotActorRef, K as createInitEvent, az as hasAmbientInspector, a as beginSpawnAllocation, ad as macrostep, ao as createSpawnEffect, ap as initialMicrostep, j as isAtomicStateNode, aA as getProperAncestors, aB as isRemoteActorRef, aC as getActorIdPrefix } from './createActor-
|
|
1
|
+
import { aa as createInertActorScope, ab as setInertActorScopeSnapshot, f as finalizeTransitionResult, ac as attachSnapshotActorRef, K as createInitEvent, az as hasAmbientInspector, a as beginSpawnAllocation, ad as macrostep, ao as createSpawnEffect, ap as initialMicrostep, j as isAtomicStateNode, aA as getProperAncestors, aB as isRemoteActorRef, aC as getActorIdPrefix } from './createActor-915ea40c.esm.js';
|
|
2
2
|
|
|
3
3
|
function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
|
|
4
4
|
if (!microsteps.length) {
|
|
@@ -128,6 +128,9 @@ function getInitialMicrosteps(machine, ...[input]) {
|
|
|
128
128
|
* deterministic order
|
|
129
129
|
*/
|
|
130
130
|
function getNextTransitions(state) {
|
|
131
|
+
if (state.status !== 'active') {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
131
134
|
const potentialTransitions = [];
|
|
132
135
|
const atomicStates = state.nodes.filter(isAtomicStateNode);
|
|
133
136
|
const visited = new Set();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var createActor = require('./createActor-
|
|
3
|
+
var createActor = require('./createActor-bfe8b6bd.cjs.js');
|
|
4
4
|
|
|
5
5
|
function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
|
|
6
6
|
if (!microsteps.length) {
|
|
@@ -130,6 +130,9 @@ function getInitialMicrosteps(machine, ...[input]) {
|
|
|
130
130
|
* deterministic order
|
|
131
131
|
*/
|
|
132
132
|
function getNextTransitions(state) {
|
|
133
|
+
if (state.status !== 'active') {
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
133
136
|
const potentialTransitions = [];
|
|
134
137
|
const atomicStates = state.nodes.filter(createActor.isAtomicStateNode);
|
|
135
138
|
const visited = new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aa as createInertActorScope, ab as setInertActorScopeSnapshot, f as finalizeTransitionResult, ac as attachSnapshotActorRef, K as createInitEvent, az as hasAmbientInspector, a as beginSpawnAllocation, ad as macrostep, ao as createSpawnEffect, ap as initialMicrostep, j as isAtomicStateNode, aA as getProperAncestors, aB as isRemoteActorRef, aC as getActorIdPrefix } from './createActor-
|
|
1
|
+
import { aa as createInertActorScope, ab as setInertActorScopeSnapshot, f as finalizeTransitionResult, ac as attachSnapshotActorRef, K as createInitEvent, az as hasAmbientInspector, a as beginSpawnAllocation, ad as macrostep, ao as createSpawnEffect, ap as initialMicrostep, j as isAtomicStateNode, aA as getProperAncestors, aB as isRemoteActorRef, aC as getActorIdPrefix } from './createActor-ff132afa.development.esm.js';
|
|
2
2
|
|
|
3
3
|
function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
|
|
4
4
|
if (!microsteps.length) {
|
|
@@ -128,6 +128,9 @@ function getInitialMicrosteps(machine, ...[input]) {
|
|
|
128
128
|
* deterministic order
|
|
129
129
|
*/
|
|
130
130
|
function getNextTransitions(state) {
|
|
131
|
+
if (state.status !== 'active') {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
131
134
|
const potentialTransitions = [];
|
|
132
135
|
const atomicStates = state.nodes.filter(isAtomicStateNode);
|
|
133
136
|
const visited = new Set();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as createInitEvent, e as XSTATE_STOP, L as createCustomEffect, M as XSTATE_LOGIC_EFFECT_START, N as XSTATE_LOGIC_EFFECT_RESOLVE, O as XSTATE_LOGIC_EFFECT_REJECT, f as finalizeTransitionResult, P as createEmitEffect, h as createSendToEffect, X as XSTATE_INIT, p as parseDelayToMilliseconds, H as runStep, k as createActor } from './createActor-
|
|
1
|
+
import { K as createInitEvent, e as XSTATE_STOP, L as createCustomEffect, M as XSTATE_LOGIC_EFFECT_START, N as XSTATE_LOGIC_EFFECT_RESOLVE, O as XSTATE_LOGIC_EFFECT_REJECT, f as finalizeTransitionResult, P as createEmitEffect, h as createSendToEffect, X as XSTATE_INIT, p as parseDelayToMilliseconds, H as runStep, k as createActor } from './createActor-ff132afa.development.esm.js';
|
|
2
2
|
|
|
3
3
|
function assertValid(validator, request) {
|
|
4
4
|
const error = validator.check(request);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as createInitEvent, e as XSTATE_STOP, L as createCustomEffect, M as XSTATE_LOGIC_EFFECT_START, N as XSTATE_LOGIC_EFFECT_RESOLVE, O as XSTATE_LOGIC_EFFECT_REJECT, f as finalizeTransitionResult, P as createEmitEffect, h as createSendToEffect, X as XSTATE_INIT, p as parseDelayToMilliseconds, H as runStep, k as createActor } from './createActor-
|
|
1
|
+
import { K as createInitEvent, e as XSTATE_STOP, L as createCustomEffect, M as XSTATE_LOGIC_EFFECT_START, N as XSTATE_LOGIC_EFFECT_RESOLVE, O as XSTATE_LOGIC_EFFECT_REJECT, f as finalizeTransitionResult, P as createEmitEffect, h as createSendToEffect, X as XSTATE_INIT, p as parseDelayToMilliseconds, H as runStep, k as createActor } from './createActor-915ea40c.esm.js';
|
|
2
2
|
|
|
3
3
|
function assertValid(validator, request) {
|
|
4
4
|
const error = validator.check(request);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var createActor = require('./createActor-
|
|
6
|
-
var dist_xstateActors = require('./index-
|
|
5
|
+
var createActor = require('./createActor-bfe8b6bd.cjs.js');
|
|
6
|
+
var dist_xstateActors = require('./index-b3fe59bc.cjs.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var createActor = require('./createActor-
|
|
6
|
-
var dist_xstateActors = require('./index-
|
|
5
|
+
var createActor = require('./createActor-6736cbbe.development.cjs.js');
|
|
6
|
+
var dist_xstateActors = require('./index-0f498ef2.development.cjs.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { l as createListenerLogic, n as createSubscriptionLogic, o as listenerLogic, s as subscriptionLogic } from './createActor-
|
|
2
|
-
export { T as TimeoutError, c as createAsyncLogic, a as createCallbackLogic, b as createEmptyActor, d as createEventObservableLogic, e as createLogic, f as createObservableLogic } from './index-
|
|
1
|
+
export { l as createListenerLogic, n as createSubscriptionLogic, o as listenerLogic, s as subscriptionLogic } from './createActor-ff132afa.development.esm.js';
|
|
2
|
+
export { T as TimeoutError, c as createAsyncLogic, a as createCallbackLogic, b as createEmptyActor, d as createEventObservableLogic, e as createLogic, f as createObservableLogic } from './index-70d56425.development.esm.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { l as createListenerLogic, n as createSubscriptionLogic, o as listenerLogic, s as subscriptionLogic } from './createActor-
|
|
2
|
-
export { T as TimeoutError, c as createAsyncLogic, a as createCallbackLogic, b as createEmptyActor, d as createEventObservableLogic, e as createLogic, f as createObservableLogic } from './index-
|
|
1
|
+
export { l as createListenerLogic, n as createSubscriptionLogic, o as listenerLogic, s as subscriptionLogic } from './createActor-915ea40c.esm.js';
|
|
2
|
+
export { T as TimeoutError, c as createAsyncLogic, a as createCallbackLogic, b as createEmptyActor, d as createEventObservableLogic, e as createLogic, f as createObservableLogic } from './index-b051c924.esm.js';
|