@xmachines/docs 1.0.0-beta.9 → 1.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 (544) hide show
  1. package/README.md +135 -7
  2. package/api/@xmachines/play/README.md +159 -39
  3. package/api/@xmachines/play/classes/NonNullableError.md +189 -0
  4. package/api/@xmachines/play/classes/PlayError.md +251 -0
  5. package/api/@xmachines/play/functions/assertNonNullable.md +56 -0
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +6 -6
  7. package/api/@xmachines/play-actor/README.md +153 -160
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +106 -121
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +40 -0
  10. package/api/@xmachines/play-actor/functions/toAtomState.md +33 -0
  11. package/api/@xmachines/play-actor/functions/typedSpec.md +54 -0
  12. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +46 -0
  13. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +33 -0
  14. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +28 -0
  15. package/api/@xmachines/play-actor/interfaces/Routable.md +6 -21
  16. package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -6
  17. package/api/@xmachines/play-dom/README.md +385 -0
  18. package/api/@xmachines/play-dom/classes/PlayRenderer.md +115 -0
  19. package/api/@xmachines/play-dom/functions/createPlayUI.md +28 -0
  20. package/api/@xmachines/play-dom/functions/createRenderer.md +44 -0
  21. package/api/@xmachines/play-dom/functions/defineRegistry.md +26 -0
  22. package/api/@xmachines/play-dom/functions/renderSpec.md +67 -0
  23. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +23 -0
  24. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +34 -0
  25. package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +17 -0
  26. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +28 -0
  27. package/api/@xmachines/play-dom/interfaces/EventHandle.md +15 -0
  28. package/api/@xmachines/play-dom/interfaces/MountOptions.md +18 -0
  29. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +30 -0
  30. package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +26 -0
  31. package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +32 -0
  32. package/api/@xmachines/play-dom/type-aliases/ActionFn.md +46 -0
  33. package/api/@xmachines/play-dom/type-aliases/Actions.md +18 -0
  34. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +114 -0
  35. package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +25 -0
  36. package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +26 -0
  37. package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +15 -0
  38. package/api/@xmachines/play-dom/type-aliases/ConfirmHandler.md +44 -0
  39. package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +39 -0
  40. package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +20 -0
  41. package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +9 -0
  42. package/api/@xmachines/play-dom/type-aliases/DomSchema.md +9 -0
  43. package/api/@xmachines/play-dom/type-aliases/MountFn.md +27 -0
  44. package/api/@xmachines/play-dom/type-aliases/RenderErrorHandler.md +23 -0
  45. package/api/@xmachines/play-dom/type-aliases/SetState.md +30 -0
  46. package/api/@xmachines/play-dom/variables/schema.md +62 -0
  47. package/api/@xmachines/play-dom-router/README.md +272 -0
  48. package/api/@xmachines/play-dom-router/functions/connectRouter.md +43 -0
  49. package/api/@xmachines/{play-router → play-dom-router}/functions/createBrowserHistory.md +10 -2
  50. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +39 -0
  51. package/api/@xmachines/play-dom-router/functions/createRouter.md +54 -0
  52. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +176 -0
  53. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +69 -0
  54. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +15 -0
  55. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +129 -0
  56. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +68 -0
  57. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +54 -0
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +121 -0
  59. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +13 -0
  60. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
  61. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
  62. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +28 -0
  63. package/api/@xmachines/play-react/README.md +185 -333
  64. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +46 -42
  65. package/api/@xmachines/play-react/functions/ActionProvider.md +21 -0
  66. package/api/@xmachines/play-react/functions/JSONUIProvider.md +21 -0
  67. package/api/@xmachines/play-react/functions/Renderer.md +21 -0
  68. package/api/@xmachines/play-react/functions/StateProvider.md +27 -0
  69. package/api/@xmachines/play-react/functions/ValidationProvider.md +21 -0
  70. package/api/@xmachines/play-react/functions/VisibilityProvider.md +21 -0
  71. package/api/@xmachines/play-react/functions/defineRegistry.md +49 -0
  72. package/api/@xmachines/play-react/functions/useActor.md +13 -0
  73. package/api/@xmachines/play-react/functions/useBoundProp.md +45 -0
  74. package/api/@xmachines/play-react/functions/usePlayView.md +32 -0
  75. package/api/@xmachines/play-react/functions/useSignalEffect.md +29 -20
  76. package/api/@xmachines/play-react/interfaces/ActionProviderProps.md +15 -0
  77. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +27 -0
  78. package/api/@xmachines/play-react/interfaces/ComponentContext.md +37 -0
  79. package/api/@xmachines/play-react/interfaces/JSONUIProviderProps.md +22 -0
  80. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  81. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
  82. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +26 -0
  83. package/api/@xmachines/play-react/interfaces/RendererProps.md +17 -0
  84. package/api/@xmachines/play-react/interfaces/StateProviderProps.md +16 -0
  85. package/api/@xmachines/play-react/interfaces/ValidationProviderProps.md +14 -0
  86. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +20 -0
  87. package/api/@xmachines/play-react/interfaces/VisibilityProviderProps.md +13 -0
  88. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -0
  89. package/api/@xmachines/play-react/type-aliases/ComponentFn.md +36 -0
  90. package/api/@xmachines/play-react/type-aliases/RenderErrorHandler.md +23 -0
  91. package/api/@xmachines/play-react/variables/ActorProvider.md +33 -0
  92. package/api/@xmachines/play-react/variables/PlayRenderer.md +6 -56
  93. package/api/@xmachines/play-react/variables/PlayUIProvider.md +43 -0
  94. package/api/@xmachines/play-react-router/README.md +130 -115
  95. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +19 -242
  96. package/api/@xmachines/play-react-router/classes/RouteMap.md +48 -36
  97. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +45 -0
  98. package/api/@xmachines/play-react-router/functions/createRouteMap.md +39 -0
  99. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +23 -12
  100. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +68 -0
  101. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +22 -12
  102. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
  103. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +25 -9
  104. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +13 -0
  105. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +19 -9
  106. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +8 -8
  107. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  108. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +32 -0
  109. package/api/@xmachines/play-router/README.md +275 -352
  110. package/api/@xmachines/play-router/classes/RouteMap.md +149 -0
  111. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +21 -221
  112. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +32 -0
  113. package/api/@xmachines/play-router/functions/buildRouteTree.md +12 -2
  114. package/api/@xmachines/play-router/functions/createRouteMap.md +22 -36
  115. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +46 -0
  116. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +14 -7
  117. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +10 -46
  118. package/api/@xmachines/play-router/functions/extractQuery.md +22 -0
  119. package/api/@xmachines/play-router/functions/extractRouteParams.md +54 -0
  120. package/api/@xmachines/play-router/functions/findRouteById.md +2 -2
  121. package/api/@xmachines/play-router/functions/findRouteByPath.md +2 -2
  122. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +2 -2
  123. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +2 -2
  124. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +43 -0
  125. package/api/@xmachines/play-router/functions/isRouteReachable.md +38 -0
  126. package/api/@xmachines/play-router/functions/machineToGraph.md +19 -0
  127. package/api/@xmachines/play-router/functions/routeExists.md +2 -2
  128. package/api/@xmachines/play-router/functions/sanitizePathname.md +40 -0
  129. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -9
  130. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  131. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +13 -0
  132. package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
  133. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +15 -0
  134. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +17 -0
  135. package/api/@xmachines/play-router/interfaces/PlayActor.md +68 -0
  136. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +22 -12
  137. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +17 -0
  138. package/api/@xmachines/play-router/interfaces/RoutableActor.md +64 -0
  139. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  140. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +13 -0
  141. package/api/@xmachines/play-router/interfaces/RouteMapping.md +27 -0
  142. package/api/@xmachines/play-router/interfaces/RouteMatch.md +12 -0
  143. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  144. package/api/@xmachines/play-router/interfaces/RouteObject.md +5 -5
  145. package/api/@xmachines/play-router/interfaces/RouteTree.md +8 -7
  146. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +55 -0
  147. package/api/@xmachines/play-router/interfaces/RouterBridge.md +8 -8
  148. package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
  149. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +20 -0
  150. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  151. package/api/@xmachines/play-signals/README.md +117 -65
  152. package/api/@xmachines/play-signals/functions/watchSignal.md +42 -0
  153. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +7 -5
  154. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +3 -3
  155. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +7 -5
  156. package/api/@xmachines/play-signals/interfaces/SignalState.md +4 -4
  157. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +5 -5
  158. package/api/@xmachines/play-signals/namespaces/Signal/README.md +1 -1
  159. package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +7 -7
  160. package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -8
  161. package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +7 -7
  162. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +1 -1
  163. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +9 -9
  164. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -2
  165. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -2
  166. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -2
  167. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -2
  168. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -2
  169. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -2
  170. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -2
  171. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -2
  172. package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -2
  173. package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -2
  174. package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -2
  175. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +2 -2
  176. package/api/@xmachines/play-solid/README.md +196 -233
  177. package/api/@xmachines/play-solid/functions/ActionProvider.md +19 -0
  178. package/api/@xmachines/play-solid/functions/JSONUIProvider.md +21 -0
  179. package/api/@xmachines/play-solid/functions/Renderer.md +21 -0
  180. package/api/@xmachines/play-solid/functions/StateProvider.md +19 -0
  181. package/api/@xmachines/play-solid/functions/ValidationProvider.md +19 -0
  182. package/api/@xmachines/play-solid/functions/VisibilityProvider.md +20 -0
  183. package/api/@xmachines/play-solid/functions/defineRegistry.md +49 -0
  184. package/api/@xmachines/play-solid/functions/useAction.md +24 -0
  185. package/api/@xmachines/play-solid/functions/useActions.md +13 -0
  186. package/api/@xmachines/play-solid/functions/useActor.md +13 -0
  187. package/api/@xmachines/play-solid/functions/useBoundProp.md +45 -0
  188. package/api/@xmachines/play-solid/functions/useFieldValidation.md +29 -0
  189. package/api/@xmachines/play-solid/functions/useIsVisible.md +19 -0
  190. package/api/@xmachines/play-solid/functions/useOptionalValidation.md +13 -0
  191. package/api/@xmachines/play-solid/functions/usePlayView.md +30 -0
  192. package/api/@xmachines/play-solid/functions/useStateBinding.md +25 -0
  193. package/api/@xmachines/play-solid/functions/useStateStore.md +13 -0
  194. package/api/@xmachines/play-solid/functions/useStateValue.md +25 -0
  195. package/api/@xmachines/play-solid/functions/useVisibility.md +13 -0
  196. package/api/@xmachines/play-solid/interfaces/ActionProviderProps.md +12 -0
  197. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +30 -0
  198. package/api/@xmachines/play-solid/interfaces/ComponentContext.md +37 -0
  199. package/api/@xmachines/play-solid/interfaces/DefineRegistryResult.md +15 -0
  200. package/api/@xmachines/play-solid/interfaces/JSONUIProviderProps.md +22 -0
  201. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +26 -0
  202. package/api/@xmachines/play-solid/interfaces/RendererProps.md +17 -0
  203. package/api/@xmachines/play-solid/interfaces/StateProviderProps.md +13 -0
  204. package/api/@xmachines/play-solid/interfaces/ValidationProviderProps.md +11 -0
  205. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +21 -0
  206. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -0
  207. package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +36 -0
  208. package/api/@xmachines/play-solid/type-aliases/ComponentRegistry.md +11 -0
  209. package/api/@xmachines/play-solid/type-aliases/RenderErrorHandler.md +23 -0
  210. package/api/@xmachines/play-solid/type-aliases/SetState.md +21 -0
  211. package/api/@xmachines/play-solid/type-aliases/VisibilityProviderProps.md +9 -0
  212. package/api/@xmachines/play-solid/variables/ActorContext.md +13 -0
  213. package/api/@xmachines/play-solid/variables/ActorProvider.md +27 -0
  214. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -62
  215. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +26 -0
  216. package/api/@xmachines/play-solid-router/README.md +151 -559
  217. package/api/@xmachines/play-solid-router/classes/RouteMap.md +31 -32
  218. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +27 -242
  219. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +44 -0
  220. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +18 -11
  221. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +99 -114
  222. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +68 -0
  223. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +22 -12
  224. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +30 -0
  225. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +25 -9
  226. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +13 -0
  227. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +20 -7
  228. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +8 -8
  229. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +34 -0
  230. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +8 -4
  231. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +22 -19
  232. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +52 -0
  233. package/api/@xmachines/play-svelte/README.md +270 -0
  234. package/api/@xmachines/play-svelte/functions/defineRegistry.md +31 -0
  235. package/api/@xmachines/play-svelte/functions/getActorContext.md +21 -0
  236. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +19 -0
  237. package/api/@xmachines/play-svelte/functions/setActorContext.md +19 -0
  238. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +44 -0
  239. package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
  240. package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
  241. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +24 -0
  242. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +43 -0
  243. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +24 -0
  244. package/api/@xmachines/play-svelte/type-aliases/ActionFn.md +30 -0
  245. package/api/@xmachines/play-svelte/type-aliases/Actions.md +17 -0
  246. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -0
  247. package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
  248. package/api/@xmachines/play-svelte/type-aliases/JSONUIProviderProps.md +7 -0
  249. package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
  250. package/api/@xmachines/play-svelte/type-aliases/RenderErrorHandler.md +23 -0
  251. package/api/@xmachines/play-svelte/type-aliases/SetState.md +21 -0
  252. package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
  253. package/api/@xmachines/play-svelte-spa-router/README.md +197 -0
  254. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +149 -0
  255. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
  256. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +39 -0
  257. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
  258. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +129 -0
  259. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +13 -0
  260. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
  261. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
  262. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
  263. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
  264. package/api/@xmachines/play-sveltekit-router/README.md +212 -0
  265. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +149 -0
  266. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
  267. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +39 -0
  268. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
  269. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
  270. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +129 -0
  271. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +13 -0
  272. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
  273. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
  274. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
  275. package/api/@xmachines/play-tanstack-react-router/README.md +155 -125
  276. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +48 -36
  277. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +31 -252
  278. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +45 -0
  279. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +22 -36
  280. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +23 -12
  281. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +28 -0
  282. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +68 -0
  283. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +22 -12
  284. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +32 -0
  285. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +25 -9
  286. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +13 -0
  287. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +19 -9
  288. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +6 -6
  289. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +8 -8
  290. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  291. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +2 -2
  292. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +40 -18
  293. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +34 -0
  294. package/api/@xmachines/play-tanstack-router/README.md +61 -0
  295. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +131 -0
  296. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +57 -0
  297. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +100 -0
  298. package/api/@xmachines/play-tanstack-solid-router/README.md +216 -175
  299. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +31 -32
  300. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +121 -0
  301. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +44 -0
  302. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +18 -11
  303. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +68 -0
  304. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +22 -12
  305. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +31 -0
  306. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +23 -9
  307. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +13 -0
  308. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +14 -10
  309. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +8 -8
  310. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +30 -0
  311. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +8 -4
  312. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +3 -3
  313. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +40 -18
  314. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +33 -0
  315. package/api/@xmachines/play-vue/README.md +190 -210
  316. package/api/@xmachines/play-vue/functions/defineRegistry.md +32 -0
  317. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +28 -0
  318. package/api/@xmachines/play-vue/functions/useActor.md +13 -0
  319. package/api/@xmachines/play-vue/functions/useBoundProp.md +45 -0
  320. package/api/@xmachines/play-vue/interfaces/ActionProviderProps.md +12 -0
  321. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +25 -0
  322. package/api/@xmachines/play-vue/interfaces/ComponentContext.md +37 -0
  323. package/api/@xmachines/play-vue/interfaces/DefineRegistryResult.md +15 -0
  324. package/api/@xmachines/play-vue/interfaces/JSONUIProviderProps.md +21 -0
  325. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +24 -0
  326. package/api/@xmachines/play-vue/interfaces/RendererProps.md +17 -0
  327. package/api/@xmachines/play-vue/interfaces/StateProviderProps.md +15 -0
  328. package/api/@xmachines/play-vue/interfaces/ValidationProviderProps.md +11 -0
  329. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +21 -0
  330. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +5 -0
  331. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -0
  332. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +16 -0
  333. package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +35 -0
  334. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +15 -0
  335. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +22 -0
  336. package/api/@xmachines/play-vue/type-aliases/RenderErrorHandler.md +23 -0
  337. package/api/@xmachines/play-vue/variables/ActionProvider.md +64 -0
  338. package/api/@xmachines/play-vue/variables/JSONUIProvider.md +105 -0
  339. package/api/@xmachines/play-vue/variables/PlayRenderer.md +2 -2
  340. package/api/@xmachines/play-vue/variables/Renderer.md +88 -0
  341. package/api/@xmachines/play-vue/variables/StateProvider.md +79 -0
  342. package/api/@xmachines/play-vue/variables/ValidationProvider.md +55 -0
  343. package/api/@xmachines/play-vue/variables/VisibilityProvider.md +40 -0
  344. package/api/@xmachines/play-vue-router/README.md +173 -486
  345. package/api/@xmachines/play-vue-router/classes/RouteMap.md +56 -116
  346. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +23 -271
  347. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +26 -6
  348. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +68 -0
  349. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +22 -12
  350. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +13 -0
  351. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +20 -8
  352. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +8 -8
  353. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +8 -4
  354. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +12 -6
  355. package/api/@xmachines/play-xstate/README.md +203 -354
  356. package/api/@xmachines/play-xstate/classes/PlayerActor.md +195 -201
  357. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +24 -20
  358. package/api/@xmachines/play-xstate/functions/composeGuards.md +8 -3
  359. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +8 -3
  360. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +43 -0
  361. package/api/@xmachines/play-xstate/functions/definePlayer.md +14 -63
  362. package/api/@xmachines/play-xstate/functions/deriveRoute.md +3 -3
  363. package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -3
  364. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +3 -3
  365. package/api/@xmachines/play-xstate/functions/hasContext.md +8 -5
  366. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +2 -2
  367. package/api/@xmachines/play-xstate/functions/negateGuard.md +8 -3
  368. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +10 -14
  369. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +22 -0
  370. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +14 -16
  371. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -13
  372. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +17 -0
  373. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +8 -3
  374. package/api/@xmachines/play-xstate/type-aliases/Guard.md +8 -6
  375. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +9 -7
  376. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +15 -18
  377. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +15 -5
  378. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +9 -0
  379. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +22 -6
  380. package/api/@xmachines/shared/README.md +95 -295
  381. package/api/@xmachines/shared/vite-aliases/README.md +11 -0
  382. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +38 -0
  383. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +27 -0
  384. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +35 -0
  385. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +42 -0
  386. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +33 -0
  387. package/api/@xmachines/shared/vitest/README.md +12 -0
  388. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +42 -0
  389. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +34 -0
  390. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +16 -0
  391. package/api/README.md +6 -7
  392. package/api/llms.txt +72 -23
  393. package/contributing/README.md +10 -0
  394. package/contributing/architecture.md +601 -0
  395. package/contributing/configuration.md +368 -0
  396. package/contributing/deployment.md +333 -0
  397. package/contributing/development.md +503 -0
  398. package/contributing/testing.md +461 -0
  399. package/examples/@xmachines/play-dom-demo/README.md +181 -0
  400. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +24 -0
  401. package/examples/@xmachines/play-dom-demo/functions/initShell.md +25 -0
  402. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +9 -0
  403. package/examples/@xmachines/play-dom-demo/variables/About.md +12 -0
  404. package/examples/@xmachines/play-dom-demo/variables/Contact.md +12 -0
  405. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +13 -0
  406. package/examples/@xmachines/play-dom-demo/variables/Home.md +13 -0
  407. package/examples/@xmachines/play-dom-demo/variables/Login.md +13 -0
  408. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +16 -0
  409. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +13 -0
  410. package/examples/@xmachines/play-dom-demo/variables/Overview.md +13 -0
  411. package/examples/@xmachines/play-dom-demo/variables/Profile.md +13 -0
  412. package/examples/@xmachines/play-dom-demo/variables/Settings.md +13 -0
  413. package/examples/@xmachines/play-dom-demo/variables/Stats.md +13 -0
  414. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +172 -0
  415. package/examples/@xmachines/play-dom-router-demo/README.md +145 -0
  416. package/examples/@xmachines/play-react-demo/README.md +187 -0
  417. package/examples/@xmachines/play-react-demo/functions/App.md +13 -0
  418. package/examples/@xmachines/play-react-demo/functions/DebugPanel.md +20 -0
  419. package/examples/@xmachines/play-react-demo/functions/HeaderNav.md +20 -0
  420. package/examples/@xmachines/play-react-demo/functions/Shell.md +22 -0
  421. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +9 -0
  422. package/examples/@xmachines/play-react-demo/variables/About.md +14 -0
  423. package/examples/@xmachines/play-react-demo/variables/Contact.md +14 -0
  424. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +15 -0
  425. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +16 -0
  426. package/examples/@xmachines/play-react-demo/variables/Home.md +14 -0
  427. package/examples/@xmachines/play-react-demo/variables/Login.md +16 -0
  428. package/examples/@xmachines/play-react-demo/variables/NavBar.md +16 -0
  429. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +15 -0
  430. package/examples/@xmachines/play-react-demo/variables/Navigation.md +14 -0
  431. package/examples/@xmachines/play-react-demo/variables/Overview.md +14 -0
  432. package/examples/@xmachines/play-react-demo/variables/Profile.md +14 -0
  433. package/examples/@xmachines/play-react-demo/variables/Settings.md +14 -0
  434. package/examples/@xmachines/play-react-demo/variables/Shell.md +19 -0
  435. package/examples/@xmachines/play-react-demo/variables/Stats.md +14 -0
  436. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +172 -0
  437. package/examples/@xmachines/play-react-router-demo/README.md +151 -0
  438. package/examples/@xmachines/play-solid-demo/README.md +187 -0
  439. package/examples/@xmachines/play-solid-demo/functions/App.md +13 -0
  440. package/examples/@xmachines/play-solid-demo/functions/DebugPanel.md +20 -0
  441. package/examples/@xmachines/play-solid-demo/functions/HeaderNav.md +20 -0
  442. package/examples/@xmachines/play-solid-demo/functions/Shell.md +22 -0
  443. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +9 -0
  444. package/examples/@xmachines/play-solid-demo/variables/About.md +9 -0
  445. package/examples/@xmachines/play-solid-demo/variables/Contact.md +9 -0
  446. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +9 -0
  447. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +17 -0
  448. package/examples/@xmachines/play-solid-demo/variables/Home.md +9 -0
  449. package/examples/@xmachines/play-solid-demo/variables/Login.md +9 -0
  450. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +11 -0
  451. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +15 -0
  452. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +9 -0
  453. package/examples/@xmachines/play-solid-demo/variables/Overview.md +9 -0
  454. package/examples/@xmachines/play-solid-demo/variables/Profile.md +9 -0
  455. package/examples/@xmachines/play-solid-demo/variables/Settings.md +9 -0
  456. package/examples/@xmachines/play-solid-demo/variables/Shell.md +18 -0
  457. package/examples/@xmachines/play-solid-demo/variables/Stats.md +9 -0
  458. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +172 -0
  459. package/examples/@xmachines/play-solid-router-demo/README.md +137 -0
  460. package/examples/@xmachines/play-svelte-demo/README.md +143 -0
  461. package/examples/@xmachines/play-svelte-demo/type-aliases/App.md +9 -0
  462. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +9 -0
  463. package/examples/@xmachines/play-svelte-demo/variables/App.md +9 -0
  464. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +172 -0
  465. package/examples/@xmachines/play-svelte-spa-router-demo/README.md +129 -0
  466. package/examples/@xmachines/play-sveltekit-router-demo/README.md +133 -0
  467. package/examples/@xmachines/play-tanstack-react-router-demo/README.md +156 -0
  468. package/examples/@xmachines/play-tanstack-solid-router-demo/README.md +139 -0
  469. package/examples/@xmachines/play-vue-demo/README.md +183 -0
  470. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +9 -0
  471. package/examples/@xmachines/play-vue-demo/variables/App.md +9 -0
  472. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +172 -0
  473. package/examples/@xmachines/play-vue-router-demo/README.md +139 -0
  474. package/examples/README.md +78 -30
  475. package/examples/basic-state-machine.md +73 -31
  476. package/examples/form-validation.md +259 -118
  477. package/examples/multi-router-integration.md +312 -194
  478. package/examples/routing-patterns.md +228 -189
  479. package/examples/traffic-light.md +112 -65
  480. package/guides/README.md +7 -21
  481. package/guides/actor-model.md +180 -0
  482. package/guides/getting-started.md +627 -137
  483. package/guides/signals.md +166 -0
  484. package/guides/state-machines.md +284 -0
  485. package/package.json +21 -7
  486. package/rfc/broker.md +100 -0
  487. package/rfc/browser.md +44 -0
  488. package/rfc/cli.md +118 -0
  489. package/rfc/git.md +61 -0
  490. package/rfc/mcp.md +43 -0
  491. package/rfc/node.md +36 -0
  492. package/rfc/play.md +472 -0
  493. package/rfc/rest.md +102 -0
  494. package/rfc/run.md +159 -0
  495. package/rfc/streams.md +168 -0
  496. package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +0 -17
  497. package/api/@xmachines/play-catalog/README.md +0 -331
  498. package/api/@xmachines/play-catalog/functions/defineCatalog.md +0 -98
  499. package/api/@xmachines/play-catalog/functions/defineComponents.md +0 -134
  500. package/api/@xmachines/play-catalog/type-aliases/Catalog.md +0 -48
  501. package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +0 -20
  502. package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +0 -65
  503. package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +0 -17
  504. package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +0 -15
  505. package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +0 -19
  506. package/api/@xmachines/play-react-router-demo/README.md +0 -137
  507. package/api/@xmachines/play-router/classes/BaseRouteMap.md +0 -142
  508. package/api/@xmachines/play-router/functions/connectRouter.md +0 -67
  509. package/api/@xmachines/play-router/functions/crawlMachine.md +0 -92
  510. package/api/@xmachines/play-router/functions/createRouter.md +0 -76
  511. package/api/@xmachines/play-router/functions/extractRoute.md +0 -45
  512. package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +0 -27
  513. package/api/@xmachines/play-router/interfaces/BrowserHistory.md +0 -172
  514. package/api/@xmachines/play-router/interfaces/BrowserWindow.md +0 -69
  515. package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +0 -13
  516. package/api/@xmachines/play-router/interfaces/RouteMap.md +0 -56
  517. package/api/@xmachines/play-router/interfaces/StateVisit.md +0 -15
  518. package/api/@xmachines/play-router/interfaces/VanillaRouter.md +0 -28
  519. package/api/@xmachines/play-router-demo/README.md +0 -137
  520. package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +0 -15
  521. package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +0 -19
  522. package/api/@xmachines/play-solid-router-demo/README.md +0 -127
  523. package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +0 -19
  524. package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
  525. package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
  526. package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +0 -64
  527. package/api/@xmachines/play-tanstack-react-router-demo/README.md +0 -126
  528. package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +0 -343
  529. package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +0 -19
  530. package/api/@xmachines/play-tanstack-solid-router-demo/README.md +0 -126
  531. package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +0 -14
  532. package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +0 -201
  533. package/api/@xmachines/play-vue-router-demo/README.md +0 -133
  534. package/api/@xmachines/play-xstate/functions/mergeViewProps.md +0 -26
  535. package/api/@xmachines/play-xstate/functions/stateMatches.md +0 -25
  536. package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +0 -39
  537. package/api/@xmachines/play-xstate/functions/validateViewProps.md +0 -80
  538. package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +0 -16
  539. package/api/@xmachines/play-xstate/type-aliases/Catalog.md +0 -21
  540. package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +0 -17
  541. package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +0 -35
  542. package/api/@xmachines/shared/functions/defineXmVitestConfig.md +0 -29
  543. package/api/@xmachines/shared/functions/xmAliases.md +0 -24
  544. package/guides/installation.md +0 -323
