@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,175 +1,157 @@
1
+ <!-- generated-by: gsd-doc-writer -->
2
+
1
3
  # Installation
2
4
 
3
- This guide covers installing XMachines packages in your project across different package managers and environments.
5
+ Install XMachines packages for your platform.
4
6
 
5
7
  ## Prerequisites
6
8
 
7
- Before installing XMachines, ensure you have:
8
-
9
9
  - **Node.js 22+** (or compatible runtime)
10
- - **Package manager**: npm, pnpm, or yarn
11
- - **TypeScript** (optional but recommended for full type safety)
12
-
13
- ## Installing XMachines
14
-
15
- Choose your preferred package manager:
10
+ - **TypeScript 5.7+** with `strict: true` and `"type": "module"` in `package.json`
11
+ - A package manager: npm, pnpm, or yarn
16
12
 
17
- ### npm
13
+ XMachines packages are **ESM-only** — no CommonJS builds. All packages use `"type": "module"`.
18
14
 
19
- ```bash
20
- npm install @xmachines/play @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
21
- ```
15
+ ## Core Packages
22
16
 
23
- ### pnpm
17
+ The minimum installation for defining machines and actors:
24
18
 
25
19
  ```bash
26
- pnpm add @xmachines/play @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
20
+ npm install @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals xstate
27
21
  ```
28
22
 
29
- ### yarn
23
+ | Package | Role |
24
+ | ------------------------- | ----------------------------------------------------------- |
25
+ | `xstate` | XState v5 peer dependency — `setup`, `assign`, etc. |
26
+ | `@xmachines/play-xstate` | `definePlayer`, `formatPlayRouteTransitions`, `PlayerActor` |
27
+ | `@xmachines/play-actor` | `AbstractActor`, `typedSpec` — actor base class |
28
+ | `@xmachines/play-signals` | TC39 Signals polyfill, `watchSignal` |
30
29
 
31
- ```bash
32
- yarn add @xmachines/play @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
33
- ```
30
+ ### Minimal working example
34
31
 
35
- ## Package Selection Guide
36
-
37
- XMachines is a modular system of packages. Choose the packages based on your needs:
38
-
39
- ### Core Packages (Required)
40
-
41
- **@xmachines/play**
42
-
43
- - Foundation package with core protocols and contracts
44
- - Required by all other packages
45
-
46
- **@xmachines/play-actor**
47
-
48
- - Abstract actor base class extending XState Actor
49
- - Required for instantiating state machines
32
+ ```typescript
33
+ import { setup } from "xstate";
34
+ import { definePlayer } from "@xmachines/play-xstate";
50
35
 
51
- **@xmachines/play-signals**
36
+ const machine = setup({
37
+ types: {
38
+ context: {} as { count: number },
39
+ events: {} as { type: "increment" },
40
+ input: {} as undefined,
41
+ },
42
+ }).createMachine({
43
+ id: "counter",
44
+ initial: "idle",
45
+ context: { count: 0 },
46
+ states: {
47
+ idle: {},
48
+ },
49
+ });
52
50
 
53
- - TC39 Signals polyfill for reactive updates
54
- - Required for reactive state observation
51
+ const createPlayer = definePlayer({ machine });
52
+ const actor = createPlayer();
53
+ actor.start();
55
54
 
56
- **@xmachines/play-xstate**
55
+ console.log("✓ XMachines installed successfully");
56
+ console.log("Current state:", actor.getSnapshot().value);
57
57
 
58
- - XState v5 logic adapter with catalog binding
59
- - Required for state machine definitions
58
+ actor.stop();
59
+ ```
60
60
 
61
- **Minimal installation:**
61
+ Run with:
62
62
 
63
63
  ```bash
64
- npm install @xmachines/play @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
64
+ npx tsx my-script.ts
65
65
  ```
66
66
 
67
- ### UI and Routing (Optional)
68
-
69
- **@json-render/core** (external)
70
-
71
- - Component catalog and schema definition with Zod validation
72
- - Install if: Building declarative UI structures from state
73
-
74
- **@xmachines/play-router**
67
+ ## Framework-Specific Additions
75
68
 
