@xmachines/docs 2.0.0-alpha.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +16 -17
  2. package/api/@xmachines/play/README.md +58 -66
  3. package/api/@xmachines/play/classes/NonNullableError.md +14 -14
  4. package/api/@xmachines/play/classes/PlayError.md +32 -34
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +28 -27
  7. package/api/@xmachines/play-actor/README.md +114 -50
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +45 -30
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +27 -0
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +21 -0
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +43 -0
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +28 -0
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +42 -0
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +29 -0
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +25 -27
  18. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
  19. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
  20. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -15
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +11 -0
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +6 -6
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +50 -0
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +15 -0
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +15 -0
  27. package/api/@xmachines/play-dom/README.md +123 -86
  28. package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
  29. package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
  30. package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
  31. package/api/@xmachines/play-dom/functions/createValidationRegistry.md +22 -0
  32. package/api/@xmachines/play-dom/functions/defineRegistry.md +5 -5
  33. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +9 -8
  34. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +16 -16
  35. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +2 -0
  36. package/api/@xmachines/play-dom/interfaces/FieldValidationState.md +16 -0
  37. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  38. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +17 -17
  39. package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +2 -0
  40. package/api/@xmachines/play-dom/interfaces/ValidationRegistry.md +21 -0
  41. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +10 -0
  42. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  43. package/api/@xmachines/play-dom/variables/schema.md +35 -45
  44. package/api/@xmachines/play-dom-router/README.md +68 -51
  45. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  46. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  47. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  48. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  49. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  50. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  51. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +21 -20
  52. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  53. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +41 -35
  54. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  55. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  56. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  57. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  59. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  60. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  61. package/api/@xmachines/play-react/README.md +65 -55
  62. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  63. package/api/@xmachines/play-react/functions/defineRegistry.md +5 -5
  64. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  65. package/api/@xmachines/play-react/functions/useFieldValidation.md +31 -0
  66. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  67. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  68. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  69. package/api/@xmachines/play-react/interfaces/ComponentContext.md +9 -8
  70. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  71. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
  72. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  73. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  74. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  75. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  76. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  77. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  78. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  79. package/api/@xmachines/play-react-router/README.md +38 -31
  80. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  81. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  82. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  83. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  84. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  85. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  86. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +41 -35
  87. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  88. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  89. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  90. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  91. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  92. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  93. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  94. package/api/@xmachines/play-router/README.md +99 -95
  95. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  96. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  97. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  98. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  99. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  100. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  101. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  102. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  103. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  104. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  105. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  106. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  107. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  108. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  109. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  110. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  111. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  112. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  113. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  114. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  115. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  116. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
  117. package/api/@xmachines/play-router/interfaces/LocationLike.md +11 -11
  118. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -9
  119. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  120. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  121. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +41 -35
  122. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  123. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  124. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  125. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  126. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  127. package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
  128. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  129. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  130. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  131. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  132. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  133. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  134. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  135. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  136. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  137. package/api/@xmachines/play-signals/README.md +38 -36
  138. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  139. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  140. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  141. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  142. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  143. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  144. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  145. package/api/@xmachines/play-solid/README.md +46 -42
  146. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  147. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  148. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  149. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  150. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  151. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  152. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  153. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  154. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  155. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  156. package/api/@xmachines/play-solid-router/README.md +39 -34
  157. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  158. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  159. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  160. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  161. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +45 -30
  162. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  163. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +41 -35
  164. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  165. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  166. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  167. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  168. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  169. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  170. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  171. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  172. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  173. package/api/@xmachines/play-svelte/README.md +60 -33
  174. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  175. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  176. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  177. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  178. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  179. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  180. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  181. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  182. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  183. package/api/@xmachines/play-svelte-spa-router/README.md +43 -52
  184. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  186. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  189. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +41 -35
  190. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  191. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  192. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  193. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  194. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-sveltekit-router/README.md +43 -39
  196. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  198. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  199. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  201. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +11 -11
  202. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +41 -35
  203. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  204. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  205. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  206. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  207. package/api/@xmachines/play-tanstack-react-router/README.md +67 -49
  208. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  209. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  210. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  211. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  212. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  213. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  214. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  215. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +41 -35
  216. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  217. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  218. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  219. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  220. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  221. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  222. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  223. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  224. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  225. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  226. package/api/@xmachines/play-tanstack-router/README.md +38 -16
  227. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  228. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  229. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  230. package/api/@xmachines/play-tanstack-solid-router/README.md +76 -50
  231. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  232. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  233. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  235. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  236. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +41 -35
  237. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  238. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  239. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  240. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  241. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  242. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  243. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  244. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  245. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  246. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  247. package/api/@xmachines/play-vue/README.md +39 -39
  248. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  249. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  250. package/api/@xmachines/play-vue/functions/useFieldValidation.md +31 -0
  251. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  252. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  253. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  254. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  255. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  256. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  257. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  258. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  259. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +4 -4
  260. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  261. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  262. package/api/@xmachines/play-vue-router/README.md +66 -57
  263. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  264. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  265. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  266. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  267. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +41 -35
  268. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  269. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  270. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  271. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  272. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  273. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  274. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  275. package/api/@xmachines/play-xstate/README.md +129 -138
  276. package/api/@xmachines/play-xstate/classes/PlayerActor.md +148 -114
  277. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -23
  278. package/api/@xmachines/play-xstate/functions/composeGuards.md +34 -33
  279. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +27 -22
  280. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +19 -14
  281. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  282. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  283. package/api/@xmachines/play-xstate/functions/eventMatches.md +12 -7
  284. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +17 -48
  285. package/api/@xmachines/play-xstate/functions/hasContext.md +12 -9
  286. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  287. package/api/@xmachines/play-xstate/functions/negateGuard.md +26 -20
  288. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  289. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  290. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -11
  291. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  292. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +4 -4
  293. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +9 -25
  294. package/api/@xmachines/play-xstate/type-aliases/Guard.md +13 -11
  295. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +8 -5
  296. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +11 -15
  297. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -19
  298. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  299. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -26
  300. package/api/@xmachines/shared/README.md +12 -14
  301. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  302. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  303. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +12 -7
  304. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  305. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +9 -4
  306. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  307. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  308. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +6 -6
  309. package/contributing/architecture.md +27 -28
  310. package/contributing/configuration.md +10 -10
  311. package/contributing/deployment.md +51 -30
  312. package/contributing/development.md +90 -21
  313. package/contributing/testing.md +36 -14
  314. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
  315. package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
  316. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
  317. package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
  318. package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
  319. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
  320. package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
  321. package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
  322. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
  323. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
  324. package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
  325. package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
  326. package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
  327. package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
  328. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
  329. package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
  330. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
  331. package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
  332. package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
  333. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
  334. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
  335. package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
  336. package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
  337. package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
  338. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
  339. package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
  340. package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
  341. package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
  342. package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
  343. package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
  344. package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
  345. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
  346. package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
  347. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
  348. package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
  349. package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
  350. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
  351. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
  352. package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
  353. package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
  354. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
  355. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
  356. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
  357. package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
  358. package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
  359. package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
  360. package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
  361. package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
  362. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
  363. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
  364. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
  365. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
  366. package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
  367. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
  368. package/examples/README.md +4 -1
  369. package/examples/basic-state-machine.md +24 -24
  370. package/examples/form-validation.md +110 -121
  371. package/examples/multi-router-integration.md +0 -2
  372. package/examples/routing-patterns.md +60 -94
  373. package/examples/traffic-light.md +57 -48
  374. package/guides/README.md +6 -2
  375. package/guides/actor-model.md +1 -1
  376. package/guides/getting-started.md +89 -90
  377. package/guides/inspector.md +197 -0
  378. package/guides/state-machines.md +55 -69
  379. package/package.json +10 -7
  380. package/rfc/play.md +15 -6
  381. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
  382. package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +0 -87
  383. package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +0 -30
  384. package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +0 -33
  385. package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +0 -31
  386. package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +0 -37
  387. package/api/@xmachines/play-xstate/variables/playMetaSchema.md +0 -40
  388. package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +0 -9