@@ -1,35 +1,26 @@
1
- [Documentation](../../README.md) / @xmachines/play-router
1
+ [API](../../README.md) / @xmachines/play-router
2
2
 
3
3
  # @xmachines/play-router
4
4
 
5
- **Route tree extraction from XState v5 state machines with routing patterns**
5
+ Route tree extraction from XState v5 state machines. Part of [@xmachines/play](../play/README.md) Universal Player Architecture.
6
6
 
7
- BFS graph crawling and bidirectional route lookup enabling Actor Authority over navigation.
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![Version](https://img.shields.io/badge/version-1.1.0-blue)](https://www.npmjs.com/package/@xmachines/play-router)
8
9
 
9
- ## Overview
10
+ Graph-based route extraction and bidirectional lookup enabling Actor Authority over navigation.
10
11
 
11
- `@xmachines/play-router` extracts route trees from XState state machines by crawling the state graph using breadth-first traversal. It extracts `meta.route` paths from state machines and builds hierarchical route trees with bidirectional state ID ↔ path mapping.
12
-
13
- It also exports `RouterBridgeBase`, the shared base class used by framework adapters to implement `RouterBridge` with consistent actor↔router synchronization behavior.
14
-
15
- `RouterBridgeBase` is the policy point; framework adapters are thin ports that implement only framework-specific navigate/subscribe/unsubscribe behavior.
16
-
17
- Per [RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md), this package implements:
18
-
19
- - **Actor Authority (INV-01):** Routes derive from machine definitions, not external configuration
20
-
21
- **Routing:** Supports `meta.route` detection, `play.route` event routing, and pattern matching for dynamic parameters.
12
+ Part of the [xmachines-js monorepo](../../README.md).
22
13
 
23
14
  ## Installation
24
15
 
25
16
  ```bash
26
- npm install xstate@^5.0.0
27
- npm install @xmachines/play-router
17
+ pnpm add xstate@^5.31.0
18
+ pnpm add @xmachines/play-router
28
19
  ```
29
20
 
30
21
  **Peer dependencies:**
31
22
 
32
- - `xstate` ^5.0.0 — State machine runtime
23
+ - `xstate` ^5.31.0 — XState v5 state machine runtime
33
24
 
34
25
  **URLPattern polyfill (Node.js < 24 / older browsers):**
35
26
 
@@ -45,458 +36,390 @@ import "urlpattern-polyfill";
45
36
  Install the polyfill:
46
37
 
47
38
  ```bash
48
- npm install urlpattern-polyfill
39
+ pnpm add urlpattern-polyfill
49
40
  ```
50
41
 
51
- `urlpattern-polyfill` is declared as an optional peer dependency. Package managers will not install it automatically — it is the consumer's responsibility to load it when needed.
42
+ `urlpattern-polyfill` is declared as an optional peer dependency. Package managers will not install it automatically — consumers must install and load it when their runtime lacks native URLPattern support.
52
43
 
53
- ## Quick Start
44
+ ## Usage
45
+
46
+ ### Extract routes from a machine
54
47
 
55
48
  ```typescript
56
49
  import { createMachine } from "xstate";
57
- import { extractMachineRoutes } from "@xmachines/play-router";
50
+ import { extractMachineRoutes, createRouteMap } from "@xmachines/play-router";
58
51
 
59
- // Route pattern (recommended)
60
52
  const machine = createMachine({
61
53
  id: "app",
62
54
  initial: "home",
63
55
  states: {
64
56
  home: {
65
57
  id: "home",
66
- meta: { route: "/", view: { component: "Home" } },
58
+ meta: { route: "/" },
67
59
  },
68
60
  dashboard: {
69
61
  id: "dashboard",
70
- meta: { route: "/dashboard", view: { component: "Dashboard" } },
62
+ meta: { route: "/dashboard" },
71
63
  initial: "overview",
72
64
  states: {
73
65
  overview: {
74
66
  id: "overview",
75
- meta: { route: "/overview", view: { component: "Overview" } },
67
+ meta: { route: "/overview" },
76
68
  },
77
69
  settings: {
78
70
  id: "settings",
79
- meta: { route: "/settings/:section?", view: { component: "Settings" } }, // Optional parameter
71
+ meta: { route: "/settings/:section?" }, // optional parameter
80
72
  },
81
73
  },
82
74
  },
75
+ profile: {
76
+ id: "profile",
77
+ meta: { route: "/profile/:userId" }, // required parameter
78
+ },
83
79
  },
84
80
  });
85
81
 
82
+ // Build hierarchical route tree with bidirectional maps
86
83
  const tree = extractMachineRoutes(machine);
87
84
 
88
- // Bidirectional lookup
89
- console.log(tree.byPath.get("/dashboard/overview")); // RouteNode
90
- console.log(tree.byId.get("overview")); // RouteNode
85
+ // Path → RouteNode
86
+ const node = tree.byPath.get("/dashboard"); // RouteNode for "dashboard"
91
87
 
92
- // Pattern matching for dynamic routes
93
- const settingsRoute = tree.byPath.get("/settings/profile");
94
- console.log(settingsRoute?.id); // "settings"
95
- ```
96
-
97
- ## Vanilla Browser Example
98
-
99
- See `examples/vanilla-demo/` for a complete example using vanilla TypeScript with the browser History API.
100
-
101
- The demo demonstrates:
102
-
103
- - **RouteTree extraction** from XState machine meta.route
104
- - **History API integration** (pushState, popstate)
105
- - **Bidirectional synchronization** (actor ↔ URL)
106
- - **Protected route guards** (authentication redirects)
107
- - **Dynamic route parameters** (/profile/:userId)
88
+ // State ID RouteNode
89
+ const overview = tree.byStateId.get("overview");
90
+ console.log(overview?.fullPath); // "/overview"
108
91
 
109
- **Run the demo:**
110
-
111
- ```bash
112
- cd packages/play-router/examples/demo
113
- npm install
114
- npm run dev
92
+ // Build a RouteMap for framework adapters
93
+ const routeMap = createRouteMap(machine);
94
+ routeMap.getStateIdByPath("/profile/123"); // "profile"
95
+ routeMap.getPathByStateId("profile"); // "/profile/:userId"
115
96
  ```
116
97
 
117
- Open http://localhost:5174/ and explore:
118
-
119
- 1. Login with any username
120
- 2. Navigate between home and profile
121
- 3. Use browser back/forward buttons
122
- 4. Try accessing protected routes directly
123
-
124
- **Key implementation patterns:**
98
+ ### Sending `play.route` events
125
99
 
126
100
  ```typescript
127
- // Extract routes from machine
128
- const routeTree = extractMachineRoutes(authMachine);
129
- const routeMap = createRouteMap(routeTree);
130
-
131
- // Actor → URL sync
132
- const watcher = new Signal.subtle.Watcher(() => {
133
- queueMicrotask(() => {
134
- watcher.getPending();
135
- const route = actor.currentRoute.get();
136
- if (route) {
137
- window.history.pushState({}, "", route);
138
- }
139
- watcher.watch(actor.currentRoute);
140
- });
101
+ import type { PlayRouteEvent } from "@xmachines/play-router";
102
+
103
+ // Navigate to a state by ID
104
+ const event: PlayRouteEvent = {
105
+ type: "play.route",
106
+ to: "#dashboard",
107
+ };
108
+ actor.send(event);
109
+
110
+ // Navigate with route parameters
111
+ actor.send({
112
+ type: "play.route",
113
+ to: "#profile",
114
+ params: { userId: "123" },
141
115
  });
142
116
 
143
- // URL → Actor sync (with pattern matching)
144
- window.addEventListener("popstate", () => {
145
- const path = window.location.pathname;
146
- const { to, params } = routeMap.resolve(path);
147
- if (to) {
148
- actor.send({ type: "play.route", to, params });
149
- }
117
+ // Navigate with query parameters
118
+ actor.send({
119
+ type: "play.route",
120
+ to: "#settings",
121
+ params: { section: "billing" },
122
+ query: { tab: "invoices" },
150
123
  });
151
-
152
- // Initial URL handling
153
- const initialPath = window.location.pathname;
154
- if (initialPath !== "/") {
155
- const { to, params } = routeMap.resolve(initialPath);
156
- if (to) {
157
- actor.send({ type: "play.route", to, params });
158
- }
159
- }
160
124
  ```
161
125
 
162
- This example shows the core routing concepts without framework dependencies, making it ideal for understanding how @xmachines/play-router integrates with browser History API.
163
-
164
- ## Canonical Watcher Lifecycle
165
-
166
- Bridge implementations should use one watcher flow:
167
-
168
- 1. `notify`
169
- 2. `queueMicrotask`
170
- 3. `getPending()`
171
- 4. read actor route and sync infrastructure state
172
- 5. re-arm with `watch(...)` or `watch()`
173
-
174
- Watcher notification is one-shot; re-arm is required.
175
-
176
- ## Bridge Cleanup Contract
126
+ ### Implementing a `RouterBridgeBase` adapter
177
127
 
178
- Bridge teardown must be explicit and deterministic:
179
-
180
- - `disconnect`/`dispose` must unwatch signal subscriptions and unhook router listeners.
181
- - Do not rely on GC-only cleanup guidance.
182
- - Infrastructure remains passive: bridges observe and forward intents, actors decide validity.
183
-
184
- ## API Reference
185
-
186
- ### extractMachineRoutes()
187
-
188
- Main entry point — crawls state machine, extracts routes, builds tree:
128
+ Extend `RouterBridgeBase` and implement the three abstract methods for your framework:
189
129
 
190
130
  ```typescript
191
- const tree = extractMachineRoutes(machine: AnyStateMachine): RouteTree;
192
- ```
193
-
194
- **Detection:**
195
-
196
- - States with `meta.route` in meta object
197
-
198
- **Returns:** `RouteTree` with:
199
-
200
- - `routes: RouteNode[]` - Array of route nodes
201
- - `byPath: Map<string, RouteNode>` - URL path → route node
202
- - `byId: Map<string, RouteNode>` - State ID → route node
203
-
204
- **Throws:** Error if routes are invalid (malformed paths, missing state IDs, duplicates)
205
-
206
- **Example:**
207
-
208
- ```typescript
209
- import { extractMachineRoutes } from "@xmachines/play-router";
210
-
211
- const tree = extractMachineRoutes(authMachine);
131
+ import { RouterBridgeBase } from "@xmachines/play-router";
132
+ import type { RoutableActor } from "@xmachines/play-router";
133
+
134
+ export class MyRouterBridge extends RouterBridgeBase {
135
+ private unsubscribe: (() => void) | null = null;
136
+
137
+ constructor(
138
+ private readonly myRouter: MyRouter,
139
+ actor: RoutableActor,
140
+ routeMap: ReturnType<typeof createRouteMap>,
141
+ ) {
142
+ super(actor, routeMap);
143
+ }
212
144
 
213
- // Query routes
214
- const loginRoute = tree.byId.get("login");
215
- console.log(loginRoute?.path); // "/login"
145
+ // Tell the framework router to navigate to a path
146
+ protected navigateRouter(path: string): void {
147
+ this.myRouter.navigate(path);
148
+ }
216
149
 
217
- const dashboardRoute = tree.byPath.get("/dashboard");
218
- console.log(dashboardRoute?.id); // "dashboard"
219
- ```
150
+ // Subscribe to router location changes, call syncActorFromRouter on each
151
+ protected watchRouterChanges(): void {
152
+ this.unsubscribe = this.myRouter.subscribe((location) => {
153
+ this.syncActorFromRouter(location.pathname, location.search);
154
+ });
155
+ }
220
156
 
221
- ### crawlMachine()
157
+ // Unsubscribe from router location changes
158
+ protected unwatchRouterChanges(): void {
159
+ this.unsubscribe?.();
160
+ this.unsubscribe = null;
161
+ }
222
162
 
223
- Low-level BFS traversal of state machine graph:
163
+ // Provide the router's current path for initial deep-link sync
164
+ protected override getInitialRouterPath(): string {
165
+ return this.myRouter.state.location.pathname;
166
+ }
167
+ }
224
168
 
