@xmachines/docs 1.0.0-beta.46 → 1.0.0-beta.48

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 (346) hide show
  1. package/README.md +135 -7
  2. package/api/@xmachines/play/README.md +134 -57
  3. package/api/@xmachines/play/classes/NonNullableError.md +4 -4
  4. package/api/@xmachines/play/classes/PlayError.md +4 -4
  5. package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
  7. package/api/@xmachines/play-actor/README.md +130 -155
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
  9. package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
  10. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
  11. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
  12. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
  13. package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
  14. package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
  15. package/api/@xmachines/play-dom/README.md +140 -232
  16. package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
  17. package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
  18. package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
  19. package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
  20. package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
  21. package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
  22. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
  23. package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +13 -13
  24. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +6 -6
  25. package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
  26. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +12 -12
  27. package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
  28. package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
  29. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
  30. package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +5 -5
  31. package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
  32. package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
  33. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
  34. package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
  35. package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
  36. package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
  37. package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
  38. package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
  39. package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
  40. package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
  41. package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
  42. package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
  43. package/api/@xmachines/play-dom/variables/schema.md +1 -1
  44. package/api/@xmachines/play-dom-router/README.md +160 -158
  45. package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
  46. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
  47. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
  48. package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
  49. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
  50. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
  51. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
  52. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
  53. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
  54. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
  55. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
  56. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
  57. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
  58. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
  59. package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
  60. package/api/@xmachines/play-react/README.md +109 -320
  61. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
  62. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  63. package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
  64. package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
  65. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
  66. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
  67. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
  68. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
  69. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
  70. package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
  71. package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
  72. package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
  73. package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
  74. package/api/@xmachines/play-react-router/README.md +107 -124
  75. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
  76. package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
  77. package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
  78. package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
  79. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
  80. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
  81. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
  82. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
  83. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
  84. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
  85. package/api/@xmachines/play-router/README.md +235 -475
  86. package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
  87. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
  88. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
  89. package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
  90. package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
  91. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
  92. package/api/@xmachines/play-router/functions/createRouteMatcher.md +1 -1
  93. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
  94. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
  95. package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
  96. package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
  97. package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
  98. package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
  99. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
  100. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
  101. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
  102. package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
  103. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  104. package/api/@xmachines/play-router/functions/routeExists.md +1 -1
  105. package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
  106. package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
  107. package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
  108. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  109. package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
  110. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
  111. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
  112. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
  113. package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
  114. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
  115. package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
  116. package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
  117. package/api/@xmachines/play-router/interfaces/RouteMatcher.md +4 -4
  118. package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
  119. package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
  120. package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
  121. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
  122. package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
  123. package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
  124. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
  125. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
  126. package/api/@xmachines/play-signals/README.md +105 -73
  127. package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
  128. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
  129. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
  130. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
  131. package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
  132. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
  133. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
  134. package/api/@xmachines/play-solid/README.md +117 -263
  135. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  136. package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
  137. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
  138. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
  139. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
  140. package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
  141. package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
  142. package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
  143. package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
  144. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
  145. package/api/@xmachines/play-solid-router/README.md +93 -606
  146. package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
  147. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
  148. package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
  149. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
  150. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
  151. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
  152. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  153. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
  154. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
  155. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
  156. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
  157. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
  158. package/api/@xmachines/play-svelte/README.md +111 -103
  159. package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
  160. package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
  161. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
  162. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  163. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
  164. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
  165. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
  166. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
  167. package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +1 -1
  168. package/api/@xmachines/play-svelte-spa-router/README.md +156 -17
  169. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
  170. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
  171. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
  172. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
  173. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
  174. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
  175. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
  176. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
  177. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
  178. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  179. package/api/@xmachines/play-sveltekit-router/README.md +168 -17
  180. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
  181. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
  182. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
  183. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
  184. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
  185. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
  186. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
  187. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
  188. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
  189. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  190. package/api/@xmachines/play-tanstack-react-router/README.md +147 -122
  191. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
  192. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
  193. package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
  194. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
  195. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
  196. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
  197. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
  198. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
  199. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
  200. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
  201. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
  202. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
  203. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  204. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
  205. package/api/@xmachines/play-tanstack-solid-router/README.md +195 -173
  206. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
  207. package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
  208. package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
  209. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
  210. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
  211. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  212. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
  213. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
  214. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
  215. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
  216. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  217. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
  218. package/api/@xmachines/play-vue/README.md +126 -271
  219. package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
  220. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
  221. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  222. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
  223. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
  224. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
  225. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
  226. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  227. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  228. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  229. package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
  230. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  231. package/api/@xmachines/play-vue-router/README.md +148 -528
  232. package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
  233. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
  234. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
  235. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
  236. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
  237. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
  238. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
  239. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
  240. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
  241. package/api/@xmachines/play-xstate/README.md +167 -496
  242. package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
  243. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
  244. package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
  245. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
  246. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
  247. package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
  248. package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
  249. package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
  250. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
  251. package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
  252. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
  253. package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
  254. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
  255. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
  256. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
  257. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
  258. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
  259. package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
  260. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
  261. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
  262. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
  263. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
  264. package/api/@xmachines/shared/README.md +81 -294
  265. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  266. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  267. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  268. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  269. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  270. package/examples/@xmachines/play-dom-demo/README.md +3 -3
  271. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
  272. package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
  273. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
  274. package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
  275. package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
  276. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
  277. package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
  278. package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
  279. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
  280. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
  281. package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
  282. package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
  283. package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
  284. package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
  285. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
  286. package/examples/@xmachines/play-dom-router-demo/README.md +2 -2
  287. package/examples/@xmachines/play-react-demo/README.md +1 -1
  288. package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
  289. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
  290. package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
  291. package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
  292. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
  293. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
  294. package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
  295. package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
  296. package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
  297. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
  298. package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
  299. package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
  300. package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
  301. package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
  302. package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
  303. package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
  304. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
  305. package/examples/@xmachines/play-react-router-demo/README.md +1 -1
  306. package/examples/@xmachines/play-solid-demo/README.md +1 -1
  307. package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
  308. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
  309. package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
  310. package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
  311. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
  312. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
  313. package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
  314. package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
  315. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
  316. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
  317. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
  318. package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
  319. package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
  320. package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
  321. package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
  322. package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
  323. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
  324. package/examples/@xmachines/play-svelte-demo/README.md +1 -1
  325. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
  326. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
  327. package/examples/@xmachines/play-svelte-spa-router-demo/README.md +2 -2
  328. package/examples/@xmachines/play-sveltekit-router-demo/README.md +2 -2
  329. package/examples/@xmachines/play-vue-demo/README.md +1 -1
  330. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
  331. package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
  332. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
  333. package/examples/README.md +24 -25
  334. package/examples/form-validation.md +2 -2
  335. package/guides/README.md +7 -7
  336. package/guides/actor-model.md +18 -18
  337. package/guides/architecture.md +500 -0
  338. package/guides/configuration.md +556 -0
  339. package/guides/deployment.md +336 -0
  340. package/guides/development.md +617 -0
  341. package/guides/getting-started.md +351 -142
  342. package/guides/signals.md +19 -19
  343. package/guides/state-machines.md +16 -16
  344. package/guides/testing.md +460 -0
  345. package/package.json +5 -5
  346. package/guides/installation.md +0 -257