76
- - Route tree protocol and machine crawler
77
- - Install if: Implementing logic-driven routing
78
-
79
- **@xmachines/play-tanstack-react-router**
80
-
81
- - TanStack Router adapter with signal observation
82
- - Install if: Using TanStack Router for navigation (React)
83
-
84
- **@xmachines/play-react**
85
-
86
- - React view renderer with JSON-Render
87
- - Install if: Building React applications
88
-
89
- > **Other frameworks:** Vue (`@xmachines/play-vue`, `@xmachines/play-vue-router`), SolidJS (`@xmachines/play-solid`, `@xmachines/play-solid-router`, `@xmachines/play-tanstack-solid-router`), and Vanilla DOM (`@xmachines/play-dom`) adapters are also available.
90
-
91
- ### Complete Installation
92
-
93
- For full-featured development with React and routing:
69
+ ### Vanilla DOM
94
70
 
95
71
  ```bash
96
- npm install @xmachines/play @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals @xmachines/play-router @xmachines/play-tanstack-react-router @xmachines/play-react @json-render/core @json-render/react
72
+ npm install @xmachines/play-dom @xmachines/play-dom-router @xmachines/play-router @json-render/core
97
73
  ```
98
74
 
99
- **See also:** [API Reference](../api/README.md) for detailed descriptions of each package.
100
-
101
- ## Environment-Specific Setup
75
+ | Package | Role |
76
+ | ---------------------------- | ------------------------------------------------------------------------- |
77
+ | `@xmachines/play-dom` | `connectRenderer`, `defineRegistry` |
78
+ | `@xmachines/play-dom-router` | `connectRouter`, `createBrowserHistory`, `createRouter`, `createRouteMap` |
79
+ | `@xmachines/play-router` | `extractMachineRoutes`, `getRoutableRoutes` |
80
+ | `@json-render/core` | Catalog and schema definitions (`defineCatalog`) |
102
81
 
103
- ### Browser (Vite, Webpack, or other bundlers)
82
+ ### React
104
83
 
105
- No special configuration needed. ESM imports work out of the box:
106
-
107
- ```typescript
108
- import { setup } from "xstate";
109
- import { definePlayer } from "@xmachines/play-xstate";
110
- import { Signal } from "@xmachines/play-signals";
84
+ ```bash
85
+ npm install @xmachines/play-react @xmachines/play-router @json-render/core @json-render/react
111
86
  ```
112
87
 
113
- Most modern bundlers (Vite, Webpack 5+, Rollup) handle ESM packages automatically.
114
-
115
- ### Node.js
116
-
117
- XMachines uses ESM (ECMAScript Modules) exclusively. Ensure your project is configured for ESM:
88
+ With routing:
118
89
 
119
- **Option 1: Set `"type": "module"` in package.json**
90
+ ```bash
91
+ # TanStack React Router
92
+ npm install @xmachines/play-tanstack-react-router @tanstack/react-router
120
93
 
121
- ```json
122
- {
123
- "type": "module",
124
- "dependencies": {
125
- "@xmachines/play": "^1.0.0"
126
- }
127
- }
94
+ # React Router v7
95
+ npm install @xmachines/play-react-router react-router
128
96
  ```
129
97
 
130
- **Option 2: Use `.mjs` file extensions**
98
+ | Package | Role |
99
+ | --------------------------------------- | ---------------------------------------------------------------- |
100
+ | `@xmachines/play-react` | `PlayRenderer`, `defineRegistry` |
101
+ | `@xmachines/play-tanstack-react-router` | `PlayRouterProvider`, `createRouteMapFromTree` |
102
+ | `@xmachines/play-react-router` | `PlayRouterProvider`, `createRouteMapFromTree` (React Router v7) |
131
103
 
132
- Alternatively, name your files with `.mjs` extension:
104
+ ### Vue 3
133
105
 
134
106
  ```bash
135
- node my-app.mjs
107
+ npm install @xmachines/play-vue @xmachines/play-vue-router @xmachines/play-router @json-render/core vue-router
136
108
  ```
137
109
 
138
- **Import example:**
110
+ | Package | Role |
111
+ | ---------------------------- | -------------------------------------- |
112
+ | `@xmachines/play-vue` | `PlayRenderer`, `defineRegistry` |
113
+ | `@xmachines/play-vue-router` | `PlayRouterProvider`, `createRouteMap` |
139
114
 
