@xmachines/docs 1.0.0-beta.25 → 1.0.0-beta.27

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 (268) hide show
  1. package/api/@xmachines/play/classes/PlayError.md +10 -4
  2. package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
  3. package/api/@xmachines/play-actor/README.md +4 -0
  4. package/api/@xmachines/play-actor/classes/AbstractActor.md +49 -92
  5. package/api/@xmachines/play-actor/functions/typedSpec.md +57 -0
  6. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +9 -18
  7. package/api/@xmachines/play-actor/interfaces/Routable.md +5 -21
  8. package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
  9. package/api/@xmachines/play-actor/interfaces/Viewable.md +5 -6
  10. package/api/@xmachines/play-dom/README.md +24 -8
  11. package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
  12. package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
  13. package/api/@xmachines/play-dom/functions/defineRegistry.md +61 -0
  14. package/api/@xmachines/play-dom/functions/renderSpec.md +29 -12
  15. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +62 -0
  16. package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +9 -9
  17. package/api/@xmachines/play-dom/interfaces/DefineRegistryOptions.md +25 -0
  18. package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +18 -0
  19. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +13 -10
  20. package/api/@xmachines/play-dom/interfaces/EventHandle.md +29 -0
  21. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
  22. package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +53 -0
  23. package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +21 -0
  24. package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +16 -3
  25. package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +5 -2
  26. package/api/@xmachines/play-dom-router/README.md +10 -0
  27. package/api/@xmachines/play-dom-router/functions/connectRouter.md +18 -46
  28. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
  29. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +38 -0
  30. package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
  31. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +16 -16
  32. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
  33. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +6 -6
  34. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +119 -0
  35. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +114 -0
  36. package/api/@xmachines/play-dom-router/interfaces/RouteMapLike.md +50 -0
  37. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
  38. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
  39. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +6 -6
  40. package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +9 -0
  41. package/api/@xmachines/play-dom-router-demo/README.md +46 -51
  42. package/api/@xmachines/play-react/README.md +4 -4
  43. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +31 -5
  44. package/api/@xmachines/play-react/functions/defineRegistry.md +2 -0
  45. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  46. package/api/@xmachines/play-react/functions/useBoundProp.md +2 -0
  47. package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
  48. package/api/@xmachines/play-react/functions/useStateBinding.md +2 -0
  49. package/api/@xmachines/play-react/interfaces/ComponentContext.md +2 -0
  50. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
  51. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
  52. package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +7 -7
  53. package/api/@xmachines/play-react/type-aliases/ComponentFn.md +2 -0
  54. package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
  55. package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
  56. package/api/@xmachines/play-react-router/README.md +5 -1
  57. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +102 -25
  58. package/api/@xmachines/play-react-router/classes/RouteMap.md +17 -33
  59. package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +8 -1
  60. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +21 -11
  61. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +8 -8
  62. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +7 -7
  63. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +18 -8
  64. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
  65. package/api/@xmachines/play-router/README.md +42 -5
  66. package/api/@xmachines/play-router/classes/BaseRouteMap.md +12 -19
  67. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +100 -25
  68. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
  69. package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
  70. package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
  71. package/api/@xmachines/play-router/functions/createRouteMapFromMachine.md +38 -0
  72. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +45 -0
  73. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
  74. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
  75. package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
  76. package/api/@xmachines/play-router/functions/extractRouteParams.md +46 -0
  77. package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
  78. package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
  79. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
  80. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
  81. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
  82. package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
  83. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  84. package/api/@xmachines/play-router/functions/routeExists.md +1 -1
  85. package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
  86. package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
  87. package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
  88. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  89. package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
  90. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
  91. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
  92. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +8 -8
  93. package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
  94. package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
  95. package/api/@xmachines/play-router/interfaces/{BaseRouteMapping.md → RouteMapping.md} +5 -5
  96. package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
  97. package/api/@xmachines/play-router/interfaces/RouteNode.md +12 -12
  98. package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
  99. package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
  100. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
  101. package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
  102. package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
  103. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
  104. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
  105. package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
  106. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
  107. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
  108. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
  109. package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
  110. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
  111. package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +6 -0
  112. package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -0
  113. package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +2 -0
  114. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +10 -0
  115. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -0
  116. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -0
  117. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -0
  118. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -0
  119. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -0
  120. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -0
  121. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -0
  122. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -0
  123. package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -0
  124. package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -0
  125. package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -0
  126. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
  127. package/api/@xmachines/play-solid/README.md +4 -4
  128. package/api/@xmachines/play-solid/functions/defineRegistry.md +2 -0
  129. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  130. package/api/@xmachines/play-solid/functions/useStateBinding.md +2 -0
  131. package/api/@xmachines/play-solid/interfaces/ComponentContext.md +2 -0
  132. package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +7 -7
  133. package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +2 -0
  134. package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
  135. package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
  136. package/api/@xmachines/play-solid-router/README.md +2 -2
  137. package/api/@xmachines/play-solid-router/classes/RouteMap.md +13 -26
  138. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +121 -46
  139. package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
  140. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +15 -9
  141. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +47 -92
  142. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +8 -8
  143. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  144. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +19 -6
  145. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
  146. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
  147. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +21 -18
  148. package/api/@xmachines/play-solid-router-demo/README.md +25 -28
  149. package/api/@xmachines/play-svelte/README.md +28 -0
  150. package/api/@xmachines/play-svelte/functions/defineRegistry.md +2 -0
  151. package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +2 -0
  152. package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +2 -0
  153. package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +9 -9
  154. package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +2 -0
  155. package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +2 -0
  156. package/api/@xmachines/play-svelte/variables/PlayRenderer.md +2 -0
  157. package/api/@xmachines/play-svelte-spa-router/README.md +1 -0
  158. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +13 -26
  159. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +14 -1
  160. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +23 -4
  161. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +6 -5
  162. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +10 -10
  163. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +20 -5
  164. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
  165. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
  166. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  167. package/api/@xmachines/play-svelte-spa-router-demo/README.md +119 -12
  168. package/api/@xmachines/play-sveltekit-router/README.md +2 -1
  169. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +46 -24
  170. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +14 -1
  171. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +23 -4
  172. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -5
  173. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
  174. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +10 -10
  175. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +20 -5
  176. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
  177. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  178. package/api/@xmachines/play-sveltekit-router-demo/README.md +120 -12
  179. package/api/@xmachines/play-tanstack-react-router/README.md +5 -3
  180. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +17 -33
  181. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +93 -25
  182. package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
  183. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
  184. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +21 -11
  185. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
  186. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +8 -8
  187. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
  188. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +18 -8
  189. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
  190. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
  191. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  192. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +13 -19
  193. package/api/@xmachines/play-tanstack-react-router-demo/README.md +23 -29
  194. package/api/@xmachines/play-tanstack-solid-router/README.md +8 -8
  195. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +13 -26
  196. package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +101 -36
  197. package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
  198. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +15 -9
  199. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +8 -8
  200. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  201. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +13 -9
  202. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
  203. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
  204. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  205. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +23 -24
  206. package/api/@xmachines/play-tanstack-solid-router-demo/README.md +25 -26
  207. package/api/@xmachines/play-vue/README.md +4 -4
  208. package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
  209. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  210. package/api/@xmachines/play-vue/functions/useStateBinding.md +2 -0
  211. package/api/@xmachines/play-vue/interfaces/ComponentContext.md +2 -0
  212. package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +5 -5
  213. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  214. package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +2 -0
  215. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  216. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +4 -3
  217. package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
  218. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  219. package/api/@xmachines/play-vue-router/README.md +2 -2
  220. package/api/@xmachines/play-vue-router/classes/RouteMap.md +18 -108
  221. package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +44 -104
  222. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +127 -62
  223. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
  224. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +8 -8
  225. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +19 -7
  226. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
  227. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
  228. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
  229. package/api/@xmachines/play-vue-router-demo/README.md +47 -40
  230. package/api/@xmachines/play-xstate/README.md +15 -15
  231. package/api/@xmachines/play-xstate/classes/PlayerActor.md +46 -30
  232. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +20 -15
  233. package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
  234. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
  235. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
  236. package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
  237. package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
  238. package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
  239. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +2 -2
  240. package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
  241. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
  242. package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
  243. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
  244. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
  245. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
  246. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +14 -12
  247. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
  248. package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
  249. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
  250. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
  251. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
  252. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
  253. package/api/@xmachines/shared/functions/defineXmVitestConfig.md +3 -7
  254. package/api/@xmachines/shared/functions/xmAliases.md +1 -1
  255. package/api/README.md +4 -4
  256. package/api/llms.txt +3 -3
  257. package/examples/README.md +50 -32
  258. package/examples/basic-state-machine.md +75 -31
  259. package/examples/form-validation.md +199 -127
  260. package/examples/multi-router-integration.md +312 -230
  261. package/examples/routing-patterns.md +243 -187
  262. package/examples/traffic-light.md +114 -65
  263. package/guides/README.md +29 -15
  264. package/guides/getting-started.md +224 -144
  265. package/guides/installation.md +153 -213
  266. package/package.json +2 -2
  267. package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
  268. package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
