xstate 5.21.0 → 5.22.1
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/actions/dist/xstate-actions.cjs.js +3 -3
- package/actions/dist/xstate-actions.development.cjs.js +3 -3
- package/actions/dist/xstate-actions.development.esm.js +3 -3
- package/actions/dist/xstate-actions.esm.js +3 -3
- package/actions/dist/xstate-actions.umd.min.js +1 -1
- package/actions/dist/xstate-actions.umd.min.js.map +1 -1
- package/actors/dist/xstate-actors.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.esm.js +1 -1
- package/actors/dist/xstate-actors.esm.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js.map +1 -1
- package/dist/{StateMachine-a87228f5.development.cjs.js → StateMachine-04e45472.development.cjs.js} +2 -2
- package/dist/{StateMachine-865e00e8.cjs.js → StateMachine-6b1e04a5.cjs.js} +2 -2
- package/dist/{StateMachine-31b70dc4.esm.js → StateMachine-98210250.esm.js} +2 -2
- package/dist/{StateMachine-30043f16.development.esm.js → StateMachine-db2d9df9.development.esm.js} +2 -2
- package/dist/{assign-a4be500b.development.cjs.js → assign-25d97d7a.development.cjs.js} +1 -1
- package/dist/{assign-381d0341.cjs.js → assign-2b42098b.cjs.js} +1 -1
- package/dist/{assign-828d933a.esm.js → assign-f458d6cf.esm.js} +1 -1
- package/dist/{assign-55675fdf.development.esm.js → assign-fb4707fe.development.esm.js} +1 -1
- package/dist/declarations/src/actions/send.d.ts +3 -3
- package/dist/declarations/src/createActor.d.ts +1 -1
- package/dist/declarations/src/setup.d.ts +43 -0
- package/dist/{log-ee7045aa.development.cjs.js → log-1e0b7d69.development.cjs.js} +2 -2
- package/dist/{log-752e55b8.development.esm.js → log-368dd776.development.esm.js} +3 -3
- package/dist/{log-b74eb32d.esm.js → log-7e8bf109.esm.js} +3 -3
- package/dist/{log-63c8f21f.cjs.js → log-c2aa7870.cjs.js} +2 -2
- package/dist/{raise-bfb6713e.esm.js → raise-4751acd2.esm.js} +6 -6
- package/dist/{raise-b4a670a0.cjs.js → raise-74fc6715.cjs.js} +5 -5
- package/dist/{raise-c94748d0.development.cjs.js → raise-999e706e.development.cjs.js} +5 -5
- package/dist/{raise-3d0be313.development.esm.js → raise-f7b216be.development.esm.js} +6 -6
- package/dist/xstate.cjs.js +15 -5
- package/dist/xstate.development.cjs.js +15 -5
- package/dist/xstate.development.esm.js +18 -6
- package/dist/xstate.esm.js +18 -6
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/graph/dist/xstate-graph.cjs.js +3 -3
- package/graph/dist/xstate-graph.development.cjs.js +3 -3
- package/graph/dist/xstate-graph.development.esm.js +3 -3
- package/graph/dist/xstate-graph.esm.js +3 -3
- package/graph/dist/xstate-graph.umd.min.js +1 -1
- package/graph/dist/xstate-graph.umd.min.js.map +1 -1
- package/guards/dist/xstate-guards.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.esm.js +1 -1
- package/guards/dist/xstate-guards.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
4
|
-
var assign = require('./assign-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-74fc6715.cjs.js');
|
|
4
|
+
var assign = require('./assign-2b42098b.cjs.js');
|
|
5
5
|
|
|
6
6
|
const cache = new WeakMap();
|
|
7
7
|
function memo(object, key, fn) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as STATE_DELIMITER, l as mapValues, t as toArray, q as formatTransitions, u as toTransitionConfigArray, v as formatTransition, N as NULL_EVENT, w as evaluateGuard, x as createInvokeId, y as getDelayedTransitions, z as formatInitialTransition, B as getCandidates, C as resolveStateValue, D as getAllStateNodes, g as getStateNodes, E as createMachineSnapshot, F as isInFinalState, G as macrostep, H as transitionNode, I as resolveActionsAndContext, J as createInitEvent, K as microstep, L as getInitialStateNodes, M as toStatePath, O as isStateId, P as getStateNodeByPath, Q as getPersistedSnapshot, R as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
2
|
-
import { a as assign } from './assign-
|
|
1
|
+
import { S as STATE_DELIMITER, l as mapValues, t as toArray, q as formatTransitions, u as toTransitionConfigArray, v as formatTransition, N as NULL_EVENT, w as evaluateGuard, x as createInvokeId, y as getDelayedTransitions, z as formatInitialTransition, B as getCandidates, C as resolveStateValue, D as getAllStateNodes, g as getStateNodes, E as createMachineSnapshot, F as isInFinalState, G as macrostep, H as transitionNode, I as resolveActionsAndContext, J as createInitEvent, K as microstep, L as getInitialStateNodes, M as toStatePath, O as isStateId, P as getStateNodeByPath, Q as getPersistedSnapshot, R as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-4751acd2.esm.js';
|
|
2
|
+
import { a as assign } from './assign-f458d6cf.esm.js';
|
|
3
3
|
|
|
4
4
|
const cache = new WeakMap();
|
|
5
5
|
function memo(object, key, fn) {
|
package/dist/{StateMachine-30043f16.development.esm.js → StateMachine-db2d9df9.development.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as STATE_DELIMITER, l as mapValues, t as toArray, q as formatTransitions, u as toTransitionConfigArray, v as formatTransition, N as NULL_EVENT, w as evaluateGuard, x as createInvokeId, y as getDelayedTransitions, z as formatInitialTransition, B as getCandidates, C as resolveStateValue, D as getAllStateNodes, g as getStateNodes, E as createMachineSnapshot, F as isInFinalState, G as macrostep, H as transitionNode, I as resolveActionsAndContext, J as createInitEvent, K as microstep, L as getInitialStateNodes, M as toStatePath, O as isStateId, P as getStateNodeByPath, Q as getPersistedSnapshot, R as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
2
|
-
import { a as assign } from './assign-
|
|
1
|
+
import { S as STATE_DELIMITER, l as mapValues, t as toArray, q as formatTransitions, u as toTransitionConfigArray, v as formatTransition, N as NULL_EVENT, w as evaluateGuard, x as createInvokeId, y as getDelayedTransitions, z as formatInitialTransition, B as getCandidates, C as resolveStateValue, D as getAllStateNodes, g as getStateNodes, E as createMachineSnapshot, F as isInFinalState, G as macrostep, H as transitionNode, I as resolveActionsAndContext, J as createInitEvent, K as microstep, L as getInitialStateNodes, M as toStatePath, O as isStateId, P as getStateNodeByPath, Q as getPersistedSnapshot, R as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-f7b216be.development.esm.js';
|
|
2
|
+
import { a as assign } from './assign-fb4707fe.development.esm.js';
|
|
3
3
|
|
|
4
4
|
const cache = new WeakMap();
|
|
5
5
|
function memo(object, key, fn) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as ProcessingStatus, R as resolveReferencedActor, c as createActor, W as cloneMachineSnapshot } from './raise-
|
|
1
|
+
import { V as ProcessingStatus, R as resolveReferencedActor, c as createActor, W as cloneMachineSnapshot } from './raise-4751acd2.esm.js';
|
|
2
2
|
|
|
3
3
|
function createSpawner(actorScope, {
|
|
4
4
|
machine,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as ProcessingStatus, R as resolveReferencedActor, c as createActor, Y as cloneMachineSnapshot, T as executingCustomAction } from './raise-
|
|
1
|
+
import { W as ProcessingStatus, R as resolveReferencedActor, c as createActor, Y as cloneMachineSnapshot, T as executingCustomAction } from './raise-f7b216be.development.esm.js';
|
|
2
2
|
|
|
3
3
|
function createSpawner(actorScope, {
|
|
4
4
|
machine,
|
|
@@ -14,7 +14,7 @@ export interface SendToAction<TContext extends MachineContext, TExpressionEvent
|
|
|
14
14
|
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
15
15
|
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
16
16
|
*/
|
|
17
|
-
export declare function sendTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TTargetActor extends AnyActorRef, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(to:
|
|
17
|
+
export declare function sendTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TTargetActor extends AnyActorRef, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(to: SendToActionTarget<TContext, TExpressionEvent, TParams, TTargetActor, TEvent>, eventOrExpr: EventFrom<TTargetActor> | SendExpr<TContext, TExpressionEvent, TParams, InferEvent<Cast<EventFrom<TTargetActor>, EventObject>>, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, DoNotInfer<TEvent>, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay, never>;
|
|
18
18
|
/**
|
|
19
19
|
* Sends an event to this machine's parent.
|
|
20
20
|
*
|
|
@@ -22,14 +22,14 @@ export declare function sendTo<TContext extends MachineContext, TExpressionEvent
|
|
|
22
22
|
* @param options Options to pass into the send event.
|
|
23
23
|
*/
|
|
24
24
|
export declare function sendParent<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TSentEvent extends EventObject = AnyEventObject, TEvent extends EventObject = AnyEventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(event: TSentEvent | SendExpr<TContext, TExpressionEvent, TParams, TSentEvent, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay, never>;
|
|
25
|
-
type
|
|
25
|
+
type SendToActionTarget<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TTargetActor extends AnyActorRef, TEvent extends EventObject> = string | TTargetActor | ((args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams) => string | TTargetActor);
|
|
26
26
|
/**
|
|
27
27
|
* Forwards (sends) an event to the `target` actor.
|
|
28
28
|
*
|
|
29
29
|
* @param target The target actor to forward the event to.
|
|
30
30
|
* @param options Options to pass into the send action creator.
|
|
31
31
|
*/
|
|
32
|
-
export declare function forwardTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(target:
|
|
32
|
+
export declare function forwardTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(target: SendToActionTarget<TContext, TExpressionEvent, TParams, AnyActorRef, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay, never>;
|
|
33
33
|
export interface ExecutableSendToAction extends ExecutableActionObject {
|
|
34
34
|
type: 'xstate.sendTo';
|
|
35
35
|
params: {
|
|
@@ -33,7 +33,7 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
|
|
|
33
33
|
_parent?: AnyActorRef;
|
|
34
34
|
ref: ActorRef<SnapshotFrom<TLogic>, EventFromLogic<TLogic>, EmittedFrom<TLogic>>;
|
|
35
35
|
private _actorScope;
|
|
36
|
-
|
|
36
|
+
systemId: string | undefined;
|
|
37
37
|
/** The globally unique process ID for this invocation. */
|
|
38
38
|
sessionId: string;
|
|
39
39
|
/** The system to which this actor belongs. */
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { StateMachine } from "./StateMachine.js";
|
|
2
|
+
import { assign } from "./actions/assign.js";
|
|
3
|
+
import { cancel } from "./actions/cancel.js";
|
|
4
|
+
import { emit } from "./actions/emit.js";
|
|
5
|
+
import { enqueueActions } from "./actions/enqueueActions.js";
|
|
6
|
+
import { log } from "./actions/log.js";
|
|
7
|
+
import { raise } from "./actions/raise.js";
|
|
8
|
+
import { sendTo } from "./actions/send.js";
|
|
9
|
+
import { spawnChild } from "./actions/spawnChild.js";
|
|
10
|
+
import { stopChild } from "./actions/stopChild.js";
|
|
2
11
|
import { GuardPredicate } from "./guards.js";
|
|
3
12
|
import { ActionFunction, AnyActorRef, AnyEventObject, Cast, DelayConfig, EventObject, Invert, IsNever, MachineConfig, MachineContext, MetaObject, NonReducibleUnknown, ParameterizedObject, SetupTypes, StateNodeConfig, ToChildren, ToStateValue, UnknownActorLogic, Values } from "./types.js";
|
|
4
13
|
type ToParameterizedObject<TParameterizedMap extends Record<string, ParameterizedObject['params'] | undefined>> = IsNever<TParameterizedMap> extends true ? never : Values<{
|
|
@@ -64,6 +73,40 @@ TActors extends Record<string, UnknownActorLogic> = {}, TChildrenMap extends Rec
|
|
|
64
73
|
* ```
|
|
65
74
|
*/
|
|
66
75
|
createStateConfig: <TStateConfig extends StateNodeConfig<TContext, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TTag, unknown, TEmitted, TMeta>>(config: TStateConfig) => TStateConfig;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a type-safe action.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* const machineSetup = setup({
|
|
83
|
+
* // ...
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* const action = machineSetup.createAction(({ context, event }) => {
|
|
87
|
+
* console.log(context.count, event.value);
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* const incrementAction = machineSetup.createAction(
|
|
91
|
+
* assign({ count: ({ context }) => context.count + 1 })
|
|
92
|
+
* );
|
|
93
|
+
*
|
|
94
|
+
* const machine = machineSetup.createMachine({
|
|
95
|
+
* context: { count: 0 },
|
|
96
|
+
* entry: [action, incrementAction]
|
|
97
|
+
* });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
createAction: (action: ActionFunction<TContext, TEvent, TEvent, unknown, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TEmitted>) => typeof action;
|
|
67
101
|
createMachine: <const TConfig extends MachineConfig<TContext, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TTag, TInput, TOutput, TEmitted, TMeta>>(config: TConfig) => StateMachine<TContext, TEvent, Cast<ToChildren<ToProvidedActor<TChildrenMap, TActors>>, Record<string, AnyActorRef | undefined>>, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, ToStateValue<TConfig>, TTag, TInput, TOutput, TEmitted, TMeta, TConfig>;
|
|
102
|
+
assign: typeof assign<TContext, TEvent, undefined, TEvent, ToProvidedActor<TChildrenMap, TActors>>;
|
|
103
|
+
sendTo: <TTargetActor extends AnyActorRef>(...args: Parameters<typeof sendTo<TContext, TEvent, undefined, TTargetActor, TEvent, TDelay, TDelay>>) => ReturnType<typeof sendTo<TContext, TEvent, undefined, TTargetActor, TEvent, TDelay, TDelay>>;
|
|
104
|
+
raise: typeof raise<TContext, TEvent, TEvent, undefined, TDelay, TDelay>;
|
|
105
|
+
log: typeof log<TContext, TEvent, undefined, TEvent>;
|
|
106
|
+
cancel: typeof cancel<TContext, TEvent, undefined, TEvent>;
|
|
107
|
+
stopChild: typeof stopChild<TContext, TEvent, undefined, TEvent>;
|
|
108
|
+
enqueueActions: typeof enqueueActions<TContext, TEvent, undefined, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TEmitted>;
|
|
109
|
+
emit: typeof emit<TContext, TEvent, undefined, TEvent, TEmitted>;
|
|
110
|
+
spawnChild: typeof spawnChild<TContext, TEvent, undefined, TEvent, ToProvidedActor<TChildrenMap, TActors>>;
|
|
68
111
|
};
|
|
69
112
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
4
|
-
var assign = require('./assign-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-999e706e.development.cjs.js');
|
|
4
|
+
var assign = require('./assign-25d97d7a.development.cjs.js');
|
|
5
5
|
|
|
6
6
|
function resolveEmit(_, snapshot, args, actionParams, {
|
|
7
7
|
event: eventOrExpr
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as executingCustomAction, U as XSTATE_ERROR, V as createErrorActorEvent, w as evaluateGuard,
|
|
2
|
-
import { a as assign } from './assign-
|
|
1
|
+
import { T as executingCustomAction, U as XSTATE_ERROR, V as createErrorActorEvent, w as evaluateGuard, a as cancel, r as raise, b as spawnChild, s as stopChild } from './raise-f7b216be.development.esm.js';
|
|
2
|
+
import { a as assign } from './assign-fb4707fe.development.esm.js';
|
|
3
3
|
|
|
4
4
|
function resolveEmit(_, snapshot, args, actionParams, {
|
|
5
5
|
event: eventOrExpr
|
|
@@ -406,4 +406,4 @@ function log(value = ({
|
|
|
406
406
|
return log;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
export { SpecialTargets as S,
|
|
409
|
+
export { SpecialTargets as S, emit as a, sendParent as b, enqueueActions as e, forwardTo as f, log as l, sendTo as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as XSTATE_ERROR, U as createErrorActorEvent, w as evaluateGuard,
|
|
2
|
-
import { a as assign } from './assign-
|
|
1
|
+
import { T as XSTATE_ERROR, U as createErrorActorEvent, w as evaluateGuard, a as cancel, r as raise, b as spawnChild, s as stopChild } from './raise-4751acd2.esm.js';
|
|
2
|
+
import { a as assign } from './assign-f458d6cf.esm.js';
|
|
3
3
|
|
|
4
4
|
function resolveEmit(_, snapshot, args, actionParams, {
|
|
5
5
|
event: eventOrExpr
|
|
@@ -378,4 +378,4 @@ function log(value = ({
|
|
|
378
378
|
return log;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
export { SpecialTargets as S,
|
|
381
|
+
export { SpecialTargets as S, emit as a, sendParent as b, enqueueActions as e, forwardTo as f, log as l, sendTo as s };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
4
|
-
var assign = require('./assign-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-74fc6715.cjs.js');
|
|
4
|
+
var assign = require('./assign-2b42098b.cjs.js');
|
|
5
5
|
|
|
6
6
|
function resolveEmit(_, snapshot, args, actionParams, {
|
|
7
7
|
event: eventOrExpr
|
|
@@ -482,7 +482,7 @@ class Actor {
|
|
|
482
482
|
this.ref = void 0;
|
|
483
483
|
// TODO: add typings for system
|
|
484
484
|
this._actorScope = void 0;
|
|
485
|
-
this.
|
|
485
|
+
this.systemId = void 0;
|
|
486
486
|
/** The globally unique process ID for this invocation. */
|
|
487
487
|
this.sessionId = void 0;
|
|
488
488
|
/** The system to which this actor belongs. */
|
|
@@ -588,7 +588,7 @@ class Actor {
|
|
|
588
588
|
actorRef: this
|
|
589
589
|
});
|
|
590
590
|
if (systemId) {
|
|
591
|
-
this.
|
|
591
|
+
this.systemId = systemId;
|
|
592
592
|
this.system._set(systemId, this);
|
|
593
593
|
}
|
|
594
594
|
this._initState(options?.snapshot ?? options?.state);
|
|
@@ -806,8 +806,8 @@ class Actor {
|
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
808
|
this.system._register(this.sessionId, this);
|
|
809
|
-
if (this.
|
|
810
|
-
this.system._set(this.
|
|
809
|
+
if (this.systemId) {
|
|
810
|
+
this.system._set(this.systemId, this);
|
|
811
811
|
}
|
|
812
812
|
this._processingStatus = ProcessingStatus.Running;
|
|
813
813
|
|
|
@@ -2546,7 +2546,7 @@ function getPersistedSnapshot(snapshot, options) {
|
|
|
2546
2546
|
childrenJson[id] = {
|
|
2547
2547
|
snapshot: child.getPersistedSnapshot(options),
|
|
2548
2548
|
src: child.src,
|
|
2549
|
-
systemId: child.
|
|
2549
|
+
systemId: child.systemId,
|
|
2550
2550
|
syncSnapshot: child._syncSnapshot
|
|
2551
2551
|
};
|
|
2552
2552
|
}
|
|
@@ -2647,4 +2647,4 @@ function raise(eventOrExpr, options) {
|
|
|
2647
2647
|
return raise;
|
|
2648
2648
|
}
|
|
2649
2649
|
|
|
2650
|
-
export { $$ACTOR_TYPE as $, Actor as A, getCandidates as B, resolveStateValue as C, getAllStateNodes as D, createMachineSnapshot as E, isInFinalState as F, macrostep as G, transitionNode as H, resolveActionsAndContext as I, createInitEvent as J, microstep as K, getInitialStateNodes as L, toStatePath as M, NULL_EVENT as N, isStateId as O, getStateNodeByPath as P, getPersistedSnapshot as Q, resolveReferencedActor as R, STATE_DELIMITER as S, XSTATE_ERROR as T, createErrorActorEvent as U, ProcessingStatus as V, cloneMachineSnapshot as W, XSTATE_STOP as X,
|
|
2650
|
+
export { $$ACTOR_TYPE as $, Actor as A, getCandidates as B, resolveStateValue as C, getAllStateNodes as D, createMachineSnapshot as E, isInFinalState as F, macrostep as G, transitionNode as H, resolveActionsAndContext as I, createInitEvent as J, microstep as K, getInitialStateNodes as L, toStatePath as M, NULL_EVENT as N, isStateId as O, getStateNodeByPath as P, getPersistedSnapshot as Q, resolveReferencedActor as R, STATE_DELIMITER as S, XSTATE_ERROR as T, createErrorActorEvent as U, ProcessingStatus as V, cloneMachineSnapshot as W, XSTATE_STOP as X, cancel as a, spawnChild as b, createActor as c, and as d, stateIn as e, isMachineSnapshot as f, getStateNodes as g, getAllOwnEventDescriptors as h, interpret as i, toObserver as j, stop as k, mapValues as l, matchesState as m, not as n, or as o, pathToStateValue as p, formatTransitions as q, raise as r, stopChild as s, toArray as t, toTransitionConfigArray as u, formatTransition as v, evaluateGuard as w, createInvokeId as x, getDelayedTransitions as y, formatInitialTransition as z };
|
|
@@ -484,7 +484,7 @@ class Actor {
|
|
|
484
484
|
this.ref = void 0;
|
|
485
485
|
// TODO: add typings for system
|
|
486
486
|
this._actorScope = void 0;
|
|
487
|
-
this.
|
|
487
|
+
this.systemId = void 0;
|
|
488
488
|
/** The globally unique process ID for this invocation. */
|
|
489
489
|
this.sessionId = void 0;
|
|
490
490
|
/** The system to which this actor belongs. */
|
|
@@ -590,7 +590,7 @@ class Actor {
|
|
|
590
590
|
actorRef: this
|
|
591
591
|
});
|
|
592
592
|
if (systemId) {
|
|
593
|
-
this.
|
|
593
|
+
this.systemId = systemId;
|
|
594
594
|
this.system._set(systemId, this);
|
|
595
595
|
}
|
|
596
596
|
this._initState(options?.snapshot ?? options?.state);
|
|
@@ -808,8 +808,8 @@ class Actor {
|
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
this.system._register(this.sessionId, this);
|
|
811
|
-
if (this.
|
|
812
|
-
this.system._set(this.
|
|
811
|
+
if (this.systemId) {
|
|
812
|
+
this.system._set(this.systemId, this);
|
|
813
813
|
}
|
|
814
814
|
this._processingStatus = ProcessingStatus.Running;
|
|
815
815
|
|
|
@@ -2548,7 +2548,7 @@ function getPersistedSnapshot(snapshot, options) {
|
|
|
2548
2548
|
childrenJson[id] = {
|
|
2549
2549
|
snapshot: child.getPersistedSnapshot(options),
|
|
2550
2550
|
src: child.src,
|
|
2551
|
-
systemId: child.
|
|
2551
|
+
systemId: child.systemId,
|
|
2552
2552
|
syncSnapshot: child._syncSnapshot
|
|
2553
2553
|
};
|
|
2554
2554
|
}
|
|
@@ -487,7 +487,7 @@ class Actor {
|
|
|
487
487
|
this.ref = void 0;
|
|
488
488
|
// TODO: add typings for system
|
|
489
489
|
this._actorScope = void 0;
|
|
490
|
-
this.
|
|
490
|
+
this.systemId = void 0;
|
|
491
491
|
/** The globally unique process ID for this invocation. */
|
|
492
492
|
this.sessionId = void 0;
|
|
493
493
|
/** The system to which this actor belongs. */
|
|
@@ -593,7 +593,7 @@ class Actor {
|
|
|
593
593
|
actorRef: this
|
|
594
594
|
});
|
|
595
595
|
if (systemId) {
|
|
596
|
-
this.
|
|
596
|
+
this.systemId = systemId;
|
|
597
597
|
this.system._set(systemId, this);
|
|
598
598
|
}
|
|
599
599
|
this._initState(options?.snapshot ?? options?.state);
|
|
@@ -811,8 +811,8 @@ class Actor {
|
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
813
|
this.system._register(this.sessionId, this);
|
|
814
|
-
if (this.
|
|
815
|
-
this.system._set(this.
|
|
814
|
+
if (this.systemId) {
|
|
815
|
+
this.system._set(this.systemId, this);
|
|
816
816
|
}
|
|
817
817
|
this._processingStatus = ProcessingStatus.Running;
|
|
818
818
|
|
|
@@ -2604,7 +2604,7 @@ function getPersistedSnapshot(snapshot, options) {
|
|
|
2604
2604
|
childrenJson[id] = {
|
|
2605
2605
|
snapshot: child.getPersistedSnapshot(options),
|
|
2606
2606
|
src: child.src,
|
|
2607
|
-
systemId: child.
|
|
2607
|
+
systemId: child.systemId,
|
|
2608
2608
|
syncSnapshot: child._syncSnapshot
|
|
2609
2609
|
};
|
|
2610
2610
|
}
|
|
@@ -485,7 +485,7 @@ class Actor {
|
|
|
485
485
|
this.ref = void 0;
|
|
486
486
|
// TODO: add typings for system
|
|
487
487
|
this._actorScope = void 0;
|
|
488
|
-
this.
|
|
488
|
+
this.systemId = void 0;
|
|
489
489
|
/** The globally unique process ID for this invocation. */
|
|
490
490
|
this.sessionId = void 0;
|
|
491
491
|
/** The system to which this actor belongs. */
|
|
@@ -591,7 +591,7 @@ class Actor {
|
|
|
591
591
|
actorRef: this
|
|
592
592
|
});
|
|
593
593
|
if (systemId) {
|
|
594
|
-
this.
|
|
594
|
+
this.systemId = systemId;
|
|
595
595
|
this.system._set(systemId, this);
|
|
596
596
|
}
|
|
597
597
|
this._initState(options?.snapshot ?? options?.state);
|
|
@@ -809,8 +809,8 @@ class Actor {
|
|
|
809
809
|
});
|
|
810
810
|
}
|
|
811
811
|
this.system._register(this.sessionId, this);
|
|
812
|
-
if (this.
|
|
813
|
-
this.system._set(this.
|
|
812
|
+
if (this.systemId) {
|
|
813
|
+
this.system._set(this.systemId, this);
|
|
814
814
|
}
|
|
815
815
|
this._processingStatus = ProcessingStatus.Running;
|
|
816
816
|
|
|
@@ -2602,7 +2602,7 @@ function getPersistedSnapshot(snapshot, options) {
|
|
|
2602
2602
|
childrenJson[id] = {
|
|
2603
2603
|
snapshot: child.getPersistedSnapshot(options),
|
|
2604
2604
|
src: child.src,
|
|
2605
|
-
systemId: child.
|
|
2605
|
+
systemId: child.systemId,
|
|
2606
2606
|
syncSnapshot: child._syncSnapshot
|
|
2607
2607
|
};
|
|
2608
2608
|
}
|
|
@@ -2709,4 +2709,4 @@ function raise(eventOrExpr, options) {
|
|
|
2709
2709
|
return raise;
|
|
2710
2710
|
}
|
|
2711
2711
|
|
|
2712
|
-
export { $$ACTOR_TYPE as $, Actor as A, getCandidates as B, resolveStateValue as C, getAllStateNodes as D, createMachineSnapshot as E, isInFinalState as F, macrostep as G, transitionNode as H, resolveActionsAndContext as I, createInitEvent as J, microstep as K, getInitialStateNodes as L, toStatePath as M, NULL_EVENT as N, isStateId as O, getStateNodeByPath as P, getPersistedSnapshot as Q, resolveReferencedActor as R, STATE_DELIMITER as S, executingCustomAction as T, XSTATE_ERROR as U, createErrorActorEvent as V, ProcessingStatus as W, XSTATE_STOP as X, cloneMachineSnapshot as Y,
|
|
2712
|
+
export { $$ACTOR_TYPE as $, Actor as A, getCandidates as B, resolveStateValue as C, getAllStateNodes as D, createMachineSnapshot as E, isInFinalState as F, macrostep as G, transitionNode as H, resolveActionsAndContext as I, createInitEvent as J, microstep as K, getInitialStateNodes as L, toStatePath as M, NULL_EVENT as N, isStateId as O, getStateNodeByPath as P, getPersistedSnapshot as Q, resolveReferencedActor as R, STATE_DELIMITER as S, executingCustomAction as T, XSTATE_ERROR as U, createErrorActorEvent as V, ProcessingStatus as W, XSTATE_STOP as X, cloneMachineSnapshot as Y, cancel as a, spawnChild as b, createActor as c, and as d, stateIn as e, isMachineSnapshot as f, getStateNodes as g, getAllOwnEventDescriptors as h, interpret as i, toObserver as j, stop as k, mapValues as l, matchesState as m, not as n, or as o, pathToStateValue as p, formatTransitions as q, raise as r, stopChild as s, toArray as t, toTransitionConfigArray as u, formatTransition as v, evaluateGuard as w, createInvokeId as x, getDelayedTransitions as y, formatInitialTransition as z };
|
package/dist/xstate.cjs.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var StateMachine = require('./StateMachine-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-74fc6715.cjs.js');
|
|
7
|
+
var StateMachine = require('./StateMachine-6b1e04a5.cjs.js');
|
|
8
|
+
var assign = require('./assign-2b42098b.cjs.js');
|
|
9
|
+
var log = require('./log-c2aa7870.cjs.js');
|
|
10
10
|
require('../dev/dist/xstate-dev.cjs.js');
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -159,7 +159,17 @@ function setup({
|
|
|
159
159
|
delays
|
|
160
160
|
}) {
|
|
161
161
|
return {
|
|
162
|
+
assign: assign.assign,
|
|
163
|
+
sendTo: log.sendTo,
|
|
164
|
+
raise: guards_dist_xstateGuards.raise,
|
|
165
|
+
log: log.log,
|
|
166
|
+
cancel: guards_dist_xstateGuards.cancel,
|
|
167
|
+
stopChild: guards_dist_xstateGuards.stopChild,
|
|
168
|
+
enqueueActions: log.enqueueActions,
|
|
169
|
+
emit: log.emit,
|
|
170
|
+
spawnChild: guards_dist_xstateGuards.spawnChild,
|
|
162
171
|
createStateConfig: config => config,
|
|
172
|
+
createAction: fn => fn,
|
|
163
173
|
createMachine: config => createMachine({
|
|
164
174
|
...config,
|
|
165
175
|
schemas
|
|
@@ -435,6 +445,7 @@ exports.stopChild = guards_dist_xstateGuards.stopChild;
|
|
|
435
445
|
exports.toObserver = guards_dist_xstateGuards.toObserver;
|
|
436
446
|
exports.StateMachine = StateMachine.StateMachine;
|
|
437
447
|
exports.StateNode = StateMachine.StateNode;
|
|
448
|
+
exports.assign = assign.assign;
|
|
438
449
|
exports.SpecialTargets = log.SpecialTargets;
|
|
439
450
|
exports.emit = log.emit;
|
|
440
451
|
exports.enqueueActions = log.enqueueActions;
|
|
@@ -442,7 +453,6 @@ exports.forwardTo = log.forwardTo;
|
|
|
442
453
|
exports.log = log.log;
|
|
443
454
|
exports.sendParent = log.sendParent;
|
|
444
455
|
exports.sendTo = log.sendTo;
|
|
445
|
-
exports.assign = assign.assign;
|
|
446
456
|
exports.SimulatedClock = SimulatedClock;
|
|
447
457
|
exports.assertEvent = assertEvent;
|
|
448
458
|
exports.createMachine = createMachine;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var StateMachine = require('./StateMachine-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-999e706e.development.cjs.js');
|
|
7
|
+
var StateMachine = require('./StateMachine-04e45472.development.cjs.js');
|
|
8
|
+
var assign = require('./assign-25d97d7a.development.cjs.js');
|
|
9
|
+
var log = require('./log-1e0b7d69.development.cjs.js');
|
|
10
10
|
require('../dev/dist/xstate-dev.development.cjs.js');
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -159,7 +159,17 @@ function setup({
|
|
|
159
159
|
delays
|
|
160
160
|
}) {
|
|
161
161
|
return {
|
|
162
|
+
assign: assign.assign,
|
|
163
|
+
sendTo: log.sendTo,
|
|
164
|
+
raise: guards_dist_xstateGuards.raise,
|
|
165
|
+
log: log.log,
|
|
166
|
+
cancel: guards_dist_xstateGuards.cancel,
|
|
167
|
+
stopChild: guards_dist_xstateGuards.stopChild,
|
|
168
|
+
enqueueActions: log.enqueueActions,
|
|
169
|
+
emit: log.emit,
|
|
170
|
+
spawnChild: guards_dist_xstateGuards.spawnChild,
|
|
162
171
|
createStateConfig: config => config,
|
|
172
|
+
createAction: fn => fn,
|
|
163
173
|
createMachine: config => createMachine({
|
|
164
174
|
...config,
|
|
165
175
|
schemas
|
|
@@ -438,6 +448,7 @@ exports.stopChild = guards_dist_xstateGuards.stopChild;
|
|
|
438
448
|
exports.toObserver = guards_dist_xstateGuards.toObserver;
|
|
439
449
|
exports.StateMachine = StateMachine.StateMachine;
|
|
440
450
|
exports.StateNode = StateMachine.StateNode;
|
|
451
|
+
exports.assign = assign.assign;
|
|
441
452
|
exports.SpecialTargets = log.SpecialTargets;
|
|
442
453
|
exports.emit = log.emit;
|
|
443
454
|
exports.enqueueActions = log.enqueueActions;
|
|
@@ -445,7 +456,6 @@ exports.forwardTo = log.forwardTo;
|
|
|
445
456
|
exports.log = log.log;
|
|
446
457
|
exports.sendParent = log.sendParent;
|
|
447
458
|
exports.sendTo = log.sendTo;
|
|
448
|
-
exports.assign = assign.assign;
|
|
449
459
|
exports.SimulatedClock = SimulatedClock;
|
|
450
460
|
exports.assertEvent = assertEvent;
|
|
451
461
|
exports.createMachine = createMachine;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
|
|
2
|
-
import { t as toArray, c as createActor } from './raise-
|
|
3
|
-
export { A as Actor,
|
|
4
|
-
import { S as StateMachine } from './StateMachine-
|
|
5
|
-
export { S as StateMachine, a as StateNode } from './StateMachine-
|
|
6
|
-
|
|
7
|
-
export { a as assign } from './assign-
|
|
2
|
+
import { t as toArray, c as createActor, r as raise, a as cancel, s as stopChild, b as spawnChild } from './raise-f7b216be.development.esm.js';
|
|
3
|
+
export { A as Actor, h as __unsafe_getAllOwnEventDescriptors, d as and, a as cancel, c as createActor, g as getStateNodes, i as interpret, f as isMachineSnapshot, m as matchesState, n as not, o as or, p as pathToStateValue, r as raise, b as spawnChild, e as stateIn, k as stop, s as stopChild, j as toObserver } from './raise-f7b216be.development.esm.js';
|
|
4
|
+
import { S as StateMachine } from './StateMachine-db2d9df9.development.esm.js';
|
|
5
|
+
export { S as StateMachine, a as StateNode } from './StateMachine-db2d9df9.development.esm.js';
|
|
6
|
+
import { a as assign } from './assign-fb4707fe.development.esm.js';
|
|
7
|
+
export { a as assign } from './assign-fb4707fe.development.esm.js';
|
|
8
|
+
import { s as sendTo, l as log, e as enqueueActions, a as emit } from './log-368dd776.development.esm.js';
|
|
9
|
+
export { S as SpecialTargets, a as emit, e as enqueueActions, f as forwardTo, l as log, b as sendParent, s as sendTo } from './log-368dd776.development.esm.js';
|
|
8
10
|
import '../dev/dist/xstate-dev.development.esm.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -157,7 +159,17 @@ function setup({
|
|
|
157
159
|
delays
|
|
158
160
|
}) {
|
|
159
161
|
return {
|
|
162
|
+
assign,
|
|
163
|
+
sendTo,
|
|
164
|
+
raise,
|
|
165
|
+
log,
|
|
166
|
+
cancel,
|
|
167
|
+
stopChild,
|
|
168
|
+
enqueueActions,
|
|
169
|
+
emit,
|
|
170
|
+
spawnChild,
|
|
160
171
|
createStateConfig: config => config,
|
|
172
|
+
createAction: fn => fn,
|
|
161
173
|
createMachine: config => createMachine({
|
|
162
174
|
...config,
|
|
163
175
|
schemas
|
package/dist/xstate.esm.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';
|
|
2
|
-
import { t as toArray, c as createActor } from './raise-
|
|
3
|
-
export { A as Actor,
|
|
4
|
-
import { S as StateMachine } from './StateMachine-
|
|
5
|
-
export { S as StateMachine, a as StateNode } from './StateMachine-
|
|
6
|
-
|
|
7
|
-
export { a as assign } from './assign-
|
|
2
|
+
import { t as toArray, c as createActor, r as raise, a as cancel, s as stopChild, b as spawnChild } from './raise-4751acd2.esm.js';
|
|
3
|
+
export { A as Actor, h as __unsafe_getAllOwnEventDescriptors, d as and, a as cancel, c as createActor, g as getStateNodes, i as interpret, f as isMachineSnapshot, m as matchesState, n as not, o as or, p as pathToStateValue, r as raise, b as spawnChild, e as stateIn, k as stop, s as stopChild, j as toObserver } from './raise-4751acd2.esm.js';
|
|
4
|
+
import { S as StateMachine } from './StateMachine-98210250.esm.js';
|
|
5
|
+
export { S as StateMachine, a as StateNode } from './StateMachine-98210250.esm.js';
|
|
6
|
+
import { a as assign } from './assign-f458d6cf.esm.js';
|
|
7
|
+
export { a as assign } from './assign-f458d6cf.esm.js';
|
|
8
|
+
import { s as sendTo, l as log, e as enqueueActions, a as emit } from './log-7e8bf109.esm.js';
|
|
9
|
+
export { S as SpecialTargets, a as emit, e as enqueueActions, f as forwardTo, l as log, b as sendParent, s as sendTo } from './log-7e8bf109.esm.js';
|
|
8
10
|
import '../dev/dist/xstate-dev.esm.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -157,7 +159,17 @@ function setup({
|
|
|
157
159
|
delays
|
|
158
160
|
}) {
|
|
159
161
|
return {
|
|
162
|
+
assign,
|
|
163
|
+
sendTo,
|
|
164
|
+
raise,
|
|
165
|
+
log,
|
|
166
|
+
cancel,
|
|
167
|
+
stopChild,
|
|
168
|
+
enqueueActions,
|
|
169
|
+
emit,
|
|
170
|
+
spawnChild,
|
|
160
171
|
createStateConfig: config => config,
|
|
172
|
+
createAction: fn => fn,
|
|
161
173
|
createMachine: config => createMachine({
|
|
162
174
|
...config,
|
|
163
175
|
schemas
|