140
- ```typescript
141
- import { setup } from "xstate";
142
- import { definePlayer } from "@xmachines/play-xstate";
115
+ ### SolidJS
143
116
 
144
- const machine = setup({}).createMachine({
145
- id: "example",
146
- initial: "idle",
147
- states: {
148
- idle: { on: { START: "running" } },
149
- running: { on: { STOP: "idle" } },
150
- },
151
- });
117
+ ```bash
118
+ npm install @xmachines/play-solid @xmachines/play-router @json-render/core
152
119
 
153
- const createExample = definePlayer({ machine });
154
- const actor = createExample();
155
- actor.start();
120
+ # With router:
121
+ npm install @xmachines/play-solid-router @solidjs/router
122
+ # or TanStack:
123
+ npm install @xmachines/play-tanstack-solid-router @tanstack/solid-router
156
124
  ```
157
125
 
158
- ### Deno
126
+ | Package | Role |
127
+ | --------------------------------------- | ------------------------------------------------------- |
128
+ | `@xmachines/play-solid` | `PlayRenderer`, `defineRegistry` |
129
+ | `@xmachines/play-solid-router` | `PlayRouterProvider`, `createRouteMap` (SolidJS Router) |
130
+ | `@xmachines/play-tanstack-solid-router` | `PlayRouterProvider`, `createRouteMap` (TanStack Solid) |
159
131
 
160
- XMachines works with Deno via npm specifiers:
132
+ ### Svelte 5
161
133
 
162
- ```typescript
163
- import { setup } from "npm:xstate";
164
- import { definePlayer } from "npm:@xmachines/play-xstate";
165
- import { Signal } from "npm:@xmachines/play-signals";
134
+ ```bash
135
+ npm install @xmachines/play-svelte @xmachines/play-router @json-render/core
136
+
137
+ # With SvelteKit routing:
138
+ npm install @xmachines/play-sveltekit-router
139
+
140
+ # With svelte-spa-router (hash routing):
141
+ npm install @xmachines/play-svelte-spa-router
166
142
  ```
167
143
 
168
- ### TypeScript
144
+ | Package | Role |
145
+ | ----------------------------------- | ----------------------------------------------------- |
146
+ | `@xmachines/play-svelte` | `PlayRenderer`, `defineRegistry` |
147
+ | `@xmachines/play-sveltekit-router` | `connectRouter`, `createRouteMap` (SvelteKit) |
148
+ | `@xmachines/play-svelte-spa-router` | `connectRouter`, `createRouteMap` (svelte-spa-router) |
169
149
 
170
- XMachines is written in TypeScript and includes built-in type definitions. No separate `@types` package is needed.
150
+ ## TypeScript Configuration
171
151
 
172
- **Recommended tsconfig.json settings:**
152
+ All XMachines packages require TypeScript strict mode and ESM module resolution.
153
+
154
+ **Recommended `tsconfig.json`:**
173
155
 
174
156
  ```json
175
157
  {
@@ -185,133 +167,91 @@ XMachines is written in TypeScript and includes built-in type definitions. No se
185
167
  }
186
168
  ```
187
169
 
188
- **Key settings:**
189
-
190
- - **`moduleResolution: "bundler"`** (recommended) or `"node16"` for Node.js projects
191
- - **`strict: true`** enables full type checking
192
- - **`target: "ESNext"`** leverages modern JavaScript features
170
+ For Node.js projects (without a bundler), use `"moduleResolution": "node16"` or `"nodenext"`.
193
171
 
194
- **Type inference:**
195
-
196
- XMachines provides full type inference from machine definition through to components:
172
+ **ESM import extensions:** Always use `.js` extensions in TypeScript import paths, even when importing `.ts` source files:
197
173
 
198
174
  ```typescript
199
- import { setup } from "xstate";
200
- import { definePlayer } from "@xmachines/play-xstate";
201
-
202
- const machine = setup({}).createMachine({
203
- id: "typed",
204
- initial: "idle",
205
- context: { count: 0 },
206
- states: {
207
- idle: { on: { START: "running" } },
208
- running: { on: { STOP: "idle" } },
209
- },
210
- });
175
+ // Correct
176
+ import { authMachine } from "./auth-machine.js";
211
177
 
212
- const createTyped = definePlayer({ machine });
213
- const actor = createTyped();
214
- // Actor signals provide reactive type-safe state access
178
+ // Wrong will fail at runtime
179
+ import { authMachine } from "./auth-machine";
215
180
  ```
216
181
 
217
- ## Verifying Installation
182
+ **`package.json` for your project:**
218
183
 