@@ -1,174 +1,56 @@
1
1
  [API](../../README.md) / @xmachines/play-react
2
2
 
3
+ <!-- generated-by: gsd-doc-writer -->
4
+
3
5
  # @xmachines/play-react
4
6
 
5
- **React renderer for XMachines Play Architecture**
7
+ React renderer for XMachines Play architecture with signal-driven rendering.
6
8
 
7
- Bridges TC39 Signal-driven actors to React's render cycle. Business logic stays in the actor; React is purely a rendering target.
9
+ Part of the [xmachines-js monorepo](../../README.md).
8
10
 
9
- ## Overview
11
+ ## Installation
10
12
 
11
- `@xmachines/play-react` provides `PlayRenderer`, a React component that:
13
+ ```bash
14
+ npm install @xmachines/play-react
15
+ ```
16
+
17
+ **Peer dependencies** (must be installed separately):
12
18
 
13
- - Subscribes to `actor.currentView` (TC39 Signal) and re-renders on every state transition
14
- - Renders the current view's JSON spec via `@json-render/react`
15
- - Routes action names from spec elements to `actor.send()` via the `actions` prop
16
- - Manages per-view UI state in an `@xstate/store` atom (automatic or caller-supplied)
19
+ ```bash
20
+ npm install react react-dom xstate @xstate/store @json-render/react @json-render/core @json-render/xstate
21
+ ```
17
22
 
18
- Per [Play RFC](../../../rfc/play.md):
23
+ Supported versions:
19
24
 
