@xmachines/docs 2.0.0 → 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 (299) hide show
  1. package/README.md +11 -13
  2. package/api/@xmachines/play/README.md +58 -63
  3. package/api/@xmachines/play/classes/NonNullableError.md +7 -7
  4. package/api/@xmachines/play/classes/PlayError.md +25 -27
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
  7. package/api/@xmachines/play-actor/README.md +72 -63
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
  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 -13
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
  27. package/api/@xmachines/play-dom/README.md +119 -85
  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/interfaces/CreatePlayUIOptions.md +8 -8
  32. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  33. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
  34. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  35. package/api/@xmachines/play-dom-router/README.md +66 -49
  36. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  37. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  38. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  39. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  40. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  41. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  42. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
  43. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  44. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
  45. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  46. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  47. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  48. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  49. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  50. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  51. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  52. package/api/@xmachines/play-react/README.md +63 -54
  53. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  54. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  55. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  56. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  57. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  58. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  59. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
  60. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  61. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  62. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  63. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  64. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  65. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  66. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  67. package/api/@xmachines/play-react-router/README.md +37 -28
  68. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  69. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  70. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  71. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  72. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  73. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  74. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
  75. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  76. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  77. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  78. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  79. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  80. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  81. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  82. package/api/@xmachines/play-router/README.md +94 -82
  83. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  84. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  85. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  86. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  87. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  88. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  89. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  90. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  91. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  92. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  93. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  94. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  95. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  96. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  97. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  98. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  99. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  100. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  101. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  102. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  103. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  104. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  105. package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
  106. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
  107. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  108. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  109. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
  110. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  111. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  112. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  113. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  114. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  115. package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
  116. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  117. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  118. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  119. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  120. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  121. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  122. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  123. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  124. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  125. package/api/@xmachines/play-signals/README.md +38 -36
  126. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  127. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  128. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  129. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  130. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  131. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  132. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  133. package/api/@xmachines/play-solid/README.md +46 -42
  134. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  135. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  136. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  137. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  138. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  139. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  140. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  141. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  142. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  143. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  144. package/api/@xmachines/play-solid-router/README.md +34 -29
  145. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  146. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  147. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  148. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  149. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
  150. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  151. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
  152. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  153. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  154. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  155. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  156. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  157. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  158. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  159. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  160. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  161. package/api/@xmachines/play-svelte/README.md +40 -31
  162. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  163. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  164. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  165. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  166. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  167. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  168. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  169. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  170. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  171. package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
  172. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  173. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  174. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  175. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  176. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  177. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
  178. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  179. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  180. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  181. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  182. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  183. package/api/@xmachines/play-sveltekit-router/README.md +38 -34
  184. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  186. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  189. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
  190. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
  191. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  192. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  193. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  194. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
  196. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  198. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  199. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  201. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  202. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  203. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
  204. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  205. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  206. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  207. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  208. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  209. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  210. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  211. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  212. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  213. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  214. package/api/@xmachines/play-tanstack-router/README.md +37 -17
  215. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  216. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  217. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  218. package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
  219. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  220. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  221. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  222. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  223. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  224. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
  225. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  226. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  227. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  228. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  229. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  230. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  231. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  232. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  233. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  235. package/api/@xmachines/play-vue/README.md +37 -35
  236. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  237. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  238. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  239. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  240. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  241. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  242. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  243. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  244. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  245. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  246. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  247. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  248. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  249. package/api/@xmachines/play-vue-router/README.md +65 -56
  250. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  251. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  252. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  253. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  254. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
  255. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  256. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  257. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  258. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  259. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  260. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  261. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  262. package/api/@xmachines/play-xstate/README.md +72 -70
  263. package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
  264. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
  265. package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
  266. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
  267. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
  268. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  269. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  270. package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
  271. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
  272. package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
  273. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  274. package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
  275. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  276. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  277. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
  278. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  279. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
  280. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
  281. package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
  282. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
  283. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
  284. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
  285. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  286. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
  287. package/api/@xmachines/shared/README.md +11 -13
  288. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  289. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  290. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  291. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  292. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
  293. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  294. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  295. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
  296. package/contributing/development.md +28 -0
  297. package/guides/inspector.md +1 -1
  298. package/package.json +1 -1
  299. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Interface: RouterBridge