225
- ```typescript
226
- const visits = crawlMachine(machine: AnyStateMachine): StateVisit[];
169
+ // Usage
170
+ const routeMap = createRouteMap(machine);
171
+ const bridge = new MyRouterBridge(myRouter, actor, routeMap);
172
+ bridge.connect();
173
+ // ...
174
+ bridge.disconnect();
227
175
  ```
228
176
 
229
- **Returns:** Array of state visits in breadth-first order with:
177
+ ## API Summary
230
178
 
231
- - `path: string[]` - State path (e.g., ["dashboard", "settings"])
232
- - `parent: StateNode | null` - Parent state node
233
- - `node: StateNode` - Current state node
179
+ ### Route Extraction
234
180
 
235
- **Example:**
181
+ | Export | Description |
182
+ | ---------------------------------------- | ---------------------------------------------------------------------------------- |
183
+ | `extractMachineRoutes(machine)` | Convert an XState machine to a `RouteTree` with bidirectional state ID ↔ path maps |
184
+ | `createRouteMap(machine, options?)` | Build a `RouteMap` directly from a machine (preferred form for adapters) |
185
+ | `createRouteMapFromTree(tree, options?)` | Build a `RouteMap` from an already-extracted `RouteTree` |
186
+ | `buildRouteTree(routes)` | Build a `RouteTree` from an array of `RouteInfo` objects |
187
+ | `machineToGraph(machine)` | Convert a machine to a typed `@statelyai/graph` `Graph` for graph algorithm access |
236
188
 