@@ -1,23 +1,130 @@
1
1
  [Documentation](../../README.md) / @xmachines/play-svelte-spa-router-demo
2
2
 
3
- # @xmachines/play-svelte-spa-router demo
3
+ # Svelte SPA Router Demo
4
4
 
5
- Compact browser demo for the Svelte SPA router adapter.
5
+ Svelte 5 + `svelte-spa-router` integration demo for the XMachines Play architecture using hash-based URL routing.
6
6
 
7
- ## Imports
7
+ ## What This Demonstrates
8
8
 
9
- - `@xmachines/play-svelte` for the Svelte renderer and registry helpers
10
- - `@xmachines/play-svelte-spa-router` for hash-based URL ↔ actor sync
9
+ - Shared auth machine reused without framework-specific business logic
10
+ - `connectRouter` hash-URL ↔ actor sync via `@xmachines/play-svelte-spa-router`
11
+ - Shell-driven rendering via `PlayRenderer` with actor-authoritative navigation
12
+ - Canonical TC39 Signals lifecycle integrated with Svelte 5 runes
13
+ - Non-browser invariant tests plus browser E2E coverage
11
14
 
12
- ## Commands
15
+ ## Running the Demo
16
+
17
+ From the repository root:
18
+
19
+ ```bash
20
+ npm install
21
+ npm run dev -w packages/play-svelte-spa-router/examples/demo
22
+ ```
23
+
24
+ Then open `http://localhost:5173`.
25
+
26
+ ## Step-by-Step Code Flow
27
+
28
+ Use this order to understand the implementation:
29
+
30
+ 1. `src/main.ts` mounts `App.svelte` and registers HMR cleanup via `cleanupDemo`.
31
+ 2. `src/lib/router.ts` creates the actor, builds the registry, calls `createRouteMap(authMachine)`, and wires `connectRouter({ actor, routeMap })`.
32
+ 3. `connectRouter` synchronizes hash URL changes with the actor via `play.route` events and reflects actor-approved routes back to the hash URL.
33
+ 4. `src/App.svelte` imports the singleton `actor` and `registry` from `src/lib/router.ts` and delegates to the shared `Shell.svelte`.
34
+ 5. `Shell.svelte` renders `<PlayRenderer>` with the actor and registry and provides the shared UI shell (nav, debug panel).
35
+ 6. Browser tests in `test/browser/` validate startup and auth route transitions.
36
+
37
+ ```ts
38
+ // src/lib/router.ts (shape)
39
+ const createDemoPlayer = definePlayer({ machine: authMachine });
40
+ export const actor = createDemoPlayer();
41
+ actor.start();
42
+
43
+ export const routeMap = createRouteMap(authMachine);
44
+ export const disconnectRouter = connectRouter({ actor, routeMap });
45
+
46
+ export function cleanupDemo(): void {
47
+ disconnectRouter();
48
+ actor.stop();
49
+ }
50
+ ```
51
+
52
+ ```svelte
53
+ <!-- src/App.svelte (shape) -->
54
+ <script lang="ts">
55
+ import Shell from "@xmachines/play-svelte-demo/src/components/Shell.svelte";
56
+ import { actor, registry } from "./lib/router.js";
57
+ </script>
58
+
59
+ <Shell {actor} {registry} />
60
+ ```
61
+
62
+ ```svelte
63
+ <!-- Shell.svelte — sending events (shape) -->
64
+ <PlayRenderer
65
+ actor={props.actor}
66
+ registry={props.registry}
67
+ actions={{ login: "auth.login", logout: "auth.logout" }}
68
+ />
69
+ ```
70
+
71
+ ## Key Files
72
+
73
+ - `src/main.ts` - Svelte app mount and HMR cleanup registration
74
+ - `src/lib/router.ts` - actor creation, registry construction, route map, and `connectRouter` wiring
75
+ - `src/App.svelte` - minimal root component delegating to shared `Shell.svelte`
76
+ - `test/library-pattern.test.ts` - architecture boundary and invariant assertions
77
+ - `test/browser/shared-demo.browser.test.ts` - browser startup and auth route flow coverage
78
+
79
+ ## State Machine & Architecture Details
80
+
81
+ The demo utilizes XMachines architectural invariants:
82
+
83
+ 1. **Actor Authority:** When a user clicks a nav link, the hash URL changes. `connectRouter` intercepts this, translates it to a `play.route` event, and sends it to the actor. The actor evaluates guards (e.g. `isAuthenticated`) and transitions to the appropriate state.
84
+ 2. **Passive Infrastructure:** `svelte-spa-router` does not execute business logic. The actor dictates whether navigation is permitted. The Svelte application only renders the state.
85
+ 3. **Signal-Only Reactivity:** The bridge leverages Svelte 5 rune reactivity internally to react precisely when actor signals update, without ad-hoc `$state` stores for business logic.
86
+
87
+ ## Watcher Lifecycle and Cleanup Contract
88
+
89
+ This demo follows the canonical watcher lifecycle used across all `@xmachines` framework adapters:
90
+
91
+ 1. `notify`
92
+ 2. `queueMicrotask`
93
+ 3. `getPending()`
94
+ 4. Read actor signals and project Svelte-local render state
95
+ 5. Re-arm with `watch()`/`watch(...signals)`
96
+
97
+ Watcher notifications are one-shot. Cleanup is explicit: `cleanupDemo()` calls `disconnectRouter()` and `actor.stop()` during HMR disposal, preventing memory leaks and ghost subscriptions.
98
+
99
+ ## Adapter Boundaries
100
+
101
+ `connectRouter` (from `@xmachines/play-svelte-spa-router`) is passive infrastructure. It translates hash URL changes into `play.route` events and reflects actor-approved route changes back to the URL. Business validity remains actor-owned. The shared `Shell.svelte` from `@xmachines/play-svelte-demo` is reused to avoid duplicating view components across router demos.
102
+
103
+ ## Available Scripts
104
+
105
+ These commands are defined in `package.json`:
106
+
107
+ | Command | Description |
108
+ | ----------------------------------------------------------------------- | -------------------------------- |
109
+ | `npm run dev -w packages/play-svelte-spa-router/examples/demo` | Start Vite dev server |
110
+ | `npm run build -w packages/play-svelte-spa-router/examples/demo` | Build production bundle |
111
+ | `npm run preview -w packages/play-svelte-spa-router/examples/demo` | Preview built bundle |
112
+ | `npm run test -w packages/play-svelte-spa-router/examples/demo` | Run Vitest test suite |
113
+ | `npm run test:browser -w packages/play-svelte-spa-router/examples/demo` | Run browser-focused Vitest suite |
114
+
115
+ ## Verification
116
+
117
+ Use these checks to validate README claims against the current demo implementation:
13
118
 
