@xmachines/docs 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 (388) hide show
  1. package/README.md +16 -17
  2. package/api/@xmachines/play/README.md +58 -66
  3. package/api/@xmachines/play/classes/NonNullableError.md +14 -14
  4. package/api/@xmachines/play/classes/PlayError.md +32 -34
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +28 -27
  7. package/api/@xmachines/play-actor/README.md +114 -50
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +45 -30
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +27 -0
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +21 -0
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +43 -0
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +28 -0
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +42 -0
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +29 -0
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +25 -27
  18. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
  19. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
  20. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -15
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +11 -0
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +6 -6
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +50 -0
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +15 -0
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +15 -0
  27. package/api/@xmachines/play-dom/README.md +123 -86
  28. package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
  29. package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
  30. package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
  31. package/api/@xmachines/play-dom/functions/createValidationRegistry.md +22 -0
  32. package/api/@xmachines/play-dom/functions/defineRegistry.md +5 -5
  33. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +9 -8
  34. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +16 -16
  35. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +2 -0
  36. package/api/@xmachines/play-dom/interfaces/FieldValidationState.md +16 -0
  37. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  38. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +17 -17
  39. package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +2 -0
  40. package/api/@xmachines/play-dom/interfaces/ValidationRegistry.md +21 -0
  41. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +10 -0
  42. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  43. package/api/@xmachines/play-dom/variables/schema.md +35 -45
  44. package/api/@xmachines/play-dom-router/README.md +68 -51
  45. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  46. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  47. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  48. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  49. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  50. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  51. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +21 -20
  52. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  53. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +41 -35
  54. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  55. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  56. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  57. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  59. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  60. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  61. package/api/@xmachines/play-react/README.md +65 -55
  62. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  63. package/api/@xmachines/play-react/functions/defineRegistry.md +5 -5
  64. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  65. package/api/@xmachines/play-react/functions/useFieldValidation.md +31 -0
  66. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  67. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  68. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  69. package/api/@xmachines/play-react/interfaces/ComponentContext.md +9 -8
  70. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  71. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
  72. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  73. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  74. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  75. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  76. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  77. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  78. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  79. package/api/@xmachines/play-react-router/README.md +38 -31
  80. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  81. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  82. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  83. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  84. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  85. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  86. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +41 -35
  87. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  88. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  89. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  90. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  91. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  92. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  93. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  94. package/api/@xmachines/play-router/README.md +99 -95
  95. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  96. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  97. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  98. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  99. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  100. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  101. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  102. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  103. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  104. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  105. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  106. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  107. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  108. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  109. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  110. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  111. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  112. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  113. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  114. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  115. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  116. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
  117. package/api/@xmachines/play-router/interfaces/LocationLike.md +11 -11
  118. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -9
  119. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  120. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  121. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +41 -35
  122. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  123. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  124. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  125. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  126. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  127. package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
  128. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  129. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  130. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  131. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  132. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  133. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  134. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  135. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  136. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  137. package/api/@xmachines/play-signals/README.md +38 -36
  138. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  139. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  140. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  141. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  142. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  143. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  144. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  145. package/api/@xmachines/play-solid/README.md +46 -42
  146. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  147. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  148. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  149. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  150. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  151. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  152. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  153. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  154. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  155. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  156. package/api/@xmachines/play-solid-router/README.md +39 -34
  157. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  158. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  159. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  160. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  161. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +45 -30
  162. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  163. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +41 -35
  164. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  165. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  166. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  167. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  168. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  169. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  170. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  171. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  172. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  173. package/api/@xmachines/play-svelte/README.md +60 -33
  174. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  175. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  176. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  177. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  178. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  179. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  180. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  181. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  182. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  183. package/api/@xmachines/play-svelte-spa-router/README.md +43 -52
  184. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  186. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  189. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +41 -35
  190. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  191. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  192. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  193. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  194. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-sveltekit-router/README.md +43 -39
  196. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  198. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  199. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  201. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +11 -11
  202. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +41 -35
  203. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  204. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  205. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  206. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  207. package/api/@xmachines/play-tanstack-react-router/README.md +67 -49
  208. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  209. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  210. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  211. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  212. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  213. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  214. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  215. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +41 -35
  216. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  217. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  218. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  219. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  220. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  221. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  222. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  223. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  224. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  225. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  226. package/api/@xmachines/play-tanstack-router/README.md +38 -16
  227. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  228. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  229. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  230. package/api/@xmachines/play-tanstack-solid-router/README.md +76 -50
  231. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  232. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  233. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  235. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  236. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +41 -35
  237. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  238. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  239. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  240. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  241. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  242. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  243. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  244. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  245. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  246. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  247. package/api/@xmachines/play-vue/README.md +39 -39
  248. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  249. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  250. package/api/@xmachines/play-vue/functions/useFieldValidation.md +31 -0
  251. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  252. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  253. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  254. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  255. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  256. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  257. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  258. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  259. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +4 -4
  260. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  261. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  262. package/api/@xmachines/play-vue-router/README.md +66 -57
  263. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  264. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  265. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  266. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  267. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +41 -35
  268. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  269. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  270. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  271. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  272. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  273. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  274. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  275. package/api/@xmachines/play-xstate/README.md +129 -138
  276. package/api/@xmachines/play-xstate/classes/PlayerActor.md +148 -114
  277. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -23
  278. package/api/@xmachines/play-xstate/functions/composeGuards.md +34 -33
  279. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +27 -22
  280. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +19 -14
  281. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  282. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  283. package/api/@xmachines/play-xstate/functions/eventMatches.md +12 -7
  284. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +17 -48
  285. package/api/@xmachines/play-xstate/functions/hasContext.md +12 -9
  286. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  287. package/api/@xmachines/play-xstate/functions/negateGuard.md +26 -20
  288. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  289. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  290. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -11
  291. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  292. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +4 -4
  293. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +9 -25
  294. package/api/@xmachines/play-xstate/type-aliases/Guard.md +13 -11
  295. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +8 -5
  296. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +11 -15
  297. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -19
  298. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  299. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -26
  300. package/api/@xmachines/shared/README.md +12 -14
  301. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  302. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  303. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +12 -7
  304. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  305. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +9 -4
  306. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  307. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  308. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +6 -6
  309. package/contributing/architecture.md +27 -28
  310. package/contributing/configuration.md +10 -10
  311. package/contributing/deployment.md +51 -30
  312. package/contributing/development.md +90 -21
  313. package/contributing/testing.md +36 -14
  314. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
  315. package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
  316. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
  317. package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
  318. package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
  319. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
  320. package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
  321. package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
  322. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
  323. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
  324. package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
  325. package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
  326. package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
  327. package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
  328. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
  329. package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
  330. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
  331. package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
  332. package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
  333. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
  334. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
  335. package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
  336. package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
  337. package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
  338. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
  339. package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
  340. package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
  341. package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
  342. package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
  343. package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
  344. package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
  345. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
  346. package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
  347. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
  348. package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
  349. package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
  350. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
  351. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
  352. package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
  353. package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
  354. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
  355. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
  356. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
  357. package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
  358. package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
  359. package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
  360. package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
  361. package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
  362. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
  363. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
  364. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
  365. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
  366. package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
  367. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
  368. package/examples/README.md +4 -1
  369. package/examples/basic-state-machine.md +24 -24
  370. package/examples/form-validation.md +110 -121
  371. package/examples/multi-router-integration.md +0 -2
  372. package/examples/routing-patterns.md +60 -94
  373. package/examples/traffic-light.md +57 -48
  374. package/guides/README.md +6 -2
  375. package/guides/actor-model.md +1 -1
  376. package/guides/getting-started.md +89 -90
  377. package/guides/inspector.md +197 -0
  378. package/guides/state-machines.md +55 -69
  379. package/package.json +10 -7
  380. package/rfc/play.md +15 -6
  381. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
  382. package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +0 -87
  383. package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +0 -30
  384. package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +0 -33
  385. package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +0 -31
  386. package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +0 -37
  387. package/api/@xmachines/play-xstate/variables/playMetaSchema.md +0 -40
  388. package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +0 -9