237
- ```typescript
238
- import { crawlMachine } from "@xmachines/play-router";
189
+ ### Route Matching
239
190
 
240
- const visits = crawlMachine(machine);
241
- visits.forEach((visit) => {
242
- console.log("State:", visit.path.join("."));
243
- console.log("Parent:", visit.parent?.id ?? "root");
244
- });
245
- ```
191
+ | Export | Description |
192
+ | ----------------------------- | ------------------------------------------------------------------------------------------ |
193
+ | `RouteMap` | Bidirectional `stateId ↔ path` lookup class; supports O(1) exact and O(k) pattern matching |
194
+ | `findRouteById(tree, id)` | Look up a `RouteNode` by state ID |
195
+ | `findRouteByPath(tree, path)` | Look up a `RouteNode` by URL path (supports dynamic patterns) |
246
196
 
247
197
  ### Query Utilities
248
198
 
249
- ```typescript
250
- // Get child routes from state
251
- const children = getNavigableRoutes(tree, "dashboard");
252
-
253
- // Check if route exists
254
- const exists = routeExists(tree, "/profile/:userId");
255
- ```
256
-
257
- ## Examples
258
-
259
- ### Route Detection
260
-
261
- ```typescript
262
- import { extractMachineRoutes } from "@xmachines/play-router";
263
- import { createMachine } from "xstate";
264
-
265
- const machine = createMachine({
266
- initial: "home",
267
- states: {
268
- home: {
269
- id: "home",
270
- meta: { route: "/", view: { component: "Home" } },
271
- },
272
- profile: {
273
- id: "profile",
274
- meta: { route: "/profile/:userId", view: { component: "Profile" } }, // Parameter pattern
275
- },
276
- settings: {
277
- id: "settings",
278
- meta: { route: "/settings/:section?", view: { component: "Settings" } }, // Optional parameter
279
- },
280
- },
281
- });
282
-
283
- const tree = extractMachineRoutes(machine);
284
-
285
- // Bidirectional mapping
286
- const profileById = tree.byId.get("profile");
287
- console.log(profileById?.path); // "/profile/:userId"
288
-
289
- const profileByPath = tree.byPath.get("/profile/user123");
290
- console.log(profileByPath?.id); // "profile"
291
- ```
292
-
293
- ### Hierarchical Route Tree
199
+ | Export | Description |
200
+ | ------------------------------------------------- | ------------------------------------------------------------------------- |
201
+ | `getRoutableRoutes(tree)` | All routable `RouteNode`s as a flat array |
202
+ | `getNavigableRoutes(tree, stateId)` | Child routes reachable from a state (hierarchical + transition-reachable) |
203
+ | `routeExists(tree, path)` | Check whether a path is registered in the tree |
204
+ | `getTransitionReachableRoutes(graph, stateId)` | Route paths reachable via XState transitions from a state |
205
+ | `isRouteReachable(graph, fromStateId, toStateId)` | Check whether a transition path exists between two states |
206
+
207
+ ### Router Bridge
208
+
209
+ | Export | Description |
210
+ | --------------------------------------- | ------------------------------------------------------------------------------------- |
211
+ | `RouterBridgeBase` | Abstract base class for framework router adapters; implements `RouterBridge` protocol |
212
+ | `sanitizePathname(path)` | Normalize a raw pathname; returns `null` for paths > 2048 chars or malformed input |
213
+ | `buildPlayRouteEvent(options)` | Build a `PlayRouteEvent` from a pathname + route-map match result |
214
+ | `extractRouteParams(pathname, pattern)` | Extract path parameters from a URL using URLPattern |
215
+ | `extractQuery(search)` | Extract query parameters from a URL search string |
216
+
217
+ ### Validation
218
+
219
+ | Export | Description |
220
+ | ---------------------------------------- | ----------------------------------------------------- |
221
+ | `validateRouteFormat(route, stateId)` | Assert route path is non-empty |
222
+ | `validateStateExists(stateId, stateIds)` | Assert a state ID is present in the machine graph |
223
+ | `detectDuplicateRoutes(routes)` | Throw if any two states resolve to the same full path |
224
+
225
+ ### Key Types
226
+
227
+ | Export | Description |
228
+ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
229
+ | `RouterBridge` | Interface for `connect()` / `disconnect()` lifecycle |
230
+ | `RouteTree` | Hierarchical tree with `root`, `byStateId`, `byPath`, and optional `graph` |
231
+ | `RouteNode` | Single node in the tree with `id`, `path`, `fullPath`, `stateId`, `children`, `parent` |
232
+ | `RouteInfo` | Flat route descriptor extracted from a state node |
233
+ | `PlayRouteEvent` | Routing event `{ type: "play.route", to, params?, query? }` |
234
+ | `RoutableActor` | Minimal actor interface required by `RouterBridgeBase` — `currentRoute`, `initialRoute`, and `send(PlayRouteEvent)` |
235
+ | `PlayActor` | Full actor interface used by `PlayRouterProvider` — extends `RoutableActor` with `currentView` (`Routable + Viewable`) |
236
+ | `RouteMapping` | `{ stateId, path }` pair used to build a `RouteMap` |
237
+ | `RouteMapping as BaseRouteMapping` | Alias for `RouteMapping` (backwards-compat re-export) |
238
+ | `MachineGraph` | Typed `@statelyai/graph` Graph with `MachineNodeData` / `MachineEdgeData` |
239
+ | `WindowLike` | Injectable minimal `window` interface for SSR / testing |
240
+ | `LocationLike` | Injectable minimal `location` interface for SSR / testing |
241
+
242
+ ### Errors (subpath `@xmachines/play-router/errors`)
243
+
244
+ | Class | Code | When thrown |
245
+ | ---------------------------- | --------------------------------------- | ----------------------------------------------------------------- |
246
+ | `RouterSyncError` | `PLAY_ROUTER_SYNC_FAILED` | `syncActorFromRouter()` fails to send a `play.route` event |
247
+ | `DuplicateBridgeError` | `PLAY_ROUTER_DUPLICATE_BRIDGE` | A second bridge tries to connect to an actor that already has one |
248
+ | `URLPatternUnavailableError` | `PLAY_ROUTE_MAP_URLPATTERN_UNAVAILABLE` | URLPattern API is absent and no polyfill is loaded |
249
+ | `InvalidRoutePatternError` | `PLAY_ROUTE_MAP_INVALID_PATTERN` | A route pattern string is rejected by the URLPattern constructor |
250
+ | `EmptyRoutePathError` | `PLAY_ROUTE_EMPTY_PATH` | A state declares `meta.route: ""` |
251
+ | `InvalidStateIdError` | `PLAY_ROUTE_INVALID_STATE_ID` | A route references a state ID not in the machine graph |
252
+ | `DuplicateRoutePathError` | `PLAY_ROUTE_DUPLICATE_PATH` | Two or more states share the same URL path |
253
+ | `UnknownStateTypeError` | `PLAY_ROUTE_UNKNOWN_STATE_TYPE` | A state node has an unrecognised XState `.type` value |
294
254
 