20
- - **Actor Authority (INV-01):** Guards in the machine decide all state transitions
21
- - **Passive Infrastructure (INV-04):** React observes signals and dispatches events — never decides
22
- - **Signal-Only Reactivity (INV-05):** `actor.currentView` signal is the sole render trigger
25
+ - `react` / `react-dom`: `^18.0.0 || ^19.0.0`
26
+ - `xstate`: `^5.30.0`
27
+ - `@xstate/store`: `^3.17.0`
28
+ - `@json-render/*`: `^0.18.0`
23
29
 
24
- ## Installation
30
+ ## Usage
25
31
 
26
- ```bash
27
- npm install @xmachines/play-react
28
- npm install @json-render/react @json-render/core # peer deps
29
- npm install @json-render/xstate @xstate/store # store integration
30
- ```
32
+ ### Standard usage — `PlayUIProvider` + `PlayRenderer`
31
33
 
32
- In this monorepo, the root install applies a `patch-package` patch to `@json-render/react`
33
- so `defineRegistry(..., { onRenderError })` can intercept inner element-boundary errors
34
- without muting console output.
35
-
36
- ## Current Exports
37
-
38
- - `PlayRenderer` — main renderer component
39
- - `useActor` — hook for accessing the actor inside a `PlayRenderer` tree
40
- - `useSignalEffect` — React hook for subscribing to TC39 Signals
41
- - `PlayErrorBoundary` — error boundary wrapping renderer output
42
- - `defineRegistry` — re-exported from `@json-render/react`
43
- - `useBoundProp` — re-exported from `@json-render/react`
44
- - `ComponentFn` (type) — re-exported from `@json-render/react`
45
- - `ComponentContext` (type) — re-exported from `@json-render/react`
46
- - `ActorProvider` — escape hatch primitive (owns actor bridging, signal bridge, store lifecycle)
47
- - `PlayUIProvider` — batteries-included composite (wraps `ActorProvider` + `JSONUIProvider`)
48
- - `usePlayView` — hook for accessing the current view spec inside a provider tree
49
- - `RenderErrorHandler` (type) — inner per-element error callback signature
50
- - `ActorProviderProps` (type)
51
- - `ViewContextValue` (type)
52
- - `PlayActor` (type)
53
-
54
- ## Quick Start
34
+ The recommended pattern for actor-driven React rendering:
55
35
 
56
36
  ```tsx
57
- import { definePlayer, formatPlayRouteTransitions } from "@xmachines/play-xstate";
58
- import { PlayUIProvider, PlayRenderer } from "@xmachines/play-react";
59
- import { defineCatalog } from "@json-render/core";
60
- import { defineRegistry } from "@xmachines/play-react";
61
- import type { ComponentFn } from "@xmachines/play-react";
62
- import { setup, assign } from "xstate";
63
- import { z } from "zod";
64
-
65
- // 1. Define catalog — the contract between machine spec and UI components
66
- const catalog = defineCatalog({
67
- elements: {
68
- Login: { props: z.object({ title: z.string() }), description: "Login form" },
69
- Dashboard: { props: z.object({ username: z.string() }), description: "Dashboard" },
70
- },
71
- });
37
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-react";
38
+ import { definePlayer } from "@xmachines/play-xstate";
72
39
 
73
- // 2. Implement components using ComponentFn — typed against catalog entries
74
- const Login: ComponentFn<typeof catalog, "Login"> = ({ props, emit }) => (
75
- <form
76
- onSubmit={(e) => {
77
- e.preventDefault();
78
- emit("submit");
79
- }}
80
- >
81
- <h2>{props.title}</h2>
82
- <button type="submit">Log In</button>
83
- </form>
84
- );
85
-
86
- const Dashboard: ComponentFn<typeof catalog, "Dashboard"> = ({ props }) => (
87
- <div>Welcome, {props.username}!</div>
88
- );
89
-
90
- // 3. Build registry — wires components to catalog and declares action handlers
91
- const registryResult = defineRegistry(catalog, {
40
+ // 1. Create and start the actor
41
+ const actor = definePlayer({ machine: myMachine })();
42
+ actor.start();
43
+
44
+ // 2. Define the component registry with action handlers
45
+ const registryResult = defineRegistry(myCatalog, {
92
46
  components: { Login, Dashboard },
93
47
  actions: {
94
- login: async (params) => {
95
- if (!params) return;
96
- actor.send({ type: "auth.login", username: params.username });
97
- },
98
- logout: async () => {
99
- actor.send({ type: "auth.logout" });
100
- },
48
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
49
+ logout: async () => actor.send({ type: "auth.logout" }),
101
50
  },
102
51
  });
103
52
 
104
- // 4. Define machine with view metadata
105
- const machine = setup({
106
- types: {
107
- context: {} as {
108
- isAuthenticated: boolean;
109
- username: string | null;
110
- params: Record<string, string>;
111
- query: Record<string, string>;
112
- },
113
- events: {} as
114
- | { type: "auth.login"; username: string }
115
- | { type: "auth.logout" }
116
- | { type: "play.route"; to: string; params?: Record<string, string> },
117
- },
118
- }).createMachine(
119
- formatPlayRouteTransitions({
120
- id: "app",
121
- initial: "login",
122
- context: { isAuthenticated: false, username: null, params: {}, query: {} },
123
- states: {
124
- login: {
125
- id: "login",
126
- meta: {
127
- route: "/login",
128
- view: {
129
- root: "root",
130
- elements: {
131
- root: { type: "Login", props: { title: "Sign In" }, children: [] },
132
- },
133
- },
134
- },
135
- },
136
- dashboard: {
137
- id: "dashboard",
138
- meta: {
139
- route: "/dashboard",
140
- view: {
141
- root: "root",
142
- elements: {
143
- root: { type: "Dashboard", props: { username: "" }, children: [] },
144
- },
145
- },
146
- },
147
- },
148
- },
149
- on: {
150
- "auth.login": {
151
- target: ".dashboard",
152
- guard: ({ context }) => !context.isAuthenticated,
153
- actions: assign({
154
- isAuthenticated: true,
155
- username: ({ event }) => event.username,
156
- }),
157
- },
158
- "auth.logout": {
159
- target: ".login",
160
- guard: ({ context }) => context.isAuthenticated,
161
- actions: assign({ isAuthenticated: false, username: null }),
162
- },
163
- },
164
- }),
165
- );
166
-
167
- // 5. Create actor and render
168
- const createPlayer = definePlayer({ machine });
169
- const actor = createPlayer();
170
- actor.start();
171
-
53
+ // 3. Render signals drive view transitions automatically
172
54
  function App() {
173
55
  return (
174
56
  <PlayUIProvider actor={actor} registryResult={registryResult}>
@@ -178,232 +60,139 @@ function App() {
178
60
  }
179
61
  ```