14
119
  ```bash
15
- npm run dev -w @xmachines/play-svelte-spa-router-demo
16
- npm run build -w @xmachines/play-svelte-spa-router-demo
17
- npm run test:browser -w @xmachines/play-svelte-spa-router-demo
120
+ npm run test -w packages/play-svelte-spa-router/examples/demo
121
+ npm run test:browser -w packages/play-svelte-spa-router/examples/demo
18
122
  ```
19
123
 
20
- ## What it proves
124
+ Expected result: library-pattern invariant tests pass and the browser demo suite validates startup rendering and auth navigation.
125
+
126
+ ## Learn More
21
127
 
22
- - Clicking a navigation control updates the rendered view
23
- - Browser back/forward restores the route and view
128
+ - [Svelte SPA Router package README](../play-svelte-spa-router/README.md)
129
+ - [Svelte package README](../play-svelte/README.md)
130
+ - [SvelteKit Router demo README](../play-sveltekit-router-demo/README.md)
@@ -8,7 +8,7 @@ Thin SvelteKit adapter for XMachines Play.
8
8
 
9
9
  - Keeps `actor.currentRoute` and SvelteKit navigation in sync.
10
10
  - Exposes a local `RouteMap` plus `createRouteMap(machine)` helper.
11
- - Stays direct, with no shared `@xmachines/play-svelte-router` abstraction.
11
+ - No intermediate shared package — all shared logic lives in `@xmachines/play-router`.
12
12
  - Extracts route params and query values when browser navigation enters through SvelteKit.
