@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,30 +2,31 @@
2
2
 
3
3
  # Class: PlayRenderer
4
4
 
5
- Defined in: [packages/play-dom/src/PlayRenderer.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/PlayRenderer.ts#L68)
5
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/PlayRenderer.ts#L72)
6
6
 
7
- PlayRenderer connects an actor's `currentView` signal to the DOM renderer.
7
+ PlayRenderer connects the `currentView` signal of an actor to the DOM renderer.
8
8
 
9
- Watches `actor.currentView` via TC39 Signals and renders `DomComponentRenderer`
10
- functions into `container` on every view transition. Cleared on `disconnect()`.
9
+ It watches `actor.currentView` through the TC39 Signals. It renders each
10
+ `DomComponentRenderer` function into `container` on every view transition.
11
+ `disconnect()` clears the container.
11
12
 
12
- Options from `PlayDomOptions` (which extends `UIProviderOptions`) are all forwarded
13
- into `DomRenderContext` on every render pass:
13
+ Every option of `PlayDomOptions`, which extends `UIProviderOptions`, goes into
14
+ `DomRenderContext` on each render pass:
14
15
 
15
- - `functions` — named compute functions for `{ $computed: "name" }` prop expressions
16
- - `directives` — custom `$`-prefixed dynamic values (from `defineDirective`), resolved during prop resolution
17
- - `validationFunctions` — custom validation functions, available at `ctx.ctx.validationFunctions`
18
- - `navigate` — navigation callback, invoked on `onSuccess: { navigate: "..." }` action bindings
19
- - `onRenderError` — called with `(error, name)` for component render errors and action handler rejections
16
+ - `functions` — the named compute functions of a `{ $computed: "name" }` prop expression
17
+ - `directives` — your own dynamic values with a `$` prefix, from `defineDirective`. The renderer resolves them with the props
18
+ - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`
19
+ - `navigate` — the navigation callback. The renderer calls it for an `onSuccess: { navigate: "..." }` action binding
20
+ - `onRenderError` — the renderer calls it with `(error, name)` for a component render error and for an action handler rejection
20
21
 
21
- **Preferred usage via `registryResult`:**
22
+ **The preferred use, with `registryResult`:**
22
23
 
23
24
  ```typescript
24
25
  import { PlayRenderer, defineRegistry } from "@xmachines/play-dom";
25
26
 
26
27
  const registryResult = defineRegistry(catalog, { components, actions });
27
28
  const renderer = new PlayRenderer(container, actor, registryResult.registry, {
28
- registryResult, // wires setState/getState from xstate store automatically
29
+ registryResult, // it connects setState and getState of the xstate store for you
29
30
  navigate: (path) => myRouter.push(path),
30
31
  functions: { fullName: (args) => `${args.first} ${args.last}` },
31
32
  });
@@ -34,7 +35,7 @@ renderer.connect();
34
35
  renderer.disconnect();
35
36
  ```
36
37
 
37
- **Controlled store mode** — bring your own `StateStore`:
38
+ **The controlled store mode** — you give your own `StateStore`:
38
39
 
39
40
  ```typescript
40
41
  import { createAtom } from "@xstate/store";
@@ -46,8 +47,9 @@ const renderer = new PlayRenderer(container, actor, registry, { registryResult,
46
47
  renderer.connect();
47
48
  ```
48
49
 
49
- Double `connect()` is safe calling `connect()` while already connected
50
- automatically disconnects first, preventing double-render subscriptions.
50
+ A second `connect()` is safe. A `connect()` call on a connected renderer
51
+ disconnects it first. Therefore the renderer holds no second render
52
+ subscription.
51
53
 
52
54
  ## Constructors
53
55
 
@@ -61,16 +63,16 @@ new PlayRenderer(
61
63
  options?): PlayRenderer;
62
64
  ```
63
65
 
64
- Defined in: [packages/play-dom/src/PlayRenderer.ts:126](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/PlayRenderer.ts#L126)
66
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:130](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/PlayRenderer.ts#L130)
65
67
 
66
68
  #### Parameters
67
69
 
68
- | Parameter | Type | Description |
69
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
- | `container` | `HTMLElement` | `HTMLElement` to render into. Cleared and repopulated on every view transition. |
71
- | `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 providing the `currentView` signal (must implement `Viewable`). |
72
- | `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | Component renderer map typically `registryResult.registry` from `defineRegistry`. |
73
- | `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | Configuration (see [PlayDomOptions](../interfaces/PlayDomOptions.md)): - `registryResult` — auto-wires `setState`/`state` from the xstate store. - `store` — external `StateStore` (controlled mode; overrides `spec.state` seeding). - `loading` — streaming mode flag; suppresses missing-child warnings. - `functions` — named compute functions for `$computed` prop expressions. - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution. - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`. - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`. - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections; suppresses `console.error` fallback. |
70
+ | Parameter | Type | Description |
71
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
72
+ | `container` | `HTMLElement` | The `HTMLElement` to render into. Each view transition clears it and fills it again. |
73
+ | `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 with the `currentView` signal. It must implement `Viewable`. |
74
+ | `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The map of the component renderers, usually `registryResult.registry` from `defineRegistry`. |
75
+ | `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | The configuration. See [PlayDomOptions](../interfaces/PlayDomOptions.md): - `registryResult` — it connects `setState` and `state` of the xstate store for you. - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`. - `loading` — the flag of the streaming mode. It stops each warning about an absent child. - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. It stops the `console.error` fallback. |
74
76
 
75
77
  #### Returns
76
78
 
@@ -84,15 +86,15 @@ Defined in: [packages/play-dom/src/PlayRenderer.ts:126](https://gitlab.com/xmach
84
86
  connect(): void;
85
87
  ```
86
88
 
87
- Defined in: [packages/play-dom/src/PlayRenderer.ts:142](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/PlayRenderer.ts#L142)
89
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:146](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/PlayRenderer.ts#L146)
88
90
 
89
- Start watching actor.currentView and render to container.
90
- Renders the initial view synchronously, then subscribes to signal changes.
91
+ Starts the watch of actor.currentView, and renders into the container.
92
+ It renders the first view synchronously, then it subscribes to the signal changes.
91
93
 
92
- Calling `connect()` on an already-connected renderer (where a previous
93
- `connect()` was never followed by `disconnect()`) would silently install a
94
- second `watchSignal` subscription, causing double-renders on every view
95
- change. Guard against this by auto-disconnecting first.
94
+ A `connect()` call on a connected renderer, where a `disconnect()` call did not
95
+ follow the previous `connect()`, installs a second `watchSignal` subscription.
96
+ Each view change then renders two times. Therefore this method disconnects the
97
+ renderer first.
96
98
 
97
99
  #### Returns
98
100
 
@@ -106,9 +108,9 @@ change. Guard against this by auto-disconnecting first.
106
108
  disconnect(): void;
107
109
  ```
108
110
 
109
- Defined in: [packages/play-dom/src/PlayRenderer.ts:151](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/PlayRenderer.ts#L151)
111
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:155](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/PlayRenderer.ts#L155)
110
112
 
111
- Stop watching and clear the container.
113
+ Stops the watch and clears the container.
112
114
 
113
115
  #### Returns
114
116
 
@@ -6,23 +6,23 @@
6
6
  function createPlayUI(registryResult, options?): MountFn;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-dom/src/create-play-ui.ts:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-play-ui.ts#L93)
9
+ Defined in: [packages/play-dom/src/create-play-ui.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-play-ui.ts#L95)
10
10
 
11
- Create a batteries-included DOM renderer mount function.
11
+ Creates the mount function of the complete DOM renderer.
12
12
 
13
- The caller is responsible for producing `registryResult` via `defineRegistry`.
14
- `createPlayUI` closes over it and returns a `MountFn` that can be invoked
15
- once per actor/container pair.
13
+ The caller makes `registryResult` with `defineRegistry`. `createPlayUI` holds it,
14
+ and it returns a `MountFn`. Call that function one time for each pair of an actor
15
+ and a container.
16
16
 
17
17
  ## Parameters
18
18
 
19
- | Parameter | Type | Description |
20
- | ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
- | `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | Result from `defineRegistry()` provides the registry and the lazy handlers factory. |
22
- | `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | Factory-level configuration (see [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md)): - `functions` — named compute functions for `$computed` prop expressions. - `directives` — custom `$`-prefixed dynamic values resolved during prop resolution. - `validationFunctions` — custom validation functions; available at `ctx.ctx.validationFunctions`. - `navigate` — navigation callback; invoked on `onSuccess: { navigate: "..." }`. - `onRenderError` — `(error, name)` handler for component render errors and action handler rejections. - `fallback` — element shown when the actor's initial view is `null`. |
19
+ | Parameter | Type | Description |
20
+ | ---------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | The result of `defineRegistry()`. It gives the registry and the factory of the handlers, which it builds late. |
22
+ | `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | The factory configuration. See [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md): - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. - `fallback` — the element to show when the first view of the actor is `null`. |
23
23
 
24
24
  ## Returns
25
25
 
26
26
  [`MountFn`](../type-aliases/MountFn.md)
27
27
 
28
- `MountFn`: `(actor, container, mountOptions?) → disconnect`
28
+ The `MountFn`: `(actor, container, mountOptions?) → disconnect`
@@ -6,12 +6,13 @@
6
6
  function createRenderer<C>(catalog, componentMap): (actor, container, options?) => () => void;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-dom/src/create-renderer.ts:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-renderer.ts#L84)
9
+ Defined in: [packages/play-dom/src/create-renderer.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-renderer.ts#L88)
10
10
 
11
- Create a reusable DOM renderer factory from a catalog and component map.
11
+ Creates a DOM renderer factory from a catalog and a component map. You can use
12
+ the factory more than one time.
12
13
 
13
- Returns a `mount(actor, container, options?)` function that wires up the
14
- PlayRenderer in one call and returns a `disconnect` cleanup function.
14
+ It returns a `mount(actor, container, options?)` function. That function connects
15
+ the PlayRenderer in one call, and it returns a `disconnect` cleanup function.
15
16
 
16
17
  ## Type Parameters
17
18
 
@@ -21,24 +22,27 @@ PlayRenderer in one call and returns a `disconnect` cleanup function.
21
22
 
22
23
  ## Parameters
23
24
 
24
- | Parameter | Type | Description |
25
- | -------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------- |
26
- | `catalog` | `C` | The json-render Catalog describing component and action schemas. |
27
- | `componentMap` | [`ComponentRegistry`](../type-aliases/ComponentRegistry.md)\<`C`\> | Component implementations keyed by catalog component name. |
25
+ | Parameter | Type | Description |
26
+ | -------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
27
+ | `catalog` | `C` | The json-render Catalog. It describes the schema of each component and of each action. |
28
+ | `componentMap` | [`ComponentRegistry`](../type-aliases/ComponentRegistry.md)\<`C`\> | The component implementations, with the catalog component name as the key. |
28
29
 
29
30
  ## Returns
30
31
 
31
- A `mount` function that accepts `(actor, container, options?)` and returns `disconnect`.
32
+ A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.
32
33
 
33
34
  (`actor`, `container`, `options?`) => () => `void`
34
35
 
35
36
  ## Remarks
36
37
 
37
- `createRenderer` manages `registryResult` internally it calls `defineRegistry` once and
38
- reuses the result across all `mount()` calls. The `mount` options type therefore excludes
39
- `registryResult` (it is always provided by `createRenderer` itself and cannot be overridden).
40
-
41
- If you need to call `registryResult.executeAction()` programmatically (outside the emit/on
42
- flow), or pass additional provider options (`navigate`, `onRenderError`, `functions`, etc.),
43
- use `createPlayUI` (which accepts the full `CreatePlayUIOptions`) or `defineRegistry` with
44
- `PlayRenderer` directly rather than `createRenderer`.
38
+ `createRenderer` manages `registryResult` internally. It calls `defineRegistry`
39
+ one time, and it uses that result in every `mount()` call. Therefore the options
40
+ type of `mount` holds no `registryResult`: `createRenderer` always gives it, and
41
+ you cannot replace it.
42
+
43
+ Two situations need a different function. In the first, your code calls
44
+ `registryResult.executeAction()` itself, outside the emit and on flow. In the
45
+ second, you give more provider options, such as `navigate`, `onRenderError`, or
46
+ `functions`. Use `createPlayUI`, which accepts the complete
47
+ `CreatePlayUIOptions`. You can also use `defineRegistry` with `PlayRenderer`
48
+ directly.
@@ -2,16 +2,16 @@
2
2
 
3
3
  # Interface: CreatePlayUIOptions
4
4
 
5
- Defined in: [packages/play-dom/src/types.ts:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L67)
5
+ Defined in: [packages/play-dom/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L69)
6
6
 
7
- Options for `createPlayUI()` the batteries-included DOM factory.
7
+ The options of `createPlayUI()`, the complete DOM factory.
8
8
 
9
- Extends [UIProviderOptions](UIProviderOptions.md), which contributes `functions`,
10
- `directives`, `validationFunctions`, `navigate`, and `onRenderError`. All
11
- are closed over at factory creation time and forwarded into `PlayRenderer`
12
- on every `mount()` call.
9
+ This type extends [UIProviderOptions](UIProviderOptions.md), which gives `functions`,
10
+ `directives`, `validationFunctions`, `navigate`, and `onRenderError`. The factory
11
+ holds all of them from the moment of its creation, and it gives them to
12
+ `PlayRenderer` on every `mount()` call.
13
13
 
14
- Parallel to `PlayUIProvider`'s props in the framework renderers.
14
+ This type is parallel to the props of `PlayUIProvider` in the framework renderers.
15
15
 
16
16
  ## See
17
17
 
@@ -26,7 +26,7 @@ createPlayUI
26
26
  | Property | Type | Description | Inherited from | Defined in |
27
27
  | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
28
28
  | <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });` | [`UIProviderOptions`](UIProviderOptions.md).[`directives`](UIProviderOptions.md#property-directives) | - |
29
- | <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | Optional fallback element shown when `currentView` is `null` on **initial mount** only. The fallback is appended immediately after `mount()` if the container is empty at that moment (i.e. the actor's initial view is `null`). **Limitation:** If the actor's view transitions to `null` after mount, the container will be cleared but this fallback will NOT be re-appended. For dynamic fallback behavior (null view after non-null), use `PlayRenderer` directly and wrap the `actor.currentView` signal to inject fallback content. | - | [packages/play-dom/src/types.ts:79](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L79) |
29
+ | <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | The optional fallback element. The factory shows it when `currentView` is `null` on the **first mount** only. The factory appends the fallback directly after `mount()`, when the container is empty at that moment, which means that the first view of the actor is `null`. **Limitation:** when the view of the actor becomes `null` after the mount, the renderer clears the container, and it does NOT append this fallback again. For a dynamic fallback, which follows a null view after a view that was not null, use `PlayRenderer` directly and wrap the `actor.currentView` signal to add the fallback content. | - | [packages/play-dom/src/types.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L82) |
30
30
  | <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named compute functions for `{ $computed: "name", args: {...} }` prop expressions. Each function receives the resolved `args` object and returns the computed value. Forwarded directly to `resolveElementProps` via `PropResolutionContext.functions`, matching the `FunctionsContext` provider in the framework renderers. Without this option, `$computed` expressions resolve to `undefined` (no throw). **Example** `renderSpec(spec, store, registry, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`. | [`UIProviderOptions`](UIProviderOptions.md).[`functions`](UIProviderOptions.md#property-functions) | - |
31
31
  | <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Programmatic navigation function. Called automatically when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Mirrors the `navigate` prop in `ActionProvider` from the framework renderers, where it is captured in the `execute()` closure. Also available to component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding. **Example** `import { useNavigate } from "my-router"; const navigate = useNavigate(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | - |
32
32
  | <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters. | [`UIProviderOptions`](UIProviderOptions.md).[`onConfirm`](UIProviderOptions.md#property-onconfirm) | - |
@@ -2,17 +2,17 @@
2
2
 
3
3
  # Interface: MountOptions
4
4
 
5
- Defined in: [packages/play-dom/src/create-play-ui.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-play-ui.ts#L48)
5
+ Defined in: [packages/play-dom/src/create-play-ui.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-play-ui.ts#L49)
6
6
 
7
- Per-mount options passed to the `MountFn` returned by `createPlayUI`.
7
+ The mount options of the `MountFn` that `createPlayUI` returns.
8
8
 
9
- These override or supplement the factory-level options on a per-actor/container
10
- basis. Factory-level options (`functions`, `validationFunctions`, `navigate`,
11
- `onRenderError`, `fallback`) are set once when calling `createPlayUI`.
9
+ They replace or complete the factory options, for one actor and one container.
10
+ The `createPlayUI` call sets the factory options (`functions`,
11
+ `validationFunctions`, `navigate`, `onRenderError`, and `fallback`) one time.
12
12
 
13
13
  ## Properties
14
14
 
15
- | Property | Type | Description | Defined in |
16
- | ---------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | <a id="property-loading"></a> `loading?` | `boolean` | When `true`, suppresses missing-child warnings during streaming spec ingestion and exposes `ctx.ctx.loading` to component implementations. | [packages/play-dom/src/create-play-ui.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-play-ui.ts#L59) |
18
- | <a id="property-store"></a> `store?` | `StateStore` | Optional external `StateStore` (controlled mode). When omitted, a fresh `@xstate/store` atom is created per view transition seeded from `spec.state`. | [packages/play-dom/src/create-play-ui.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-play-ui.ts#L54) |
15
+ | Property | Type | Description | Defined in |
16
+ | ---------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the renderer stops each warning about an absent child during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each component implementation. | [packages/play-dom/src/create-play-ui.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-play-ui.ts#L61) |
18
+ | <a id="property-store"></a> `store?` | `StateStore` | The optional external `StateStore`, which is the controlled mode. Without it, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | [packages/play-dom/src/create-play-ui.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-play-ui.ts#L55) |
@@ -2,14 +2,14 @@
2
2
 
3
3
  # Interface: PlayDomOptions
4
4
 
5
- Defined in: [packages/play-dom/src/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L23)
5
+ Defined in: [packages/play-dom/src/types.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L23)
6
6
 
7
- Options for `PlayRenderer`.
7
+ The options of `PlayRenderer`.
8
8
 
9
- Extends [UIProviderOptions](UIProviderOptions.md), which contributes `functions`,
10
- `directives`, `validationFunctions`, `navigate`, and `onRenderError`. All
11
- are forwarded into `DomRenderContext` on every render pass and are readable
12
- by component implementations via `ctx.ctx.*`.
9
+ This type extends [UIProviderOptions](UIProviderOptions.md), which gives `functions`,
10
+ `directives`, `validationFunctions`, `navigate`, and `onRenderError`. Each render
11
+ pass puts all of them into `DomRenderContext`, and a component implementation
12
+ reads them at `ctx.ctx.*`.
13
13
 
14
14
  ## Extends
15
15
 
@@ -21,10 +21,10 @@ by component implementations via `ctx.ctx.*`.
21
21
  | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
22
22
  | <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });` | [`UIProviderOptions`](UIProviderOptions.md).[`directives`](UIProviderOptions.md#property-directives) | - |
23
23
  | <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named compute functions for `{ $computed: "name", args: {...} }` prop expressions. Each function receives the resolved `args` object and returns the computed value. Forwarded directly to `resolveElementProps` via `PropResolutionContext.functions`, matching the `FunctionsContext` provider in the framework renderers. Without this option, `$computed` expressions resolve to `undefined` (no throw). **Example** `renderSpec(spec, store, registry, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`. | [`UIProviderOptions`](UIProviderOptions.md).[`functions`](UIProviderOptions.md#property-functions) | - |
24
- | <a id="property-loading"></a> `loading?` | `boolean` | When `true`, indicates the spec is still streaming (e.g. from an AI provider). Forwarded to `renderSpec` so component implementations can read `ctx.ctx.loading` to render skeleton states. Also suppresses missing-child warnings during stream ingestion, since referenced elements may not yet have arrived in the incremental spec. Mirrors the `loading` prop from framework renderer providers. | - | [packages/play-dom/src/types.ts:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L52) |
24
+ | <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the spec is still streaming, for example from an AI provider. The renderer gives the flag to `renderSpec`. A component implementation therefore reads `ctx.ctx.loading`, and it can render a skeleton state. The flag also stops each warning about an absent child during the ingestion of the stream, because an element of a reference can still be absent from the incremental spec. This option matches the `loading` prop of the framework renderer providers. | - | [packages/play-dom/src/types.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L54) |
25
25
  | <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Programmatic navigation function. Called automatically when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Mirrors the `navigate` prop in `ActionProvider` from the framework renderers, where it is captured in the `execute()` closure. Also available to component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding. **Example** `import { useNavigate } from "my-router"; const navigate = useNavigate(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | - |
26
26
  | <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters. | [`UIProviderOptions`](UIProviderOptions.md).[`onConfirm`](UIProviderOptions.md#property-onconfirm) | - |
27
27
  | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Unified error handler for component render errors and action handler rejections. Matches `RenderErrorHandler = (error: unknown, name: string) => void`. Invoked for three distinct error classes: - `(error, elementType)` — when a component renderer throws synchronously during `renderSpec` - `(error, actionName)` — when an action handler rejects during `emit()` (on-event path) - `(error, actionName)` — when an action handler rejects during a `watch` binding callback When provided, suppresses the `console.error` fallback for all three error types. Forwarded into `renderSpec` as the `onRenderError` parameter and into `DomRenderContext.onRenderError` so both `emit()` and `watch` handlers route their errors through the same channel as component render errors. **Example** `renderSpec(spec, store, registry, { onRenderError: (err, name) => { myErrorReporter.capture(err, { context: name }); }, });` | [`UIProviderOptions`](UIProviderOptions.md).[`onRenderError`](UIProviderOptions.md#property-onrendererror) | - |
28
- | <a id="property-registryresult"></a> `registryResult?` | [`DefineRegistryResult`](DefineRegistryResult.md) | The result from `defineRegistry` provides both the registry and the handlers factory. When provided, `PlayRenderer` wires `setState` and `getState` from the @xstate/store-backed `StateStore` into the handlers factory automatically. This is the preferred approach as it ensures actions always receive live `setState` and `state` bound to the current store. | - | [packages/play-dom/src/types.ts:31](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L31) |
29
- | <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @xmachines/json-render-xstate). When provided, `PlayRenderer` operates in controlled mode `spec.state` is ignored and this store is the single source of truth for UI state (form values, etc.). When omitted, a fresh `@xstate/store` atom is created internally per view transition, seeded from `spec.state`. | - | [packages/play-dom/src/types.ts:41](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/types.ts#L41) |
28
+ | <a id="property-registryresult"></a> `registryResult?` | [`DefineRegistryResult`](DefineRegistryResult.md) | The result of `defineRegistry`. It gives the registry and the factory of the handlers. With this option, `PlayRenderer` connects `setState` and `getState` of the `StateStore` on @xstate/store to the factory of the handlers for you. This is the preferred way, because each action then always receives a live `setState` and a live `state` on the current store. | - | [packages/play-dom/src/types.ts:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L32) |
29
+ | <a id="property-store"></a> `store?` | `StateStore` | The optional external StateStore, for example from `xstateStoreStateStore` in @xmachines/json-render-xstate. With this option, `PlayRenderer` works in the controlled mode: it ignores `spec.state`, and this store is the single source of truth of the UI state, such as a form value. Without this option, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | - | [packages/play-dom/src/types.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/types.ts#L42) |
30
30
  | <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions for inline field validation. Each function receives `(value, args?)` and returns `true` (valid) or `false` (invalid). Functions are available to component implementations via `ctx.ctx.validationFunctions` and should be passed as `customFunctions` to `runValidationCheck` / `runValidation` from `@xmachines/json-render-core`. Mirrors `customFunctions` in `ValidationProvider` from the framework renderers. The DOM renderer has no automatic `ValidationProvider` tree — validation must be invoked explicitly by component implementations. **Example** `import { runValidationCheck } from "@xmachines/json-render-core"; renderSpec(spec, store, registry, { validationFunctions: { isEven: (value) => typeof value === "number" && value % 2 === 0, phoneNumber: (value) => /^\+?[\d\s\-()]{7,}$/.test(String(value)), }, }); // Inside a ComponentFn: const MyField: ComponentFn<typeof catalog, "MyField"> = ({ ctx }) => { const result = runValidationCheck( { type: "isEven", message: "must be even" }, { value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions }, ); // result.valid, result.message };` | [`UIProviderOptions`](UIProviderOptions.md).[`validationFunctions`](UIProviderOptions.md#property-validationfunctions) | - |
@@ -6,13 +6,13 @@
6
6
  type MountFn = (actor, container, options?) => () => void;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-dom/src/create-play-ui.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-dom/src/create-play-ui.ts#L69)
9
+ Defined in: [packages/play-dom/src/create-play-ui.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom/src/create-play-ui.ts#L71)
10
10
 
11
- The mount function returned by `createPlayUI`.
11
+ The mount function that `createPlayUI` returns.
12
12
 
13
- Call with `(actor, container, mountOptions?)` to start the renderer.
14
- Returns a `disconnect` cleanup function that stops rendering and clears
15
- the container.
13
+ Call it with `(actor, container, mountOptions?)` to start the renderer.
14
+ It returns a `disconnect` cleanup function. That function stops the render and
15
+ clears the container.
16
16
 
17
17
  ## Parameters
18
18