@@ -6,19 +6,19 @@
6
6
  function assertNonNullable<V>(value, name?): NonNullable<V>;
7
7
  ```
8
8
 
9
- Defined in: [packages/play/src/utils.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/utils.ts#L39)
9
+ Defined in: [packages/play/src/utils.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/utils.ts#L39)
10
10
 
11
- Assert that `value` is neither `null` nor `undefined`, and return it typed
12
- as `NonNullable<V>` combining the guard and the narrowed value in a single
13
- expression.
11
+ Asserts that `value` is not `null` and not `undefined`, then returns it with the
12
+ type `NonNullable<V>`. One expression therefore holds the guard and the narrowed
13
+ value.
14
14
 
15
- Unlike a non-null assertion (`value!`), this throws a descriptive error at
16
- the point of failure rather than producing `undefined`-is-not-an-object`
17
- crashes somewhere downstream.
15
+ A non-null assertion (`value!`) is different: it produces `undefined`, and your
16
+ code then fails later with a message such as "undefined is not an object". This
17
+ function throws a clear error at the point of the failure.
18
18
 
19
- Unlike an `asserts value is T` assertion function, this returns the narrowed
20
- value directly, so no separate variable or `as` cast is required at the call
21
- site.
19
+ An assertion function of the form `asserts value is T` is also different: this
20
+ function returns the narrowed value directly. Therefore the call site needs no
21
+ second variable and no `as` cast.
22
22
 