13
13
 
14
14
  ## Usage
@@ -39,6 +39,7 @@ onDestroy(disconnect);
39
39
  ## Interfaces
40
40
 
41
41
  - [ConnectRouterOptions](interfaces/ConnectRouterOptions.md)
42
+ - [LocationLike](interfaces/LocationLike.md)
42
43
  - [PlayRouteEvent](interfaces/PlayRouteEvent.md)
43
44
  - [RouteMapping](interfaces/RouteMapping.md)
44
45
  - [RouterBridge](interfaces/RouterBridge.md)
@@ -2,23 +2,55 @@
2
2
 
3
3
  # Class: RouteMap
4
4
 
5
- Defined in: [play-sveltekit-router/src/route-map.ts:6](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/route-map.ts#L6)
5
+ Defined in: [play-router/src/base-route-map.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L100)
6
6
 
7
- SvelteKit route map backed by the shared Play router base class.
7
+ Shared bidirectional route map base class.
8
8
 
9
- ## Extends
9
+ All framework adapter `RouteMap` classes extend this — they add no logic of their
10
+ own and inherit the full public API from here.
10
11
 
11
- - [`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md)
12
+ **Lookup strategy:**
13
+
14
+ - Static paths (no `:param`) → O(1) `Map` lookup
15
+ - Dynamic paths → O(k) bucket-indexed scan using `URLPattern`, where `k` is the number
16
+ of routes sharing the same first path segment
17
+ - Results are cached after the first match in an LRU cache (default 500 entries,
18
+ configurable via the `cacheSize` constructor option)
19
+
20
+ **Pattern syntax** (`:param` / `:param?`):
21
+
22
+ - `:param` — required segment, matches exactly one non-`/` segment
23
+ - `:param?` — optional segment, matches zero or one non-`/` segment
24
+
25
+ ## Example
26
+
27
+ ```typescript
28
+ import { BaseRouteMap } from "@xmachines/play-router";
29
+
30
+ const map = new BaseRouteMap([
31
+ { stateId: "home", path: "/" },
32
+ { stateId: "profile", path: "/profile/:userId" },
33
+ { stateId: "settings", path: "/settings/:section?" },
34
+ ]);
35
+
36
+ map.getStateIdByPath("/"); // "home"
37
+ map.getStateIdByPath("/profile/123"); // "profile"
38
+ map.getStateIdByPath("/settings"); // "settings"
39
+ map.getStateIdByPath("/unknown"); // null
40
+
41
+ map.getPathByStateId("profile"); // "/profile/:userId"
42
+ map.getPathByStateId("missing"); // null
43
+ ```
12
44
 
13
45
  ## Constructors
14
46
 
15
47
  ### Constructor
16
48
 
17
49
  ```ts
18
- new RouteMap(mappings): RouteMap;
50
+ new RouteMap(mappings, options?): BaseRouteMap;
19
51
  ```
20
52
 
21
- Defined in: play-router/dist/base-route-map.d.ts:82
53
+ Defined in: [play-router/src/base-route-map.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L125)
22
54
 
23
55
  Build a route map from an array of state ID ↔ path mappings.
24
56
 
@@ -28,17 +60,15 @@ buckets for efficient candidate selection.
28
60
 
29
61
  #### Parameters
30
62
 
31
- | Parameter | Type | Description |
32
- | ---------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
33
- | `mappings` | [`BaseRouteMapping`](../../play-router/interfaces/BaseRouteMapping.md)[] | Array of `{ stateId, path }` entries. Order determines priority when multiple patterns could match the same path. |
63
+ | Parameter | Type | Description |
64
+ | -------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
65
+ | `mappings` | [`RouteMapping`](../interfaces/RouteMapping.md)[] | Array of `{ stateId, path }` entries. Order determines priority when multiple patterns could match the same path. |
66
+ | `options` | \{ `cacheSize?`: `number`; \} | Optional configuration. `options.cacheSize`: Maximum number of resolved parameterized path lookups to cache. Defaults to `500`. Increase for applications with many unique parameterized URL values (e.g. user profile pages with thousands of distinct IDs). After eviction the path falls back to the O(k) bucket pattern scan — correct but slower. Minimum effective value is `1` (QuickLRU constraint). |
67
+ | `options.cacheSize?` | `number` | - |
34
68
 
35
69
  #### Returns
36
70
 
37
- `RouteMap`
38
-
39
- #### Inherited from
40
-
41
- [`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md).[`constructor`](../../play-router/classes/BaseRouteMap.md#constructor)
71
+ `BaseRouteMap`
42
72
 
43
73
  ## Methods
44
74
 
@@ -48,7 +78,7 @@ buckets for efficient candidate selection.
48
78
  getPathByStateId(stateId): string | null;
49
79
  ```
50
80
 
51
- Defined in: play-router/dist/base-route-map.d.ts:112
81
+ Defined in: [play-router/src/base-route-map.ts:209](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L209)
52
82
 
53
83
  Look up the path pattern registered for a state ID.
54
84
 
@@ -71,10 +101,6 @@ map.getPathByStateId("profile"); // "/profile/:userId"
71
101
  map.getPathByStateId("missing"); // null
72
102
  ```
73
103
 
74
- #### Inherited from
75
-
76
- [`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md).[`getPathByStateId`](../../play-router/classes/BaseRouteMap.md#getpathbystateid)
77
-
78
104
  ---
79
105
 
80
106
  ### getStateIdByPath()
@@ -83,7 +109,7 @@ map.getPathByStateId("missing"); // null
83
109
  getStateIdByPath(path): string | null;
84
110
  ```
85
111
 
86
- Defined in: play-router/dist/base-route-map.d.ts:99
112
+ Defined in: [play-router/src/base-route-map.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L174)
87
113
 
88
114
  Resolve a URL path to its mapped state ID.
89
115
 
@@ -109,7 +135,3 @@ The mapped state ID, or `null` if no route matches
109
135
  map.getStateIdByPath("/profile/123"); // "profile"
110
136
  map.getStateIdByPath("/unknown"); // null
111
137
  ```
112
-
113
- #### Inherited from
114
-
115
- [`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md).[`getStateIdByPath`](../../play-router/classes/BaseRouteMap.md#getstateidbypath)
@@ -6,7 +6,11 @@
6
6
  function connectRouter(options): () => void;
7
7
  ```
8
8
 
9
- Defined in: [play-sveltekit-router/src/connect-router.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/connect-router.ts#L28)
9
+ Defined in: [play-sveltekit-router/src/connect-router.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/connect-router.ts#L29)
10
+
11
+ Connect SvelteKit router to actor.
12
+
13
+ Returns a cleanup function. The public API surface is unchanged (D-14).
10
14
 
11
15
  ## Parameters
12
16
 
@@ -17,3 +21,12 @@ Defined in: [play-sveltekit-router/src/connect-router.ts:28](https://gitlab.com/
17
21
  ## Returns
18
22
 
19
23
  () => `void`
24
+
25
+ ## Example
26
+
27
+ ```typescript
28
+ import { connectRouter, createRouteMap } from "@xmachines/play-sveltekit-router";
29
+ const routeMap = createRouteMap(machine);
30
+ const disconnect = connectRouter({ actor, routeMap });
31
+ onDestroy(() => disconnect());
32
+ ```
@@ -6,14 +6,33 @@
6
6
  function createRouteMap(machine): RouteMap;
7
7
  ```
8
8
 
9
- Defined in: [play-sveltekit-router/src/create-route-map.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/create-route-map.ts#L5)
9
+ Defined in: [play-router/src/create-route-map-from-machine.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/create-route-map-from-machine.ts#L26)
10
+
11
+ Create a `BaseRouteMap` from an XState state machine.
12
+
13
+ Extracts all routable states (those with `meta.route`) and builds a bidirectional
14
+ path ↔ stateId lookup structure. The returned map is used by `RouterBridgeBase`
15
+ subclasses to translate browser URL changes into `play.route` actor events and
16
+ vice-versa.
10
17
 
11
18
  ## Parameters
12
19
 
13
- | Parameter | Type |
14
- | --------- | ------------------------------------------------------------------------- |
15
- | `machine` | [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) |
20
+ | Parameter | Type | Description |
21
+ | --------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------- |
22
+ | `machine` | [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v5 state machine with `meta.route` annotations on states. |
16
23
 
17
24
  ## Returns
18
25
 
19
26
  [`RouteMap`](../classes/RouteMap.md)
27
+
28
+ A `BaseRouteMap` for passing to any `RouterBridgeBase`-based adapter.
29
+
30
+ ## Example
31
+
32
+ ```typescript
33
+ import { createRouteMapFromMachine } from "@xmachines/play-router";
34
+ import { connectRouter } from "@xmachines/play-dom-router";
35
+
36
+ const routeMap = createRouteMapFromMachine(myMachine);
37
+ const disconnect = connectRouter({ actor, router, routeMap });
38
+ ```
@@ -2,11 +2,12 @@
2
2
 
3
3
  # Interface: ConnectRouterOptions
4
4
 
5
- Defined in: [play-sveltekit-router/src/connect-router.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/connect-router.ts#L12)
5
+ Defined in: [play-sveltekit-router/src/connect-router.ts:6](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/connect-router.ts#L6)
6
6
 
7
7
  ## Properties
8
8
 
9
- | Property | Modifier | Type | Defined in |
10
- | ----------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
- | <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | [play-sveltekit-router/src/connect-router.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/connect-router.ts#L13) |
12
- | <a id="property-routemap"></a> `routeMap` | `readonly` | [`RouteMap`](../classes/RouteMap.md) | [play-sveltekit-router/src/connect-router.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/connect-router.ts#L14) |
9
+ | Property | Modifier | Type | Description | Defined in |
10
+ | ------------------------------------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | <a id="property-actor"></a> `actor` | `readonly` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Routable`](../../play-actor/interfaces/Routable.md) | - | [play-sveltekit-router/src/connect-router.ts:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/connect-router.ts#L7) |
12
+ | <a id="property-location"></a> `location?` | `readonly` | [`LocationLike`](LocationLike.md) \| `null` | Location-like object for initial URL reads. Defaults to `globalThis.location`. Pass a mock in tests or a stub in SSR environments. | [play-sveltekit-router/src/connect-router.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/connect-router.ts#L13) |
13
+ | <a id="property-routemap"></a> `routeMap` | `readonly` | [`RouteMap`](../classes/RouteMap.md) | - | [play-sveltekit-router/src/connect-router.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/connect-router.ts#L8) |
@@ -0,0 +1,27 @@
1
+ [Documentation](../../../README.md) / [@xmachines/play-sveltekit-router](../README.md) / LocationLike
2
+
3
+ # Interface: LocationLike
4
+
5
+ Defined in: [play-router/src/types.ts:344](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L344)
6
+
7
+ Minimal location interface required by adapters that read the current URL at
8
+ `connect()` time. Injectable for SSR and testing — pass a mock instead of the
9
+ global `location` when the DOM is unavailable.
10
+
11
+ Defined structurally (no `Location` reference) so this package compiles without
12
+ the DOM lib.
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ // SSR / test — injected mock
18
+ const mockLoc: LocationLike = { pathname: "/dashboard", search: "?tab=posts" };
19
+ connectRouter({ actor, routeMap, location: mockLoc });
20
+ ```
21
+
22
+ ## Properties
23
+
24
+ | Property | Modifier | Type | Defined in |
25
+ | ----------------------------------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | <a id="property-pathname"></a> `pathname` | `readonly` | `string` | [play-router/src/types.ts:345](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L345) |
27
+ | <a id="property-search"></a> `search` | `readonly` | `string` | [play-router/src/types.ts:346](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L346) |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: PlayRouteEvent
4
4
 
5
- Defined in: play-router/dist/types.d.ts:207
5
+ Defined in: [play-router/src/types.ts:223](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L223)
6
6
 
7
7
  Enhanced routing event with parameter and query support
8
8
 
@@ -30,7 +30,7 @@ Target state ID with # prefix (e.g., '#home', '#profile')
30
30
 
31
31
  ## Param
32
32
 
33
- Merged path + query parameters (path parameters win conflicts)
33
+ Path-only route parameters extracted from the URL path (e.g., `{ userId: '123' }` from `/profile/123`). Query parameters are kept separate in `query`.
34
34
 
35
35
  ## Param
36
36
 
@@ -85,7 +85,7 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
85
85
  const event: PlayRouteEvent = {
86
86
  type: "play.route",
87
87
  to: "#settings",
88
- params: { section: "profile" }, // Merged: path + query
88
+ params: { section: "profile" }, // Path-only route parameter
89
89
  query: { tab: "security" }, // Query-only
90
90
  };
91
91
  actor.send(event);
@@ -110,10 +110,10 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
110
110
 
111
111
  ## Properties
112
112
 
113
- | Property | Modifier | Type | Defined in |
114
- | -------------------------------------- | ---------- | ------------------------------ | ------------------------------- |
115
- | <a id="property-match"></a> `match?` | `readonly` | `unknown` | play-router/dist/types.d.ts:212 |
116
- | <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:210 |
117
- | <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | play-router/dist/types.d.ts:211 |
118
- | <a id="property-to"></a> `to` | `readonly` | `string` | play-router/dist/types.d.ts:209 |
119
- | <a id="property-type"></a> `type` | `readonly` | `"play.route"` | play-router/dist/types.d.ts:208 |
113
+ | Property | Modifier | Type | Defined in |
114
+ | -------------------------------------- | ---------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
115
+ | <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:228](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L228) |
116
+ | <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:226](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L226) |
117
+ | <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:227](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L227) |
118
+ | <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:225](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L225) |
119
+ | <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:224](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L224) |
@@ -2,11 +2,26 @@
2
2
 
3
3
  # Interface: RouteMapping
4
4
 
5
- Defined in: [play-sveltekit-router/src/types.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/types.ts#L10)
5
+ Defined in: [play-router/src/base-route-map.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L57)
6
+
7
+ A single state ID ↔ path mapping entry.
8
+
9
+ Both fields are `readonly` — mappings are immutable once passed to `BaseRouteMap`.
10
+ Adapter packages re-export a structurally compatible `RouteMapping` type under
11
+ their own name. This type is published from `@xmachines/play-router` as
12
+ `BaseRouteMapping` to avoid name collisions with those adapter-local types.
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ const mapping: BaseRouteMapping = { stateId: "home", path: "/" };
18
+ const paramMapping: BaseRouteMapping = { stateId: "profile", path: "/profile/:userId" };
19
+ const optionalMapping: BaseRouteMapping = { stateId: "settings", path: "/settings/:section?" };
20
+ ```
6
21
 
7
22
  ## Properties
8
23
 
9
- | Property | Modifier | Type | Description | Defined in |
10
- | --------------------------------------- | ---------- | -------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
- | <a id="property-path"></a> `path` | `readonly` | `string` | SvelteKit pathname pattern. | [play-sveltekit-router/src/types.ts:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/types.ts#L14) |
12
- | <a id="property-stateid"></a> `stateId` | `readonly` | `string` | XMachines state ID (for example `#home` or `dashboard.home`). | [play-sveltekit-router/src/types.ts:12](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/types.ts#L12) |
24
+ | Property | Modifier | Type | Description | Defined in |
25
+ | --------------------------------------- | ---------- | -------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | <a id="property-path"></a> `path` | `readonly` | `string` | URL path pattern (e.g., `"/"`, `"/profile/:userId"`, `"/settings/:section?"`) | [play-router/src/base-route-map.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L61) |
27
+ | <a id="property-stateid"></a> `stateId` | `readonly` | `string` | State machine state ID (e.g., `"home"`, `"#profile"`) | [play-router/src/base-route-map.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/base-route-map.ts#L59) |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: RouterBridge
4
4
 
5
- Defined in: play-router/dist/types.d.ts:254
5
+ Defined in: [play-router/src/types.ts:271](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L271)
6
6
 
7
7
  RouterBridge interface for runtime infrastructure adapters
8
8
 
@@ -54,7 +54,7 @@ class TanStackRouterBridge implements RouterBridge {
54
54
  connect(): void | Promise<void>;
55
55
  ```
56
56
 
57
- Defined in: play-router/dist/types.d.ts:270
57
+ Defined in: [play-router/src/types.ts:287](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L287)
58
58
 
59
59
  Connect the router bridge to the Actor
60
60
 
@@ -83,7 +83,7 @@ await bridge.connect();
83
83
  disconnect(): void | Promise<void>;
84
84
  ```
85
85
 
86
- Defined in: play-router/dist/types.d.ts:285
86
+ Defined in: [play-router/src/types.ts:303](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-router/src/types.ts#L303)
87
87
 
88
88
  Disconnect the router bridge from the Actor
89
89
 
@@ -6,4 +6,4 @@
6
6
  type RoutableActor = AbstractActor<AnyActorLogic> & Routable;
7
7
  ```
8
8
 
9
- Defined in: [play-sveltekit-router/src/types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-sveltekit-router/src/types.ts#L17)
9
+ Defined in: [play-sveltekit-router/src/types.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.27/packages/play-sveltekit-router/src/types.ts#L10)