@xmachines/play-xstate 3.0.0 → 5.0.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.
- package/README.md +190 -68
- package/dist/capabilities.d.ts +93 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +4 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/define-player.d.ts +7 -1
- package/dist/define-player.d.ts.map +1 -1
- package/dist/define-player.js +9 -60
- package/dist/define-player.js.map +1 -1
- package/dist/errors.d.ts +64 -23
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +93 -31
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/player-actor.d.ts +73 -137
- package/dist/player-actor.d.ts.map +1 -1
- package/dist/player-actor.js +108 -254
- package/dist/player-actor.js.map +1 -1
- package/dist/routing/build-url.d.ts +8 -1
- package/dist/routing/build-url.d.ts.map +1 -1
- package/dist/routing/build-url.js +34 -54
- package/dist/routing/build-url.js.map +1 -1
- package/dist/routing/derive-current-route.d.ts +12 -38
- package/dist/routing/derive-current-route.d.ts.map +1 -1
- package/dist/routing/derive-current-route.js +24 -82
- package/dist/routing/derive-current-route.js.map +1 -1
- package/dist/routing/derive-initial-route.d.ts +2 -1
- package/dist/routing/derive-initial-route.d.ts.map +1 -1
- package/dist/routing/derive-initial-route.js +13 -2
- package/dist/routing/derive-initial-route.js.map +1 -1
- package/dist/routing/derive-route.d.ts +81 -2
- package/dist/routing/derive-route.d.ts.map +1 -1
- package/dist/routing/derive-route.js +97 -3
- package/dist/routing/derive-route.js.map +1 -1
- package/dist/routing/format-play-route-transitions.d.ts +8 -2
- package/dist/routing/format-play-route-transitions.d.ts.map +1 -1
- package/dist/routing/format-play-route-transitions.js +175 -43
- package/dist/routing/format-play-route-transitions.js.map +1 -1
- package/dist/routing/index.d.ts +1 -1
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/types.d.ts +9 -5
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/state-meta.d.ts +52 -0
- package/dist/state-meta.d.ts.map +1 -0
- package/dist/state-meta.js +77 -0
- package/dist/state-meta.js.map +1 -0
- package/dist/types.d.ts +20 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/view/derive-current-view.d.ts +7 -6
- package/dist/view/derive-current-view.d.ts.map +1 -1
- package/dist/view/derive-current-view.js +7 -6
- package/dist/view/derive-current-view.js.map +1 -1
- package/dist/with-routing.d.ts +45 -0
- package/dist/with-routing.d.ts.map +1 -0
- package/dist/with-routing.js +140 -0
- package/dist/with-routing.js.map +1 -0
- package/dist/with-view.d.ts +57 -0
- package/dist/with-view.d.ts.map +1 -0
- package/dist/with-view.js +158 -0
- package/dist/with-view.js.map +1 -0
- package/package.json +40 -18
- package/dist/guards/compose.d.ts +0 -158
- package/dist/guards/compose.d.ts.map +0 -1
- package/dist/guards/compose.js +0 -188
- package/dist/guards/compose.js.map +0 -1
- package/dist/guards/helpers.d.ts +0 -62
- package/dist/guards/helpers.d.ts.map +0 -1
- package/dist/guards/helpers.js +0 -85
- package/dist/guards/helpers.js.map +0 -1
- package/dist/guards/index.d.ts +0 -20
- package/dist/guards/index.d.ts.map +0 -1
- package/dist/guards/index.js +0 -18
- package/dist/guards/index.js.map +0 -1
- package/dist/guards/types.d.ts +0 -22
- package/dist/guards/types.d.ts.map +0 -1
- package/dist/guards/types.js +0 -2
- package/dist/guards/types.js.map +0 -1
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayError } from "@xmachines/play";
|
|
1
|
+
import { PlayError } from "@xmachines/play/errors";
|
|
2
2
|
/**
|
|
3
3
|
* `buildRouteUrl()` throws this error when the context of the actor does not hold a
|
|
4
4
|
* necessary route parameter.
|
|
@@ -14,7 +14,7 @@ import { PlayError } from "@xmachines/play";
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
|
-
* import { buildRouteUrl } from "@xmachines/play-xstate";
|
|
17
|
+
* import { buildRouteUrl } from "@xmachines/play-xstate/routing";
|
|
18
18
|
* import { MissingRouteParamError } from "@xmachines/play-xstate/errors";
|
|
19
19
|
*
|
|
20
20
|
* try {
|
|
@@ -36,21 +36,42 @@ export declare class MissingRouteParamError extends PlayError {
|
|
|
36
36
|
constructor(param: string, template: string);
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* and
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
39
|
+
* `buildRouteUrl()` throws this error when a route parameter carries a value that no path
|
|
40
|
+
* can hold, so the template matches the built URL back never.
|
|
41
|
+
*
|
|
42
|
+
* A dot segment is that value. A URL parser resolves `.` and `..` BEFORE it decodes the
|
|
43
|
+
* percent escapes, and it counts `%2e` as the dot, so every encoding of them resolves
|
|
44
|
+
* away: `/files/..` becomes `/`. The actor would hold the route `/files/..` while the
|
|
45
|
+
* address bar shows `/`, and the two stay out of step for the rest of the session.
|
|
46
|
+
*
|
|
47
|
+
* Give the param a value that names a segment. Machine state that can carry a path from a
|
|
48
|
+
* user belongs behind a check of its own, in the same way that a base path checks the
|
|
49
|
+
* values of its `:param` segments.
|
|
50
|
+
*
|
|
51
|
+
* **Error code:** `PLAY_XSTATE_ROUTE_PARAM_INVALID`
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* import { buildRouteUrl } from "@xmachines/play-xstate/routing";
|
|
56
|
+
* import { InvalidRouteParamError } from "@xmachines/play-xstate/errors";
|
|
57
|
+
*
|
|
58
|
+
* try {
|
|
59
|
+
* buildRouteUrl("/files/:name", { params: { name: ".." }, query: {} });
|
|
60
|
+
* } catch (err) {
|
|
61
|
+
* if (err instanceof InvalidRouteParamError) {
|
|
62
|
+
* console.error(`"${err.value}" cannot stand in "${err.param}"`);
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
51
66
|
*/
|
|
52
|
-
export declare class
|
|
53
|
-
|
|
67
|
+
export declare class InvalidRouteParamError extends PlayError {
|
|
68
|
+
/** The name of the route parameter that carries the value, for example `"name"`. */
|
|
69
|
+
readonly param: string;
|
|
70
|
+
/** The value that no path can hold, for example `".."`. */
|
|
71
|
+
readonly value: string;
|
|
72
|
+
/** The route template that declares the parameter, for example `"/files/:name"`. */
|
|
73
|
+
readonly template: string;
|
|
74
|
+
constructor(param: string, value: string, template: string);
|
|
54
75
|
}
|
|
55
76
|
/**
|
|
56
77
|
* `formatPlayRouteTransitions()` throws this error when a state node declares a
|
|
@@ -112,15 +133,35 @@ export declare class InvalidRouteMetadataError extends PlayError {
|
|
|
112
133
|
constructor(route: unknown, source?: string);
|
|
113
134
|
}
|
|
114
135
|
/**
|
|
115
|
-
* `
|
|
116
|
-
*
|
|
136
|
+
* `formatPlayRouteTransitions()` throws this error for a `meta.route` object whose
|
|
137
|
+
* `handler` field holds a value that the routing layer does not know.
|
|
138
|
+
*
|
|
139
|
+
* The field decides WHERE the generated `play.route` transition sits, and each value
|
|
140
|
+
* produces a different reachability. `"local"` in particular makes a state reachable
|
|
141
|
+
* only while its parent is active. A typo such as `"locale"` would therefore fall back
|
|
142
|
+
* to a placement that the author did not ask for, and the route would behave correctly
|
|
143
|
+
* in the test that the author wrote and wrongly everywhere else. The error refuses the
|
|
144
|
+
* value instead.
|
|
145
|
+
*
|
|
146
|
+
* **Error code:** `PLAY_XSTATE_INVALID_ROUTE_HANDLER`
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* import { InvalidRouteHandlerError } from "@xmachines/play-xstate/errors";
|
|
117
151
|
*
|
|
118
|
-
*
|
|
152
|
+
* try {
|
|
153
|
+
* formatPlayRouteTransitions(config);
|
|
154
|
+
* } catch (error) {
|
|
155
|
+
* if (error instanceof InvalidRouteHandlerError) {
|
|
156
|
+
* console.error(error.handler); // the value that the config declared
|
|
157
|
+
* }
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
119
160
|
*/
|
|
120
|
-
export declare class
|
|
121
|
-
/** The
|
|
122
|
-
readonly
|
|
123
|
-
constructor(
|
|
161
|
+
export declare class InvalidRouteHandlerError extends PlayError {
|
|
162
|
+
/** The value that the config declared, as a string, for the debug work. */
|
|
163
|
+
readonly handler: string;
|
|
164
|
+
constructor(handler: unknown, source?: string);
|
|
124
165
|
}
|
|
125
166
|
/**
|
|
126
167
|
* `PlayerActor.send()` throws this error when the event argument is not a plain
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAsBnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAU3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAW1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IACjD,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAEX,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAW3C;AAED;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;;CASjD;AAqBD;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACvD,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,KAAK,EAAE,OAAO,EAAE,MAAM,SAAgB;CAUlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACtD,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,OAAO,EAAE,MAAM,SAA+B;CAUnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAC/C,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEb,MAAM,EAAE,OAAO;CAS3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;gBACzC,KAAK,EAAE,OAAO;CAS1B"}
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayError } from "@xmachines/play";
|
|
1
|
+
import { PlayError } from "@xmachines/play/errors";
|
|
2
2
|
/**
|
|
3
3
|
* Converts a value from a throw into a string, and it trusts that value not:
|
|
4
4
|
* `String()` itself throws for an object with a null prototype, and also for a value
|
|
@@ -35,7 +35,7 @@ const safeString = (value) => {
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```typescript
|
|
38
|
-
* import { buildRouteUrl } from "@xmachines/play-xstate";
|
|
38
|
+
* import { buildRouteUrl } from "@xmachines/play-xstate/routing";
|
|
39
39
|
* import { MissingRouteParamError } from "@xmachines/play-xstate/errors";
|
|
40
40
|
*
|
|
41
41
|
* try {
|
|
@@ -62,25 +62,47 @@ export class MissingRouteParamError extends PlayError {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* and
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
65
|
+
* `buildRouteUrl()` throws this error when a route parameter carries a value that no path
|
|
66
|
+
* can hold, so the template matches the built URL back never.
|
|
67
|
+
*
|
|
68
|
+
* A dot segment is that value. A URL parser resolves `.` and `..` BEFORE it decodes the
|
|
69
|
+
* percent escapes, and it counts `%2e` as the dot, so every encoding of them resolves
|
|
70
|
+
* away: `/files/..` becomes `/`. The actor would hold the route `/files/..` while the
|
|
71
|
+
* address bar shows `/`, and the two stay out of step for the rest of the session.
|
|
72
|
+
*
|
|
73
|
+
* Give the param a value that names a segment. Machine state that can carry a path from a
|
|
74
|
+
* user belongs behind a check of its own, in the same way that a base path checks the
|
|
75
|
+
* values of its `:param` segments.
|
|
76
|
+
*
|
|
77
|
+
* **Error code:** `PLAY_XSTATE_ROUTE_PARAM_INVALID`
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* import { buildRouteUrl } from "@xmachines/play-xstate/routing";
|
|
82
|
+
* import { InvalidRouteParamError } from "@xmachines/play-xstate/errors";
|
|
83
|
+
*
|
|
84
|
+
* try {
|
|
85
|
+
* buildRouteUrl("/files/:name", { params: { name: ".." }, query: {} });
|
|
86
|
+
* } catch (err) {
|
|
87
|
+
* if (err instanceof InvalidRouteParamError) {
|
|
88
|
+
* console.error(`"${err.value}" cannot stand in "${err.param}"`);
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
77
92
|
*/
|
|
78
|
-
export class
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
export class InvalidRouteParamError extends PlayError {
|
|
94
|
+
/** The name of the route parameter that carries the value, for example `"name"`. */
|
|
95
|
+
param;
|
|
96
|
+
/** The value that no path can hold, for example `".."`. */
|
|
97
|
+
value;
|
|
98
|
+
/** The route template that declares the parameter, for example `"/files/:name"`. */
|
|
99
|
+
template;
|
|
100
|
+
constructor(param, value, template) {
|
|
101
|
+
super("buildRouteUrl", "PLAY_XSTATE_ROUTE_PARAM_INVALID", `Route parameter '${param}' of template '${template}' carries the value '${value}', which resolves away in a URL.`);
|
|
102
|
+
this.name = "InvalidRouteParamError";
|
|
103
|
+
this.param = param;
|
|
104
|
+
this.value = value;
|
|
105
|
+
this.template = template;
|
|
84
106
|
}
|
|
85
107
|
}
|
|
86
108
|
/**
|
|
@@ -140,6 +162,25 @@ export class InvalidMachineError extends PlayError {
|
|
|
140
162
|
this.name = "InvalidMachineError";
|
|
141
163
|
}
|
|
142
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Describes an unknown value for the message of an error, and throws nothing itself.
|
|
167
|
+
*
|
|
168
|
+
* `JSON.stringify` alone is not enough for a value that arrives from the config of a
|
|
169
|
+
* user. It returns the VALUE `undefined` for a function, for a symbol, and for
|
|
170
|
+
* `undefined`, which puts the text "undefined" in a field that is declared `string`.
|
|
171
|
+
* It also THROWS a `TypeError` for a circular object, and an error constructor that
|
|
172
|
+
* throws hides the error that it was built to report.
|
|
173
|
+
*
|
|
174
|
+
* The fallback names the type instead, for example `[function]`.
|
|
175
|
+
*/
|
|
176
|
+
function describeValue(value) {
|
|
177
|
+
try {
|
|
178
|
+
return JSON.stringify(value) ?? `[${typeof value}]`;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return `[${typeof value}]`;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
143
184
|
/**
|
|
144
185
|
* `normalizeRoute()` throws this error when the `meta.route` value of a state is not
|
|
145
186
|
* a string and not an object with a `path` property.
|
|
@@ -150,25 +191,46 @@ export class InvalidRouteMetadataError extends PlayError {
|
|
|
150
191
|
/** The invalid route value, as a string, for the debug work. */
|
|
151
192
|
detail;
|
|
152
193
|
constructor(route, source = "deriveRoute") {
|
|
153
|
-
const detail =
|
|
194
|
+
const detail = describeValue(route);
|
|
154
195
|
super(source, "PLAY_XSTATE_INVALID_ROUTE_METADATA", `Invalid route metadata: ${detail}. Expected string or { path: string }`);
|
|
155
196
|
this.name = "InvalidRouteMetadataError";
|
|
156
197
|
this.detail = detail;
|
|
157
198
|
}
|
|
158
199
|
}
|
|
159
200
|
/**
|
|
160
|
-
* `
|
|
161
|
-
*
|
|
201
|
+
* `formatPlayRouteTransitions()` throws this error for a `meta.route` object whose
|
|
202
|
+
* `handler` field holds a value that the routing layer does not know.
|
|
203
|
+
*
|
|
204
|
+
* The field decides WHERE the generated `play.route` transition sits, and each value
|
|
205
|
+
* produces a different reachability. `"local"` in particular makes a state reachable
|
|
206
|
+
* only while its parent is active. A typo such as `"locale"` would therefore fall back
|
|
207
|
+
* to a placement that the author did not ask for, and the route would behave correctly
|
|
208
|
+
* in the test that the author wrote and wrongly everywhere else. The error refuses the
|
|
209
|
+
* value instead.
|
|
162
210
|
*
|
|
163
|
-
* **Error code:** `
|
|
211
|
+
* **Error code:** `PLAY_XSTATE_INVALID_ROUTE_HANDLER`
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```typescript
|
|
215
|
+
* import { InvalidRouteHandlerError } from "@xmachines/play-xstate/errors";
|
|
216
|
+
*
|
|
217
|
+
* try {
|
|
218
|
+
* formatPlayRouteTransitions(config);
|
|
219
|
+
* } catch (error) {
|
|
220
|
+
* if (error instanceof InvalidRouteHandlerError) {
|
|
221
|
+
* console.error(error.handler); // the value that the config declared
|
|
222
|
+
* }
|
|
223
|
+
* }
|
|
224
|
+
* ```
|
|
164
225
|
*/
|
|
165
|
-
export class
|
|
166
|
-
/** The
|
|
167
|
-
|
|
168
|
-
constructor(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
this.
|
|
226
|
+
export class InvalidRouteHandlerError extends PlayError {
|
|
227
|
+
/** The value that the config declared, as a string, for the debug work. */
|
|
228
|
+
handler;
|
|
229
|
+
constructor(handler, source = "formatPlayRouteTransitions") {
|
|
230
|
+
const detail = describeValue(handler);
|
|
231
|
+
super(source, "PLAY_XSTATE_INVALID_ROUTE_HANDLER", `Invalid route handler: ${detail}. Expected "root", "local", or "both"`);
|
|
232
|
+
this.name = "InvalidRouteHandlerError";
|
|
233
|
+
this.handler = detail;
|
|
172
234
|
}
|
|
173
235
|
}
|
|
174
236
|
/**
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,KAAc,EAAU,EAAE;IAC7C,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACR,IAAI,CAAC;YACJ,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;QAAC,M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;QAClE,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACtC,KAAK,CACJ,MAAM,EACN,mCAAmC,EACnC,0BAA0B,MAAM,uCAAuC,CACvE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC/C,qDAAqD;IAC5C,MAAM,CAAU;IAEzB,YAAY,MAAe;QAC1B,KAAK,CACJ,aAAa,EACb,2BAA2B,EAC3B,iDAAiD,CACjD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IACrD,YAAY,KAAc;QACzB,KAAK,CACJ,aAAa,EACb,8BAA8B,EAC9B,8CAA8C,UAAU,CAAC,KAAK,CAAC,GAAG,EAClE,EAAE,KAAK,EAAE,KAAK,EAAE,CAChB,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACvC,CAAC;CACD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
* @xmachines/play-xstate - the XState v5 adapter of the Play Architecture
|
|
3
3
|
*
|
|
4
4
|
* This package gives you the definePlayer() API. That function binds an XState state
|
|
5
|
-
* machine to the actor base, with the
|
|
5
|
+
* machine to the actor base, with the atom lifecycle and the DevTools
|
|
6
6
|
* integration.
|
|
7
7
|
*
|
|
8
8
|
* The Play RFC gives this package as the adapter of the logic layer. It converts a
|
|
9
|
-
* declarative machine definition into a live actor with
|
|
9
|
+
* declarative machine definition into a live actor with an atom-driven
|
|
10
10
|
* reactivity.
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
14
|
export { definePlayer } from "./define-player.js";
|
|
15
15
|
export { PlayerActor } from "./player-actor.js";
|
|
16
|
+
export { compose } from "./capabilities.js";
|
|
17
|
+
export type { Capability, PlayerConstructor } from "./capabilities.js";
|
|
16
18
|
export type { PlayerConfig, PlayerOptions, PlayerFactory, PlayerFactoryResumeOptions, } from "./types.js";
|
|
17
|
-
export { composeGuards, composeGuardsOr, negateGuard, hasContext, eventMatches, contextFieldMatches, } from "./guards/index.js";
|
|
18
|
-
export type { Guard, GuardArray, ComposedGuard } from "./guards/index.js";
|
|
19
|
-
export { deriveRoute, isAbsoluteRoute, buildRouteUrl, formatPlayRouteTransitions, } from "./routing/index.js";
|
|
20
|
-
export type { RouteMachineConfig, RouteStateNode, RouteContext, RouteObject, RouteMetadata, } from "./routing/index.js";
|
|
21
19
|
export { DISPOSE } from "@xmachines/play";
|
|
22
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
* @xmachines/play-xstate - the XState v5 adapter of the Play Architecture
|
|
3
3
|
*
|
|
4
4
|
* This package gives you the definePlayer() API. That function binds an XState state
|
|
5
|
-
* machine to the actor base, with the
|
|
5
|
+
* machine to the actor base, with the atom lifecycle and the DevTools
|
|
6
6
|
* integration.
|
|
7
7
|
*
|
|
8
8
|
* The Play RFC gives this package as the adapter of the logic layer. It converts a
|
|
9
|
-
* declarative machine definition into a live actor with
|
|
9
|
+
* declarative machine definition into a live actor with an atom-driven
|
|
10
10
|
* reactivity.
|
|
11
11
|
*
|
|
12
12
|
* @packageDocumentation
|
|
13
13
|
*/
|
|
14
14
|
export { definePlayer } from "./define-player.js";
|
|
15
15
|
export { PlayerActor } from "./player-actor.js";
|
|
16
|
-
// The
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
export {
|
|
16
|
+
// The composition of the capabilities. Each capability itself lives behind its own entry
|
|
17
|
+
// point — `@xmachines/play-xstate/routing` and `@xmachines/play-xstate/view` — so this
|
|
18
|
+
// module imports neither, and an application loads only what it composes.
|
|
19
|
+
export { compose } from "./capabilities.js";
|
|
20
|
+
// The routing utilities live behind `@xmachines/play-xstate/routing`, with the mixin
|
|
21
|
+
// that needs them: `deriveRoute`, `isAbsoluteRoute`, `buildRouteUrl`,
|
|
22
|
+
// `formatPlayRouteTransitions`, and the route types. Each one names
|
|
23
|
+
// `@xmachines/play-router` in its `.d.ts`, and that package is an OPTIONAL peer. This
|
|
24
|
+
// entry therefore names no capability package, exactly as the view half does.
|
|
20
25
|
// The release protocol of @xmachines/play. This package's own published `.d.ts` names
|
|
21
26
|
// exactly these, so a consumer reads them from here and needs no second manifest
|
|
22
27
|
// entry. It names `asCleanup` nowhere: a consumer of this package RECEIVES a
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,yFAAyF;AACzF,uFAAuF;AACvF,0EAA0E;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAS5C,qFAAqF;AACrF,sEAAsE;AACtE,oEAAoE;AACpE,sFAAsF;AACtF,8EAA8E;AAC9E,sFAAsF;AACtF,iFAAiF;AACjF,6EAA6E;AAC7E,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|