219
- Test your installation with this simple script:
220
-
221
- **test.ts** (or test.js with `"type": "module"`):
222
-
223
- ```typescript
224
- import { setup } from "xstate";
225
- import { definePlayer } from "@xmachines/play-xstate";
226
-
227
- const machine = setup({}).createMachine({
228
- id: "test",
229
- initial: "ready",
230
- states: {
231
- ready: {},
232
- },
233
- });
234
-
235
- const createTest = definePlayer({ machine });
236
- const actor = createTest();
237
- actor.start();
238
-
239
- console.log("✓ XMachines installed successfully");
240
- console.log("Current state:", actor.getSnapshot().value);
184
+ ```json
185
+ {
186
+ "type": "module",
187
+ "dependencies": {
188
+ "@xmachines/play-xstate": "latest",
189
+ "@xmachines/play-actor": "latest",
190
+ "@xmachines/play-signals": "latest",
191
+ "xstate": "latest"
192
+ }
193
+ }
241
194
  ```
242
195
 
243
- **Run the test:**
244
-
245
- ```bash
246
- # TypeScript (requires tsx or ts-node)
247
- npx tsx test.ts
196
+ ## ESM Setup for Node.js
248
197
 
249
- # Or compile first
250
- npx tsc test.ts && node test.js
198
+ XMachines uses ESM exclusively. For Node.js:
251
199
 
252
- # JavaScript (with "type": "module")
253
- node test.js
200
+ ```json
201
+ {
202
+ "type": "module"
203
+ }
254
204
  ```
255
205
 
256
- **Expected output:**
206
+ Or use `.mjs` file extensions. Dynamic imports work in CommonJS contexts:
257
207
 
258
- ```
259
- XMachines installed successfully
260
- Current state: ready
208
+ ```javascript
209
+ const { definePlayer } = await import("@xmachines/play-xstate");
261
210
  ```
262
211
 
263
- ## Troubleshooting
264
-
265
- ### Module Not Found
212
+ ## Deno
266
213
 
267
- **Error:** `Cannot find module '@xmachines/play-xstate'`
268
-
269
- **Solutions:**
214
+ XMachines works with Deno via npm specifiers:
270
215
 
271
- - Verify package is installed: `npm list @xmachines/play-xstate`
272
- - Re-install dependencies: `npm install`
273
- - Check `node_modules/@xmachines/` directory exists
216
+ ```typescript
217
+ import { setup } from "npm:xstate";
218
+ import { definePlayer } from "npm:@xmachines/play-xstate";
219
+ ```
274
220
 
275
- ### ESM Import Errors
221
+ ## Troubleshooting
276
222
 
277
- **Error:** `SyntaxError: Cannot use import statement outside a module`
223
+ ### `Cannot find module '@xmachines/play-xstate'`
278
224
 
279
- **Solutions:**
225
+ ```bash
226
+ # Verify installation
227
+ npm list @xmachines/play-xstate
280
228
 
281
- - Add `"type": "module"` to package.json
282
- - Or rename files to `.mjs` extension
283
- - Or use dynamic import: `const { definePlayer } = await import('@xmachines/play-xstate')`
229
+ # Reinstall
230
+ npm install
231
+ ```
284
232
 
285
- ### Type Errors
233
+ ### `SyntaxError: Cannot use import statement outside a module`
286
234
 
287
- **Error:** `Could not find a declaration file for module '@xmachines/play-xstate'`
235
+ Add `"type": "module"` to your `package.json`, or rename files to `.mjs`.
288
236
 
289
- **Solutions:**
237
+ ### `Could not find a declaration file for module`
290
238
 
291
- - Types are built-in; no `@types` package needed
292
- - Check TypeScript version (4.5+ required)
293
- - Verify `moduleResolution` in tsconfig.json is set correctly
294
- - Try `npm install` again to ensure types are properly linked
239
+ Types are built-in no separate `@types/` package needed. Check:
295
240
 
296
- ### Version Mismatches
241
+ - `moduleResolution` in `tsconfig.json` is set to `"bundler"`, `"node16"`, or `"nodenext"`
242
+ - TypeScript version is 5.7+
243
+ - Run `npm install` again to ensure dist files are present
297
244
 
298
- **Error:** Type incompatibilities between packages
245
+ ### Type incompatibilities between packages
299
246
 
300
- **Solution:**
301
247
  Install all XMachines packages with matching major versions:
302
248
 
303
249
  ```bash