295
255
  ```typescript
296
- import { extractMachineRoutes, getNavigableRoutes } from "@xmachines/play-router";
297
-
298
- const machine = createMachine({
299
- initial: "app",
300
- states: {
301
- app: {
302
- id: "app",
303
- meta: { route: "/", view: { component: "AppShell" } },
304
- initial: "dashboard",
305
- states: {
306
- dashboard: {
307
- id: "dashboard",
308
- meta: { route: "/dashboard", view: { component: "Dashboard" } },
309
- initial: "overview",
310
- states: {
311
- overview: {
312
- id: "overview",
313
- meta: { route: "/overview", view: { component: "Overview" } },
314
- },
315
- analytics: {
316
- id: "analytics",
317
- meta: { route: "/analytics", view: { component: "Analytics" } },
318
- },
319
- },
320
- },
321
- },
322
- },
323
- },
324
- });
325
-
326
- const tree = extractMachineRoutes(machine);
327
-
328
- // Get child routes
329
- const dashboardChildren = getNavigableRoutes(tree, "dashboard");
330
- console.log(dashboardChildren.map((r) => r.id)); // ["overview", "analytics"]
331
-
332
- // Route inheritance
333
- const analyticsRoute = tree.byId.get("analytics");
334
- console.log(analyticsRoute?.path); // "/dashboard/analytics" (inherited parent path)
335
- ```
336
-
337
- ### Pattern Matching
338
-
339
- ```typescript
340
- import { extractMachineRoutes } from "@xmachines/play-router";
341
-
342
- const machine = createMachine({
343
- states: {
344
- user: {
345
- id: "user",
346
- meta: { route: "/user/:userId", view: { component: "User" } }, // Required parameter
347
- },
348
- settings: {
349
- id: "settings",
350
- meta: { route: "/settings/:section?", view: { component: "Settings" } }, // Optional parameter
351
- },
352
- },
353
- });
354
-
355
- const tree = extractMachineRoutes(machine);
356
-
357
- // Pattern matching for actual URLs
358
- const userRoute = tree.byPath.get("/user/user123");
359
- console.log(userRoute?.id); // "user"
360
-
361
- const settingsDefault = tree.byPath.get("/settings");
362
- console.log(settingsDefault?.id); // "settings" (optional param)
363
-
364
- const settingsProfile = tree.byPath.get("/settings/profile");
365
- console.log(settingsProfile?.id); // "settings" (with param)
256
+ import {
257
+ RouterSyncError,
258
+ DuplicateBridgeError,
259
+ URLPatternUnavailableError,
260
+ } from "@xmachines/play-router/errors";
261
+
262
+ try {
263
+ bridge.connect();
264
+ } catch (err) {
265
+ if (err instanceof DuplicateBridgeError) {
266
+ // Actor already bridged — call disconnect() first
267
+ } else if (err instanceof RouterSyncError) {
268
+ console.error("Router sync failed:", err.message, err.cause);
269
+ }
270
+ }
366
271
  ```