23
23
  ## Type Parameters
24
24
 
@@ -28,16 +28,16 @@ site.
28
28
 
29
29
  ## Parameters
30
30
 
31
- | Parameter | Type | Description |
32
- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
33
- | `value` | `V` | The value to check. |
34
- | `name?` | `string` | Optional name included in the error message to identify the missing value (e.g. the variable or injection key name). |
31
+ | Parameter | Type | Description |
32
+ | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `value` | `V` | The value to check. |
34
+ | `name?` | `string` | The optional name in the error message. It identifies the missing value, for example the name of the variable or of the injection key. |
35
35
 
36
36
  ## Returns
37
37
 
38
38
  `NonNullable`\<`V`\>
39
39
 
40
- `value` typed as `NonNullable<V>` `null` and `undefined` removed.
40
+ `value` with the type `NonNullable<V>`, without `null` and without `undefined`.
41
41
 
42
42
  ## Throws
43
43
 
@@ -48,9 +48,9 @@ When `value` is `null` or `undefined`.
48
48
  ```ts
49
49
  import { assertNonNullable } from "@xmachines/play";
50
50
 
51
- // inject() + assertNonNullable in one line no `!` or intermediate variable:
51
+ // inject() and assertNonNullable in one line, with no `!` and no second variable:
52
52
  const actor = assertNonNullable(inject<AuthActor>("actor"), "actor");
53
53
 
54
- // Element lookup:
54
+ // A lookup of an element:
55
55
  const el = assertNonNullable(document.getElementById("app"), "#app");
56
56
  ```
@@ -6,50 +6,51 @@
6
6
  type PlayEvent<TPayload> = object & TPayload;