304
- npm install @xmachines/play@latest @xmachines/play-xstate@latest @xmachines/play-actor@latest @xmachines/play-signals@latest
250
+ npm install @xmachines/play-xstate@latest @xmachines/play-actor@latest @xmachines/play-signals@latest
305
251
  ```
306
252
 
307
253
  ## Next Steps
308
254
 
309
- Now that XMachines is installed, you're ready to build your first state machine:
310
-
311
- - **[Getting Started →](getting-started.md)** - Build your first state machine
312
- - **[API Reference](../api/README.md)** - Deep dive into each package
313
- - **[Examples](../examples/README.md)** - See XMachines in action
314
-
315
- ---
316
-
317
- **Need help?** Check the [API Reference](../api/README.md) for detailed information.
255
+ - **[Getting Started →](getting-started.md)** Build your first machine and actor
256
+ - **[Examples](../examples/README.md)** — Routing patterns, form validation, multi-router demos
257
+ - **[API Reference](../api/README.md)** Generated API docs for all packages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/docs",
3
- "version": "1.0.0-beta.25",
3
+ "version": "1.0.0-beta.27",
4
4
  "description": "Documentation for XMachines",
5
5
  "keywords": [
6
6
  "documentation",
@@ -48,7 +48,7 @@
48
48
  "typedoc": "typedoc"
49
49
  },
50
50
  "devDependencies": {
51
- "@xmachines/shared": "1.0.0-beta.25",
51
+ "@xmachines/shared": "1.0.0-beta.27",
52
52
  "oxfmt": "^0.43.0",
53
53
  "oxlint": "^1.57.0",
54
54
  "typedoc": "^0.28.18",
@@ -1,38 +0,0 @@
1
- [Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / extractParams
2
-
3
- # Function: extractParams()
4
-
5
- ```ts
6
- function extractParams(pathname, pattern): Record<string, string>;
7
- ```
8
-
9
- Defined in: [play-tanstack-react-router/src/extract-params.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-tanstack-react-router/src/extract-params.ts#L29)
10
-
11
- Extract route parameters from URL path based on route pattern using URLPattern API
12
-
13
- ## Parameters
14
-
15
- | Parameter | Type | Description |
16
- | ---------- | -------- | ---------------------------------------------------- |
17
- | `pathname` | `string` | Actual URL path (e.g., "/profile/123") |
18
- | `pattern` | `string` | Route pattern with params (e.g., "/profile/:userId") |
19
-
20
- ## Returns
21
-
22
- `Record`\<`string`, `string`\>
23
-
24
- Object with extracted parameters
25
-
26
- ## Example
27
-
28
- ```typescript
29
- extractParams("/profile/123", "/profile/:userId");
30
- // Returns: { userId: "123" }
31
-
32
- extractParams("/api/123", "/api/:id(\\d+)");
33
- // Returns: { id: "123" }
34
- // Validates numeric constraint via URLPattern
35
-
36
- extractParams("/docs/intro", "/docs/*");
37
- // Returns: { "0": "intro" }
38
- ```
@@ -1,33 +0,0 @@
1
- [Documentation](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / extractQueryParams
2
-
3
- # Function: extractQueryParams()
4
-
5
- ```ts
6
- function extractQueryParams(search): Record<string, string>;
7
- ```
8
-
9
- Defined in: [play-tanstack-react-router/src/extract-params.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.25/packages/play-tanstack-react-router/src/extract-params.ts#L68)
10
-
11
- Extract query parameters from search string
12
-
13
- ## Parameters
14
-
15
- | Parameter | Type | Description |
16
- | --------- | -------- | -------------------------------------------------------------------------------- |
17
- | `search` | `string` | Query string with or without leading ? (e.g., "?tab=settings" or "tab=settings") |
18
-
19
- ## Returns
20
-
21
- `Record`\<`string`, `string`\>
22
-
23
- Object mapping query parameter names to values
24
-
25
- ## Example
26
-
27
- ```typescript
28
- extractQueryParams("?tab=settings&theme=dark");
29
- // Returns: { tab: "settings", theme: "dark" }
30
-
31
- extractQueryParams("q=hello%20world");
32
- // Returns: { q: "hello world" } (auto-decoded)
33
- ```