@xmachines/play-xstate 2.0.0-alpha.1 → 2.1.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 (89) hide show
  1. package/README.md +114 -114
  2. package/dist/define-player.d.ts +16 -16
  3. package/dist/define-player.js +16 -16
  4. package/dist/errors.d.ts +84 -101
  5. package/dist/errors.d.ts.map +1 -1
  6. package/dist/errors.js +108 -108
  7. package/dist/errors.js.map +1 -1
  8. package/dist/guards/compose.d.ts +70 -77
  9. package/dist/guards/compose.d.ts.map +1 -1
  10. package/dist/guards/compose.js +90 -113
  11. package/dist/guards/compose.js.map +1 -1
  12. package/dist/guards/helpers.d.ts +22 -18
  13. package/dist/guards/helpers.d.ts.map +1 -1
  14. package/dist/guards/helpers.js +23 -19
  15. package/dist/guards/helpers.js.map +1 -1
  16. package/dist/guards/index.d.ts +10 -3
  17. package/dist/guards/index.d.ts.map +1 -1
  18. package/dist/guards/index.js +10 -3
  19. package/dist/guards/index.js.map +1 -1
  20. package/dist/guards/types.d.ts +9 -9
  21. package/dist/guards/types.d.ts.map +1 -1
  22. package/dist/index.d.ts +8 -8
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +9 -10
  25. package/dist/index.js.map +1 -1
  26. package/dist/player-actor.d.ts +197 -113
  27. package/dist/player-actor.d.ts.map +1 -1
  28. package/dist/player-actor.js +413 -401
  29. package/dist/player-actor.js.map +1 -1
  30. package/dist/routing/build-url.d.ts +19 -21
  31. package/dist/routing/build-url.d.ts.map +1 -1
  32. package/dist/routing/build-url.js +70 -71
  33. package/dist/routing/build-url.js.map +1 -1
  34. package/dist/routing/derive-current-route.d.ts +51 -13
  35. package/dist/routing/derive-current-route.d.ts.map +1 -1
  36. package/dist/routing/derive-current-route.js +69 -60
  37. package/dist/routing/derive-current-route.js.map +1 -1
  38. package/dist/routing/derive-initial-route.d.ts +23 -23
  39. package/dist/routing/derive-initial-route.js +27 -27
  40. package/dist/routing/derive-initial-route.js.map +1 -1
  41. package/dist/routing/derive-route.d.ts +38 -37
  42. package/dist/routing/derive-route.d.ts.map +1 -1
  43. package/dist/routing/derive-route.js +45 -42
  44. package/dist/routing/derive-route.js.map +1 -1
  45. package/dist/routing/format-play-route-transitions.d.ts +34 -71
  46. package/dist/routing/format-play-route-transitions.d.ts.map +1 -1
  47. package/dist/routing/format-play-route-transitions.js +74 -130
  48. package/dist/routing/format-play-route-transitions.js.map +1 -1
  49. package/dist/routing/index.d.ts +4 -8
  50. package/dist/routing/index.d.ts.map +1 -1
  51. package/dist/routing/index.js +4 -6
  52. package/dist/routing/index.js.map +1 -1
  53. package/dist/routing/types.d.ts +12 -11
  54. package/dist/routing/types.d.ts.map +1 -1
  55. package/dist/types.d.ts +97 -20
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/view/derive-current-view.d.ts +51 -0
  58. package/dist/view/derive-current-view.d.ts.map +1 -0
  59. package/dist/view/derive-current-view.js +119 -0
  60. package/dist/view/derive-current-view.js.map +1 -0
  61. package/package.json +22 -21
  62. package/dist/define-player.typecheck.d.ts +0 -2
  63. package/dist/define-player.typecheck.d.ts.map +0 -1
  64. package/dist/define-player.typecheck.js +0 -48
  65. package/dist/define-player.typecheck.js.map +0 -1
  66. package/dist/guards/compose.typecheck.d.ts +0 -2
  67. package/dist/guards/compose.typecheck.d.ts.map +0 -1
  68. package/dist/guards/compose.typecheck.js +0 -22
  69. package/dist/guards/compose.typecheck.js.map +0 -1
  70. package/dist/player-actor.typecheck.d.ts +0 -2
  71. package/dist/player-actor.typecheck.d.ts.map +0 -1
  72. package/dist/player-actor.typecheck.js +0 -30
  73. package/dist/player-actor.typecheck.js.map +0 -1
  74. package/dist/routing/create-routed-machine.d.ts +0 -71
  75. package/dist/routing/create-routed-machine.d.ts.map +0 -1
  76. package/dist/routing/create-routed-machine.js +0 -71
  77. package/dist/routing/create-routed-machine.js.map +0 -1
  78. package/dist/routing/play-route-event.typecheck.d.ts +0 -2
  79. package/dist/routing/play-route-event.typecheck.d.ts.map +0 -1
  80. package/dist/routing/play-route-event.typecheck.js +0 -43
  81. package/dist/routing/play-route-event.typecheck.js.map +0 -1
  82. package/dist/routing/schemas.d.ts +0 -99
  83. package/dist/routing/schemas.d.ts.map +0 -1
  84. package/dist/routing/schemas.js +0 -30
  85. package/dist/routing/schemas.js.map +0 -1
  86. package/dist/schemas.d.ts +0 -28
  87. package/dist/schemas.d.ts.map +0 -1
  88. package/dist/schemas.js +0 -29
  89. package/dist/schemas.js.map +0 -1