180
62
 
181
- ## API Reference
182
-
183
- ### `PlayUIProvider`
63
+ ### With optional `JSONUIProvider` props
184
64
 
185
- Batteries-included composite provider. Wraps `ActorProvider` + `JSONUIProvider`. Pass `actor` and `registryResult` here, then place `<PlayRenderer />` inside as a zero-prop child.
65
+ Pass navigation and validation helpers through `PlayUIProvider`:
186
66
 
187
67
  ```tsx
188
68
  <PlayUIProvider
189
- actor={actor} // required
190
- registryResult={registryResult} // required
191
- store={myStore} // optional — controlled mode
192
- fallback={<p>Loading…</p>} // optional
193
- onError={(err, info) => Sentry.captureException(err, { extra: info })} // optional
194
- onRenderError={(error, elementType) => console.warn(`<${elementType}> crashed:`, error)} // optional
195
- >
196
- <PlayRenderer />
197
- </PlayUIProvider>
198
- ```
199
-
200
- **`actor`** — A `PlayerActor` (or any `AbstractActor & Viewable`). Provides the `currentView` signal.
201
-
202
- **`registryResult`** — Full result from `defineRegistry(catalog, { components, actions })`. Contains both the component registry and action handlers.
203
-
204
- **`store`** (optional) — Controls per-view UI state (form values, `$state` bindings):
205
-
206
- - **Omitted (uncontrolled, default):** A fresh `@xstate/store` atom is created per view transition, seeded from `view.spec.state`. The atom resets automatically on each state transition.
207
- - **Provided (controlled):** The caller owns the store lifecycle. `spec.state` is ignored.
208
-
209
- ```tsx
210
- import { createAtom } from "@xstate/store";
211
- import { xstateStoreStateStore } from "@json-render/xstate";
212
- import type { StateStore } from "@json-render/core";
213
-
214
- const store: StateStore = xstateStoreStateStore({ atom: createAtom({ username: "alice" }) });
215
-
216
- <PlayUIProvider actor={actor} registryResult={registryResult} store={store}>
217
- <PlayRenderer />
218
- </PlayUIProvider>;
219
- ```
220
-
221
- **`fallback`** — Shown when `actor.currentView.get()` is `null` (machine in a no-view state, or during initialisation).
222
-
223
- **`onError`** — Called when the outer `PlayErrorBoundary` catches an error. Receives `(error: Error, info: React.ErrorInfo)`. Use for observability tools (Sentry, Datadog, etc.).
224
-
225
- **`onRenderError`** — Called when an individual catalog component throws during render. Caught by `@json-render/react`'s inner per-element boundary — the failed component is silently removed while the rest of the spec continues rendering. `onError` / `fallback` are **not** triggered. When both `onRenderError` on `PlayUIProvider` and on `defineRegistry` are set, the prop wins.
226
-
227
- ---
228
-
229
- ### `ActorProvider`
230
-
231
- Escape hatch primitive. Owns actor bridging, signal bridge, and store lifecycle. Use this when you need direct control over the provider layer (e.g. custom `JSONUIProvider` configuration).
232
-
233
- ```tsx
234
- import { ActorProvider } from "@xmachines/play-react";
235
-
236
- <ActorProvider
237
69
  actor={actor}
238
70
  registryResult={registryResult}
239
- onRenderError={(err, type) => reportError(err, type)}
71
+ navigate={(path) => router.push(path)}
72
+ validationFunctions={{ isEmail: (v) => /^.+@.+$/.test(String(v)) }}
240
73
  >
241
- {/* your own JSONUIProvider + PlayRenderer tree */}
242
- </ActorProvider>;
243
- ```
244
-
245
- ---
246
-
247
- ### `PlayRenderer`
248
-
249
- Zero-prop leaf component. Must be rendered inside a `PlayUIProvider` (or `ActorProvider`) tree. Subscribes to `actor.currentView` via context and renders the current spec.
250
-
251
- ```tsx
252
- <PlayUIProvider actor={actor} registryResult={registryResult}>
253
74
  <PlayRenderer />
254
75
  </PlayUIProvider>
255
76
  ```
