@xmachines/play-router 6.0.0 → 7.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.
Files changed (40) hide show
  1. package/README.md +79 -23
  2. package/dist/base-route-map.js +240 -270
  3. package/dist/base-route-map.js.map +1 -1
  4. package/dist/build-tree.js +84 -96
  5. package/dist/build-tree.js.map +1 -1
  6. package/dist/create-route-map-from-tree.js +50 -47
  7. package/dist/create-route-map-from-tree.js.map +1 -1
  8. package/dist/errors.js +124 -133
  9. package/dist/errors.js.map +1 -1
  10. package/dist/find-route.js +88 -105
  11. package/dist/find-route.js.map +1 -1
  12. package/dist/index.js +10 -28
  13. package/dist/provider-lifecycle.js +109 -143
  14. package/dist/provider-lifecycle.js.map +1 -1
  15. package/dist/router-bridge-base.d.ts +5 -5
  16. package/dist/router-bridge-base.d.ts.map +1 -1
  17. package/dist/router-bridge-base.js +1026 -1601
  18. package/dist/router-bridge-base.js.map +1 -1
  19. package/dist/router-sync.js +107 -139
  20. package/dist/router-sync.js.map +1 -1
  21. package/dist/types.d.ts +17 -17
  22. package/dist/types.d.ts.map +1 -1
  23. package/dist/validate-routes.js +58 -66
  24. package/dist/validate-routes.js.map +1 -1
  25. package/dist/xstate/create-route-map.js +36 -35
  26. package/dist/xstate/create-route-map.js.map +1 -1
  27. package/dist/xstate/extract-routes.js +66 -83
  28. package/dist/xstate/extract-routes.js.map +1 -1
  29. package/dist/xstate/index.js +5 -33
  30. package/dist/xstate/machine-to-graph.js +98 -109
  31. package/dist/xstate/machine-to-graph.js.map +1 -1
  32. package/dist/xstate/query.js +190 -212
  33. package/dist/xstate/query.js.map +1 -1
  34. package/package.json +16 -16
  35. package/dist/index.js.map +0 -1
  36. package/dist/types.js +0 -2
  37. package/dist/types.js.map +0 -1
  38. package/dist/xstate/index.js.map +0 -1
  39. package/dist/xstate/machine-types.js +0 -2
  40. package/dist/xstate/machine-types.js.map +0 -1
@@ -1,229 +1,207 @@
1
- import { joinBasePath, normalizeBasePath, resolveBasePath, } from "@xmachines/play-url";
1
+ import "../build-tree.js";
2
+ import { joinBasePath, normalizeBasePath, resolveBasePath } from "@xmachines/play-url";
2
3
  import { getSuccessors, hasNode, hasPath } from "@statelyai/graph";