@@ -1,8 +1,6 @@
1
1
  import { dequal } from "dequal/lite";
2
2
  /**
3
- * Check if context has a truthy value at path
4
- *
5
- * Per CONTEXT.md: Convenience helper for common guard pattern
3
+ * Tells you if the context holds a value at the path, and that the value is truthy
6
4
  *
7
5
  * @example
8
6
  * ```typescript
@@ -14,15 +12,17 @@ import { dequal } from "dequal/lite";
14
12
  * });
15
13
  * ```
16
14
  *
17
- * @param path - Dot-separated path to context property
18
- * @returns Guard predicate checking if property is truthy
15
+ * @param path - The path to the context property, with a dot between two segments
16
+ * @returns The guard predicate. It tests the property for a truthy value
17
+ * @deprecated This function is part of the guard utilities, and the next major version removes
18
+ * them. Write a plain typed predicate instead.
19
19
  */
20
20
  export const hasContext = (path) => ({ context }) => {
21
21
  const value = getNestedValue(context, path);
22
22
  return value !== undefined && value !== null && value !== "";
23
23
  };
24
24
  /**
25
- * Check if event type matches expected type
25
+ * Tells you if the type of the event is the expected type
26
26
  *
27
27
  * @example
28
28
  * ```typescript
@@ -37,33 +37,37 @@ export const hasContext = (path) => ({ context }) => {
37
37
  * });
38
38
  * ```
39
39
  *
40
- * @param eventType - Expected event type
41
- * @returns Guard predicate checking event type
40
+ * @param eventType - The expected event type
41
+ * @returns The guard predicate. It tests the event type
42
+ * @deprecated This function is part of the guard utilities, and the next major version removes
43
+ * them. Write a plain typed predicate instead.
42
44
  */
43
45
  export const eventMatches = (eventType) => ({ event }) => {
44
46
  return event.type === eventType;
45
47
  };
46
48
  /**
47
- * Check if a context field matches an expected value.
49
+ * Tells you if a context field holds the expected value.
48
50
  *
49
- * - Accepts an explicit dot-separated field path (e.g. `"user.role"`)
50
- * - Uses strict equality for primitives, deep structural equality for objects
51
- * - Object comparison is key-order-insensitive: `{a:1,b:2}` equals `{b:2,a:1}`
52
- * - Supports Date, RegExp, class instances, nested objects and arrays via `dequal/lite`
53
- * - Does NOT use substring matching — `"a"` will not match `"active"`
51
+ * - The function accepts an explicit field path, with a dot between two segments, for example `"user.role"`
52
+ * - It compares a primitive with a strict equality, and an object with a deep structural equality
53
+ * - The order of the keys has no effect on the comparison of an object: `{a:1,b:2}` equals `{b:2,a:1}`
54
+ * - It supports a Date, a RegExp, an instance of a class, a nested object, and an array, through `dequal/lite`
55
+ * - It does NOT match a substring: `"a"` does not match `"active"`
54
56
  *
55
- * For XState state-node matching, use the built-in `in:` guard syntax instead.
57
+ * For a match of an XState state node, use the built-in `in:` guard syntax instead.
56
58
  *
57
- * @param fieldPath - Dot-separated path to context property (e.g., "status", "user.role")
58
- * @param expectedValue - Value to compare against (string, object, Date, etc.)
59
- * @returns Guard predicate checking if context field matches
59
+ * @param fieldPath - The path to the context property, with a dot between two segments, for example "status" or "user.role"
60
+ * @param expectedValue - The value for the comparison: a string, an object, a Date, and so on
61
+ * @returns The guard predicate. It tests the context field for the value
62
+ * @deprecated This function is part of the guard utilities, and the next major version removes
63
+ * them. Write a plain typed predicate instead.
60
64
  */