256
77
 
257
- `PlayRenderer` accepts no props all configuration (`actor`, `registryResult`, `store`, `fallback`, `onError`, `onRenderError`) is provided by the enclosing `PlayUIProvider` or `ActorProvider`.
258
-
259
- ## Error handling
260
-
261
- The provider tree has two layers of error boundaries:
78
+ ### Escape hatchcustom provider composition
262
79
 
263
- ### Outer boundary `onError` and `fallback`
264
-
265
- Wraps the entire renderer output via `PlayErrorBoundary`. Triggered when the spec or store setup throws, or when the inner boundary is not present.
80
+ Use `ActorProvider` directly when you need to compose providers manually:
266
81
 
267
82
  ```tsx
268
- <PlayUIProvider
269
- actor={actor}
270
- registryResult={registryResult}
271
- fallback={<p>Something went wrong.</p>}
272
- onError={(err, info) => Sentry.captureException(err, { extra: info })}
273
- >
274
- <PlayRenderer />
275
- </PlayUIProvider>
276
- ```
277
-
278
- ### Inner boundary — `onRenderError`
279
-
280
- Each catalog element is individually wrapped in an error boundary by `@json-render/react`. When a component throws, it is silently removed while the rest of the spec continues rendering. The outer boundary is **not** triggered.
281
-
282
- Pass `onRenderError` to `PlayUIProvider` (or `ActorProvider`) — overrides any registry-level handler — or bake it into `defineRegistry`:
83
+ import { ActorProvider, JSONUIProvider, PlayRenderer } from "@xmachines/play-react";
283
84
 
284
- ```tsx
285
- // via PlayUIProvider prop
286
- <PlayUIProvider
287
- actor={actor}
288
- registryResult={registryResult}
289
- onRenderError={(error, elementType) => {
290
- console.warn(`<${elementType}> crashed:`, error);
291
- }}
292
- >
293
- <PlayRenderer />
294
- </PlayUIProvider>
295
- ```
296
-
297
- ```ts
298
- // via defineRegistry — bakes the handler into the registry
299
- const registryResult = defineRegistry(catalog, {
300
- components: { Login, Dashboard },
301
- actions: { login: async (params) => { ... }, logout: async () => { ... } },
302
- onRenderError(error, elementType) {
303
- reportExpectedRenderError(error, elementType);
304
- },
305
- });
85
+ <ActorProvider actor={actor} registryResult={registryResult}>
86
+ <JSONUIProvider registry={registryResult.registry}>
87
+ <PlayRenderer />
88
+ </JSONUIProvider>
89
+ </ActorProvider>;
306
90
  ```
307
91
 
308
- `onRenderError` is typed as `RenderErrorHandler` and exported from.
309
-
310
- ---
311
-
312
- ### `useActor`
313
-
314
- Hook for accessing the actor from inside any component rendered by `PlayRenderer`. No prop drilling needed.
92
+ ### Accessing the actor from inside the tree
315
93
 