4
4
 
5
- Defined in: [packages/play-router/src/types.ts:341](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L341)
5
+ Defined in: [packages/play-router/src/types.ts:358](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L358)
6
6
 
7
- RouterBridge interface for runtime infrastructure adapters
7
+ The RouterBridge interface of a runtime infrastructure adapter
8
8
 
9
- Defines the lifecycle connection between Infrastructure (e.g., a framework router) and
10
- the Actor. Infrastructure "bridges" to the Actor by observing its signals and
11
- managing its own lifecycle accordingly.
9
+ The interface defines the connection of the lifecycle between the infrastructure,
10
+ for example a framework router, and the Actor. The infrastructure builds a "bridge"
11
+ to the Actor: it observes the signals of the Actor, and it manages its own
12
+ lifecycle accordingly.
12
13
 
13
- **Architectural Context:** Implements **Passive Infrastructure (INV-04)** by establishing
14
- a unidirectional observation pattern. Infrastructure connects to observe Actor signals
15
- (currentRoute, currentView, state) and reflects changes without making state decisions.
14
+ **Architectural context:** the interface implements **Passive Infrastructure
15
+ (INV-04)**, because it gives an observation in one direction. The infrastructure
16
+ connects to observe the signals of the Actor (currentRoute, currentView, and
17
+ state), and it reflects each change. It makes no decision about the state.
16
18
 
17
19
  ## Example
18
20
 
19
- Framework router bridge implementation
21
+ The implementation of a framework router bridge
20
22
 
21
23
  ```typescript
22
24
  import type { RouterBridge } from "@xmachines/play-router";
@@ -26,7 +28,7 @@ class MyRouterBridge implements RouterBridge {
26
28
  private watcher: Signal.Watcher | null = null;
27
29
 
28
30
  async connect(): Promise<void> {
29
- // Start observing actor.currentRoute signal
31
+ // Start the observation of the actor.currentRoute signal
30
32
  this.watcher = new Signal.subtle.Watcher(() => {
31
33
  const route = actor.currentRoute.get();
32
34
  if (route) router.navigate(route);
@@ -35,7 +37,7 @@ class MyRouterBridge implements RouterBridge {
35
37
  }
36
38
 
37
39
  async disconnect(): Promise<void> {
38
- // Stop observing, cleanup watchers
40
+ // Stop the observation, and clean the watchers up
39
41
  this.watcher?.unwatch(actor.currentRoute);
40
42
  this.watcher = null;
41
43
  }
@@ -44,7 +46,7 @@ class MyRouterBridge implements RouterBridge {
44
46
 
45
47
  ## See
46
48
 
47
- [Play RFC](../../../../rfc/play.md) - Invariant INV-04
49
+ [Play RFC](../../../../rfc/play.md) - invariant INV-04
48
50
 
49
51
  ## Methods
50
52
 
@@ -54,25 +56,26 @@ class MyRouterBridge implements RouterBridge {
54
56
  connect(): void | Promise<void>;
55
57
  ```
56
58
 
57
- Defined in: [packages/play-router/src/types.ts:357](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L357)
59
+ Defined in: [packages/play-router/src/types.ts:375](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L375)
58
60
 
59
- Connect the router bridge to the Actor
61
+ Connects the router bridge to the Actor
60
62
 
61
- Called when Infrastructure should begin observing Actor signals and
62
- synchronizing its state (e.g., browser URL) with Actor state.
63
+ The infrastructure calls it when it must start the observation of the Actor
64
+ signals, and when it must bring its own state, for example the browser URL, in line
65
+ with the Actor state.
63
66
 
64
67
  #### Returns
65
68
 
66
69
  `void` \| `Promise`\<`void`\>
67
70
 
68
- Promise that resolves when connection is established, or void for synchronous connection
71
+ The promise that resolves after the connection, or void for a synchronous connection
69
72
 
70
73
  #### Example
71
74
 
72
75
  ```typescript
73
76
  const bridge: RouterBridge = createBridge(actor, router);
74
77
  await bridge.connect();
75
- // Bridge now observing actor.currentRoute signal
78
+ // The bridge observes the actor.currentRoute signal now
76
79
  ```