7
7
  ```
8
8
 
9
- Defined in: [packages/play/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/types.ts#L69)
9
+ Defined in: [packages/play/src/types.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/types.ts#L71)
10
10
 
11
- Generic event type for Play Architecture
11
+ The generic event type of the Play Architecture
12
12
 
13
- PlayEvent represents the minimal event contract for Actor communication: any object
14
- with a `type` string property. Infrastructure forwards events to the Actor, and the
15
- Actor's state machine guards determine validity.
13
+ PlayEvent is the minimal event contract of the Actor communication: it is every
14
+ object with a `type` string property. The infrastructure sends each event to the
15
+ Actor, and the guards of the Actor state machine decide the validity.
16
16
 
17
- **Type Parameter:** The generic `TPayload` allows specifying the shape of additional
18
- event fields beyond `type`. It defaults to `Record<string, unknown>` for maximum flexibility.
17
+ **The type parameter:** the generic `TPayload` gives the shape of the event fields
18
+ after `type`. Its default is `Record<string, unknown>`, which accepts each shape.
19
19
 
20
- **Architectural Context:** Implements **Passive Infrastructure (INV-04)** where
21
- infrastructure reflects user actions as events without making decisions. The Actor's
22
- state machine guards determine whether each event is valid from the current state.
20
+ **Architectural context:** the type implements **Passive Infrastructure
21
+ (INV-04)**. The infrastructure converts each user action into an event, and it
22
+ makes no decision. The guards of the Actor state machine decide if each event is
23
+ valid in the current state.
23
24
 
24
- **Framework Agnostic:** This type is intentionally generic and not tied to any
25
- specific state machine framework. It matches the common event shape used by XState,
26
- Robot, and other state machine libraries.
25
+ **Framework-agnostic:** this type is generic on purpose, and it is bound to no
26
+ state machine framework. It matches the common event shape of XState, of Robot,
27
+ and of the other state machine libraries.
27
28
 
28
- **Common Event Types:**
29
+ **The common event types:**
29
30
 
30
- - Domain events: `{ type: 'auth.login', userId: '123' }`
31
- - Custom events: `{ type: 'form.submit', data: {...} }`
31
+ - A domain event: `{ type: 'auth.login', userId: '123' }`
32
+ - Your own event: `{ type: 'form.submit', data: {...} }`
32
33
 
33
34
  ## Type Declaration
34
35
 
35
- | Name | Type | Defined in |
36
- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
37
- | `type` | `string` | [packages/play/src/types.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/types.ts#L70) |
36
+ | Name | Type | Defined in |
37
+ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------ |
38
+ | `type` | `string` | [packages/play/src/types.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/types.ts#L72) |
38
39
 
39
40
  ## Type Parameters
40
41
 
41
- | Type Parameter | Default type | Description |
42
- | ---------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------- |
43
- | `TPayload` _extends_ `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> | Additional fields beyond `type` (defaults to `Record<string, unknown>`) |
42
+ | Type Parameter | Default type | Description |
43
+ | ---------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------- |
44
+ | `TPayload` _extends_ `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> | The fields after `type`. The default is `Record<string, unknown>` |
44
45
 
45
46
  ## Examples
46
47
 
47
- Using without type parameter (flexible)
48
+ The use without the type parameter, which is flexible
48
49
 
49
50
  ```typescript
50
51
  import type { PlayEvent } from "@xmachines/play";
51
52
 