316
94
  ```tsx
317
95
  import { useActor } from "@xmachines/play-react";
318
96
 
319
- // Works in any component rendered inside PlayRenderer:
320
- function LogoutButton() {
97
+ function SubmitButton() {
321
98
  const actor = useActor();
322
- return <button onClick={() => actor.send({ type: "auth.logout" })}>Log Out</button>;
99
+ return <button onClick={() => actor.send({ type: "SUBMIT" })}>Submit</button>;
323
100
  }
324
101
  ```
325
102
 
326
- Throws `NonNullableError: "useActor() must be called inside <ActorProvider> (or <PlayUIProvider>)"` if called outside the tree.
327
-
328
- ---
329
-
330
- ### `useSignalEffect`
331
-
332
- Hook for subscribing to TC39 Signals in React components that live outside a `PlayRenderer` tree (e.g. nav bars, status indicators driven by actor state).
103
+ ### Subscribing to signals directly
333
104
 
334
105
  ```tsx
335
106
  import { useSignalEffect } from "@xmachines/play-react";
336
107
 
337
- function NavBar({ actor }: { actor: ReturnType<typeof createPlayer> }) {
338
- const [isAuth, setIsAuth] = useState(false);
108
+ function MyComponent({ actor }) {
109
+ const [view, setView] = useState(null);
339
110
 
340
111
  useSignalEffect(() => {
341
- const snap = actor.state.get();
342
- setIsAuth((snap.context as { isAuthenticated: boolean }).isAuthenticated);
112
+ setView(actor.currentView.get());
343
113
  });
344
114
 
345
- return <nav>{isAuth ? <LogoutBtn /> : <LoginBtn />}</nav>;
115
+ return <div>{view?.component}</div>;
346
116
  }
347
117
  ```
348
118
 
349
- ---
119
+ ## API Summary
350
120
 
351
- ### `PlayErrorBoundary`
121
+ ### Components
352
122
 
353
- Class error boundary that wraps the rendered output. `PlayRenderer` wraps its own output in this boundary automatically — use this directly only if you need to wrap other content or nest boundaries manually.
123
+ | Export | Description |
124
+ | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
125
+ | `<PlayUIProvider>` | Batteries-included provider: wraps `ActorProvider` + `JSONUIProvider`. Standard entry point. |
126
+ | `<PlayRenderer>` | Zero-prop leaf component. Reads the current actor view from context and renders it. Must be inside `PlayUIProvider` or `ActorProvider`. |
127
+ | `<ActorProvider>` | Escape-hatch primitive. Owns actor bridging, signal subscription, and per-view `StateStore` lifecycle. |
128
+ | `<PlayErrorBoundary>` | React class error boundary for catching catalog component render errors. |
354
129
 
355
- `componentDidCatch` invokes the `onError` prop (for observability tools) but does **not** re-throw — re-throwing from `componentDidCatch` can unmount the entire React 19 root. `getDerivedStateFromError` handles fallback state transition instead.
130
+ ### Hooks
356
131
 
357
- ```tsx
358
- import { PlayErrorBoundary } from "@xmachines/play-react";
132
+ | Export | Description |
133
+ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
134
+ | `useSignalEffect(callback)` | Subscribes to TC39 signal changes; re-runs the callback and forces a React re-render when any accessed signal changes. Cleanup is automatic on unmount. |
135
+ | `useActor()` | Returns the raw actor instance. Must be called inside an `ActorProvider`/`PlayUIProvider` tree. |
136
+ | `usePlayView()` | Returns `{ spec, handlers, registry, store }` for the current view. Must be called inside an `ActorProvider`/`PlayUIProvider` tree. |
359
137
 
360
- <PlayErrorBoundary
361
- fallback={<p>Something went wrong.</p>}
362
- onError={(err, info) => Sentry.captureException(err, { extra: info })}
363
- >
364
- <PlayUIProvider actor={actor} registryResult={registryResult}>
365
- <PlayRenderer />
366
- </PlayUIProvider>
367
- </PlayErrorBoundary>;
368
- ```
138
+ ### Types
369
139
 
370
- ---
140
+ | Export | Description |
141
+ | ------------------------ | ---------------------------------------------------------------------------------------------- |
142
+ | `PlayUIProviderProps` | Props for `<PlayUIProvider>` |
143
+ | `ActorProviderProps` | Props for `<ActorProvider>` (also exported as `PlayRendererProps` for migration compatibility) |
144
+ | `PlayErrorBoundaryProps` | Props for `<PlayErrorBoundary>` |
145
+ | `PlayErrorBoundaryState` | State shape for `<PlayErrorBoundary>` |
146
+ | `PlayActor` | Type alias for `AbstractActor<AnyActorLogic>` |
147
+ | `ViewContextValue` | Value shape returned by `usePlayView()` |
148
+ | `RenderErrorHandler` | Error handler callback type for render errors |
371
149
 