3
- import { ROOT_NODE_ID } from "../build-tree.js";
4
+ //#region packages/play-router/src/xstate/query.ts
4
5
  /**
5
- * Returns the successor nodes of a state that have a route: the states of a direct
6
- * transition edge that hold a `meta.route` field.
7
- *
8
- * `getTransitionReachableStateIds` and `getTransitionReachableRoutes` share this
9
- * walk. The function returns the complete nodes. Therefore each caller reads the
10
- * field that it needs: the stateId, or the raw route string.
11
- */
12
- const getRoutableSuccessors = (graph, stateId) =>
13
- // A state ID without a graph node, for example a state without a route or a state
14
- // that a person removed, is a normal result of "nothing to reach". The code tests
15
- // that case explicitly, and it matches no message of an error from a throw.
16
- hasNode(graph, stateId)
17
- ? getSuccessors(graph, stateId).filter((n) => n.data.route !== undefined)
18
- : [];
6
+ * Returns the successor nodes of a state that have a route: the states of a direct
7
+ * transition edge that hold a `meta.route` field.
8
+ *
9
+ * `getTransitionReachableStateIds` and `getTransitionReachableRoutes` share this
10
+ * walk. The function returns the complete nodes. Therefore each caller reads the
11
+ * field that it needs: the stateId, or the raw route string.
12
+ */
13
+ var getRoutableSuccessors = (graph, stateId) => hasNode(graph, stateId) ? getSuccessors(graph, stateId).filter((n) => n.data.route !== void 0) : [];
19
14
  /**
20
- * Returns every route of a navigation from the given state
21
- *
22
- * The function returns the child routes of the state. A later version also returns
23
- * the sibling routes of a transition.
24
- *
25
- * @param tree - The route tree, from extractMachineRoutes()
26
- * @param stateId - The ID of the current state
27
- * @returns The array of the route nodes that the state can reach
28
- *
29
- * @example
30
- * ```typescript
31
- * const tree = extractMachineRoutes(machine);
32
- * const routes = getNavigableRoutes(tree, 'dashboard');
33
- * // [{ id: 'overview', path: '/overview', ... }, { id: 'settings', ... }]
34
- * ```
35
- */
36
- export const getNavigableRoutes = (tree, stateId) => {
37
- const node = tree.byStateId.get(stateId);
38
- if (!node)
39
- return [];
40
- const results = [...node.children]; // The direct child routes
41
- // With a graph, the result also holds each route that a transition can reach.
42
- // The code looks each node up by its state ID: a graph node carries the RAW
43
- // meta.route string, and that string can be relative, for example "detail". The
44
- // keys of tree.byPath are the resolved fullPath values, for example
45
- // "/section/detail". A lookup by the path therefore loses every relative route in
46
- // silence. A state ID is unambiguous in both structures.
47
- if (tree.graph) {
48
- const reachableStateIds = getTransitionReachableStateIds(tree.graph, stateId);
49
- const existingPaths = new Set(results.map((r) => r.fullPath));
50
- for (const reachableStateId of reachableStateIds) {
51
- const routeNode = tree.byStateId.get(reachableStateId);
52
- if (routeNode && !existingPaths.has(routeNode.fullPath)) {
53
- results.push(routeNode);
54
- existingPaths.add(routeNode.fullPath);
55
- }
56
- }
57
- }
58
- return results;
15
+ * Returns every route of a navigation from the given state
16
+ *
17
+ * The function returns the child routes of the state. A later version also returns
18
+ * the sibling routes of a transition.
19
+ *
20
+ * @param tree - The route tree, from extractMachineRoutes()
21
+ * @param stateId - The ID of the current state
22
+ * @returns The array of the route nodes that the state can reach
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const tree = extractMachineRoutes(machine);
27
+ * const routes = getNavigableRoutes(tree, 'dashboard');
28
+ * // [{ id: 'overview', path: '/overview', ... }, { id: 'settings', ... }]
29
+ * ```
30
+ */
31
+ var getNavigableRoutes = (tree, stateId) => {
32
+ const node = tree.byStateId.get(stateId);
33
+ if (!node) return [];
34
+ const results = [...node.children];
35
+ if (tree.graph) {
36
+ const reachableStateIds = getTransitionReachableStateIds(tree.graph, stateId);
37
+ const existingPaths = new Set(results.map((r) => r.fullPath));
38
+ for (const reachableStateId of reachableStateIds) {
39
+ const routeNode = tree.byStateId.get(reachableStateId);
40
+ if (routeNode && !existingPaths.has(routeNode.fullPath)) {
41
+ results.push(routeNode);
42
+ existingPaths.add(routeNode.fullPath);
43
+ }
44
+ }
45
+ }
46
+ return results;
59
47
  };
60
48
  /**
61
- * Returns the state IDs of the states with a route that a transition from a state
62
- * can reach.
63
- *
64
- * The walk is the same as the walk of `getTransitionReachableRoutes`, but this
65
- * function returns the state IDs, and not the raw `meta.route` strings. A caller
66
- * therefore resolves each node through `tree.byStateId`, with no doubt between a raw
67
- * path and a resolved path.
68
- */
69
- const getTransitionReachableStateIds = (graph, stateId) => {
70
- return getRoutableSuccessors(graph, stateId).map((n) => n.data.stateId);
49
+ * Returns the state IDs of the states with a route that a transition from a state
50
+ * can reach.
51
+ *
52
+ * The walk is the same as the walk of `getTransitionReachableRoutes`, but this
53
+ * function returns the state IDs, and not the raw `meta.route` strings. A caller
54
+ * therefore resolves each node through `tree.byStateId`, with no doubt between a raw
55
+ * path and a resolved path.
56
+ */
57
+ var getTransitionReachableStateIds = (graph, stateId) => {
58
+ return getRoutableSuccessors(graph, stateId).map((n) => n.data.stateId);
71
59
  };
72
60
  /**
73
- * Returns every route of the tree that has a route, in one flat array
74
- *
75
- * The function returns each route with a `meta.route` field. It returns no state
76
- * without a route, and no synthetic root node. Use it to generate a router
77
- * configuration in a framework adapter dynamically.
78
- *
79
- * @param tree - The route tree, from extractMachineRoutes()
80
- * @returns The array of the route nodes with a route, with their path and their stateId
81
- *
82
- * @example
83
- * ```typescript
84
- * const tree = extractMachineRoutes(machine);
85
- * const routes = getRoutableRoutes(tree);
86
- * // [
87
- * // { path: '/', stateId: '#home', ... },
88
- * // { path: '/about', stateId: '#about', ... },
89
- * // { path: '/profile/:userId', stateId: '#profile', ... }
90
- * // ]
91
- * ```
92
- */
93
- export const getRoutableRoutes = (tree) => {
94
- const routes = [];
95
- for (const node of tree.byStateId.values()) {
96
- // Keep the nodes with a route, which means the nodes with a meta.route field, and skip the synthetic root
97
- if (node.routable && node.id !== ROOT_NODE_ID) {
98
- routes.push(node);
99
- }
100
- }
101
- return routes;
61
+ * Returns every route of the tree that has a route, in one flat array
62
+ *
63
+ * The function returns each route with a `meta.route` field. It returns no state
64
+ * without a route, and no synthetic root node. Use it to generate a router
65
+ * configuration in a framework adapter dynamically.
66
+ *
67
+ * @param tree - The route tree, from extractMachineRoutes()
68
+ * @returns The array of the route nodes with a route, with their path and their stateId
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const tree = extractMachineRoutes(machine);
73
+ * const routes = getRoutableRoutes(tree);
74
+ * // [
75
+ * // { path: '/', stateId: '#home', ... },
76
+ * // { path: '/about', stateId: '#about', ... },
77
+ * // { path: '/profile/:userId', stateId: '#profile', ... }
78
+ * // ]
79
+ * ```
80
+ */
81
+ var getRoutableRoutes = (tree) => {
82
+ const routes = [];
83
+ for (const node of tree.byStateId.values()) if (node.routable && node.id !== "__root__") routes.push(node);
84
+ return routes;
102
85
  };
103
86
  /**
104
- * Tells you if a route path is in the tree
105
- *
106
- * The function tests if the path has a state with a `meta.route` field.
107
- *
108
- * @param tree - The route tree, from extractMachineRoutes()
109
- * @param path - The complete route path, for example '/dashboard/settings'
110
- * @returns true when the tree holds the path. In every other case, false
111
- */
112
- export const routeExists = (tree, path) => {
113
- return tree.byPath.has(path);
87
+ * Tells you if a route path is in the tree
88
+ *
89
+ * The function tests if the path has a state with a `meta.route` field.
90
+ *
91
+ * @param tree - The route tree, from extractMachineRoutes()
92
+ * @param path - The complete route path, for example '/dashboard/settings'
93
+ * @returns true when the tree holds the path. In every other case, false
94
+ */
95
+ var routeExists = (tree, path) => {
96
+ return tree.byPath.has(path);
114
97
  };
115
98
  /**
116
- * Returns the routes that a transition from the current state can reach
117
- *
118
- * The function uses the successor algorithm of @statelyai/graph. It finds every
119
- * state of a direct transition edge from the given state, then it keeps the states
120
- * with a route.
121
- *
122
- * The values of the return are the RAW `meta.route` strings of the machine. The
123
- * function does NOT resolve a relative route, for example `"detail"`, to a complete
124
- * path, and such a value is therefore no key of `tree.byPath`. For a resolved
125
- * `RouteNode`, use `getNavigableRoutes`: that function resolves each state that the
126
- * transition reaches through `tree.byStateId`.
127
- *
128
- * @param graph - The machine graph, from RouteTree.graph
129
- * @param stateId - The ID of the current state, for example "test.home"
130
- * @returns The array of the raw route strings that a transition can reach
131
- *
132
- * @example
133
- * ```typescript
134
- * const tree = extractMachineRoutes(machine);
135
- * if (tree.graph) {
136
- * const reachable = getTransitionReachableRoutes(tree.graph, 'auth.loggedIn');
137
- * // ['/dashboard', '/settings'] — the routes that a transition can reach
138
- * }
139
- * ```
140
- */
141
- export const getTransitionReachableRoutes = (graph, stateId) => {
142
- return getRoutableSuccessors(graph, stateId).map((n) => n.data.route);
99
+ * Returns the routes that a transition from the current state can reach
100
+ *
101
+ * The function uses the successor algorithm of @statelyai/graph. It finds every
102
+ * state of a direct transition edge from the given state, then it keeps the states
103
+ * with a route.
104
+ *
105
+ * The values of the return are the RAW `meta.route` strings of the machine. The
106
+ * function does NOT resolve a relative route, for example `"detail"`, to a complete
107
+ * path, and such a value is therefore no key of `tree.byPath`. For a resolved
108
+ * `RouteNode`, use `getNavigableRoutes`: that function resolves each state that the
109
+ * transition reaches through `tree.byStateId`.
110
+ *
111
+ * @param graph - The machine graph, from RouteTree.graph
112
+ * @param stateId - The ID of the current state, for example "test.home"
113
+ * @returns The array of the raw route strings that a transition can reach
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * const tree = extractMachineRoutes(machine);
118
+ * if (tree.graph) {
119
+ * const reachable = getTransitionReachableRoutes(tree.graph, 'auth.loggedIn');
120
+ * // ['/dashboard', '/settings'] — the routes that a transition can reach
121
+ * }
122
+ * ```
123
+ */
124
+ var getTransitionReachableRoutes = (graph, stateId) => {
125
+ return getRoutableSuccessors(graph, stateId).map((n) => n.data.route);
143
126
  };
144
127
  /**
145
- * Tells you if a transition from the current state can reach a route
146
- *
147
- * The function uses the path search of @statelyai/graph. It decides if a chain of
148
- * transition edges is present from the state of the origin to the state of the
149
- * target.
150
- *
151
- * @param graph - The machine graph, from RouteTree.graph
152
- * @param fromStateId - The ID of the state of the origin
153
- * @param toStateId - The ID of the state of the target
154
- * @returns true when a transition path is present. In every other case, false
155
- *
156
- * @example
157
- * ```typescript
158
- * const tree = extractMachineRoutes(machine);
159
- * if (tree.graph) {
160
- * const canReach = isRouteReachable(tree.graph, 'auth.login', 'auth.dashboard');
161
- * // it is true when a transition path from login to dashboard is present
162
- * }
163
- * ```
164
- */
165
- export const isRouteReachable = (graph, fromStateId, toStateId) => {
166
- // An absent endpoint is a normal result of "not reachable".
167
- return hasNode(graph, fromStateId) && hasNode(graph, toStateId)
168
- ? hasPath(graph, fromStateId, toStateId)
169
- : false;
128
+ * Tells you if a transition from the current state can reach a route
129
+ *
130
+ * The function uses the path search of @statelyai/graph. It decides if a chain of
131
+ * transition edges is present from the state of the origin to the state of the
132
+ * target.
133
+ *
134
+ * @param graph - The machine graph, from RouteTree.graph
135
+ * @param fromStateId - The ID of the state of the origin
136
+ * @param toStateId - The ID of the state of the target
137
+ * @returns true when a transition path is present. In every other case, false
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * const tree = extractMachineRoutes(machine);
142
+ * if (tree.graph) {
143
+ * const canReach = isRouteReachable(tree.graph, 'auth.login', 'auth.dashboard');
144
+ * // it is true when a transition path from login to dashboard is present
145
+ * }
146
+ * ```
147
+ */
148
+ var isRouteReachable = (graph, fromStateId, toStateId) => {
149
+ return hasNode(graph, fromStateId) && hasNode(graph, toStateId) ? hasPath(graph, fromStateId, toStateId) : false;
170
150
  };
171
151
  /**
172
- * Returns the `{ stateId, path }` entries that a host router needs, so that it can
173
- * register the routes of a machine under a base path, and remove them again later.
174
- *
175
- * This function makes the routes dynamic. `getStateIdByPath` and `getPathByStateId`
176
- * answer the question "what is this URL?" at the moment of a navigation, but a host
177
- * that declares real route objects — a route tree of TanStack, a `RouteObject[]`, an
178
- * `addRoute` call of vue-router — needs the LIST in advance, and it needs that list
179
- * with the prefix of the mount. A registration of these paths, and a removal of them
180
- * when the machine unloads, keeps the route table of the host in step with the mount.
181
- *
182
- * `basePathParams` decides the form of each path, and both forms are useful:
183
- * - **Given** → a concrete path (`/abc123/play/profile/:userId`), for a route that
184
- * the host adds at run time, after a loader resolved the mount.
185
- * - **Absent** → the pattern stays (`/:machineId/play/profile/:userId`), for a static
186
- * route declaration of the host.
187
- *
188
- * The function ALWAYS keeps each `:param` segment that the machine declares itself:
189
- * those are the params that the route of the host must match.
190
- *
191
- * @param tree - The route tree of extractMachineRoutes()
192
- * @param options - The optional `{ basePath, basePathParams }`, the same option as the bridge takes.
193
- * Each `stateId` comes from the route tree, so it carries NO `#` prefix. A host that
194
- * keys its route table on the target of a `play.route` event adds the `#` itself,
195
- * because the event always carries the prefixed form.
196
- *
197
- * @returns One entry for each state with a route, in the order of the route tree.
198
- * @throws {InvalidBasePathError} For a base path that resolves to one concrete path never.
199
- * @throws {MissingBasePathParamError} When `basePathParams` is present and it omits a `:param`.
200
- *
201
- * @example
202
- * ```typescript
203
- * const tree = extractMachineRoutes(machine);
204
- *
205
- * // Concrete, for a route that the host adds after a loader resolved the mount
206
- * getRouteMappings(tree, { basePath: "/:machineId/play", basePathParams: { machineId: "abc123" } });
207
- * // [
208
- * // { stateId: "app.home", path: "/abc123/play" },
209
- * // { stateId: "app.profile", path: "/abc123/play/profile/:userId" },
210
- * // ]
211
- *
212
- * // The pattern, for a static route declaration of the host
213
- * getRouteMappings(tree, { basePath: "/:machineId/play" });
214
- * // [{ stateId: "app.home", path: "/:machineId/play" }, ...]
215
- * ```
216
- */
217
- export const getRouteMappings = (tree, options) => {
218
- // With the params, resolve the prefix to a concrete path. Without them, keep the
219
- // pattern, so that a host declares its routes statically and substitutes each param
220
- // itself.
221
- const basePath = options?.basePathParams === undefined
222
- ? normalizeBasePath(options?.basePath)
223
- : resolveBasePath(options.basePath, options.basePathParams).path;
224
- return getRoutableRoutes(tree).map((node) => ({
225
- stateId: node.stateId,
226
- path: joinBasePath(basePath, node.fullPath),
227
- }));
152
+ * Returns the `{ stateId, path }` entries that a host router needs, so that it can
153
+ * register the routes of a machine under a base path, and remove them again later.
154
+ *
155
+ * This function makes the routes dynamic. `getStateIdByPath` and `getPathByStateId`
156
+ * answer the question "what is this URL?" at the moment of a navigation, but a host
157
+ * that declares real route objects — a route tree of TanStack, a `RouteObject[]`, an
158
+ * `addRoute` call of vue-router — needs the LIST in advance, and it needs that list
159
+ * with the prefix of the mount. A registration of these paths, and a removal of them
160
+ * when the machine unloads, keeps the route table of the host in step with the mount.
161
+ *
162
+ * `basePathParams` decides the form of each path, and both forms are useful:
163
+ * - **Given** → a concrete path (`/abc123/play/profile/:userId`), for a route that
164
+ * the host adds at run time, after a loader resolved the mount.
165
+ * - **Absent** → the pattern stays (`/:machineId/play/profile/:userId`), for a static
166
+ * route declaration of the host.
167
+ *
168
+ * The function ALWAYS keeps each `:param` segment that the machine declares itself:
169
+ * those are the params that the route of the host must match.
170
+ *
171
+ * @param tree - The route tree of extractMachineRoutes()
172
+ * @param options - The optional `{ basePath, basePathParams }`, the same option as the bridge takes.
173
+ * Each `stateId` comes from the route tree, so it carries NO `#` prefix. A host that
174
+ * keys its route table on the target of a `play.route` event adds the `#` itself,
175
+ * because the event always carries the prefixed form.
176
+ *
177
+ * @returns One entry for each state with a route, in the order of the route tree.
178
+ * @throws {InvalidBasePathError} For a base path that resolves to one concrete path never.
179
+ * @throws {MissingBasePathParamError} When `basePathParams` is present and it omits a `:param`.
180
+ *
181
+ * @example
182
+ * ```typescript
183
+ * const tree = extractMachineRoutes(machine);
184
+ *
185
+ * // Concrete, for a route that the host adds after a loader resolved the mount
186
+ * getRouteMappings(tree, { basePath: "/:machineId/play", basePathParams: { machineId: "abc123" } });
187
+ * // [
188
+ * // { stateId: "app.home", path: "/abc123/play" },
189
+ * // { stateId: "app.profile", path: "/abc123/play/profile/:userId" },
190
+ * // ]
191
+ *
192
+ * // The pattern, for a static route declaration of the host
193
+ * getRouteMappings(tree, { basePath: "/:machineId/play" });
194
+ * // [{ stateId: "app.home", path: "/:machineId/play" }, ...]
195
+ * ```
196
+ */
197
+ var getRouteMappings = (tree, options) => {
198
+ const basePath = options?.basePathParams === void 0 ? normalizeBasePath(options?.basePath) : resolveBasePath(options.basePath, options.basePathParams).path;
199
+ return getRoutableRoutes(tree).map((node) => ({
200
+ stateId: node.stateId,
201
+ path: joinBasePath(basePath, node.fullPath)
202
+ }));
228
203
  };
204
+ //#endregion
205
+ export { getNavigableRoutes, getRoutableRoutes, getRouteMappings, getTransitionReachableRoutes, isRouteReachable, routeExists };
206
+
229
207
  //# sourceMappingURL=query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/xstate/query.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,iBAAiB,EACjB,eAAe,GAEf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAShD;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,CAC7B,KAA8C,EAC9C,OAAe,EACiB,EAAE;AAClC,kFAAkF;AAClF,kFAAkF;AAClF,4EAA4E;AAC5E,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;IACtB,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CACpC,CAAC,CAAC,EAAoC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CACnE;IACF,CAAC,CAAC,EAAE,CAAC;AAEP;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAA6B,EAAE,OAAe,EAAe,EAAE;IACjG,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B;IAE9D,8EAA8E;IAC9E,4EAA4E;IAC5E,g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AAE,QAAQ,CAAC;QACtC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC;IAEnE,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7C,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;KAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"query.js","names":[],"sources":["../../src/xstate/query.ts"],"sourcesContent":["import {\n\tjoinBasePath,\n\tnormalizeBasePath,\n\tresolveBasePath,\n\ttype BasePathOptions,\n} from \"@xmachines/play-url\";\nimport type { Graph, GraphNode } from \"@statelyai/graph\";\nimport { getSuccessors, hasNode, hasPath } from \"@statelyai/graph\";\nimport { ROOT_NODE_ID } from \"../build-tree.js\";\nimport type { RouteTree, RouteNode } from \"../types.js\";\nimport type { MachineNodeData, MachineEdgeData } from \"./machine-types.js\";\nimport type { MachineGraph } from \"./machine-to-graph.js\";\nimport type { RouteMapping } from \"../base-route-map.js\";\n\n/** A graph node whose state declares a route. The filter below proves the `route` field. */\ntype RoutableNodeData = MachineNodeData & { route: string };\n\n/**\n * Returns the successor nodes of a state that have a route: the states of a direct\n * transition edge that hold a `meta.route` field.\n *\n * `getTransitionReachableStateIds` and `getTransitionReachableRoutes` share this\n * walk. The function returns the complete nodes. Therefore each caller reads the\n * field that it needs: the stateId, or the raw route string.\n */\nconst getRoutableSuccessors = (\n\tgraph: Graph<MachineNodeData, MachineEdgeData>,\n\tstateId: string,\n): GraphNode<RoutableNodeData>[] =>\n\t// A state ID without a graph node, for example a state without a route or a state\n\t// that a person removed, is a normal result of \"nothing to reach\". The code tests\n\t// that case explicitly, and it matches no message of an error from a throw.\n\thasNode(graph, stateId)\n\t\t? getSuccessors(graph, stateId).filter(\n\t\t\t\t(n): n is GraphNode<RoutableNodeData> => n.data.route !== undefined,\n\t\t\t)\n\t\t: [];\n\n/**\n * Returns every route of a navigation from the given state\n *\n * The function returns the child routes of the state. A later version also returns\n * the sibling routes of a transition.\n *\n * @param tree - The route tree, from extractMachineRoutes()\n * @param stateId - The ID of the current state\n * @returns The array of the route nodes that the state can reach\n *\n * @example\n * ```typescript\n * const tree = extractMachineRoutes(machine);\n * const routes = getNavigableRoutes(tree, 'dashboard');\n * // [{ id: 'overview', path: '/overview', ... }, { id: 'settings', ... }]\n * ```\n */\nexport const getNavigableRoutes = (tree: RouteTree<MachineGraph>, stateId: string): RouteNode[] => {\n\tconst node = tree.byStateId.get(stateId);\n\tif (!node) return [];\n\n\tconst results = [...node.children]; // The direct child routes\n\n\t// With a graph, the result also holds each route that a transition can reach.\n\t// The code looks each node up by its state ID: a graph node carries the RAW\n\t// meta.route string, and that string can be relative, for example \"detail\". The\n\t// keys of tree.byPath are the resolved fullPath values, for example\n\t// \"/section/detail\". A lookup by the path therefore loses every relative route in\n\t// silence. A state ID is unambiguous in both structures.\n\tif (tree.graph) {\n\t\tconst reachableStateIds = getTransitionReachableStateIds(tree.graph, stateId);\n\t\tconst existingPaths = new Set(results.map((r) => r.fullPath));\n\n\t\tfor (const reachableStateId of reachableStateIds) {\n\t\t\tconst routeNode = tree.byStateId.get(reachableStateId);\n\t\t\tif (routeNode && !existingPaths.has(routeNode.fullPath)) {\n\t\t\t\tresults.push(routeNode);\n\t\t\t\texistingPaths.add(routeNode.fullPath);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn results;\n};\n\n/**\n * Returns the state IDs of the states with a route that a transition from a state\n * can reach.\n *\n * The walk is the same as the walk of `getTransitionReachableRoutes`, but this\n * function returns the state IDs, and not the raw `meta.route` strings. A caller\n * therefore resolves each node through `tree.byStateId`, with no doubt between a raw\n * path and a resolved path.\n */\nconst getTransitionReachableStateIds = (\n\tgraph: Graph<MachineNodeData, MachineEdgeData>,\n\tstateId: string,\n): string[] => {\n\treturn getRoutableSuccessors(graph, stateId).map((n) => n.data.stateId);\n};\n\n/**\n * Returns every route of the tree that has a route, in one flat array\n *\n * The function returns each route with a `meta.route` field. It returns no state\n * without a route, and no synthetic root node. Use it to generate a router\n * configuration in a framework adapter dynamically.\n *\n * @param tree - The route tree, from extractMachineRoutes()\n * @returns The array of the route nodes with a route, with their path and their stateId\n *\n * @example\n * ```typescript\n * const tree = extractMachineRoutes(machine);\n * const routes = getRoutableRoutes(tree);\n * // [\n * // { path: '/', stateId: '#home', ... },\n * // { path: '/about', stateId: '#about', ... },\n * // { path: '/profile/:userId', stateId: '#profile', ... }\n * // ]\n * ```\n */\nexport const getRoutableRoutes = (tree: RouteTree): RouteNode[] => {\n\tconst routes: RouteNode[] = [];\n\n\tfor (const node of tree.byStateId.values()) {\n\t\t// Keep the nodes with a route, which means the nodes with a meta.route field, and skip the synthetic root\n\t\tif (node.routable && node.id !== ROOT_NODE_ID) {\n\t\t\troutes.push(node);\n\t\t}\n\t}\n\n\treturn routes;\n};\n\n/**\n * Tells you if a route path is in the tree\n *\n * The function tests if the path has a state with a `meta.route` field.\n *\n * @param tree - The route tree, from extractMachineRoutes()\n * @param path - The complete route path, for example '/dashboard/settings'\n * @returns true when the tree holds the path. In every other case, false\n */\nexport const routeExists = (tree: RouteTree, path: string): boolean => {\n\treturn tree.byPath.has(path);\n};\n\n/**\n * Returns the routes that a transition from the current state can reach\n *\n * The function uses the successor algorithm of @statelyai/graph. It finds every\n * state of a direct transition edge from the given state, then it keeps the states\n * with a route.\n *\n * The values of the return are the RAW `meta.route` strings of the machine. The\n * function does NOT resolve a relative route, for example `\"detail\"`, to a complete\n * path, and such a value is therefore no key of `tree.byPath`. For a resolved\n * `RouteNode`, use `getNavigableRoutes`: that function resolves each state that the\n * transition reaches through `tree.byStateId`.\n *\n * @param graph - The machine graph, from RouteTree.graph\n * @param stateId - The ID of the current state, for example \"test.home\"\n * @returns The array of the raw route strings that a transition can reach\n *\n * @example\n * ```typescript\n * const tree = extractMachineRoutes(machine);\n * if (tree.graph) {\n * const reachable = getTransitionReachableRoutes(tree.graph, 'auth.loggedIn');\n * // ['/dashboard', '/settings'] — the routes that a transition can reach\n * }\n * ```\n */\nexport const getTransitionReachableRoutes = (\n\tgraph: Graph<MachineNodeData, MachineEdgeData>,\n\tstateId: string,\n): string[] => {\n\treturn getRoutableSuccessors(graph, stateId).map((n) => n.data.route);\n};\n\n/**\n * Tells you if a transition from the current state can reach a route\n *\n * The function uses the path search of @statelyai/graph. It decides if a chain of\n * transition edges is present from the state of the origin to the state of the\n * target.\n *\n * @param graph - The machine graph, from RouteTree.graph\n * @param fromStateId - The ID of the state of the origin\n * @param toStateId - The ID of the state of the target\n * @returns true when a transition path is present. In every other case, false\n *\n * @example\n * ```typescript\n * const tree = extractMachineRoutes(machine);\n * if (tree.graph) {\n * const canReach = isRouteReachable(tree.graph, 'auth.login', 'auth.dashboard');\n * // it is true when a transition path from login to dashboard is present\n * }\n * ```\n */\nexport const isRouteReachable = (\n\tgraph: Graph<MachineNodeData, MachineEdgeData>,\n\tfromStateId: string,\n\ttoStateId: string,\n): boolean => {\n\t// An absent endpoint is a normal result of \"not reachable\".\n\treturn hasNode(graph, fromStateId) && hasNode(graph, toStateId)\n\t\t? hasPath(graph, fromStateId, toStateId)\n\t\t: false;\n};\n\n/**\n * Returns the `{ stateId, path }` entries that a host router needs, so that it can\n * register the routes of a machine under a base path, and remove them again later.\n *\n * This function makes the routes dynamic. `getStateIdByPath` and `getPathByStateId`\n * answer the question \"what is this URL?\" at the moment of a navigation, but a host\n * that declares real route objects — a route tree of TanStack, a `RouteObject[]`, an\n * `addRoute` call of vue-router — needs the LIST in advance, and it needs that list\n * with the prefix of the mount. A registration of these paths, and a removal of them\n * when the machine unloads, keeps the route table of the host in step with the mount.\n *\n * `basePathParams` decides the form of each path, and both forms are useful:\n * - **Given** → a concrete path (`/abc123/play/profile/:userId`), for a route that\n * the host adds at run time, after a loader resolved the mount.\n * - **Absent** → the pattern stays (`/:machineId/play/profile/:userId`), for a static\n * route declaration of the host.\n *\n * The function ALWAYS keeps each `:param` segment that the machine declares itself:\n * those are the params that the route of the host must match.\n *\n * @param tree - The route tree of extractMachineRoutes()\n * @param options - The optional `{ basePath, basePathParams }`, the same option as the bridge takes.\n * Each `stateId` comes from the route tree, so it carries NO `#` prefix. A host that\n * keys its route table on the target of a `play.route` event adds the `#` itself,\n * because the event always carries the prefixed form.\n *\n * @returns One entry for each state with a route, in the order of the route tree.\n * @throws {InvalidBasePathError} For a base path that resolves to one concrete path never.\n * @throws {MissingBasePathParamError} When `basePathParams` is present and it omits a `:param`.\n *\n * @example\n * ```typescript\n * const tree = extractMachineRoutes(machine);\n *\n * // Concrete, for a route that the host adds after a loader resolved the mount\n * getRouteMappings(tree, { basePath: \"/:machineId/play\", basePathParams: { machineId: \"abc123\" } });\n * // [\n * // { stateId: \"app.home\", path: \"/abc123/play\" },\n * // { stateId: \"app.profile\", path: \"/abc123/play/profile/:userId\" },\n * // ]\n *\n * // The pattern, for a static route declaration of the host\n * getRouteMappings(tree, { basePath: \"/:machineId/play\" });\n * // [{ stateId: \"app.home\", path: \"/:machineId/play\" }, ...]\n * ```\n */\nexport const getRouteMappings = (tree: RouteTree, options?: BasePathOptions): RouteMapping[] => {\n\t// With the params, resolve the prefix to a concrete path. Without them, keep the\n\t// pattern, so that a host declares its routes statically and substitutes each param\n\t// itself.\n\tconst basePath =\n\t\toptions?.basePathParams === undefined\n\t\t\t? normalizeBasePath(options?.basePath)\n\t\t\t: resolveBasePath(options.basePath, options.basePathParams).path;\n\n\treturn getRoutableRoutes(tree).map((node) => ({\n\t\tstateId: node.stateId,\n\t\tpath: joinBasePath(basePath, node.fullPath),\n\t}));\n};\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,yBACL,OACA,YAKA,QAAQ,OAAO,OAAO,IACnB,cAAc,OAAO,OAAO,CAAC,CAAC,QAC7B,MAAwC,EAAE,KAAK,UAAU,KAAA,CA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D,QAAQ,OAAO,aAAa,SAAS,IACrC;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,IAAa,oBAAoB,MAAiB,YAA8C;CAI/F,MAAM,WACL,SAAS,mBAAmB,KAAA,IACzB,kBAAkB,SAAS,QAAQ,IACnC,gBAAgB,QAAQ,UAAU,QAAQ,cAAc,CAAC,CAAC;CAE9D,OAAO,kBAAkB,IAAI,CAAC,CAAC,KAAK,UAAU;EAC7C,SAAS,KAAK;EACd,MAAM,aAAa,UAAU,KAAK,QAAQ;CAC3C,EAAE;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-router",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Route maps, the router bridge base and the Routable capability of @xmachines/play. It names no state machine; the machine half is the ./xstate subpath.",
5
5
  "keywords": [
6
6
  "routing",
@@ -53,29 +53,29 @@
53
53
  "test:coverage": "vitest run --coverage"
54
54
  },
55
55
  "dependencies": {
56
- "@xmachines/play-url": "6.0.0"
56
+ "@xmachines/play-url": "7.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@statelyai/graph": "^2.4.0",
59
+ "@statelyai/graph": "^2.5.0",
60
60
  "@testing-library/jest-dom": "^7.0.1",
61
- "@types/node": "^26.6.2",
62
- "@vitest/browser-playwright": "^5.0.1",
63
- "@xmachines/core": "6.0.0",
64
- "@xmachines/play": "6.0.0",
65
- "@xmachines/play-atom": "6.0.0",
66
- "@xmachines/play-view": "6.0.0",
67
- "oxfmt": "^0.70.0",
68
- "oxlint": "^1.85.0",
61
+ "@types/node": "^26.6.4",
62
+ "@vitest/browser-playwright": "^5.0.3",
63
+ "@xmachines/core": "7.0.0",
64
+ "@xmachines/play": "7.0.0",
65
+ "@xmachines/play-atom": "7.0.0",
66
+ "@xmachines/play-view": "7.0.0",
67
+ "oxfmt": "^0.71.0",
68
+ "oxlint": "^1.86.0",
69
69
  "typescript": "^5.9.3 || ^6.0.3",
70
- "vite": "^8.3.0",
71
- "vitest": "^5.0.1",
70
+ "vite": "^8.3.2",
71
+ "vitest": "^5.0.3",
72
72
  "xstate": "^5.33.0"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@statelyai/graph": "^2.4.0",
76
- "@xmachines/core": "6.0.0",
77
- "@xmachines/play": "6.0.0",
78
- "@xmachines/play-atom": "6.0.0",
76
+ "@xmachines/core": "7.0.0",
77
+ "@xmachines/play": "7.0.0",
78
+ "@xmachines/play-atom": "7.0.0",
79
79
  "xstate": "^5.33.0"
80
80
  },
81
81
  "peerDependenciesMeta": {
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,wHAAwH;AACxH,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGzF,sBAAsB;AACtB,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAG9B,mFAAmF;AACnF,gFAAgF;AAChF,sFAAsF;AACtF,mBAAmB;AACnB,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAE7B,kFAAkF;AAClF,uFAAuF;AACvF,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,GAQb,MAAM,qBAAqB,CAAC;AAE7B,qFAAqF;AACrF,sFAAsF;AACtF,gFAAgF;AAChF,OAAO,EACN,iBAAiB,EACjB,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AAyBjC,8DAA8D;AAC9D,OAAO,EAAE,QAAQ,EAAqB,MAAM,qBAAqB,CAAC;AAElE,kFAAkF;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,mFAAmF;AACnF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjE,yFAAyF;AACzF,iFAAiF;AACjF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xstate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EACN,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,4BAA4B,EAC5B,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=machine-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"machine-types.js","sourceRoot":"","sources":["../../src/xstate/machine-types.ts"],"names":[],"mappings":""}