@zag-js/core 1.34.1 → 1.35.0

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.
@@ -0,0 +1,232 @@
1
+ type Dict = Record<string, any>;
2
+ interface ComputedParams<T extends Dict> {
3
+ context: BindableContext<T>;
4
+ event: EventType<T["event"]>;
5
+ prop: PropFn<T>;
6
+ refs: BindableRefs<T>;
7
+ scope: Scope;
8
+ computed: ComputedFn<T>;
9
+ }
10
+ interface ContextParams<T extends Dict> {
11
+ prop: PropFn<T>;
12
+ bindable: BindableFn;
13
+ scope: Scope;
14
+ getContext: () => BindableContext<T>;
15
+ getComputed: () => ComputedFn<T>;
16
+ getRefs: () => BindableRefs<T>;
17
+ getEvent: () => EventType<T["event"]>;
18
+ flush: (fn: VoidFunction) => void;
19
+ }
20
+ interface PropFn<T extends Dict> {
21
+ <K extends keyof T["props"]>(key: K): T["props"][K];
22
+ }
23
+ interface ComputedFn<T extends Dict> {
24
+ <K extends keyof T["computed"]>(key: K): T["computed"][K];
25
+ }
26
+ type AnyFunction = () => string | number | boolean | null | undefined;
27
+ type TrackFn = (deps: AnyFunction[], fn: VoidFunction) => void;
28
+ interface BindableParams<T> {
29
+ defaultValue?: T | undefined;
30
+ value?: T | undefined;
31
+ hash?: ((a: T) => string) | undefined;
32
+ isEqual?: ((a: T, b: T | undefined) => boolean) | undefined;
33
+ onChange?: ((value: T, prev: T | undefined) => void) | undefined;
34
+ debug?: string | undefined;
35
+ sync?: boolean | undefined;
36
+ }
37
+ type ValueOrFn<T> = T | ((prev: T) => T);
38
+ interface Bindable<T> {
39
+ initial: T | undefined;
40
+ ref: any;
41
+ get: () => T;
42
+ set(value: ValueOrFn<T>): void;
43
+ invoke(nextValue: T, prevValue: T): void;
44
+ hash(value: T): string;
45
+ }
46
+ interface BindableRefs<T extends Dict> {
47
+ set<K extends keyof T["refs"]>(key: K, value: T["refs"][K]): void;
48
+ get<K extends keyof T["refs"]>(key: K): T["refs"][K];
49
+ }
50
+ interface BindableContext<T extends Dict> {
51
+ set<K extends keyof T["context"]>(key: K, value: ValueOrFn<T["context"][K]>): void;
52
+ get<K extends keyof T["context"]>(key: K): T["context"][K];
53
+ initial<K extends keyof T["context"]>(key: K): T["context"][K];
54
+ hash<K extends keyof T["context"]>(key: K): string;
55
+ }
56
+ interface BindableRef<T> {
57
+ get: () => T;
58
+ set: (next: T) => void;
59
+ }
60
+ interface BindableFn {
61
+ <K>(params: () => BindableParams<K>): Bindable<K>;
62
+ cleanup: (fn: VoidFunction) => void;
63
+ ref: <T>(defaultValue: T) => BindableRef<T>;
64
+ }
65
+ interface Scope {
66
+ id?: string | undefined;
67
+ ids?: Record<string, any> | undefined;
68
+ getRootNode: () => ShadowRoot | Document | Node;
69
+ getById: <T extends Element = HTMLElement>(id: string) => T | null;
70
+ getActiveElement: () => HTMLElement | null;
71
+ isActiveElement: (elem: HTMLElement | null) => boolean;
72
+ getDoc: () => typeof document;
73
+ getWin: () => typeof window;
74
+ }
75
+ type EventType<T = any> = T & {
76
+ previousEvent?: (T & {
77
+ [key: string]: any;
78
+ }) | undefined;
79
+ src?: string | undefined;
80
+ [key: string]: any;
81
+ };
82
+ type EventObject = EventType<{
83
+ type: string;
84
+ }>;
85
+ interface Params<T extends Dict> {
86
+ prop: PropFn<T>;
87
+ action: (action: T["action"][]) => void;
88
+ context: BindableContext<T>;
89
+ refs: BindableRefs<T>;
90
+ track: TrackFn;
91
+ flush: (fn: VoidFunction) => void;
92
+ event: EventType<T["event"]> & {
93
+ current: () => EventType<T["event"]>;
94
+ previous: () => EventType<T["event"]>;
95
+ };
96
+ send: (event: EventType<T["event"]>) => void;
97
+ computed: ComputedFn<T>;
98
+ scope: Scope;
99
+ state: Bindable<T["state"]> & {
100
+ matches: (...values: T["state"][]) => boolean;
101
+ hasTag: (tag: T["tag"]) => boolean;
102
+ };
103
+ choose: ChooseFn<T>;
104
+ guard: (key: T["guard"] | GuardFn<T>) => boolean | undefined;
105
+ }
106
+ type GuardFn<T extends Dict> = (params: Params<T>) => boolean;
107
+ type TopLevelState<S extends string> = S extends `${infer Top}.${string}` ? Top : S;
108
+ type ChildStateKey<S extends string, Parent extends string> = S extends `${Parent}.${infer Rest}` ? Rest extends `${infer Child}.${string}` ? Child : Rest : never;
109
+ type ParentPath<S extends string> = S extends `${infer Parent}.${string}` ? Parent : never;
110
+ type AncestorPaths<S extends string> = S | (ParentPath<S> extends never ? never : AncestorPaths<ParentPath<S>>);
111
+ type RelativeStateTarget<S extends string, Source extends string> = ChildStateKey<S, AncestorPaths<Source>>;
112
+ interface Transition<T extends Dict, Source extends string | undefined = string | undefined> {
113
+ target?: T["state"] | (Source extends string ? RelativeStateTarget<T["state"], Source> : never) | undefined;
114
+ actions?: T["action"][] | undefined;
115
+ guard?: T["guard"] | GuardFn<T> | undefined;
116
+ reenter?: boolean | undefined;
117
+ }
118
+ type TransitionSet<T extends Dict> = Transition<T> | Transition<T>[] | undefined;
119
+ type TransitionMap<T extends Dict> = Record<string, TransitionSet<T>>;
120
+ type TransitionMatch<T extends Dict> = {
121
+ transitions: TransitionSet<T>;
122
+ source: string | undefined;
123
+ };
124
+ type MaybeArray<T> = T | T[];
125
+ type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T, string>, "target">> | null | undefined) => Transition<T> | undefined;
126
+ interface PropsParams<T extends Dict> {
127
+ props: Partial<T["props"]>;
128
+ scope: Scope;
129
+ }
130
+ interface RefsParams<T extends Dict> {
131
+ prop: PropFn<T>;
132
+ context: BindableContext<T>;
133
+ }
134
+ type ActionsOrFn<T extends Dict> = T["action"][] | ((params: Params<T>) => T["action"][] | undefined);
135
+ type EffectsOrFn<T extends Dict> = T["effect"][] | ((params: Params<T>) => T["effect"][] | undefined);
136
+ interface MachineState<T extends Dict, Parent extends string = string> {
137
+ tags?: T["tag"][] | undefined;
138
+ entry?: ActionsOrFn<T> | undefined;
139
+ exit?: ActionsOrFn<T> | undefined;
140
+ effects?: EffectsOrFn<T> | undefined;
141
+ initial?: ChildStateKey<T["state"], Parent> | undefined;
142
+ states?: {
143
+ [K in ChildStateKey<T["state"], Parent>]?: MachineState<T, `${Parent}.${K}`>;
144
+ } | undefined;
145
+ on?: {
146
+ [E in T["event"]["type"]]?: Transition<T, Parent> | Array<Transition<T, Parent>>;
147
+ } | undefined;
148
+ }
149
+ interface Machine<T extends Dict> {
150
+ debug?: boolean | undefined;
151
+ props?: ((params: PropsParams<T>) => T["props"]) | undefined;
152
+ context?: ((params: ContextParams<T>) => {
153
+ [K in keyof T["context"]]: Bindable<T["context"][K]>;
154
+ }) | undefined;
155
+ computed?: {
156
+ [K in keyof T["computed"]]: (params: ComputedParams<T>) => T["computed"][K];
157
+ } | undefined;
158
+ initialState: (params: {
159
+ prop: PropFn<T>;
160
+ }) => T["state"];
161
+ entry?: ActionsOrFn<T> | undefined;
162
+ exit?: ActionsOrFn<T> | undefined;
163
+ effects?: EffectsOrFn<T> | undefined;
164
+ refs?: ((params: RefsParams<T>) => T["refs"]) | undefined;
165
+ watch?: ((params: Params<T>) => void) | undefined;
166
+ on?: {
167
+ [E in T["event"]["type"]]?: Transition<T, undefined> | Array<Transition<T, undefined>>;
168
+ } | undefined;
169
+ states: {
170
+ [K in TopLevelState<T["state"]>]: MachineState<T, K>;
171
+ };
172
+ implementations?: {
173
+ guards?: {
174
+ [K in T["guard"]]: (params: Params<T>) => boolean;
175
+ } | undefined;
176
+ actions?: {
177
+ [K in T["action"]]: (params: Params<T>) => void;
178
+ } | undefined;
179
+ effects?: {
180
+ [K in T["effect"]]: (params: Params<T>) => void | VoidFunction;
181
+ } | undefined;
182
+ } | undefined;
183
+ }
184
+ interface MachineBaseProps {
185
+ id?: string | undefined;
186
+ ids?: Record<string, any> | undefined;
187
+ getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
188
+ [key: string]: any;
189
+ }
190
+ interface MachineSchema {
191
+ props?: MachineBaseProps | undefined;
192
+ context?: Record<string, any> | undefined;
193
+ refs?: Record<string, any> | undefined;
194
+ computed?: Record<string, any> | undefined;
195
+ state?: string | undefined;
196
+ tag?: string | undefined;
197
+ guard?: string | undefined;
198
+ action?: string | undefined;
199
+ effect?: string | undefined;
200
+ event?: ({
201
+ type: string;
202
+ } & Dict) | undefined;
203
+ }
204
+ type State<T extends MachineSchema> = Bindable<T["state"]> & {
205
+ hasTag: (tag: T["tag"]) => boolean;
206
+ matches: (...values: T["state"][]) => boolean;
207
+ };
208
+ type Service<T extends MachineSchema> = {
209
+ getStatus: () => MachineStatus;
210
+ state: State<T> & {
211
+ matches: (...values: T["state"][]) => boolean;
212
+ hasTag: (tag: T["tag"]) => boolean;
213
+ };
214
+ context: BindableContext<T>;
215
+ send: (event: EventType<T["event"]>) => void;
216
+ prop: PropFn<T>;
217
+ scope: Scope;
218
+ computed: ComputedFn<T>;
219
+ refs: BindableRefs<T>;
220
+ event: EventType<T["event"]> & {
221
+ current: () => EventType<T["event"]>;
222
+ previous: () => EventType<T["event"]>;
223
+ };
224
+ };
225
+ declare enum MachineStatus {
226
+ NotStarted = "Not Started",
227
+ Started = "Started",
228
+ Stopped = "Stopped"
229
+ }
230
+ declare const INIT_STATE = "__init__";
231
+
232
+ export { type ActionsOrFn, type Bindable, type BindableContext, type BindableFn, type BindableParams, type BindableRefs, type ChooseFn, type ComputedFn, type EffectsOrFn, type EventObject, type GuardFn, INIT_STATE, type Machine, type MachineSchema, type MachineState, MachineStatus, type Params, type PropFn, type Scope, type Service, type Transition, type TransitionMap, type TransitionMatch, type TransitionSet, type ValueOrFn };
@@ -0,0 +1,232 @@
1
+ type Dict = Record<string, any>;
2
+ interface ComputedParams<T extends Dict> {
3
+ context: BindableContext<T>;
4
+ event: EventType<T["event"]>;
5
+ prop: PropFn<T>;
6
+ refs: BindableRefs<T>;
7
+ scope: Scope;
8
+ computed: ComputedFn<T>;
9
+ }
10
+ interface ContextParams<T extends Dict> {
11
+ prop: PropFn<T>;
12
+ bindable: BindableFn;
13
+ scope: Scope;
14
+ getContext: () => BindableContext<T>;
15
+ getComputed: () => ComputedFn<T>;
16
+ getRefs: () => BindableRefs<T>;
17
+ getEvent: () => EventType<T["event"]>;
18
+ flush: (fn: VoidFunction) => void;
19
+ }
20
+ interface PropFn<T extends Dict> {
21
+ <K extends keyof T["props"]>(key: K): T["props"][K];
22
+ }
23
+ interface ComputedFn<T extends Dict> {
24
+ <K extends keyof T["computed"]>(key: K): T["computed"][K];
25
+ }
26
+ type AnyFunction = () => string | number | boolean | null | undefined;
27
+ type TrackFn = (deps: AnyFunction[], fn: VoidFunction) => void;
28
+ interface BindableParams<T> {
29
+ defaultValue?: T | undefined;
30
+ value?: T | undefined;
31
+ hash?: ((a: T) => string) | undefined;
32
+ isEqual?: ((a: T, b: T | undefined) => boolean) | undefined;
33
+ onChange?: ((value: T, prev: T | undefined) => void) | undefined;
34
+ debug?: string | undefined;
35
+ sync?: boolean | undefined;
36
+ }
37
+ type ValueOrFn<T> = T | ((prev: T) => T);
38
+ interface Bindable<T> {
39
+ initial: T | undefined;
40
+ ref: any;
41
+ get: () => T;
42
+ set(value: ValueOrFn<T>): void;
43
+ invoke(nextValue: T, prevValue: T): void;
44
+ hash(value: T): string;
45
+ }
46
+ interface BindableRefs<T extends Dict> {
47
+ set<K extends keyof T["refs"]>(key: K, value: T["refs"][K]): void;
48
+ get<K extends keyof T["refs"]>(key: K): T["refs"][K];
49
+ }
50
+ interface BindableContext<T extends Dict> {
51
+ set<K extends keyof T["context"]>(key: K, value: ValueOrFn<T["context"][K]>): void;
52
+ get<K extends keyof T["context"]>(key: K): T["context"][K];
53
+ initial<K extends keyof T["context"]>(key: K): T["context"][K];
54
+ hash<K extends keyof T["context"]>(key: K): string;
55
+ }
56
+ interface BindableRef<T> {
57
+ get: () => T;
58
+ set: (next: T) => void;
59
+ }
60
+ interface BindableFn {
61
+ <K>(params: () => BindableParams<K>): Bindable<K>;
62
+ cleanup: (fn: VoidFunction) => void;
63
+ ref: <T>(defaultValue: T) => BindableRef<T>;
64
+ }
65
+ interface Scope {
66
+ id?: string | undefined;
67
+ ids?: Record<string, any> | undefined;
68
+ getRootNode: () => ShadowRoot | Document | Node;
69
+ getById: <T extends Element = HTMLElement>(id: string) => T | null;
70
+ getActiveElement: () => HTMLElement | null;
71
+ isActiveElement: (elem: HTMLElement | null) => boolean;
72
+ getDoc: () => typeof document;
73
+ getWin: () => typeof window;
74
+ }
75
+ type EventType<T = any> = T & {
76
+ previousEvent?: (T & {
77
+ [key: string]: any;
78
+ }) | undefined;
79
+ src?: string | undefined;
80
+ [key: string]: any;
81
+ };
82
+ type EventObject = EventType<{
83
+ type: string;
84
+ }>;
85
+ interface Params<T extends Dict> {
86
+ prop: PropFn<T>;
87
+ action: (action: T["action"][]) => void;
88
+ context: BindableContext<T>;
89
+ refs: BindableRefs<T>;
90
+ track: TrackFn;
91
+ flush: (fn: VoidFunction) => void;
92
+ event: EventType<T["event"]> & {
93
+ current: () => EventType<T["event"]>;
94
+ previous: () => EventType<T["event"]>;
95
+ };
96
+ send: (event: EventType<T["event"]>) => void;
97
+ computed: ComputedFn<T>;
98
+ scope: Scope;
99
+ state: Bindable<T["state"]> & {
100
+ matches: (...values: T["state"][]) => boolean;
101
+ hasTag: (tag: T["tag"]) => boolean;
102
+ };
103
+ choose: ChooseFn<T>;
104
+ guard: (key: T["guard"] | GuardFn<T>) => boolean | undefined;
105
+ }
106
+ type GuardFn<T extends Dict> = (params: Params<T>) => boolean;
107
+ type TopLevelState<S extends string> = S extends `${infer Top}.${string}` ? Top : S;
108
+ type ChildStateKey<S extends string, Parent extends string> = S extends `${Parent}.${infer Rest}` ? Rest extends `${infer Child}.${string}` ? Child : Rest : never;
109
+ type ParentPath<S extends string> = S extends `${infer Parent}.${string}` ? Parent : never;
110
+ type AncestorPaths<S extends string> = S | (ParentPath<S> extends never ? never : AncestorPaths<ParentPath<S>>);
111
+ type RelativeStateTarget<S extends string, Source extends string> = ChildStateKey<S, AncestorPaths<Source>>;
112
+ interface Transition<T extends Dict, Source extends string | undefined = string | undefined> {
113
+ target?: T["state"] | (Source extends string ? RelativeStateTarget<T["state"], Source> : never) | undefined;
114
+ actions?: T["action"][] | undefined;
115
+ guard?: T["guard"] | GuardFn<T> | undefined;
116
+ reenter?: boolean | undefined;
117
+ }
118
+ type TransitionSet<T extends Dict> = Transition<T> | Transition<T>[] | undefined;
119
+ type TransitionMap<T extends Dict> = Record<string, TransitionSet<T>>;
120
+ type TransitionMatch<T extends Dict> = {
121
+ transitions: TransitionSet<T>;
122
+ source: string | undefined;
123
+ };
124
+ type MaybeArray<T> = T | T[];
125
+ type ChooseFn<T extends Dict> = (transitions: MaybeArray<Omit<Transition<T, string>, "target">> | null | undefined) => Transition<T> | undefined;
126
+ interface PropsParams<T extends Dict> {
127
+ props: Partial<T["props"]>;
128
+ scope: Scope;
129
+ }
130
+ interface RefsParams<T extends Dict> {
131
+ prop: PropFn<T>;
132
+ context: BindableContext<T>;
133
+ }
134
+ type ActionsOrFn<T extends Dict> = T["action"][] | ((params: Params<T>) => T["action"][] | undefined);
135
+ type EffectsOrFn<T extends Dict> = T["effect"][] | ((params: Params<T>) => T["effect"][] | undefined);
136
+ interface MachineState<T extends Dict, Parent extends string = string> {
137
+ tags?: T["tag"][] | undefined;
138
+ entry?: ActionsOrFn<T> | undefined;
139
+ exit?: ActionsOrFn<T> | undefined;
140
+ effects?: EffectsOrFn<T> | undefined;
141
+ initial?: ChildStateKey<T["state"], Parent> | undefined;
142
+ states?: {
143
+ [K in ChildStateKey<T["state"], Parent>]?: MachineState<T, `${Parent}.${K}`>;
144
+ } | undefined;
145
+ on?: {
146
+ [E in T["event"]["type"]]?: Transition<T, Parent> | Array<Transition<T, Parent>>;
147
+ } | undefined;
148
+ }
149
+ interface Machine<T extends Dict> {
150
+ debug?: boolean | undefined;
151
+ props?: ((params: PropsParams<T>) => T["props"]) | undefined;
152
+ context?: ((params: ContextParams<T>) => {
153
+ [K in keyof T["context"]]: Bindable<T["context"][K]>;
154
+ }) | undefined;
155
+ computed?: {
156
+ [K in keyof T["computed"]]: (params: ComputedParams<T>) => T["computed"][K];
157
+ } | undefined;
158
+ initialState: (params: {
159
+ prop: PropFn<T>;
160
+ }) => T["state"];
161
+ entry?: ActionsOrFn<T> | undefined;
162
+ exit?: ActionsOrFn<T> | undefined;
163
+ effects?: EffectsOrFn<T> | undefined;
164
+ refs?: ((params: RefsParams<T>) => T["refs"]) | undefined;
165
+ watch?: ((params: Params<T>) => void) | undefined;
166
+ on?: {
167
+ [E in T["event"]["type"]]?: Transition<T, undefined> | Array<Transition<T, undefined>>;
168
+ } | undefined;
169
+ states: {
170
+ [K in TopLevelState<T["state"]>]: MachineState<T, K>;
171
+ };
172
+ implementations?: {
173
+ guards?: {
174
+ [K in T["guard"]]: (params: Params<T>) => boolean;
175
+ } | undefined;
176
+ actions?: {
177
+ [K in T["action"]]: (params: Params<T>) => void;
178
+ } | undefined;
179
+ effects?: {
180
+ [K in T["effect"]]: (params: Params<T>) => void | VoidFunction;
181
+ } | undefined;
182
+ } | undefined;
183
+ }
184
+ interface MachineBaseProps {
185
+ id?: string | undefined;
186
+ ids?: Record<string, any> | undefined;
187
+ getRootNode?: (() => ShadowRoot | Document | Node) | undefined;
188
+ [key: string]: any;
189
+ }
190
+ interface MachineSchema {
191
+ props?: MachineBaseProps | undefined;
192
+ context?: Record<string, any> | undefined;
193
+ refs?: Record<string, any> | undefined;
194
+ computed?: Record<string, any> | undefined;
195
+ state?: string | undefined;
196
+ tag?: string | undefined;
197
+ guard?: string | undefined;
198
+ action?: string | undefined;
199
+ effect?: string | undefined;
200
+ event?: ({
201
+ type: string;
202
+ } & Dict) | undefined;
203
+ }
204
+ type State<T extends MachineSchema> = Bindable<T["state"]> & {
205
+ hasTag: (tag: T["tag"]) => boolean;
206
+ matches: (...values: T["state"][]) => boolean;
207
+ };
208
+ type Service<T extends MachineSchema> = {
209
+ getStatus: () => MachineStatus;
210
+ state: State<T> & {
211
+ matches: (...values: T["state"][]) => boolean;
212
+ hasTag: (tag: T["tag"]) => boolean;
213
+ };
214
+ context: BindableContext<T>;
215
+ send: (event: EventType<T["event"]>) => void;
216
+ prop: PropFn<T>;
217
+ scope: Scope;
218
+ computed: ComputedFn<T>;
219
+ refs: BindableRefs<T>;
220
+ event: EventType<T["event"]> & {
221
+ current: () => EventType<T["event"]>;
222
+ previous: () => EventType<T["event"]>;
223
+ };
224
+ };
225
+ declare enum MachineStatus {
226
+ NotStarted = "Not Started",
227
+ Started = "Started",
228
+ Stopped = "Stopped"
229
+ }
230
+ declare const INIT_STATE = "__init__";
231
+
232
+ export { type ActionsOrFn, type Bindable, type BindableContext, type BindableFn, type BindableParams, type BindableRefs, type ChooseFn, type ComputedFn, type EffectsOrFn, type EventObject, type GuardFn, INIT_STATE, type Machine, type MachineSchema, type MachineState, MachineStatus, type Params, type PropFn, type Scope, type Service, type Transition, type TransitionMap, type TransitionMatch, type TransitionSet, type ValueOrFn };
package/dist/types.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/types.ts
21
+ var types_exports = {};
22
+ __export(types_exports, {
23
+ INIT_STATE: () => INIT_STATE,
24
+ MachineStatus: () => MachineStatus
25
+ });
26
+ module.exports = __toCommonJS(types_exports);
27
+ var MachineStatus = /* @__PURE__ */ ((MachineStatus2) => {
28
+ MachineStatus2["NotStarted"] = "Not Started";
29
+ MachineStatus2["Started"] = "Started";
30
+ MachineStatus2["Stopped"] = "Stopped";
31
+ return MachineStatus2;
32
+ })(MachineStatus || {});
33
+ var INIT_STATE = "__init__";
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ INIT_STATE,
37
+ MachineStatus
38
+ });
package/dist/types.mjs ADDED
@@ -0,0 +1,12 @@
1
+ // src/types.ts
2
+ var MachineStatus = /* @__PURE__ */ ((MachineStatus2) => {
3
+ MachineStatus2["NotStarted"] = "Not Started";
4
+ MachineStatus2["Started"] = "Started";
5
+ MachineStatus2["Stopped"] = "Stopped";
6
+ return MachineStatus2;
7
+ })(MachineStatus || {});
8
+ var INIT_STATE = "__init__";
9
+ export {
10
+ INIT_STATE,
11
+ MachineStatus
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/core",
3
- "version": "1.34.1",
3
+ "version": "1.35.0",
4
4
  "description": "A minimal implementation of xstate fsm for UI machines",
5
5
  "keywords": [
6
6
  "ui-machines",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/chakra-ui/zag/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@zag-js/utils": "1.34.1",
29
- "@zag-js/dom-query": "1.34.1"
28
+ "@zag-js/utils": "1.35.0",
29
+ "@zag-js/dom-query": "1.35.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "clean-package": "2.2.0"