372
- ## Route Parameters in Props
150
+ ### Re-exports from `@json-render/react`
373
151
 
374
- When using `formatPlayRouteTransitions`, URL path parameters flow automatically into component props. Declare an `undefined` slot in the spec to opt in:
152
+ `@xmachines/play-react` re-exports the full `@json-render/react` surface so consumers only need one import:
375
153
 
376
154
  ```ts
377
- // spec: { section: undefined, user: "alice" }
378
- // After play.route to /settings/profile → context.params = { section: "profile" }
379
- // Component receives: { section: "profile", user: "alice" }
155
+ import {
156
+ defineRegistry,
157
+ useBoundProp,
158
+ JSONUIProvider,
159
+ StateProvider,
160
+ ActionProvider,
161
+ VisibilityProvider,
162
+ ValidationProvider,
163
+ Renderer,
164
+ } from "@xmachines/play-react";
380
165
  ```
381
166
 
382
- Priority: **route param fills `undefined` slots; explicit non-`undefined` spec props always win.**
167
+ ## Key Principle
383
168
 
384
- ---
169
+ React state is **never** used for business logic — only for triggering React's render cycle. Signals (`@xmachines/play-signals`) are the source of truth. `PlayUIProvider` passively observes actor signals via `useSignalEffect` and re-renders when the current view changes. Rapid signal updates are batched via microtasks to prevent unnecessary React renders.
385
170
 
386
- ## Error Handling
171
+ ## Testing
387
172
 
388
- | Error | Cause | Fix |
389
- | ------------------------------------------------------------------------ | ---------------------------- | ---------------------------------------------------------------- |
390
- | `useActor() must be called inside <ActorProvider> (or <PlayUIProvider>)` | Hook called outside the tree | Wrap with `<PlayUIProvider>` or `<ActorProvider>` |
391
- | Component render error | Component throws | `PlayErrorBoundary` catches it; inspect component implementation |
173
+ Run unit tests (jsdom environment):
392
174
 
393
- ---
175
+ ```bash
176
+ npm test -w @xmachines/play-react
177
+ ```
178
+
179
+ Run tests with coverage:
394
180
 
395
- ## Architecture Notes
181
+ ```bash
182
+ npm run test:coverage -w @xmachines/play-react
183
+ ```
184
+
185
+ Run browser integration tests (requires Chromium):
186
+
187
+ ```bash
188
+ npm run test:browser -w @xmachines/play-react
189
+ ```
396
190
 
397
- - React `useState` is **only** used to trigger re-renders — never for business logic
398
- - `actor.currentView` (TC39 Signal) is the sole render trigger; `PlayRenderer` is a passive observer
399
- - Per-view UI state lives in an `@xstate/store` atom, not in React state
400
- - `@json-render/react` drives rendering; `PlayRenderer` is the signal bridge — import `defineRegistry`, `ComponentFn`, `ComponentContext`, and `useBoundProp` from
191
+ Coverage thresholds: 80% lines, functions, branches, and statements.
401
192
 
402
- ## Learn More
193
+ ## License
403
194
 
404
- - [Demo](../../../examples/@xmachines/play-react-demo/README.md)
405
- - [React Router adapter](../play-react-router/README.md)
406
- - [TanStack React Router adapter](../play-tanstack-react-router/README.md)
195
+ MIT — see [LICENSE](./LICENSE).
407
196
 
408
197
  @xmachines/play-react - React renderer for XMachines Play architecture
409
198
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Class: PlayErrorBoundary
4
4
 
5
- Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/PlayErrorBoundary.tsx#L53)
5
+ Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/PlayErrorBoundary.tsx#L53)
6
6
 
7
7
  React class component error boundary for catching catalog component render errors.
8
8
 
@@ -36,7 +36,7 @@ Per CONS-14: Class component pattern works with all React versions (18 and 19).
36
36
  new PlayErrorBoundary(props): PlayErrorBoundary;
37
37
  ```
38
38
 
39
- Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/PlayErrorBoundary.tsx#L57)
39
+ Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/PlayErrorBoundary.tsx#L57)
40
40
 
41
41
  #### Parameters
42
42
 
@@ -75,7 +75,7 @@ React.Component<
75
75
  componentDidCatch(error, info): void;
76
76
  ```
77
77
 