367
272
 
368
273
  ## Route Configuration
369
274
 
370
- ### Route Pattern (Recommended)
275
+ ### `meta.route` patterns
371
276
 
372
- ```typescript
373
- states: {
374
- dashboard: {
375
- id: "dashboard", // Required for bidirectional lookup
376
- meta: {
377
- route: "/dashboard", // URL path - marks state as routable
378
- },
379
- },
380
- }
381
- ```
382
-
383
- ### Alternative Pattern
277
+ Routes are declared on XState state nodes via the `meta.route` field:
384
278
 
385
279
  ```typescript
386
280
  states: {
387
- dashboard: {
388
- id: "dashboard",
389
- meta: {
390
- route: "/dashboard",
391
- },
392
- },
281
+ home: {
282
+ id: "home",
283
+ meta: { route: "/" }, // static route
284
+ },
285
+ profile: {
286
+ id: "profile",
287
+ meta: { route: "/profile/:userId" }, // required parameter
288
+ },
289
+ settings: {
290
+ id: "settings",
291
+ meta: { route: "/settings/:section?" }, // optional parameter
292
+ },
293
+ docs: {
294
+ id: "docs",
295
+ meta: { route: { path: "/docs", title: "Documentation" } }, // object form
296
+ },
393
297
  }
394
298
  ```