77
80
 
78
81
  ---
@@ -83,22 +86,22 @@ await bridge.connect();
83
86
  disconnect(): void | Promise<void>;
84
87
  ```
85
88
 
86
- Defined in: [packages/play-router/src/types.ts:373](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L373)
89
+ Defined in: [packages/play-router/src/types.ts:391](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L391)
87
90
 
88
- Disconnect the router bridge from the Actor
91
+ Disconnects the router bridge from the Actor
89
92
 
90
- Called when Infrastructure should stop observing and clean up resources
91
- (e.g., signal watchers, event listeners).
93
+ The infrastructure calls it when it must stop the observation and free its
94
+ resources, for example a signal watcher and an event listener.
92
95
 
93
96
  #### Returns
94
97
 
95
98
  `void` \| `Promise`\<`void`\>
96
99
 
97
- Promise that resolves when disconnection is complete, or void for synchronous disconnection
100
+ The promise that resolves after the disconnection, or void for a synchronous disconnection
98
101
 
99
102
  #### Example
100
103
 
101
104
  ```typescript
102
105
  await bridge.disconnect();
103
- // Bridge stopped observing, resources cleaned up
106
+ // The bridge stopped its observation, and it freed its resources
104
107
  ```
@@ -6,14 +6,14 @@
6
6
  type PlayRouterBridgeConstructor<TRouter> = (router, actor, routeMap) => RouterBridge;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-solid-router/src/create-play-router-provider.tsx:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/create-play-router-provider.tsx#L25)
9
+ Defined in: [packages/play-solid-router/src/create-play-router-provider.tsx:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/create-play-router-provider.tsx#L24)
10
10
 
11
- Constructor shape a bridge class must satisfy to be used with
11
+ The constructor shape that a bridge class must satisfy for
12
12
  `createPlayRouterProvider`: `(router, actor, routeMap) → RouterBridge`.
13
13
 
14
- Bridges with a different constructor shape (e.g. `SolidRouterBridge`, which
15
- takes the hook results as separate arguments) are adapted with a thin
16
- subclass that repackages the `router` prop.
14
+ A bridge with another constructor shape, for example `SolidRouterBridge`, which
15
+ takes each hook result as a separate argument, receives a thin subclass. That
16
+ subclass packs the `router` prop again.
17
17
 
18
18
  ## Type Parameters
19
19
 
@@ -6,8 +6,8 @@
6
6
  type RoutableActor = PlayActor;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L19)
9
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L19)
10
10
 
11
11
  ## Deprecated
12
12
 
13
- Use `PlayActor` from `@xmachines/play-router`. Will be removed in the next major version.
13
+ Use `PlayActor` from `@xmachines/play-router`. The next major version removes this alias.
@@ -6,10 +6,10 @@
6
6
  type SolidRouterHooks = object;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L37)
9
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L37)
10
10
 
11
- The three Solid Router hook results that `PlayRouterProvider` and `SolidRouterBridge`
12
- require. Pass these directly from your component's hook calls:
11
+ The three results of the Solid Router hooks that `PlayRouterProvider` and
12
+ `SolidRouterBridge` need. Give them directly from the hook calls of your component:
13
13
 
14
14
  ```tsx
15
15
  const navigate = useNavigate(); // → SolidRouterHooks.navigate
@@ -17,11 +17,11 @@ const location = useLocation(); // → SolidRouterHooks.location
17
17
  const params = useParams(); // → SolidRouterHooks.params
18
18
  ```
19
19
 
20
- - `navigate` — used to push URL changes when the actor's `currentRoute` changes.
21
- - `location` — `pathname` and `search` are read at `connect()` time for deep-link sync.
22
- Subsequent pathname changes drive router→actor sync via `createEffect`.
23
- - `params` — Solid's pre-parsed path parameters for the current route segment. Used
24
- directly in `extractParams()` to avoid re-parsing with URLPattern.
20
+ - `navigate` — the bridge pushes each URL change with it, when the `currentRoute` of the actor changes.
21
+ - `location` — the bridge reads `pathname` and `search` at the moment of `connect()`, for a deep link.
22
+ Each later change of the pathname then goes to the actor, through `createEffect`.
23
+ - `params` — the path parameters of the current route segment, which Solid parsed already. The bridge
24
+ uses them directly in `extractParams()`, and it parses them not again with URLPattern.
25
25
 
26
26
  ## Properties
27
27
 
@@ -31,7 +31,7 @@ const params = useParams(); // → SolidRouterHooks.params
31
31
  location: Location;
32
32
  ```