@@ -6,42 +6,38 @@
6
6
  function buildRouteUrl(routeTemplate, context?): string;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/routing/build-url.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/routing/build-url.ts#L40)
9
+ Defined in: [packages/play-xstate/src/routing/build-url.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/routing/build-url.ts#L38)
10
10
 
11
- Build a full URL from a route template and the actor's context.
11
+ Builds a complete URL from a route template and the context of the actor.
12
12
 
13
- Substitutes `:param` and `:param?` placeholders from `context.params`,
14
- then appends query params and hash fragments.
13
+ The function replaces each `:param` placeholder and each `:param?` placeholder
14
+ with a value of `context.params`. It then appends the query params and the hash
15
+ fragment.
15
16
 
16
- All parameter values must be in `context.params`. Flat context fields are not
17
- inspected this is intentional so misspelled placeholders produce a compile-time
18
- error rather than silently resolving to `undefined`.
17
+ Every parameter value must be in `context.params`. The function reads no flat
18
+ context field, and this is deliberate: a placeholder with a spelling error
19
+ therefore gives a compile-time error, and it does not resolve to `undefined` in
20
+ silence.
19
21
 
20
22
  ## Parameters
21
23
 
22
- | Parameter | Type | Description |
23
- | --------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
- | `routeTemplate` | `string` | Route path template, e.g. `"/profile/:userId"` or `"/settings/:section?"`. |
25
- | `context` | [`RouteContext`](../interfaces/RouteContext.md) | Actor context object. Route parameters must be in `context.params`; flat context fields are not inspected. **Must include a `query` field** (use `query: {}` when no query parameters are needed). Omitting `query` when `params` is present throws `MissingQueryContextError` to prevent silent query-string loss. |
24
+ | Parameter | Type | Description |
25
+ | --------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | `routeTemplate` | `string` | The template of the route path, for example `"/profile/:userId"` or `"/settings/:section?"`. |
27
+ | `context` | [`RouteContext`](../interfaces/RouteContext.md) | The context object of the actor. Each route parameter must be in `context.params`, because the function reads no flat context field. An absent `query` field builds a URL without a query, exactly like `query: {}`. |
26
28
 
27
29
  ## Returns
28
30
 
29
31
  `string`
30
32
 
31
- The fully resolved URL string.
33
+ The complete URL string.
32
34
 
33
35
  ## Throws
34
36
 
35
- When a **required** `:param` placeholder has no
36
- matching value in context. Optional parameters (`:param?`) are silently omitted
37
- when missing. Import the class from `@xmachines/play-xstate/errors`.
38
-
39
- ## Throws
40
-
41
- When the context has a `params` field but no
42
- `query` field. This indicates a routing-aware machine context that was not set up
43
- to receive query parameters, which would silently drop query params from
44
- `play.route` events. Import the class from `@xmachines/play-xstate/errors`.
37
+ When a **necessary** `:param` placeholder has no
38
+ value in the context. The function omits an optional parameter (`:param?`) in
39
+ silence when its value is absent. Import the class from
40
+ `@xmachines/play-xstate/errors`.
45
41
 
46
42
  ## Example
47
43
 
@@ -50,5 +46,5 @@ buildRouteUrl("/user/:id", { params: { id: "123" }, query: { tab: "profile" }, h
50
46
  // → "/user/123?tab=profile#top"
51
47
 
52
48
  buildRouteUrl("/settings/:section?", { params: {}, query: {} });
53
- // → "/settings" (optional param omitted, no query string)
49
+ // → "/settings" (the optional param is absent, and there is no query string)
54
50
  ```
@@ -1,58 +1,56 @@
1
1
  [API](../../../README.md) / [@xmachines/play-xstate](../README.md) / composeGuards
2
2
 
3
- # Function: composeGuards()
3
+ # ~~Function: composeGuards()~~
4
4
 
5
5
  ```ts
6
6
  function composeGuards<TContext, TEvent>(guards): ComposedGuard;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/compose.ts:130](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/guards/compose.ts#L130)
9
+ Defined in: [packages/play-xstate/src/guards/compose.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/compose.ts#L100)
10
10
 
11
- Compose guards with AND logic.
11
+ Composes the guards with the AND logic, through the and() helper of XState
12
12
 
13
- Combines multiple guard predicates using AND semantics—all guards must pass for
14
- the composition to succeed. Evaluation is short-circuiting, left to right.
13
+ The function joins more than one guard predicate with the AND semantics: every
14
+ guard must pass, and the composition then succeeds. It uses the built-in `and()`
15
+ helper of XState. The type inference and the serialization of the machine are
16
+ therefore correct.
15
17
 
16
- **Architectural Context:** Supports **Actor Authority (INV-01)** by enabling
17
- declarative guard composition in state machine transitions. Guards enforce business
18
- logic rules that determine whether navigation or actions are valid.
19
-
20
- **XState v6:** the composed value is a plain predicate. Call it inside a
21
- transition function and return early to block the transition:
18
+ **Architectural context:** the function supports **Actor Authority (INV-01)**,
19
+ because it composes the guards of a state machine transition declaratively. A
20
+ guard enforces a rule of the business logic, and that rule decides if a
21
+ navigation or an action is valid.
22
22
 
23
23
  ## Type Parameters
24
24
 
25
- | Type Parameter | Default type | Description |
26
- | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------- |
27
- | `TContext` | `any` | State machine context type (defaults to `any` so the documented inline-predicate examples compile without annotations) |
28
- | `TEvent` | `any` | Event type |
25
+ | Type Parameter | Default type | Description |
26
+ | -------------- | ------------ | ------------------------------------- |
27
+ | `TContext` | `any` | The context type of the state machine |
28
+ | `TEvent` | `any` | The event type |
29
29
 
30
30
  ## Parameters
31
31
 
32
- | Parameter | Type | Description |
33
- | --------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
34
- | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | Array of guard predicates or guard names (string references resolved against `args.guards` from `setup({ guards })`) |
32
+ | Parameter | Type | Description |
33
+ | --------- | --------------------------------------------------------------------- | ------------------------------------------------------------------- |
34
+ | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | The array of the guard predicates, or of the guard names as strings |
35
35
 
36
36
  ## Returns
37
37
 
38
38
  [`ComposedGuard`](../type-aliases/ComposedGuard.md)
39
39
 
40
- Predicate returning `true` only when every guard passes
40
+ The and() guard composition of XState
41
41
 
42
42
  ## Throws
43
43
 
44
- If guards array is empty
44
+ When the array of the guards is empty
45
45
 
46
46
  ## Examples
47
47
 
48
- AND composition with named guards
48
+ An AND composition with named guards
49
49
 
50
50
  ```typescript
51
51
  import { setup } from "xstate";
52
52
  import { composeGuards } from "@xmachines/play-xstate";
53
53
 
54
- const canAccessAdmin = composeGuards(["isLoggedIn", "hasPermission"]);
55
-
56
54
  const machine = setup({
57
55
  guards: {
58
56
  isLoggedIn: ({ context }) => !!context.userId,
@@ -60,26 +58,29 @@ const machine = setup({
60
58
  },
61
59
  }).createMachine({
62
60
  on: {
63
- accessAdmin: (args) => {
64
- if (!canAccessAdmin(args)) return;
65
- return { target: "adminPanel" };
61
+ accessAdmin: {
62
+ // Both guards must pass
63
+ guard: composeGuards(["isLoggedIn", "hasPermission"]),
64
+ target: "adminPanel",
66
65
  },
67
66
  },
68
67
  });
69
68
  ```
70
69
 
71
- AND composition with inline predicates
70
+ An AND composition with inline predicates
72
71
 
73
72
  ```typescript
74
73
  import { composeGuards } from "@xmachines/play-xstate";
75
74
 
76
- const isEligible = composeGuards([
77
- ({ context }) => context.age >= 18,
78
- ({ context }) => context.verified,
79
- ]);
75
+ guard: composeGuards([({ context }) => context.age >= 18, ({ context }) => context.verified]);
80
76
  ```
81
77
 
82
78
  ## See
83
79
 
84
- - [composeGuardsOr](composeGuardsOr.md) for OR composition
85
- - [negateGuard](negateGuard.md) for NOT logic
80
+ - [composeGuardsOr](composeGuardsOr.md) for the OR composition
81
+ - [negateGuard](negateGuard.md) for the NOT logic
82
+
83
+ ## Deprecated
84
+
85
+ Use the `and()`, `or()`, and `not()` combinators of XState directly. This helper
86
+ does not compose with a guard slot that `setup()` types, and the next major version removes it.
@@ -1,51 +1,50 @@
1
1
  [API](../../../README.md) / [@xmachines/play-xstate](../README.md) / composeGuardsOr
2
2
 
3
- # Function: composeGuardsOr()
3
+ # ~~Function: composeGuardsOr()~~
4
4
 
5
5
  ```ts
6
6
  function composeGuardsOr<TContext, TEvent>(guards): ComposedGuard;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/compose.ts:189](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/guards/compose.ts#L189)
9
+ Defined in: [packages/play-xstate/src/guards/compose.ts:159](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/compose.ts#L159)
10
10
 
11
- Compose guards with OR logic.
11
+ Composes the guards with the OR logic, through the or() helper of XState
12
12
 
13
- Combines multiple guard predicates using OR semantics—at least one guard must pass
14
- for the composition to succeed. Evaluation is short-circuiting, left to right.
13
+ The function joins more than one guard predicate with the OR semantics: one guard
14
+ must pass at least, and the composition then succeeds. It uses the built-in `or()`
15
+ helper of XState, and the type inference is therefore correct.
15
16
 
16
17
  ## Type Parameters
17
18
 
18
- | Type Parameter | Default type |
19
- | -------------- | ------------ |
20
- | `TContext` | `any` |
21
- | `TEvent` | `any` |
19
+ | Type Parameter | Default type | Description |
20
+ | -------------- | ------------ | ------------------------------------- |
21
+ | `TContext` | `any` | The context type of the state machine |
22
+ | `TEvent` | `any` | The event type |
22
23
 
23
24
  ## Parameters
24
25
 
25
- | Parameter | Type | Description |
26
- | --------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
27
- | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | Array of guard predicates or guard names (string references resolved against `args.guards` from `setup({ guards })`) |
26
+ | Parameter | Type | Description |
27
+ | --------- | --------------------------------------------------------------------- | -------------------------------------------------------- |
28
+ | `guards` | [`GuardArray`](../type-aliases/GuardArray.md)\<`TContext`, `TEvent`\> | The array of the guard predicates, or of the guard names |
28
29
 
29
30
  ## Returns
30
31
 
31
32
  [`ComposedGuard`](../type-aliases/ComposedGuard.md)
32
33
 
33
- Predicate returning `true` when any guard passes
34
+ The or() guard composition of XState
34
35
 
35
36
  ## Throws
36
37
 
37
- If guards array is empty
38
+ When the array of the guards is empty
38
39
 
39
40
  ## Example
40
41
 
41
- OR composition with named guards
42
+ An OR composition with named guards
42
43
 
43
44
  ```typescript
44
45
  import { setup } from "xstate";
45
46
  import { composeGuardsOr } from "@xmachines/play-xstate";
46
47
 
47
- const canDelete = composeGuardsOr(["isOwner", "isAdmin"]);
48
-
49
48
  const machine = setup({
50
49
  guards: {
51
50
  isOwner: ({ context }) => context.role === "owner",
@@ -53,9 +52,10 @@ const machine = setup({
53
52
  },
54
53
  }).createMachine({
55
54
  on: {
56
- deleteResource: (args, enq) => {
57
- if (!canDelete(args)) return;
58
- enq(() => deleteIt());
55
+ deleteResource: {
56
+ // One guard is sufficient
57
+ guard: composeGuardsOr(["isOwner", "isAdmin"]),
58
+ actions: "delete",
59
59
  },
60
60
  },
61
61
  });
@@ -63,5 +63,10 @@ const machine = setup({
63
63
 
64
64
  ## See
65
65
 
66
- - [composeGuards](composeGuards.md) for AND composition
67
- - [negateGuard](negateGuard.md) for NOT logic
66
+ - [composeGuards](composeGuards.md) for the AND composition
67
+ - [negateGuard](negateGuard.md) for the NOT logic
68
+
69
+ ## Deprecated
70
+
71
+ Use the `and()`, `or()`, and `not()` combinators of XState directly. This helper
72
+ does not compose with a guard slot that `setup()` types, and the next major version removes it.
@@ -1,22 +1,22 @@
1
1
  [API](../../../README.md) / [@xmachines/play-xstate](../README.md) / contextFieldMatches
2
2
 
3
- # Function: contextFieldMatches()
3
+ # ~~Function: contextFieldMatches()~~
4
4
 
5
5
  ```ts
6
6
  function contextFieldMatches<TContext>(fieldPath, expectedValue): Guard<TContext, PlayEvent>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/helpers.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/guards/helpers.ts#L71)
9
+ Defined in: [packages/play-xstate/src/guards/helpers.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/helpers.ts#L75)
10
10
 
11
- Check if a context field matches an expected value.
11
+ Tells you if a context field holds the expected value.
12
12
 
13
- - Accepts an explicit dot-separated field path (e.g. `"user.role"`)
14
- - Uses strict equality for primitives, deep structural equality for objects
15
- - Object comparison is key-order-insensitive: `{a:1,b:2}` equals `{b:2,a:1}`
16
- - Supports Date, RegExp, class instances, nested objects and arrays via `dequal/lite`
17
- - Does NOT use substring matching — `"a"` will not match `"active"`
13
+ - The function accepts an explicit field path, with a dot between two segments, for example `"user.role"`
14
+ - It compares a primitive with a strict equality, and an object with a deep structural equality
15
+ - The order of the keys has no effect on the comparison of an object: `{a:1,b:2}` equals `{b:2,a:1}`
16
+ - It supports a Date, a RegExp, an instance of a class, a nested object, and an array, through `dequal/lite`
17
+ - It does NOT match a substring: `"a"` does not match `"active"`
18
18
 
19
- For XState state-node matching, use the built-in `in:` guard syntax instead.
19
+ For a match of an XState state node, use the built-in `in:` guard syntax instead.
20
20
 
21
21
  ## Type Parameters
22
22
 
@@ -26,13 +26,18 @@ For XState state-node matching, use the built-in `in:` guard syntax instead.
26
26
 
27
27
  ## Parameters
28
28
 
29
- | Parameter | Type | Description |
30
- | --------------- | --------- | -------------------------------------------------------------------- |
31
- | `fieldPath` | `string` | Dot-separated path to context property (e.g., "status", "user.role") |
32
- | `expectedValue` | `unknown` | Value to compare against (string, object, Date, etc.) |
29
+ | Parameter | Type | Description |
30
+ | --------------- | --------- | ------------------------------------------------------------------------------------------------------ |
31
+ | `fieldPath` | `string` | The path to the context property, with a dot between two segments, for example "status" or "user.role" |
32
+ | `expectedValue` | `unknown` | The value for the comparison: a string, an object, a Date, and so on |
33
33
 
34
34
  ## Returns
35
35
 
36
36
  [`Guard`](../type-aliases/Guard.md)\<`TContext`, [`PlayEvent`](../../play/type-aliases/PlayEvent.md)\>
37
37
 
38
- Guard predicate checking if context field matches
38
+ The guard predicate. It tests the context field for the value
39
+
40
+ ## Deprecated
41
+
42
+ This function is part of the guard utilities, and the next major version removes
43
+ them. Write a plain typed predicate instead.
@@ -6,36 +6,36 @@
6
6
  function definePlayer<TMachine>(config): PlayerFactory<TMachine>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/define-player.ts#L61)
9
+ Defined in: [packages/play-xstate/src/define-player.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/define-player.ts#L61)
10
10
 
11
- Create a player factory from an XState machine
11
+ Creates a player factory from an XState machine
12
12
 
13
- Factory pattern that accepts an XState v6 machine,
14
- returning a function that creates [PlayerActor](../classes/PlayerActor.md) instances. This enables
15
- creating multiple actor instances from a single configuration, useful for
16
- testing, multi-instance scenarios, or server-side rendering.
13
+ This factory function accepts an XState v5 machine. It returns a function that
14
+ makes [PlayerActor](../classes/PlayerActor.md) instances. One configuration can therefore make more
15
+ than one actor instance, and this helps with a test, with an application of
16
+ several instances, and with a render on the server.
17
17
 
18
18
  ## Type Parameters
19
19
 
20
- | Type Parameter | Description |
21
- | ---------------------------------------------------------------------------------------------- | ---------------------------- |
22
- | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v6 state machine type |
20
+ | Type Parameter | Description |
21
+ | ---------------------------------------------------------------------------------------------- | --------------------------------------- |
22
+ | `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | The type of the XState v5 state machine |
23
23
 
24
24
  ## Parameters
25
25
 
26
- | Parameter | Type | Description |
27
- | --------- | ------------------------------------------------------------- | --------------------------- |
28
- | `config` | [`PlayerConfig`](../interfaces/PlayerConfig.md)\<`TMachine`\> | Player configuration object |
26
+ | Parameter | Type | Description |
27
+ | --------- | ------------------------------------------------------------- | -------------------------------------- |
28
+ | `config` | [`PlayerConfig`](../interfaces/PlayerConfig.md)\<`TMachine`\> | The configuration object of the player |
29
29
 
30
30
  ## Returns
31
31
 
32
32
  [`PlayerFactory`](../type-aliases/PlayerFactory.md)\<`TMachine`\>
33
33
 
34
- Factory function that creates actor instances with optional input context
34
+ The factory function. It makes an actor instance, with an optional input context
35
35
 
36
36
  ## Examples
37
37
 
38
- Basic player factory
38
+ A basic player factory
39
39
 
40
40
  ```typescript
41
41
  import { setup } from "xstate";
@@ -54,19 +54,19 @@ const actor = createPlayer();
54
54
  actor.start();
55
55
  ```
56
56
 
57
- Multiple actor instances from single factory
57
+ More than one actor instance from one factory
58
58
 
59
59
  ```typescript
60
60
  const createPlayer = definePlayer({ machine });
61
61
 
62
- // Create actors for different users
62
+ // Create an actor for each user
63
63
  const alice = createPlayer({ userId: "alice" });
64
64
  const bob = createPlayer({ userId: "bob" });
65
65
 
66
66
  alice.start();
67
67
  bob.start();
68
68
 
69
- // Independent state machines
69
+ // The two state machines are independent
70
70
  console.log(alice.state.get() !== bob.state.get());
71
71
  ```
72
72
 
@@ -74,5 +74,5 @@ console.log(alice.state.get() !== bob.state.get());
74
74
 
75
75
  - [Play RFC](../../../../rfc/play.md)
76
76
  - [PlayerActor](../classes/PlayerActor.md) for the concrete actor implementation
77
- - [PlayerConfig](../interfaces/PlayerConfig.md) for configuration options
78
- - [PlayerFactory](../type-aliases/PlayerFactory.md) for factory function signature
77
+ - [PlayerConfig](../interfaces/PlayerConfig.md) for the configuration options
78
+ - [PlayerFactory](../type-aliases/PlayerFactory.md) for the signature of the factory function
@@ -6,34 +6,35 @@
6
6
  function deriveRoute(stateMeta): string | null;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/routing/derive-route.ts:91](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/routing/derive-route.ts#L91)
9
+ Defined in: [packages/play-xstate/src/routing/derive-route.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/routing/derive-route.ts#L92)
10
10
 
11
- Derive route from XState state metadata
11
+ Derives the route from the metadata of an XState state
12
12
 
13
- Extracts route URL template from `meta.route` in the active state's metadata.
14
- Supports both string routes (`"/about"`) and object routes with path property
15
- (`{ path: "/about" }`). Returns null for states without route metadata (not
16
- all states need to be routable).
13
+ The function reads the URL template of the route from the `meta.route` field in
14
+ the metadata of the active state. It supports a string route (`"/about"`) and also
15
+ an object route with a path property (`{ path: "/about" }`). It returns null for a
16
+ state without route metadata, because not every state needs a route.
17
17
 
18
- **Architectural Context:** Implements **Actor Authority (INV-01)** by extracting
19
- routing information from state machine definitions rather than external configuration.
20
- The route is determined by the Actor's current state, not by infrastructure decisions.
18
+ **Architectural context:** the function implements **Actor Authority (INV-01)**,
19
+ because it reads the routing information from the state machine definition, and
20
+ not from an external configuration. The current state of the Actor decides the
21
+ route, and no decision of the infrastructure decides it.
21
22
 
22
23
  ## Parameters
23
24
 
24
- | Parameter | Type | Description |
25
- | ----------- | ------------------------------- | -------------------------------------- |
26
- | `stateMeta` | `Record`\<`string`, `unknown`\> | State metadata from snapshot.getMeta() |
25
+ | Parameter | Type | Description |
26
+ | ----------- | ------------------------------- | ------------------------------------------ |
27
+ | `stateMeta` | `Record`\<`string`, `unknown`\> | The state metadata from snapshot.getMeta() |
27
28
 
28
29
  ## Returns
29
30
 
30
31
  `string` \| `null`
31
32
 
32
- Route path template (may include :params) or null if no route found
33
+ The template of the route path, which can hold a :param, or null when the function finds no route
33
34
 
34
35
  ## Examples
35
36
 
36
- Basic route extraction
37
+ The basic read of a route
37
38
 
38
39
  ```typescript
39
40
  import { deriveRoute } from "@xmachines/play-xstate";
@@ -56,7 +57,7 @@ const route = deriveRoute(meta);
56
57
  console.log(route); // "/about"
57
58
  ```
58
59
 
59
- Route with parameters
60
+ A route with a parameter
60
61
 
61
62
  ```typescript
62
63
  const machine = setup({}).createMachine({
@@ -71,10 +72,10 @@ const machine = setup({}).createMachine({
71
72
  });
72
73
 
73
74
  const route = deriveRoute(snapshot.getMeta());
74
- console.log(route); // "/profile/:userId" (template, before substitution)
75
+ console.log(route); // "/profile/:userId" — the template, before the substitution
75
76
  ```
76
77
 
77
- Route object format
78
+ The object form of a route
78
79
 
79
80
  ```typescript
80
81
  const machine = setup({}).createMachine({
@@ -95,15 +96,15 @@ console.log(route); // "/dashboard"
95
96
  ## See
96
97
 
97
98
  - [Play RFC](../../../../rfc/play.md)
98
- - [buildRouteUrl](buildRouteUrl.md) for URL construction with parameter substitution
99
- - [isAbsoluteRoute](isAbsoluteRoute.md) for checking path absoluteness
99
+ - [buildRouteUrl](buildRouteUrl.md) for the construction of a URL, with the substitution of each parameter
100
+ - [isAbsoluteRoute](isAbsoluteRoute.md) for the test of an absolute path
100
101
 
101
102
  ## Remarks
102
103
 
103
- This function checks `meta.route` for route definitions. States with `route: {}` config
104
- are routable. Parameter substitution happens via [buildRouteUrl](buildRouteUrl.md), not in this
105
- function (deriveRoute returns templates).
104
+ This function reads the route definition from `meta.route`. A state with a
105
+ `route: {}` config has a route. [buildRouteUrl](buildRouteUrl.md) substitutes each parameter,
106
+ and this function does not: deriveRoute returns a template.
106
107
 
107
- **Non-routable States:** States without `meta.route` return `null`. This is intentional—
108
- not all states need routes. For example, intermediate loading states or substates may
109
- not correspond to distinct URLs.
108
+ **A state without a route:** a state without a `meta.route` field gives `null`.
109
+ This is deliberate, because not every state needs a route. An intermediate loading
110
+ state and a substate, for example, often have no URL of their own.
@@ -1,14 +1,14 @@
1
1
  [API](../../../README.md) / [@xmachines/play-xstate](../README.md) / eventMatches
2
2
 
3
- # Function: eventMatches()
3
+ # ~~Function: eventMatches()~~
4
4
 
5
5
  ```ts
6
6
  function eventMatches<TEvent>(eventType): Guard<unknown, TEvent>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-xstate/src/guards/helpers.ts:50](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/guards/helpers.ts#L50)
9
+ Defined in: [packages/play-xstate/src/guards/helpers.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-xstate/src/guards/helpers.ts#L52)
10
10
 
11
- Check if event type matches expected type
11
+ Tells you if the type of the event is the expected type
12
12
 
13
13
  ## Type Parameters
14
14
 
@@ -18,15 +18,15 @@ Check if event type matches expected type
18
18
 
19
19
  ## Parameters
20
20
 
21
- | Parameter | Type | Description |
22
- | ----------- | -------- | ------------------- |
23
- | `eventType` | `string` | Expected event type |
21
+ | Parameter | Type | Description |
22
+ | ----------- | -------- | ----------------------- |
23
+ | `eventType` | `string` | The expected event type |
24
24
 
25
25
  ## Returns
26
26
 
27
27
  [`Guard`](../type-aliases/Guard.md)\<`unknown`, `TEvent`\>
28
28
 
29
- Guard predicate checking event type
29
+ The guard predicate. It tests the event type
30
30
 
31
31
  ## Example
32
32
 
@@ -38,3 +38,8 @@ const machine = setup({
38
38
  },
39
39
  });
40
40
  ```
41
+
42
+ ## Deprecated
43
+
44
+ This function is part of the guard utilities, and the next major version removes
45
+ them. Write a plain typed predicate instead.