395
299
 
396
- ### Route Inheritance
300
+ ### Relative vs absolute paths
301
+
302
+ Child routes with a leading `/` are absolute (do not inherit the parent path). Without a leading `/`, they resolve relative to their nearest routable ancestor:
397
303
 
398
304
  ```typescript
399
305
  states: {
400
- parent: {
401
- id: "parent",
402
- meta: { route: "/parent", view: { component: "Parent" } },
403
- states: {
404
- absolute: {
405
- id: "absolute",
406
- meta: { route: "/absolute", view: { component: "Absolute" } }, // Starts with / doesn't inherit
407
- },
408
- relative: {
409
- id: "relative",
410
- meta: { route: "relative", view: { component: "Relative" } }, // No leading / inherits parent
411
- // Final path: "/parent/relative"
412
- },
413
- },
414
- },
306
+ dashboard: {
307
+ id: "dashboard",
308
+ meta: { route: "/dashboard" },
309
+ states: {
310
+ overview: {
311
+ id: "overview",
312
+ meta: { route: "/overview" }, // absolutefullPath: "/overview"
313
+ },
314
+ stats: {
315
+ id: "stats",
316
+ meta: { route: "stats" }, // relativefullPath: "/dashboard/stats"
317
+ },
318
+ },
319
+ },
415
320
  }
416
321
  ```
417
322
 
418
- ### Dynamic Parameters
323
+ Always use `node.fullPath` (never `node.path`) for browser URL matching and route map construction.
419
324
 
420
- ```typescript
421
- meta: {
422
- route: "/profile/:userId", // Required parameter
423
- route: "/settings/:section?", // Optional parameter
424
- route: "/docs/:category/:page", // Multiple parameters
425
- view: { component: "AnyView" },
426
- }
427
- ```
428
-
429
- **Parameter substitution:** Values extracted from context or event params (handled by play-xstate adapter).
325
+ ## Testing
430
326
 