33
33
 
34
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L39)
34
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L39)
35
35
 
36
36
  ---
37
37
 
@@ -41,7 +41,7 @@ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:39](https:/
41
41
  navigate: Navigator;
42
42
  ```
43
43
 
44
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L38)
44
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L38)
45
45
 
46
46
  ---
47
47
 
@@ -51,4 +51,4 @@ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:38](https:/
51
51
  params: Params;
52
52
  ```
53
53
 
54
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L40)
54
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L40)
@@ -6,17 +6,18 @@
6
6
  const PlayRouterProvider: <TActor>(props) => any;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-solid-router/src/play-router-provider.tsx:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-solid-router/src/play-router-provider.tsx#L92)
9
+ Defined in: [packages/play-solid-router/src/play-router-provider.tsx:94](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-solid-router/src/play-router-provider.tsx#L94)
10
10
 
11
- Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
12
- in sync bidirectionally.
11
+ Connects a `PlayerActor` to Solid Router. It keeps the actor state and the browser
12
+ URL in step, in both directions.
13
13
 
14
- The bridge is created synchronously at component evaluation time (Solid's
15
- execution model) and torn down via `onCleanup` when the component is disposed.
16
- Unlike React, prop stability is not a concern Solid's `props` accessor is
17
- already reactive and the bridge is created once per component instance.
14
+ The component creates the bridge synchronously, during its own evaluation, because
15
+ this is the execution model of Solid. It disconnects the bridge in `onCleanup`,
16
+ when Solid disposes of the component. React is different: the stability of a prop
17
+ is no concern here, because the `props` accessor of Solid is reactive already, and
18
+ the component creates the bridge one time for each of its instances.
18
19
 
19
- The `router` prop must be obtained from Solid Router hooks in the parent component:
20
+ Take the `router` prop from the Solid Router hooks in the parent component:
20
21
 
21
22
  ```tsx
22
23
  function AppShell() {
@@ -2,11 +2,9 @@
2
2
 
3
3
  # @xmachines/play-svelte
4
4
 
5
- Svelte 5 renderer for the XMachines Play architecture connects an actor to a `@xmachines/json-render-svelte` catalog-driven UI using Svelte 5 runes and TC39 Signals.
5
+ Svelte 5 renderer for the XMachines Play architecture. It connects an actor to a catalog-driven `@xmachines/json-render-svelte` UI, with Svelte 5 runes and TC39 Signals.
6
6
 
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.0.0-blue)](https://www.npmjs.com/package/@xmachines/play-svelte)
8
-
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-svelte)
10
8
 
11
9
  ## Installation
12
10
 
@@ -14,7 +12,7 @@ Part of the [xmachines-js monorepo](../../README.md).
14
12
  pnpm add @xmachines/play-svelte
15
13
  ```
16
14
 
17
- **Peer dependencies** (must be installed separately):
15
+ **Peer dependencies.** Install them separately:
18
16
 
19
17
  ```bash
20
18
  pnpm add svelte@^5.0.0 xstate@^5.31.0 @xstate/store@^3.17.0 \
@@ -25,7 +23,7 @@ pnpm add svelte@^5.0.0 xstate@^5.31.0 @xstate/store@^3.17.0 \
25
23
 
26
24
  ### Basic setup
27
25
 
28
- Define a catalog and registry once, then pass both to `PlayUIProvider` with your actor. `PlayRenderer` renders the current actor view automatically:
26
+ Define the catalog and the registry one time. Then give both to `PlayUIProvider`, together with your actor. `PlayRenderer` then renders the current view of the actor:
29
27
 
30
28
  ```svelte
31
29
  <!-- App.svelte -->
@@ -55,15 +53,23 @@ Define a catalog and registry once, then pass both to `PlayUIProvider` with your
55
53
 
56
54
  ### Lower-level: ActorProvider
57
55
 
58
- Use `ActorProvider` directly when you need fine-grained control over rendering for example, to wrap with a custom layout or inject the `@xmachines/json-render-svelte` providers individually:
56
+ Use `ActorProvider` directly when you need more control over the rendering. For example, use it to add a custom layout, or to add each `@xmachines/json-render-svelte` provider one by one:
59
57
 
60
58
  ```svelte
61
59
  <script lang="ts">
62
60
  import { ActorProvider } from "@xmachines/play-svelte";
63
61
 
64
- let { actor, registryResult } = $props();
62
+ let { actor, registryResult, children } = $props();
63
+
64
+ function handleError(error: unknown, reset: () => void) {
65
+ console.error(error);
66
+ }
65
67
  </script>
66
68
 
69
+ {#snippet loadingSnippet()}
70
+ <div>Loading…</div>
71
+ {/snippet}
72
+
67
73
  <ActorProvider {actor} {registryResult} fallback={loadingSnippet} onError={handleError}>
68
74
  <!-- children rendered inside StateProvider tree -->
69
75
  {@render children()}
@@ -84,20 +90,20 @@ actor.send({ type: "some.event" });
84
90
 
85
91
  ### Components
86
92
 
87
- | Component | Description |
88
- | ------------------ | ---------------------------------------------------------------------------------------------------------------------- |
89
- | `<PlayUIProvider>` | Batteries-included composite wraps `ActorProvider` + `JsonUIProvider`. Standard entry point for actor-driven UI. |
90
- | `<ActorProvider>` | Primitive provider — owns actor lifecycle, signal subscription, per-view `StateStore`, and `onRenderError` injection. |
91
- | `<PlayRenderer>` | Zero-prop leaf component — reads `getPlayViewContext()` and renders `<Renderer>` from `@xmachines/json-render-svelte`. |
93
+ | Component | Description |
94
+ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
95
+ | `<PlayUIProvider>` | Composite provider. It wraps `ActorProvider` and `JsonUIProvider`. Use it as the standard entry point for an actor-driven UI. |
96
+ | `<ActorProvider>` | Primitive provider — owns actor lifecycle, signal subscription, per-view `StateStore`, and `onRenderError` injection. |
97
+ | `<PlayRenderer>` | Zero-prop leaf component — reads `getPlayViewContext()` and renders `<Renderer>` from `@xmachines/json-render-svelte`. |
92
98
 
93
99
  ### Functions
94
100
 
95
101
  | Function | Description |
96
102
  | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
103
  | `defineRegistry(catalog, options)` | Creates a typed component registry. Wraps `@xmachines/json-render-svelte`'s `defineRegistry` with catalog-typed `params` on action handlers. Import from `@xmachines/play-svelte`, not `@xmachines/json-render-svelte`. |
98
- | `getActorContext()` | Returns the `AnyPlayActor` from the nearest `ActorProvider` ancestor. Throws if called outside the provider tree. |
104
+ | `getActorContext()` | Returns the `AnyPlayActor` of the nearest `ActorProvider` ancestor. It throws when the caller is outside the provider tree. |
99
105
  | `getPlayViewContext()` | Returns the `ViewContextValue` (spec, registry, handlers, store) from the nearest `ActorProvider` ancestor. |
100
- | `setActorContext(actor)` | Sets the actor context used internally by `ActorProvider`. |
106
+ | `setActorContext(actor)` | Sets the actor context. `ActorProvider` uses it internally. |
101
107
 
102
108
  ### Types
103
109
 
@@ -105,17 +111,17 @@ actor.send({ type: "some.event" });
105
111
  | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
106
112
  | `ActorProviderProps` | Props for `<ActorProvider>`: `actor`, `registryResult`, optional `store`, `fallback` snippet, `onError`, `onRenderError`, `children`. |
107
113
  | `PlayUIProviderProps` | Extends `ActorProviderProps` with optional `validationFunctions`, `navigate`, and `functions`. |
108
- | `ViewContextValue` | The view context shape provided by `ActorProvider` and consumed by `PlayRenderer`. |
109
- | `AnyPlayActor` | `AbstractActor<AnyActorLogic> & Viewable` — the actor shape accepted by `ActorProvider` and `getActorContext`. |
114
+ | `ViewContextValue` | The view context shape that `ActorProvider` provides and `PlayRenderer` reads. |
115
+ | `AnyPlayActor` | `AbstractActor<AnyActorLogic> & Viewable` — the actor shape that `ActorProvider` and `getActorContext` accept. |
110
116
  | `DefineRegistryOptions<C>` | Options for `defineRegistry`: `components`, catalog-typed `actions`, and `onRenderError`. |
111
- | `ActionFn<C, K>` | Per-action handler type with params inferred from catalog. |
117
+ | `ActionFn<C, K>` | The handler type for one action. The params come from the catalog. |
112
118
  | `Actions<C>` | Map of catalog-typed action handlers. |
113
- | `SetState` | State setter function type passed as the second argument to action handlers. |
114
- | `RenderErrorHandler` | Callback `(error: unknown, elementType: string) => void` invoked when a catalog component throws. |
119
+ | `SetState` | The state setter type. Each action handler receives it as the second argument. |
120
+ | `RenderErrorHandler` | The callback `(error: unknown, elementType: string) => void`. The renderer calls it when a catalog component throws. |
115
121
 
116
122
  ### Re-exports from `@xmachines/json-render-svelte`
117
123
 
118
- Import everything from `@xmachines/play-svelte` these providers are re-exported for convenience:
124
+ Import everything from `@xmachines/play-svelte`. This package re-exports these providers:
119
125
 
120
126
  ```ts
121
127
  import {
@@ -152,30 +158,33 @@ Or from within the package directory:
152
158
  pnpm test
153
159
  ```
154
160
 
155
- Tests run with [Vitest](https://vitest.dev/) in a `jsdom` environment using `@testing-library/svelte`. Browser-specific tests are in `test/browser/` and use a separate Playwright-backed config:
161
+ The tests run with [Vitest](https://vitest.dev/) in a `jsdom` environment, together with `@testing-library/svelte`. The browser tests are in `test/browser/`. They use a separate config with Playwright:
156
162
 
157
163
  ```bash
158
164
  # From the package directory
159
165
  pnpm exec vitest --config vitest.browser.config.ts
160
166
  ```
161
167
 
162
- **Coverage thresholds:** 80% lines, functions, branches, and statements (enforced via v8 provider).
168
+ **Coverage thresholds:** 80% for lines, functions, branches, and statements. The v8 provider enforces them.
163
169
 
164
170
  ## License
165
171
 
166
172
  MIT — see [LICENSE](./LICENSE).
167
173
 
168
- @xmachines/play-svelte - Svelte renderer for XMachines Play architecture
174
+ @xmachines/play-svelte - Svelte renderer for the XMachines Play architecture
169
175
 
170
- Provides a provider/renderer split that mirrors @xmachines/json-render-svelte patterns:
176
+ The package splits the provider from the renderer, in the same way as
177
+ @xmachines/json-render-svelte:
171
178
 
172
- - ActorProvider: primitive escape-hatch (owns actor lifecycle, signal subscription,
173
- per-view StateStore, onRenderError injection)
174
- - PlayUIProvider: batteries-included composite (ActorProvider + JsonUIProvider)
175
- - PlayRenderer: zero-prop leaf reads getPlayViewContext() and renders Renderer
179
+ - ActorProvider: the low-level provider. It owns the actor lifecycle, the signal
180
+ subscription, the StateStore of each view, and the injection of onRenderError
181
+ - PlayUIProvider: the composite provider (ActorProvider and JsonUIProvider)
182
+ - PlayRenderer: the leaf without props. It reads getPlayViewContext() and renders
183
+ the Renderer
176
184
 
177
- Re-exports primitives from @xmachines/json-render-svelte so consumers import everything
178
- from @xmachines/play-svelte rather than @xmachines/json-render-svelte directly.
185
+ The package re-exports the primitives of @xmachines/json-render-svelte. A
186
+ consumer therefore imports everything from @xmachines/play-svelte, and not from
187
+ @xmachines/json-render-svelte.
179
188
 
180
189
  ## Interfaces
181
190
 
@@ -6,12 +6,13 @@
6
6
  function defineRegistry<C>(catalog, options): DefineRegistryResult;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-svelte/src/define-registry.ts:154](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/define-registry.ts#L154)
9
+ Defined in: [packages/play-svelte/src/define-registry.ts:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/define-registry.ts#L156)
10
10
 
11
- Create a component registry, restoring catalog-typed `params` on action handlers.
11
+ Creates a component registry, and gives each action handler its catalog-typed `params`.
12
12
 
13
- Drop-in replacement for `defineRegistry` from `@xmachines/json-render-svelte`. Import from
14
- `@xmachines/play-svelte` to get per-action param type inference for free.
13
+ This function is the drop-in replacement for `defineRegistry` from
14
+ `@xmachines/json-render-svelte`. Import it from `@xmachines/play-svelte`, and each
15
+ action then gets its param type from the catalog.
15
16
 
16
17
  ## Type Parameters
17
18
 
@@ -21,10 +22,10 @@ Drop-in replacement for `defineRegistry` from `@xmachines/json-render-svelte`. I
21
22
 
22
23
  ## Parameters
23
24
 
24
- | Parameter | Type | Description |
25
- | --------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
26
- | `catalog` | `C` | The json-render catalog defining component prop shapes and action schemas. |
27
- | `options` | [`DefineRegistryOptions`](../interfaces/DefineRegistryOptions.md)\<`C`\> | Registry options. `actions` entries receive params typed from the catalog. |
25
+ | Parameter | Type | Description |
26
+ | --------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
27
+ | `catalog` | `C` | The json-render catalog. It defines the prop shape of each component and the schema of each action. |
28
+ | `options` | [`DefineRegistryOptions`](../interfaces/DefineRegistryOptions.md)\<`C`\> | The registry options. Each `actions` entry receives its params with the type from the catalog. |
28
29
 
29
30
  ## Returns
30
31
 
@@ -6,11 +6,12 @@
6
6
  function getActorContext(): AnyPlayActor;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-svelte/src/actor-context.svelte.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L38)
9
+ Defined in: [packages/play-svelte/src/actor-context.svelte.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L42)
10
10
 
11
- Get the actor from the nearest ActorProvider ancestor.
11
+ Returns the actor of the nearest ActorProvider ancestor.
12
12
 
13
- Renamed from useActor() to match @xmachines/json-render-svelte's get*Context() convention (D-07).
13
+ This function had the name useActor() before. The new name follows the
14
+ get*Context() convention of @xmachines/json-render-svelte (D-07).
14
15
 
15
16
  ## Returns
16
17
 
@@ -18,4 +19,4 @@ Renamed from useActor() to match @xmachines/json-render-svelte's get*Context() c
18
19
 
19
20
  ## Throws
20
21
 
21
- if called outside <ActorProvider> or <PlayUIProvider>
22
+ When the caller is outside <ActorProvider> or <PlayUIProvider>
@@ -6,9 +6,9 @@
6
6
  function getPlayViewContext(): ViewContextValue;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-svelte/src/actor-context.svelte.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L59)
9
+ Defined in: [packages/play-svelte/src/actor-context.svelte.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L63)
10
10
 
11
- Get the current view context from the nearest ActorProvider ancestor.
11
+ Returns the current view context of the nearest ActorProvider ancestor.
12
12
 
13
13
  ## Returns
14
14
 
@@ -16,4 +16,4 @@ Get the current view context from the nearest ActorProvider ancestor.
16
16
 
17
17
  ## Throws
18
18
 
19
- if called outside <ActorProvider> or <PlayUIProvider>
19
+ When the caller is outside <ActorProvider> or <PlayUIProvider>
@@ -6,7 +6,7 @@
6
6
  function setActorContext(actor): void;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-svelte/src/actor-context.svelte.ts:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L28)
9
+ Defined in: [packages/play-svelte/src/actor-context.svelte.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L31)
10
10
 
11
11
  ## Parameters
12
12
 
@@ -2,14 +2,16 @@
2
2
 
3
3
  # Interface: ActorProviderProps
4
4
 
5
- Defined in: [packages/play-svelte/src/actor-context.svelte.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L68)
5
+ Defined in: [packages/play-svelte/src/actor-context.svelte.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L72)
6
6
 
7
- Framework-agnostic base props shared by every `ActorProvider` implementation
8
- (React, Vue, Solid, Svelte). `TRegistry` captures the framework-specific
9
- `DefineRegistryResult` type; `RenderErrorHandler` is sourced from
10
- `@xmachines/json-render-core` so no second generic is needed.
7
+ The framework-agnostic base props. Every `ActorProvider` implementation shares
8
+ them: React, Vue, Solid, and Svelte. `TRegistry` holds the
9
+ `DefineRegistryResult` type of the framework. `RenderErrorHandler` comes from
10
+ `@xmachines/json-render-core`, and a second generic parameter is therefore not
11
+ necessary.
11
12
 
12
- Framework packages extend this with their `fallback`, `onError`, and `children` fields.
13
+ Each framework package extends this interface with its `fallback` field, its
14
+ `onError` field, and its `children` field.
13
15
 
14
16
  ## Example
15
17
 
@@ -33,12 +35,12 @@ interface ActorProviderProps extends BaseActorProviderProps<DefineRegistryResult
33
35
 
34
36
  ## Properties
35
37
 
36
- | Property | Type | Description | Inherited from | Defined in |
37
- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38
- | <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:156](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-actor/src/abstract-actor.ts#L156) |
39
- | <a id="property-children"></a> `children` | `Snippet` | - | - | [packages/play-svelte/src/actor-context.svelte.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L71) |
40
- | <a id="property-fallback"></a> `fallback?` | `Snippet`\<\[\]\> | - | - | [packages/play-svelte/src/actor-context.svelte.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L69) |
41
- | <a id="property-onerror"></a> `onError?` | (`error`, `reset`) => `void` | - | - | [packages/play-svelte/src/actor-context.svelte.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-svelte/src/actor-context.svelte.ts#L70) |
42
- | <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:169](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-actor/src/abstract-actor.ts#L169) |
43
- | <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:158](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-actor/src/abstract-actor.ts#L158) |
44
- | <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:164](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-actor/src/abstract-actor.ts#L164) |
38
+ | Property | Type | Description | Inherited from | Defined in |
39
+ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
+ | <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) | The actor instance with the currentView signal. It requires the Viewable capability. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`actor`](../../play-actor/interfaces/BaseActorProviderProps.md#property-actor) | [packages/play-actor/src/abstract-actor.ts:163](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L163) |
41
+ | <a id="property-children"></a> `children` | `Snippet` | - | - | [packages/play-svelte/src/actor-context.svelte.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L75) |
42
+ | <a id="property-fallback"></a> `fallback?` | `Snippet`\<\[\]\> | - | - | [packages/play-svelte/src/actor-context.svelte.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L73) |
43
+ | <a id="property-onerror"></a> `onError?` | (`error`, `reset`) => `void` | - | - | [packages/play-svelte/src/actor-context.svelte.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-svelte/src/actor-context.svelte.ts#L74) |
44
+ | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | The provider calls it when one catalog component throws during a render. This handler replaces every onRenderError of defineRegistry. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`onRenderError`](../../play-actor/interfaces/BaseActorProviderProps.md#property-onrendererror) | [packages/play-actor/src/abstract-actor.ts:177](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L177) |
45
+ | <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` | The complete result of defineRegistry(). It holds the component registry and the factory of the action handlers. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`registryResult`](../../play-actor/interfaces/BaseActorProviderProps.md#property-registryresult) | [packages/play-actor/src/abstract-actor.ts:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L165) |
46
+ | <a id="property-store"></a> `store?` | `StateStore` | The optional external StateStore, which is the controlled mode. With this option, the provider ignores spec.state, and this store is the single source of truth. Without it, the provider makes a new @xstate/store atom for each view transition, with the values of spec.state. | [`BaseActorProviderProps`](../../play-actor/interfaces/BaseActorProviderProps.md).[`store`](../../play-actor/interfaces/BaseActorProviderProps.md#property-store) | [packages/play-actor/src/abstract-actor.ts:172](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L172) |