78
- Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/PlayErrorBoundary.tsx#L66)
78
+ Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/PlayErrorBoundary.tsx#L66)
79
79
 
80
80
  Catches exceptions generated in descendant components. Unhandled exceptions will cause
81
81
  the entire component tree to unmount.
@@ -375,7 +375,7 @@ React.Component.getSnapshotBeforeUpdate;
375
375
  render(): ReactNode;
376
376
  ```
377
377
 
378
- Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/PlayErrorBoundary.tsx#L70)
378
+ Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/PlayErrorBoundary.tsx#L70)
379
379
 
380
380
  #### Returns
381
381
 
@@ -604,7 +604,7 @@ React.Component.UNSAFE_componentWillUpdate;
604
604
  static getDerivedStateFromError(error): PlayErrorBoundaryState;
605
605
  ```
606
606
 
607
- Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/PlayErrorBoundary.tsx#L62)
607
+ Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/PlayErrorBoundary.tsx#L62)
608
608
 
609
609
  #### Parameters
610
610
 
@@ -6,7 +6,7 @@
6
6
  function useActor(): PlayActor;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-react/src/useActor.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/useActor.ts#L31)
9
+ Defined in: [packages/play-react/src/useActor.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/useActor.ts#L31)
10
10
 
11
11
  ## Returns
12
12
 
@@ -6,7 +6,7 @@
6
6
  function usePlayView(): ViewContextValue;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-react/src/ActorProvider.tsx:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/ActorProvider.tsx#L72)
9
+ Defined in: [packages/play-react/src/ActorProvider.tsx:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/ActorProvider.tsx#L72)
10
10
 
11
11
  Hook to access the current view spec, handlers, and registry.
12
12
 
@@ -6,7 +6,7 @@
6
6
  function useSignalEffect(callback): void;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-react/src/useSignalEffect.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/useSignalEffect.ts#L71)
9
+ Defined in: [packages/play-react/src/useSignalEffect.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/useSignalEffect.ts#L71)
10
10
 
11
11
  React hook that subscribes to signal changes and runs effect callback
12
12
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: ActorProviderProps
4
4
 
5
- Defined in: [packages/play-react/src/ActorProvider.tsx:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/ActorProvider.tsx#L31)
5
+ Defined in: [packages/play-react/src/ActorProvider.tsx:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/ActorProvider.tsx#L31)
6
6
 
7
7
  Props for the ActorProvider component.
8
8
 
@@ -18,10 +18,10 @@ Props for the ActorProvider component.
18
18
 
19
19
  | Property | Type | Description | Inherited from | Defined in |
20
20
  | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
- | <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability). | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-actor/src/abstract-actor.ts#L154) |
22
- | <a id="property-children"></a> `children` | `ReactNode` | Child components to render inside the provider tree | - | [packages/play-react/src/ActorProvider.tsx:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/ActorProvider.tsx#L37) |
23
- | <a id="property-fallback"></a> `fallback?` | `ReactNode` | Optional component shown when currentView is null or a catalog component throws | - | [packages/play-react/src/ActorProvider.tsx:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/ActorProvider.tsx#L33) |
24
- | <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | Optional error handler callback invoked when a catalog component throws during render | - | [packages/play-react/src/ActorProvider.tsx:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-react/src/ActorProvider.tsx#L35) |
25
- | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-actor/src/abstract-actor.ts#L167) |
26
- | <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-actor/src/abstract-actor.ts#L156) |
27
- | <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.46/packages/play-actor/src/abstract-actor.ts#L162) |
21
+ | <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability). | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L154) |
22
+ | <a id="property-children"></a> `children` | `ReactNode` | Child components to render inside the provider tree | - | [packages/play-react/src/ActorProvider.tsx:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/ActorProvider.tsx#L37) |
23
+ | <a id="property-fallback"></a> `fallback?` | `ReactNode` | Optional component shown when currentView is null or a catalog component throws | - | [packages/play-react/src/ActorProvider.tsx:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/ActorProvider.tsx#L33) |
24
+ | <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | Optional error handler callback invoked when a catalog component throws during render | - | [packages/play-react/src/ActorProvider.tsx:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-react/src/ActorProvider.tsx#L35) |
25
+ | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Called when an individual catalog component throws during render. Takes precedence over any onRenderError set via defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:167](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L167) |
26
+ | <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` | Full result from defineRegistry() — contains the component registry and action handlers factory. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L156) |
27
+ | <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (controlled mode). When provided, spec.state is ignored and this store is the single source of truth. When omitted, a fresh @xstate/store atom is created per view transition from spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:162](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.48/packages/play-actor/src/abstract-actor.ts#L162) |