431
- ## Architecture
327
+ ```bash
328
+ # Run tests for this package
329
+ pnpm --filter @xmachines/play-router test
432
330
 
433
- This package enables **Actor Authority (INV-01)**:
331
+ # Watch mode
332
+ pnpm --filter @xmachines/play-router run test:watch
333
+ ```
434
334
 
435
- 1. **Routes derive from machine:** Business logic defines routes in state machine, not external config
436
- 2. **BFS traversal:** Systematic state discovery ensures all nested states visited
437
- 3. **Bidirectional mapping:** Fast lookup by path (browser URL) or by ID (state machine)
438
- 4. **Build-time validation:** Invalid routes throw errors during extraction, not runtime
335
+ A router bridge contract test suite for adapter authors lives in
336
+ `@xmachines/play-router-shared` (it drives a real actor, so it sits one layer
337
+ above this package to keep `@xmachines/play-router` free of an actor-runtime
338
+ dependency):
439
339
 
440
- **Enhancements:**
340
+ ```typescript
341
+ import { runBridgeContractTests } from "@xmachines/play-router-shared/test/router-bridge-contract.js";
441
342
 
442
- - `meta.route` detection via state metadata
443
- - Pattern matching for dynamic routes (`:param` and `:param?`)
444
- - State ID ↔ path bidirectional maps for `play.route` events
343
+ runBridgeContractTests({
344
+ name: "MyRouterBridge",
345
+ createHarness(initialPath) {
346
+ // return ContractHarness with bridge, actor, simulateNavigation, getLastNavigatedPath
347
+ },
348
+ });
349
+ ```
445
350
 
446
351
  ## Related Packages
447
352
 
448
- - **[@xmachines/play-xstate](../play-xstate/README.md)** - XState adapter using route extraction
449
- - **[@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md)** - TanStack Router adapter using route trees
450
- - **[@xmachines/play-react-router](../play-react-router/README.md)** - React Router v7 adapter using RouterBridgeBase
451
- - **[@xmachines/play](../play/README.md)** - Protocol types
353
+ - **[@xmachines/play](../play/README.md)** Core protocol types (`PlayEvent`, `PlayError`)
354
+ - **[@xmachines/play-actor](../play-actor/README.md)** Abstract actor base class (`AbstractActor`, `Routable`); all `AbstractActor` subclasses satisfy `RoutableActor` structurally
355
+ - **[@xmachines/play-signals](../play-signals/README.md)** TC39 Signals polyfill used for actor route observation
356
+ - **[@xmachines/play-xstate](../play-xstate/README.md)** XState v5 logic adapter that integrates with route trees
357
+ - **[@xmachines/play-tanstack-router](../play-tanstack-router/README.md)** — Shared TanStack Router bridge base (framework-agnostic)
358
+ - **[@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md)** — TanStack Router adapter (React)
359
+ - **[@xmachines/play-tanstack-solid-router](../play-tanstack-solid-router/README.md)** — TanStack Router adapter (SolidJS)
360
+ - **[@xmachines/play-react-router](../play-react-router/README.md)** — React Router v7 adapter
361
+ - **[@xmachines/play-vue-router](../play-vue-router/README.md)** — Vue Router adapter
362
+ - **[@xmachines/play-solid-router](../play-solid-router/README.md)** — SolidJS Router adapter
452
363
 
453
364
  ## License
454
365
 
455
- Copyright (c) 2016 [Mikael Karon](mailto:mikael@karon.se). All rights reserved.
456
-
457
- This work is licensed under the terms of the MIT license.
458
- For a copy, see <https://opensource.org/licenses/MIT>.
366
+ MIT see [LICENSE](LICENSE).
459
367
 
460
368
  ## Classes
461
369
 
462
- - [BaseRouteMap](classes/BaseRouteMap.md)
370
+ - [RouteMap](classes/RouteMap.md)
463
371
  - [RouterBridgeBase](classes/RouterBridgeBase.md)
464
372
 
465
373
  ## Interfaces
466
374
 
467
- - [BaseRouteMapping](interfaces/BaseRouteMapping.md)
468
- - [BrowserHistory](interfaces/BrowserHistory.md)
469
- - [BrowserWindow](interfaces/BrowserWindow.md)
470
- - [ConnectRouterOptions](interfaces/ConnectRouterOptions.md)
375
+ - [BuildPlayRouteEventOptions](interfaces/BuildPlayRouteEventOptions.md)
376
+ - [LocationLike](interfaces/LocationLike.md)
377
+ - [MachineEdgeData](interfaces/MachineEdgeData.md)
378
+ - [MachineNodeData](interfaces/MachineNodeData.md)
379
+ - [PlayActor](interfaces/PlayActor.md)
471
380
  - [PlayRouteEvent](interfaces/PlayRouteEvent.md)
381
+ - [ResolvedRoutePath](interfaces/ResolvedRoutePath.md)
382
+ - [RoutableActor](interfaces/RoutableActor.md)
472
383
  - [RouteInfo](interfaces/RouteInfo.md)
473
- - [RouteMap](interfaces/RouteMap.md)
384
+ - [RouteMapOptions](interfaces/RouteMapOptions.md)
385
+ - [RouteMapping](interfaces/RouteMapping.md)
386
+ - [RouteMatch](interfaces/RouteMatch.md)
474
387
  - [RouteNode](interfaces/RouteNode.md)
475
388
  - [RouteObject](interfaces/RouteObject.md)
476
389
  - [RouterBridge](interfaces/RouterBridge.md)
477
390
  - [RouteTree](interfaces/RouteTree.md)
478
- - [StateVisit](interfaces/StateVisit.md)
479
- - [VanillaRouter](interfaces/VanillaRouter.md)
391
+ - [RouteWatcherHandle](interfaces/RouteWatcherHandle.md)
392
+ - [WindowLike](interfaces/WindowLike.md)
480
393
 
481
394
  ## Type Aliases
482
395
 
396
+ - [MachineGraph](type-aliases/MachineGraph.md)
483
397
  - [RouteMetadata](type-aliases/RouteMetadata.md)
484
398
 
485
399
  ## Functions
486
400
 
401
+ - [buildPlayRouteEvent](functions/buildPlayRouteEvent.md)
487
402
  - [buildRouteTree](functions/buildRouteTree.md)
488
- - [connectRouter](functions/connectRouter.md)
489
- - [crawlMachine](functions/crawlMachine.md)
490
- - [createBrowserHistory](functions/createBrowserHistory.md)
491
403
  - [createRouteMap](functions/createRouteMap.md)
492
- - [createRouter](functions/createRouter.md)
404
+ - [createRouteMapFromTree](functions/createRouteMapFromTree.md)
493
405
  - [detectDuplicateRoutes](functions/detectDuplicateRoutes.md)
494
406
  - [extractMachineRoutes](functions/extractMachineRoutes.md)
495
- - [extractRoute](functions/extractRoute.md)
407
+ - [extractQuery](functions/extractQuery.md)
408
+ - [extractRouteParams](functions/extractRouteParams.md)
496
409
  - [findRouteById](functions/findRouteById.md)
497
410
  - [findRouteByPath](functions/findRouteByPath.md)
498
411
  - [getNavigableRoutes](functions/getNavigableRoutes.md)
499
412
  - [getRoutableRoutes](functions/getRoutableRoutes.md)
413
+ - [getTransitionReachableRoutes](functions/getTransitionReachableRoutes.md)
414
+ - [isRouteReachable](functions/isRouteReachable.md)
415
+ - [machineToGraph](functions/machineToGraph.md)
500
416
  - [routeExists](functions/routeExists.md)
417
+ - [sanitizePathname](functions/sanitizePathname.md)
501
418
  - [validateRouteFormat](functions/validateRouteFormat.md)
502
419
  - [validateStateExists](functions/validateStateExists.md)
420
+
421
+ ## References
422
+
423
+ ### BaseRouteMapping
424
+
425
+ Renames and re-exports [RouteMapping](interfaces/RouteMapping.md)