61
65
  export const contextFieldMatches = (fieldPath, expectedValue) => ({ context }) => {
62
66
  const actual = getNestedValue(context, fieldPath);
63
67
  return dequal(actual, expectedValue);
64
68
  };
65
69
  /**
66
- * Get nested value from object using dot-separated path
70
+ * Returns a nested value of an object, from a path with a dot between two segments
67
71
  *
68
72
  * @internal
69
73
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/guards/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIr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AK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxE,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,KAAK,GAAI,KAAiC,CAAC,GAAG,CAAC,CAAC,CAAC,mDAAmD;IACrG,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC"}
@@ -1,8 +1,15 @@
1
1
  /**
2
- * Guard composition and helper utilities for XState machines
2
+ * The guard composition utilities and the guard helpers of an XState machine
3
3
  *
4
- * Provides array-means-AND composition and convenience helpers
5
- * for common guard patterns in Play Architecture.
4
+ * The package gives you a composition where an array means AND. It also gives you
5
+ * the helpers of the common guard patterns of the Play Architecture.
6
+ *
7
+ * @deprecated These guard helpers wrap the `and`, `or`, and `not` combinators of
8
+ * XState, but they do not compose with a guard slot that `setup()` types. The
9
+ * example of the package itself needs a cast for them. Use the combinators of XState
10
+ * directly. The next major version removes this module. Each exported symbol carries
11
+ * its own deprecation tag, because a consumer imports it through the root of the
12
+ * package, and not through this barrel.
6
13
  *
7
14
  * @packageDocumentation
8
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC7E,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC7E,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
@@ -1,8 +1,15 @@
1
1
  /**
2
- * Guard composition and helper utilities for XState machines
2
+ * The guard composition utilities and the guard helpers of an XState machine
3
3
  *
4
- * Provides array-means-AND composition and convenience helpers
5
- * for common guard patterns in Play Architecture.
4
+ * The package gives you a composition where an array means AND. It also gives you
5
+ * the helpers of the common guard patterns of the Play Architecture.
6
+ *
7
+ * @deprecated These guard helpers wrap the `and`, `or`, and `not` combinators of
8
+ * XState, but they do not compose with a guard slot that `setup()` types. The
9
+ * example of the package itself needs a cast for them. Use the combinators of XState
10
+ * directly. The next major version removes this module. Each exported symbol carries
11
+ * its own deprecation tag, because a consumer imports it through the root of the
12
+ * package, and not through this barrel.
6
13
  *
7
14
  * @packageDocumentation
8
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,22 +1,22 @@
1
1
  import type { PlayEvent } from "@xmachines/play";
2
2
  /**
3
- * Standard XState guard function signature
3
+ * The standard signature of an XState guard function. A guard receives `{ context, event }`.
4
4
  *
5
- * Per CONTEXT.md: Guards receive { context, event } per XState standard
6
- *
7
- * @param args - Guard arguments with context and event
8
- * @param args.context - Current machine context
9
- * @param args.event - Event that triggered the guard evaluation
10
- * @returns boolean indicating if guard passes
5
+ * @param args - The arguments of the guard: the context and the event
6
+ * @param args.context - The current machine context
7
+ * @param args.event - The event that started the evaluation of the guard
8
+ * @returns The boolean value. It tells you if the guard passes
9
+ * @deprecated The next major version removes the guard utilities.
11
10
  */
12
11
  export type Guard<TContext = Record<string, unknown>, TEvent = PlayEvent> = (args: {
13
12
  context: TContext;
14
13
  event: TEvent;
15
14
  }) => boolean;
16
15
  /**
17
- * Array of guard predicates or guard names
16
+ * The array of the guard predicates, or of the guard names. An array means AND:
17
+ * every guard must pass.
18
18
  *
19
- * Per CONTEXT.md: Array means AND - all guards must pass
19
+ * @deprecated The next major version removes the guard utilities.
20
20
  */