52
- // Accepts any event with type: string
53
+ // It accepts every event with type: string
53
54
  const loginEvent: PlayEvent = {
54
55
  type: "auth.login",
55
56
  userId: "user123",
@@ -58,12 +59,12 @@ const loginEvent: PlayEvent = {
58
59
  actor.send(loginEvent);
59
60
  ```
60
61
 
61
- Using with type parameter (type-safe)
62
+ The use with the type parameter, which is type-safe
62
63
 
63
64
  ```typescript
64
65
  import type { PlayEvent } from "@xmachines/play";
65
66
 
66
- // Type-safe event with known shape
67
+ // A type-safe event with a known shape
67
68
  type LoginEvent = PlayEvent<{ userId: string; timestamp: number }>;
68
69
 
69
70
  const loginEvent: LoginEvent = {
@@ -72,7 +73,7 @@ const loginEvent: LoginEvent = {
72
73
  timestamp: Date.now(),
73
74
  };
74
75
 
75
- // TypeScript error: missing required field
76
+ // A TypeScript error: a necessary field is absent
76
77
  const invalid: LoginEvent = { type: "auth.login" }; // Error!
77
78
  ```
78
79
 
@@ -1,12 +1,10 @@
1
1
  [API](../../README.md) / @xmachines/play-actor
2
2
 
3
- <!-- generated-by: gsd-doc-writer -->
4
-
5
3
  # @xmachines/play-actor
6
4
 
7
5
  Abstract Actor base class for XMachines Play Architecture.
8
6
 
9
- Part of the [xmachines-js monorepo](../../README.md).
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-2.1.0-blue)](https://www.npmjs.com/package/@xmachines/play-actor)
10
8
 
11
9
  ## Installation
12
10
 
@@ -14,90 +12,101 @@ Part of the [xmachines-js monorepo](../../README.md).
14
12
  pnpm add @xmachines/play-actor
15
13
  ```
16
14
 
17
- **Peer dependencies** install alongside the package:
15
+ **Peer dependencies.** Install them with the package:
18
16
 
19
17
  ```bash
20
- pnpm add xstate @xmachines/play @xmachines/play-signals
18
+ pnpm add xstate @xmachines/play @xmachines/play-signals @xmachines/json-render-core
21
19
  ```
22
20
 
23
21
  ## Overview
24
22
 
25
- `@xmachines/play-actor` provides `AbstractActor`, a minimal base class that extends the XState `Actor` class while enforcing the Play Architecture's **signal protocol** (RFC section 5.3). It exposes reactive TC39 Signals for infrastructure-layer communication while preserving full XState ecosystem compatibility (devtools, inspection).
23
+ `@xmachines/play-actor` gives you `AbstractActor`, a minimal base class. The class extends the XState `Actor` class, and it enforces the **signal protocol** of the Play Architecture (RFC section 5.3). It exposes reactive TC39 Signals for the infrastructure layer. It also keeps the complete compatibility with the XState ecosystem, which includes the devtools and the inspection.
26
24
 
27
- The core protocol is deliberately minimal:
25
+ The core protocol is small on purpose:
28
26
 
29
27
  | Property | Type | Description |
30
28
  | -------- | ------------------------- | ---------------------------------------- |
31
29
  | `state` | `Signal.State<unknown>` | Reactive snapshot of current actor state |
32
30
  | `send` | `(event: TEvent) => void` | Event dispatch method |
33
31
 
34
- Optional capabilities are declared as separate interfaces — a concrete actor opts in only to what it needs:
32
+ Separate interfaces declare the optional capabilities. A concrete actor implements only the interfaces that it needs:
35
33
 
36
34
  | Interface | Property | Description |
37
35
  | ---------- | ----------------------------------------------- | ------------------------------------- |
38
36
  | `Routable` | `currentRoute: Signal.Computed<string \| null>` | Current route path derived from state |
39
- | `Routable` | `initialRoute: string \| null` | Route the actor starts on |
37
+ | `Routable` | `initialRoute: string \| null` | The route where the actor starts |
40
38
  | `Viewable` | `currentView: Signal.State<PlaySpec \| null>` | Current JSON-render view spec |
41
39
 
42
- Concrete implementations are created by adapters such as [`@xmachines/play-xstate`](../play-xstate/README.md).
40
+ An adapter, such as [`@xmachines/play-xstate`](../play-xstate/README.md), makes the concrete implementations.
43
41
 
44
42
  ## API Summary
45
43
 
46
44
  ### `AbstractActor<TLogic, TEvent>`
47
45
 
48
- Abstract base class extending XState `Actor<TLogic>`.
46
+ The abstract base class extends the XState `Actor<TLogic>` class.
47
+
48
+ A subclass **is** the actor. Give the logic and its options to `super()`, so that one
49
+ instance holds the running machine. Reach the `send` method of XState through the
50
+ prototype. This class declares `send` as abstract for one reason only: to narrow the
51
+ event type. TypeScript forbids a `super` call to an abstract member.
49
52
 
50
53
  ```ts
51
54
  import { AbstractActor } from "@xmachines/play-actor";
52
55
  import { Signal } from "@xmachines/play-signals";
53
- import type { AnyActorLogic } from "xstate";
56
+ import { Actor, type ActorOptions, type AnyActorLogic } from "xstate";
54
57
 
55
58
  class MyActor extends AbstractActor<AnyActorLogic> {
56
59
  // Required: reactive state signal
57
- state = new Signal.State({});
60
+ state: Signal.State<unknown>;
61
+
62
+ constructor(logic: AnyActorLogic, options?: ActorOptions<AnyActorLogic>) {
63
+ super(logic, options);
64
+ this.state = new Signal.State(this.getSnapshot());
65
+ super.subscribe((snapshot) => this.state.set(snapshot));
66
+ }
58
67
 
59
68
  // Required: typed event dispatch
60
- send = (event: { type: string }) => {
61
- /* dispatch to XState */
62
- };
69
+ override send(event: { type: string }): void {
70
+ Actor.prototype.send.call(this, event);
71
+ }
63
72
  }
64
73
  ```
65
74
 
66
75
  With a typed event union:
67
76
 
68
77
  ```ts
78
+ // imports as in the previous example
69
79
  type AuthEvent = { type: "auth.login"; username: string } | { type: "auth.logout" };
70
80
 
71
81
  class AuthActor extends AbstractActor<AnyActorLogic, AuthEvent> {
72
82
  state = new Signal.State({ isAuthenticated: false, username: null });
73
83
 
74
- send = (event: AuthEvent) => {
75
- /* dispatch */
76
- };
84
+ override send(event: AuthEvent): void {
85
+ Actor.prototype.send.call(this, event);
86
+ }
77
87
  }
78
88
  ```
79
89
 
80
- ### `typedSpec<TContext>(spec)`
90
+ ### `typedSpec(spec)`
81
91
 
82
- Identity helper that constrains a `PlaySpec` object's `contextProps` to keys of a specific machine context type. This enables compile-time validation and IDE autocomplete without any runtime cost.
92
+ This identity helper gives a view-spec literal the type `PlaySpec` at the definition site. The
93
+ XState `meta` field has the type `Record<string, unknown>`. Therefore this helper is the place
94
+ where the spec shape receives the compile-time check and the IDE autocomplete. The helper has no
95
+ cost at run time.
83
96
 
84
97
  ```ts
85
98
  import { typedSpec } from "@xmachines/play-actor";
86
99
 
87
- interface DashboardCtx {
88
- username: string;
89
- params: Record<string, string>;
90
- query: Record<string, string>;
91
- }
92
-
93
100
  // In an XState machine meta block:
94
101
  meta: {
95
- view: typedSpec<DashboardCtx>({
102
+ view: typedSpec({
96
103
  root: "root",
97
- contextProps: ["username"], // ✓ key of DashboardCtx
98
- // contextProps: ["usernaem"], // ✗ compile error
99
104
  elements: {
100
- root: { type: "Dashboard", props: {}, children: [] },
105
+ root: {
106
+ type: "Dashboard",
107
+ props: { username: { $state: "/context/username" } },
108
+ children: [],
109
+ },
101
110
  },
102
111
  }),
103
112
  }
@@ -105,36 +114,76 @@ meta: {
105
114
 
106
115
  ### `PlaySpec`
107
116
 
108
- Extends `@xmachines/json-render-core`'s `Spec` with an optional `contextProps` field — an explicit allowlist of machine context fields that are merged into element props at view derivation time.
117
+ This type extends the `Spec` type of `@xmachines/json-render-core`. Each derived view receives
118
+ the complete machine context in its state store, under the read-only **`/context` subtree**. A
119
+ spec therefore reads the context through the ordinary `{ $state: "/context/…" }` grammar: in a
120
+ prop, in a `visible` condition, and in `repeat.statePath`.
121
+
122
+ `/context` is read-only by design. Nothing can write to it. The machine context changes through
123
+ an event only. A `$bindState` write or a `setState` write under `/context` throws an error, and
124
+ the error names the event to send. This is the model: the bindable ephemeral state is at the
125
+ root of the store, from `spec.state`; the domain state is in the machine, and it changes through
126
+ events that are meaningful and easy to inspect.
127
+
128
+ The path shows the origin of each value. `/context/params/username` comes from the URL.
129
+ `/context/username` belongs to the machine. One value can never hide the other.
130
+
131
+ The model projects everything, and this has two consequences. The first consequence is
132
+ **exposure**. The complete context is visible to the client in the view store, which includes a
133
+ debug panel, an inspector, and a validator. The context is a client-side value in each case, so
134
+ keep a secret out of it.
135
+
136
+ The second consequence is **emission granularity**. The emit gate compares the context field by
137
+ field, at the top level only. Therefore an event that changes any field emits the view again
138
+ with the same `viewKey`. A provider refreshes `/context` in the live store, and it does not seed
139
+ the store again. The component does not remount, and the ephemeral view state and the focus
140
+ stay. However, a new emission is still a render pass in the framework layer. Keep
141
+ high-frequency ephemeral data, such as a draft for each keystroke or a timer, in the view store
142
+ (`spec.state` with `$bindState`) or in a child actor. The domain state belongs in the context. A
143
+ keystroke does not.
109
144
 
110
145
  ```ts
111
146
  import type { PlaySpec } from "@xmachines/play-actor";
112
147
 
113
148
  const spec: PlaySpec = {
114
149
  root: "root",
115
- contextProps: ["username"], // only these keys are exposed to components
116
150
  elements: {
117
- root: { type: "Profile", props: { username: undefined }, children: [] },
151
+ root: {
152
+ type: "Profile",
153
+ props: { username: { $state: "/context/username" } },
154
+ children: [],
155
+ },
118
156
  },
119
157
  };
120
158
  ```
121
159
 
160
+ > Historical note: an earlier version had a `contextProps` field. At first the field drove an
161
+ > implicit prop-enrichment pass. That pass merged the allowlisted context fields and the URL
162
+ > params into the props of every element. We removed it, because it put values into components
163
+ > that never asked for them, and it let URL data from the user hide machine-owned state. The
164
+ > field was then a projection filter for a short time. We removed that filter too, because a
165
+ > limit on what a view can read added machinery without a real problem to solve. Always
166
+ > validate the **derived** view (`actor.currentView.get()`), not the raw `meta.view`. The
167
+ > `state` of the derived spec carries the projection, so a tool such as `validateSpec` sees a
168
+ > spec that is consistent with itself.
169
+
122
170
  ### `Routable`
123
171
 
124
172
  Interface for actors that support routing.
125
173
 
126
174
  ```ts
127
- import type { Routable } from "@xmachines/play-actor";
175
+ import { AbstractActor, type Routable } from "@xmachines/play-actor";
128
176
  import { Signal } from "@xmachines/play-signals";
177
+ import type { AnyActorLogic, EventObject } from "xstate";
129
178
 
130
179
  // Implement in a concrete actor (note: RoutableActor interface is exported from @xmachines/play-router):
131
180
  class MyRoutableActor extends AbstractActor<AnyActorLogic> implements Routable {
132
- state = new Signal.State({});
133
- currentRoute = new Signal.Computed(() => this.state.get().path ?? null);
181
+ state = new Signal.State<{ path?: string }>({});
182
+ currentRoute = new Signal.Computed<string | null>(() => this.state.get().path ?? null);
134
183
  initialRoute = "/";
135
- send = (event) => {
184
+ override send(event: EventObject): void {
136
185
  /* dispatch */
137
- };
186
+ }
138
187
  }
139
188
  ```
140
189
 
@@ -154,7 +203,7 @@ const viewable: Viewable = { currentView: signal };
154
203
 
155
204
  ### `BaseActorProviderProps<TRegistry>`
156
205
 
157
- Framework-agnostic base props shared by every `ActorProvider` implementation (React, Vue, Solid, Svelte). Framework renderer packages extend this interface.
206
+ The framework-agnostic base props. Every `ActorProvider` implementation shares them: React, Vue, Solid, and Svelte. Each framework renderer package extends this interface.
158
207
 
159
208
  ```ts
160
209
  import type { BaseActorProviderProps } from "@xmachines/play-actor";
@@ -168,7 +217,7 @@ interface ActorProviderProps extends BaseActorProviderProps<DefineRegistryResult
168
217
 
169
218
  ### `BaseViewContextValue<TRegistry>`
170
219
 
171
- Framework-agnostic base for every framework's `ViewContextValue`. Holds `spec`, `handlers`, `registry`, and `store` fields that are identical across React, Vue, Solid, and Svelte.
220
+ The framework-agnostic base of the `ViewContextValue` type in each framework. It holds the `spec`, `handlers`, `registry`, and `store` fields. These fields are identical in React, Vue, Solid, and Svelte.
172
221
 
173
222
  ## Testing
174
223
 
@@ -191,19 +240,21 @@ pnpm --filter @xmachines/play-actor run test:watch
191
240
  - **TypeScript** `>=5.7` (strict mode)
192
241
  - **ESM only** — `"type": "module"`
193
242
 
194
- @xmachines/play-actor - Abstract Actor base class for Play Architecture
243
+ @xmachines/play-actor - the abstract Actor base class of the Play Architecture
195
244
 
196
- This package provides AbstractActor, a minimal base class that extends XState Actor
197
- while enforcing the Play Architecture's signal protocol (RFC section 5.3).
245
+ This package gives you AbstractActor, a minimal base class. It extends the XState
246
+ Actor class, and it enforces the signal protocol of the Play Architecture (RFC
247
+ section 5.3).
198
248
 
199
- The core protocol is minimal (state + send). Optional capabilities are provided
200
- via interfaces:
249
+ The core protocol is minimal: state and send. Two interfaces give the optional
250
+ capabilities:
201
251
 
202
- - Routable: For actors that support routing
203
- - Viewable: For actors that support view rendering
252
+ - Routable: for an actor with a routing support
253
+ - Viewable: for an actor with a view rendering
204
254
 
205
- Maintains XState ecosystem compatibility (inspection, devtools) while exposing
206
- reactive signals for Infrastructure layer communication.
255
+ The class keeps the compatibility with the XState ecosystem, such as the
256
+ inspection and the devtools. It also exposes the reactive signals of the
257
+ communication with the infrastructure layer.
207
258
 
208
259
  ## See
209
260
 
@@ -218,11 +269,24 @@ reactive signals for Infrastructure layer communication.
218
269
  - [BaseActorProviderProps](interfaces/BaseActorProviderProps.md)
219
270
  - [BaseViewContextValue](interfaces/BaseViewContextValue.md)
220
271
  - [PlaySpec](interfaces/PlaySpec.md)
272
+ - [ResolveViewStoreOptions](interfaces/ResolveViewStoreOptions.md)
221
273
  - [Routable](interfaces/Routable.md)
222
274
  - [Viewable](interfaces/Viewable.md)
275
+ - [ViewStoreLifecycle](interfaces/ViewStoreLifecycle.md)
276
+ - [ViewStoreResolution](interfaces/ViewStoreResolution.md)
277
+
278
+ ## Variables
279
+
280
+ - [CONTEXT\_STATE\_KEY](variables/CONTEXT_STATE_KEY.md)
223
281
 
224
282
  ## Functions
225
283
 
226
284
  - [attachRenderErrorHandler](functions/attachRenderErrorHandler.md)
285
+ - [composePlayState](functions/composePlayState.md)
286
+ - [createViewStoreLifecycle](functions/createViewStoreLifecycle.md)
287
+ - [guardContextWrites](functions/guardContextWrites.md)
288
+ - [refreshContextSubtree](functions/refreshContextSubtree.md)
289
+ - [reuseComposedState](functions/reuseComposedState.md)
290
+ - [shallowEqualExcept](functions/shallowEqualExcept.md)
227
291
  - [toAtomState](functions/toAtomState.md)
228
292
  - [typedSpec](functions/typedSpec.md)