@zag-js/core
Advanced tools
Comparing version 0.74.2 to 0.75.0
@@ -62,6 +62,6 @@ export { Ref, proxy, ref, snapshot, subscribe } from '@zag-js/store'; | ||
type TransitionDefinition<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = { | ||
target?: TState["value"]; | ||
actions?: Actions<TContext, TState, TEvent>; | ||
guard?: Guard<TContext, TState, TEvent>; | ||
internal?: boolean; | ||
target?: TState["value"] | undefined; | ||
actions?: Actions<TContext, TState, TEvent> | undefined; | ||
guard?: Guard<TContext, TState, TEvent> | undefined; | ||
internal?: boolean | undefined; | ||
}; | ||
@@ -77,3 +77,3 @@ type DelayExpression<TContext extends Dict, TEvent extends EventObject> = Expression<TContext, TEvent, number>; | ||
*/ | ||
delay?: Delay<TContext, TEvent>; | ||
delay?: Delay<TContext, TEvent> | undefined; | ||
}; | ||
@@ -92,3 +92,3 @@ type DelayedTransitions<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = Record<string | number, TState["value"] | MaybeArray<TransitionDefinition<TContext, TState, TEvent>>> | Array<DelayedTransition<TContext, TState, TEvent>>; | ||
type TransitionDefinitionMap<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = { | ||
[K in TEvent["type"]]?: TState["value"] | MaybeArray<TransitionDefinition<TContext, TState, ExtractEvent<TEvent, K>>>; | ||
[K in TEvent["type"]]?: TState["value"] | MaybeArray<TransitionDefinition<TContext, TState, ExtractEvent<TEvent, K>>> | undefined; | ||
}; | ||
@@ -99,7 +99,7 @@ interface StateNode<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> { | ||
*/ | ||
type?: "final"; | ||
type?: "final" | undefined; | ||
/** | ||
* The tags for the state node. | ||
*/ | ||
tags?: MaybeArray<TState["tags"] extends string ? TState["tags"] : string>; | ||
tags?: MaybeArray<TState["tags"] extends string ? TState["tags"] : string> | undefined; | ||
/** | ||
@@ -109,19 +109,19 @@ * The activities to be started upon entering the state node, | ||
*/ | ||
activities?: Activities<TContext, TState, TEvent>; | ||
activities?: Activities<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The mapping of event types to their potential transition(s). | ||
*/ | ||
on?: TransitionDefinitionMap<TContext, TState, TEvent>; | ||
on?: TransitionDefinitionMap<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The action(s) to be executed upon entering the state node. | ||
*/ | ||
entry?: Actions<TContext, TState, TEvent>; | ||
entry?: Actions<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The action(s) to be executed upon exiting the state node. | ||
*/ | ||
exit?: Actions<TContext, TState, TEvent>; | ||
exit?: Actions<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The meta data associated with this state node. | ||
*/ | ||
meta?: string | Dict; | ||
meta?: string | Dict | undefined; | ||
/** | ||
@@ -131,3 +131,3 @@ * The mapping (or array) of delays (in `ms`) to their potential transition(s) to run after | ||
*/ | ||
after?: DelayedTransitions<TContext, TState, TEvent>; | ||
after?: DelayedTransitions<TContext, TState, TEvent> | undefined; | ||
/** | ||
@@ -141,3 +141,3 @@ * The mapping (or array) of intervals (in `ms`) to their potential actions(s) to run at interval. | ||
guard?: Guard<TContext, TState, TEvent>; | ||
}>; | ||
}> | undefined; | ||
} | ||
@@ -160,8 +160,8 @@ type GuardMeta<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = { | ||
value: string; | ||
tags?: string; | ||
tags?: string | undefined; | ||
}; | ||
type StateInitObject<TContext, TState extends StateSchema> = { | ||
context?: TContext; | ||
context?: TContext | undefined; | ||
value: TState["value"] | null; | ||
tags?: TState["tags"][]; | ||
tags?: TState["tags"][] | undefined; | ||
}; | ||
@@ -182,3 +182,3 @@ type StateInit<TContext, TState extends StateSchema> = StateInitObject<TContext, TState>; | ||
*/ | ||
created?: Actions<TContext, TState, TEvent>; | ||
created?: Actions<TContext, TState, TEvent> | undefined; | ||
/** | ||
@@ -188,3 +188,3 @@ * The actions to run when the machine has started. This is usually | ||
*/ | ||
entry?: Actions<TContext, TState, TEvent>; | ||
entry?: Actions<TContext, TState, TEvent> | undefined; | ||
/** | ||
@@ -194,15 +194,15 @@ * The actions to run when the machine has stopped. This is usually | ||
*/ | ||
exit?: Actions<TContext, TState, TEvent>; | ||
exit?: Actions<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The root level activities to run when the machine is started | ||
*/ | ||
activities?: Activities<TContext, TState, TEvent>; | ||
activities?: Activities<TContext, TState, TEvent> | undefined; | ||
/** | ||
* The unique identifier for the invoked machine. | ||
*/ | ||
id?: string; | ||
id?: string | undefined; | ||
/** | ||
* The extended state used to store `data` for your machine | ||
*/ | ||
context?: Writable<TContext>; | ||
context?: Writable<TContext> | undefined; | ||
/** | ||
@@ -213,19 +213,19 @@ * A generic way to react to context value changes | ||
[K in keyof TContext]?: Actions<TContext, TState, TEvent>; | ||
}; | ||
} | undefined; | ||
/** | ||
* The computed properties based on the state | ||
*/ | ||
computed?: Partial<TComputedContext<TContext>>; | ||
computed?: Partial<TComputedContext<TContext>> | undefined; | ||
/** | ||
* The initial state to start with | ||
*/ | ||
initial?: TState["value"]; | ||
initial?: TState["value"] | undefined; | ||
/** | ||
* The mapping of state node keys to their state node configurations (recursive). | ||
*/ | ||
states?: Partial<Record<TState["value"], StateNode<TContext, TState, TEvent>>>; | ||
states?: Partial<Record<TState["value"], StateNode<TContext, TState, TEvent>>> | undefined; | ||
/** | ||
* Mapping events to transitions | ||
*/ | ||
on?: TransitionDefinitionMap<TContext, TState, TEvent>; | ||
on?: TransitionDefinitionMap<TContext, TState, TEvent> | undefined; | ||
} | ||
@@ -247,16 +247,16 @@ interface State<TContext extends Dict, TState extends StateSchema = StateSchema, TEvent extends EventObject = AnyEventObject> { | ||
interface MachineOptions<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> { | ||
debug?: boolean; | ||
guards?: GuardMap<TContext, TState, TEvent>; | ||
actions?: ActionMap<TContext, TState, TEvent>; | ||
delays?: DelayMap<TContext, TEvent>; | ||
activities?: ActivityMap<TContext, TState, TEvent>; | ||
sync?: boolean; | ||
debug?: boolean | undefined; | ||
guards?: GuardMap<TContext, TState, TEvent> | undefined; | ||
actions?: ActionMap<TContext, TState, TEvent> | undefined; | ||
delays?: DelayMap<TContext, TEvent> | undefined; | ||
activities?: ActivityMap<TContext, TState, TEvent> | undefined; | ||
sync?: boolean | undefined; | ||
compareFns?: { | ||
[K in keyof TContext]?: CompareFn<TContext[K]>; | ||
}; | ||
} | undefined; | ||
} | ||
type HookOptions<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = { | ||
actions?: ActionMap<TContext, TState, TEvent>; | ||
state?: StateInit<TContext, TState>; | ||
context?: UserContext<TContext>; | ||
actions?: ActionMap<TContext, TState, TEvent> | undefined; | ||
state?: StateInit<TContext, TState> | undefined; | ||
context?: UserContext<TContext> | undefined; | ||
}; | ||
@@ -263,0 +263,0 @@ type Self<TContext extends Dict, TState extends StateSchema, TEvent extends EventObject> = { |
{ | ||
"name": "@zag-js/core", | ||
"version": "0.74.2", | ||
"version": "0.75.0", | ||
"description": "A minimal implementation of xstate fsm for UI machines", | ||
@@ -29,4 +29,4 @@ "keywords": [ | ||
"klona": "2.0.6", | ||
"@zag-js/store": "0.74.2", | ||
"@zag-js/utils": "0.74.2" | ||
"@zag-js/store": "0.75.0", | ||
"@zag-js/utils": "0.75.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109947
+ Added@zag-js/store@0.75.0(transitive)
+ Added@zag-js/utils@0.75.0(transitive)
- Removed@zag-js/store@0.74.2(transitive)
- Removed@zag-js/utils@0.74.2(transitive)
Updated@zag-js/store@0.75.0
Updated@zag-js/utils@0.75.0