21
21
  export type GuardArray<TContext = Record<string, unknown>, TEvent = PlayEvent> = Array<Guard<TContext, TEvent> | string>;
22
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,IAAI,CAAC,IAAI,EAAE;IAClF,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACd,KAAK,OAAO,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,IAAI,KAAK,CACrF,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,CAChC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,IAAI,CAAC,IAAI,EAAE;IAClF,OAAO,EAAE,QAAQ,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACd,KAAK,OAAO,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,IAAI,KAAK,CACrF,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,CAChC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
- * @xmachines/play-xstate - XState v6 adapter for Play Architecture
2
+ * @xmachines/play-xstate - the XState v5 adapter of the Play Architecture
3
3
  *
4
- * Provides definePlayer() API for binding XState state machines to the
5
- * actor base with signal lifecycle and DevTools integration.
4
+ * This package gives you the definePlayer() API. That function binds an XState state
5
+ * machine to the actor base, with the signal lifecycle and the DevTools
6
+ * integration.
6
7
  *
7
- * Per the Play RFC, this package implements the Logic Layer adapter that
8
- * transforms declarative machine definitions into live actors with signal-driven
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 a signal-driven
9
10
  * reactivity.
10
11
  *
11
12
  * @packageDocumentation
@@ -15,7 +16,6 @@ export { PlayerActor } from "./player-actor.js";
15
16
  export type { PlayerConfig, PlayerOptions, PlayerFactory, PlayerFactoryResumeOptions, } from "./types.js";
16
17
  export { composeGuards, composeGuardsOr, negateGuard, hasContext, eventMatches, contextFieldMatches, } from "./guards/index.js";
17
18
  export type { Guard, GuardArray, ComposedGuard } from "./guards/index.js";
18
- export { deriveRoute, isAbsoluteRoute, buildRouteUrl, formatPlayRouteTransitions, createRoutedMachine, playMetaSchema, playRouteEventSchema, } from "./routing/index.js";
19
- export { emptyEventSchema } from "./schemas.js";
20
- export type { PlayRoutePayload, SetupLike, WithOptional, RouteMachineConfig, RouteStateNode, RouteContext, RouteObject, RouteMetadata, } from "./routing/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
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACN,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACb,MAAM,oBAAoB,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;AAChD,YAAY,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,0BAA0B,GAC1B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACN,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,GACb,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,21 +1,20 @@
1
1
  /**
2
- * @xmachines/play-xstate - XState v6 adapter for Play Architecture
2
+ * @xmachines/play-xstate - the XState v5 adapter of the Play Architecture
3
3
  *
4
- * Provides definePlayer() API for binding XState state machines to the
5
- * actor base with signal lifecycle and DevTools integration.
4
+ * This package gives you the definePlayer() API. That function binds an XState state
5
+ * machine to the actor base, with the signal lifecycle and the DevTools
6
+ * integration.
6
7
  *
7
- * Per the Play RFC, this package implements the Logic Layer adapter that
8
- * transforms declarative machine definitions into live actors with signal-driven
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 a signal-driven
9
10
  * reactivity.
10
11
  *
11
12
  * @packageDocumentation
12
13
  */
13
14
  export { definePlayer } from "./define-player.js";
14
15
  export { PlayerActor } from "./player-actor.js";
15
- // Guard utilities
16
+ // The guard utilities
16
17
  export { composeGuards, composeGuardsOr, negateGuard, hasContext, eventMatches, contextFieldMatches, } from "./guards/index.js";
17
- // Routing utilities
18
- export { deriveRoute, isAbsoluteRoute, buildRouteUrl, formatPlayRouteTransitions, createRoutedMachine, playMetaSchema, playRouteEventSchema, } from "./routing/index.js";
19
- // XState v6 schema constants (not routing-specific)
20
- export { emptyEventSchema } from "./schemas.js";
18
+ // The routing utilities
19
+ export { deriveRoute, isAbsoluteRoute, buildRouteUrl, formatPlayRouteTransitions, } from "./routing/index.js";
21
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,kBAAkB;AAClB,OAAO,EACN,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,oBAAoB;AACpB,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,oDAAoD;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,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;AAQhD,sBAAsB;AACtB,OAAO,EACN,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,wBAAwB;AACxB,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}