@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.
- package/README.md +11 -13
- package/api/@xmachines/play/README.md +58 -63
- package/api/@xmachines/play/classes/NonNullableError.md +7 -7
- package/api/@xmachines/play/classes/PlayError.md +25 -27
- package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
- package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
- package/api/@xmachines/play-actor/README.md +72 -63
- package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
- package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
- package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
- package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
- package/api/@xmachines/play-dom/README.md +119 -85
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
- package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
- package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
- package/api/@xmachines/play-dom-router/README.md +66 -49
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
- package/api/@xmachines/play-react/README.md +63 -54
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
- package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
- package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
- package/api/@xmachines/play-react-router/README.md +37 -28
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
- package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
- package/api/@xmachines/play-router/README.md +94 -82
- package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
- package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
- package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
- package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
- package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
- package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
- package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +8 -8
- package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
- package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +38 -36
- package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
- package/api/@xmachines/play-solid/README.md +46 -42
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
- package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
- package/api/@xmachines/play-solid-router/README.md +34 -29
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-svelte/README.md +40 -31
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
- package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +38 -34
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +37 -17
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
- package/api/@xmachines/play-vue/README.md +37 -35
- package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
- package/api/@xmachines/play-vue-router/README.md +65 -56
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
- package/api/@xmachines/play-xstate/README.md +72 -70
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
- package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
- package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
- package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
- package/api/@xmachines/shared/README.md +11 -13
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/development.md +28 -0
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayErrorBoundary
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L54)
|
|
6
6
|
|
|
7
|
-
React class component error
|
|
7
|
+
The React class component that catches a render error of a catalog component.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
React error boundary protocol.
|
|
11
|
-
|
|
9
|
+
It wraps each render of a catalog component. It catches a failure and sends it to
|
|
10
|
+
the standard React error boundary protocol. Attach the `onError` prop to send
|
|
11
|
+
each error to an observability tool in production, such as Sentry or Datadog.
|
|
12
12
|
|
|
13
|
-
**React 19 safety (Phase 29):** `componentDidCatch` calls `onError` for
|
|
14
|
-
but does NOT
|
|
15
|
-
|
|
13
|
+
**React 19 safety (Phase 29):** `componentDidCatch` calls `onError` for the
|
|
14
|
+
observability, but it does NOT throw the error again. `getDerivedStateFromError`
|
|
15
|
+
sets the fallback state already, and a throw from `componentDidCatch` can unmount
|
|
16
|
+
the complete React 19 root.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
CONS-14: the class component pattern works with every React version, 18 and 19.
|
|
18
19
|
|
|
19
20
|
## Example
|
|
20
21
|
|
|
@@ -36,7 +37,7 @@ Per CONS-14: Class component pattern works with all React versions (18 and 19).
|
|
|
36
37
|
new PlayErrorBoundary(props): PlayErrorBoundary;
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:
|
|
40
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L58)
|
|
40
41
|
|
|
41
42
|
#### Parameters
|
|
42
43
|
|
|
@@ -75,7 +76,7 @@ React.Component<
|
|
|
75
76
|
componentDidCatch(error, info): void;
|
|
76
77
|
```
|
|
77
78
|
|
|
78
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:
|
|
79
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L67)
|
|
79
80
|
|
|
80
81
|
Catches exceptions generated in descendant components. Unhandled exceptions will cause
|
|
81
82
|
the entire component tree to unmount.
|
|
@@ -375,7 +376,7 @@ React.Component.getSnapshotBeforeUpdate;
|
|
|
375
376
|
render(): ReactNode;
|
|
376
377
|
```
|
|
377
378
|
|
|
378
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:
|
|
379
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L71)
|
|
379
380
|
|
|
380
381
|
#### Returns
|
|
381
382
|
|
|
@@ -604,7 +605,7 @@ React.Component.UNSAFE_componentWillUpdate;
|
|
|
604
605
|
static getDerivedStateFromError(error): PlayErrorBoundaryState;
|
|
605
606
|
```
|
|
606
607
|
|
|
607
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:
|
|
608
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L63)
|
|
608
609
|
|
|
609
610
|
#### Parameters
|
|
610
611
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function useActor(): AnyPlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-react/src/useActor.ts:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/useActor.ts#L34)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
function usePlayView(): ViewContextValue;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/ActorProvider.tsx:
|
|
9
|
+
Defined in: [packages/play-react/src/ActorProvider.tsx:94](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L94)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The hook that gives the current view spec, the handlers, and the registry.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Call it inside <ActorProvider> or <PlayUIProvider>.
|
|
14
14
|
|
|
15
15
|
## Returns
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ Must be called inside <ActorProvider> or <PlayUIProvider>.
|
|
|
18
18
|
|
|
19
19
|
## Throws
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
When the caller is outside an ActorProvider or PlayUIProvider tree
|
|
22
22
|
|
|
23
23
|
## Example
|
|
24
24
|
|
|
@@ -6,33 +6,33 @@
|
|
|
6
6
|
function useSignalEffect(callback, deps?): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/useSignalEffect.ts:
|
|
9
|
+
Defined in: [packages/play-react/src/useSignalEffect.ts:81](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/useSignalEffect.ts#L81)
|
|
10
10
|
|
|
11
|
-
React hook that subscribes to signal changes and runs effect callback
|
|
11
|
+
The React hook that subscribes to the signal changes and runs an effect callback
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
The hook puts the callback in a Signal.Computed, which tracks each signal that
|
|
14
|
+
the callback reads. It then gives the watcher lifecycle to `watchSignal` from
|
|
15
|
+
`@xmachines/play-signals`. That function does the microtask batching, the new arm
|
|
16
|
+
of the watcher, and the disposal. It is the one canonical implementation, and
|
|
17
|
+
every framework renderer uses it.
|
|
18
18
|
|
|
19
19
|
Architecture:
|
|
20
20
|
|
|
21
|
-
-
|
|
22
|
-
- watchSignal owns the Signal.subtle.Watcher lifecycle (Phase 29 memory safety)
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
21
|
+
- The hook puts the callback in a Signal.Computed for the dependency tracking
|
|
22
|
+
- watchSignal owns the Signal.subtle.Watcher lifecycle (Phase 29, memory safety)
|
|
23
|
+
- The microtask batching groups rapid signal updates
|
|
24
|
+
- The callback triggers each new render with its own setState (see the remarks)
|
|
25
|
+
- The hook cleans up on unmount, so that nothing stays in memory
|
|
26
26
|
|
|
27
|
-
Invariant: Signal-Only Reactivity
|
|
28
|
-
Invariant: Passive Infrastructure
|
|
27
|
+
Invariant: Signal-Only Reactivity. The hook watches each signal that the callback reads.
|
|
28
|
+
Invariant: Passive Infrastructure. React observes the signals, and it does not control them.
|
|
29
29
|
|
|
30
30
|
## Parameters
|
|
31
31
|
|
|
32
|
-
| Parameter | Type | Default value | Description
|
|
33
|
-
| ---------- | ------------------------------ | ------------- |
|
|
34
|
-
| `callback` | () => `void` \| (() => `void`) | `undefined` |
|
|
35
|
-
| `deps` | `DependencyList` | `[]` |
|
|
32
|
+
| Parameter | Type | Default value | Description |
|
|
33
|
+
| ---------- | ------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `callback` | () => `void` \| (() => `void`) | `undefined` | The effect function that reads the signals. It can return a cleanup function. |
|
|
35
|
+
| `deps` | `DependencyList` | `[]` | The optional dependency list, as in useEffect. On a change of one dependency, the hook removes the watcher and the Computed, then makes them again and tracks the signals from the start. The default is `[]`, which subscribes one time for each mount. Give this list when the identity of the object whose signals you read can change during the life of the component, for example an `actor` prop. Without the list, the watcher tracks the signals of the OLD object for ever. |
|
|
36
36
|
|
|
37
37
|
## Returns
|
|
38
38
|
|
|
@@ -44,34 +44,34 @@ Invariant: Passive Infrastructure - React observes signals and does not control
|
|
|
44
44
|
const MyComponent = ({ actor }) => {
|
|
45
45
|
const [view, setView] = useState(null);
|
|
46
46
|
|
|
47
|
-
// Subscribe to actor.currentView signal
|
|
47
|
+
// Subscribe to the actor.currentView signal, and subscribe again on a new actor
|
|
48
48
|
useSignalEffect(() => {
|
|
49
49
|
const currentView = actor.currentView.get();
|
|
50
50
|
setView(currentView);
|
|
51
51
|
}, [actor]);
|
|
52
52
|
|
|
53
|
-
return <div>{view?.
|
|
53
|
+
return <div>{view?.root}</div>;
|
|
54
54
|
};
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
## Remarks
|
|
58
58
|
|
|
59
|
-
**CRITICAL:**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
**Performance:**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**Re-rendering:** the hook itself does NOT force a React render on signal
|
|
66
|
-
change
|
|
67
|
-
signal value
|
|
68
|
-
skip
|
|
69
|
-
force-update here
|
|
70
|
-
when the callback
|
|
71
|
-
notification
|
|
72
|
-
into React state inside the callback.
|
|
73
|
-
|
|
74
|
-
**Implementation note:**
|
|
75
|
-
Signal.subtle.Watcher cannot
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
**CRITICAL:** read each signal unconditionally, with no `if` statement. A
|
|
60
|
+
conditional read breaks the dependency tracking.
|
|
61
|
+
|
|
62
|
+
**Performance:** the microtask batching (queueMicrotask, inside watchSignal)
|
|
63
|
+
stops a flood of React renders when several signals update in rapid sequence.
|
|
64
|
+
|
|
65
|
+
**Re-rendering:** the hook itself does NOT force a React render on a signal
|
|
66
|
+
change. The callback triggers each new render, because it calls setState with the
|
|
67
|
+
new signal value, as in the example above. The setState bailout of React can
|
|
68
|
+
therefore skip a render when the derived value is the same. An unconditional
|
|
69
|
+
force-update here caused one wasted render for each notification before, also
|
|
70
|
+
when the setState of the callback made the bailout. If you must render again on
|
|
71
|
+
every notification, and you read the signals during the render, copy the signal
|
|
72
|
+
value into the React state inside the callback.
|
|
73
|
+
|
|
74
|
+
**Implementation note:** the hook puts the callback in a Signal.Computed, because
|
|
75
|
+
Signal.subtle.Watcher cannot track an arbitrary function call. The Computed does
|
|
76
|
+
the dependency tracking. watchSignal evaluates the Computed, which runs the
|
|
77
|
+
callback, on each change of a tracked signal.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ActorProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/ActorProvider.tsx:
|
|
5
|
+
Defined in: [packages/play-react/src/ActorProvider.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L53)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of the ActorProvider component.
|
|
8
8
|
|
|
9
9
|
## Extends
|
|
10
10
|
|
|
@@ -16,12 +16,12 @@ Props for the ActorProvider component.
|
|
|
16
16
|
|
|
17
17
|
## Properties
|
|
18
18
|
|
|
19
|
-
| Property | Type | Description
|
|
20
|
-
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
-
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) |
|
|
22
|
-
| <a id="property-children"></a> `children` | `ReactNode` |
|
|
23
|
-
| <a id="property-fallback"></a> `fallback?` | `ReactNode` |
|
|
24
|
-
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` |
|
|
25
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) |
|
|
26
|
-
| <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` |
|
|
27
|
-
| <a id="property-store"></a> `store?` | `StateStore` |
|
|
19
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
20
|
+
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | 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) |
|
|
22
|
+
| <a id="property-children"></a> `children` | `ReactNode` | The child components to render inside the provider tree | - | [packages/play-react/src/ActorProvider.tsx:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L59) |
|
|
23
|
+
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | The component to show when currentView is null, or when a catalog component throws. This prop is optional | - | [packages/play-react/src/ActorProvider.tsx:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L55) |
|
|
24
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | The optional error handler. The provider calls it when a catalog component throws during a render | - | [packages/play-react/src/ActorProvider.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L57) |
|
|
25
|
+
| <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) |
|
|
26
|
+
| <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) |
|
|
27
|
+
| <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) |
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayErrorBoundaryProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L14)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of PlayErrorBoundary
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type | Description
|
|
12
|
-
| ------------------------------------------ | --------------------------- |
|
|
13
|
-
| <a id="property-children"></a> `children` | `ReactNode` |
|
|
14
|
-
| <a id="property-fallback"></a> `fallback?` | `ReactNode` |
|
|
15
|
-
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` |
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-children"></a> `children` | `ReactNode` | The child components to render | [packages/play-react/src/PlayErrorBoundary.tsx:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L18) |
|
|
14
|
+
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | The fallback UI to render when a child component throws. The default is null. | [packages/play-react/src/PlayErrorBoundary.tsx:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L16) |
|
|
15
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | The optional error handler. It sends each error to an observability tool, such as Sentry | [packages/play-react/src/PlayErrorBoundary.tsx:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L20) |
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayErrorBoundaryState
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:28](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L28)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The internal state shape of PlayErrorBoundary
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
11
|
| Property | Type | Defined in |
|
|
12
12
|
| ----------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| <a id="property-error"></a> `error` | `Error` \| `null` | [packages/play-react/src/PlayErrorBoundary.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
14
|
-
| <a id="property-haserror"></a> `hasError` | `boolean` | [packages/play-react/src/PlayErrorBoundary.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
13
|
+
| <a id="property-error"></a> `error` | `Error` \| `null` | [packages/play-react/src/PlayErrorBoundary.tsx:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L30) |
|
|
14
|
+
| <a id="property-haserror"></a> `hasError` | `boolean` | [packages/play-react/src/PlayErrorBoundary.tsx:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayErrorBoundary.tsx#L29) |
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayUIProviderProps
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/PlayUIProvider.tsx:
|
|
5
|
+
Defined in: [packages/play-react/src/PlayUIProvider.tsx:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayUIProvider.tsx#L35)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The props of PlayUIProvider — every ActorProvider prop, and also the props of JSONUIProvider.
|
|
8
8
|
|
|
9
9
|
## Extends
|
|
10
10
|
|
|
@@ -12,15 +12,15 @@ Props for PlayUIProvider — all ActorProvider props plus JSONUIProvider's own p
|
|
|
12
12
|
|
|
13
13
|
## Properties
|
|
14
14
|
|
|
15
|
-
| Property | Type | Description
|
|
16
|
-
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| <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) |
|
|
18
|
-
| <a id="property-children"></a> `children` | `ReactNode` |
|
|
19
|
-
| <a id="property-fallback"></a> `fallback?` | `ReactNode` |
|
|
20
|
-
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named functions for `$computed` expressions in props
|
|
21
|
-
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigation function
|
|
22
|
-
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` |
|
|
23
|
-
| <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) |
|
|
24
|
-
| <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` |
|
|
25
|
-
| <a id="property-store"></a> `store?` | `StateStore` |
|
|
26
|
-
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions
|
|
15
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
16
|
+
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <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. | [`ActorProviderProps`](ActorProviderProps.md).[`actor`](ActorProviderProps.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) |
|
|
18
|
+
| <a id="property-children"></a> `children` | `ReactNode` | The child components to render inside the provider tree | [`ActorProviderProps`](ActorProviderProps.md).[`children`](ActorProviderProps.md#property-children) | [packages/play-react/src/ActorProvider.tsx:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L59) |
|
|
19
|
+
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | The component to show when currentView is null, or when a catalog component throws. This prop is optional | [`ActorProviderProps`](ActorProviderProps.md).[`fallback`](ActorProviderProps.md#property-fallback) | [packages/play-react/src/ActorProvider.tsx:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L55) |
|
|
20
|
+
| <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named functions for `$computed` expressions in props | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`functions`](JSONUIProviderProps.md#property-functions) | - |
|
|
21
|
+
| <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Navigation function | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`navigate`](JSONUIProviderProps.md#property-navigate) | - |
|
|
22
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | The optional error handler. The provider calls it when a catalog component throws during a render | [`ActorProviderProps`](ActorProviderProps.md).[`onError`](ActorProviderProps.md#property-onerror) | [packages/play-react/src/ActorProvider.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L57) |
|
|
23
|
+
| <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. | [`ActorProviderProps`](ActorProviderProps.md).[`onRenderError`](ActorProviderProps.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) |
|
|
24
|
+
| <a id="property-registryresult"></a> `registryResult` | `DefineRegistryResult` | The complete result of defineRegistry(). It holds the component registry and the factory of the action handlers. | [`ActorProviderProps`](ActorProviderProps.md).[`registryResult`](ActorProviderProps.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) |
|
|
25
|
+
| <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. | [`ActorProviderProps`](ActorProviderProps.md).[`store`](ActorProviderProps.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) |
|
|
26
|
+
| <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions | [`JSONUIProviderProps`](JSONUIProviderProps.md).[`validationFunctions`](JSONUIProviderProps.md#property-validationfunctions) | - |
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ViewContextValue
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-react/src/ActorProvider.tsx:
|
|
5
|
+
Defined in: [packages/play-react/src/ActorProvider.tsx:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L67)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The value that ViewContext provides. usePlayView() reads it.
|
|
8
8
|
|
|
9
9
|
## Extends
|
|
10
10
|
|
|
@@ -12,9 +12,9 @@ Value provided by ViewContext (accessible via usePlayView()).
|
|
|
12
12
|
|
|
13
13
|
## Properties
|
|
14
14
|
|
|
15
|
-
| Property | Type | Description
|
|
16
|
-
| ----------------------------------------- | ----------------------------------------------------- |
|
|
17
|
-
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> |
|
|
18
|
-
| <a id="property-registry"></a> `registry` | `TRegistry` |
|
|
19
|
-
| <a id="property-spec"></a> `spec` | [`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) | The current PlaySpec to render.
|
|
20
|
-
| <a id="property-store"></a> `store` | `StateStore` | The active StateStore
|
|
15
|
+
| Property | Type | Description | Inherited from | Defined in |
|
|
16
|
+
| ----------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <a id="property-handlers"></a> `handlers` | `Record`\<`string`, `ActionHandler`\> | The action handlers, resolved against the live StateStore. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`handlers`](../../play-actor/interfaces/BaseViewContextValue.md#property-handlers) | [packages/play-actor/src/abstract-actor.ts:127](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L127) |
|
|
18
|
+
| <a id="property-registry"></a> `registry` | `TRegistry` | The component registry, from registryResult.registry. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`registry`](../../play-actor/interfaces/BaseViewContextValue.md#property-registry) | [packages/play-actor/src/abstract-actor.ts:129](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L129) |
|
|
19
|
+
| <a id="property-spec"></a> `spec` | [`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) | The current PlaySpec to render. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`spec`](../../play-actor/interfaces/BaseViewContextValue.md#property-spec) | [packages/play-actor/src/abstract-actor.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L125) |
|
|
20
|
+
| <a id="property-store"></a> `store` | `StateStore` | The active StateStore. Give it to JSONUIProvider or JsonUIProvider as `store`, and the providers then share the state. | [`BaseViewContextValue`](../../play-actor/interfaces/BaseViewContextValue.md).[`store`](../../play-actor/interfaces/BaseViewContextValue.md#property-store) | [packages/play-actor/src/abstract-actor.ts:133](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L133) |
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
type AnyPlayActor = AbstractActor<AnyActorLogic>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-react/src/useActor.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/useActor.ts#L30)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The bare actor type that the React context providers accept. For the complete routing and view shape, use `PlayActor` from `@xmachines/play-router`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-react](../README.md) / PlayRendererProps
|
|
2
|
+
|
|
3
|
+
# ~~Type Alias: PlayRendererProps~~
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type PlayRendererProps = ActorProviderProps;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-react/src/index.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/index.ts#L71)
|
|
10
|
+
|
|
11
|
+
## Deprecated
|
|
12
|
+
|
|
13
|
+
Use [ActorProviderProps](../interfaces/ActorProviderProps.md). Will be removed in the next major.
|
|
@@ -6,27 +6,28 @@
|
|
|
6
6
|
const ActorProvider: React.FC<ActorProviderProps>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/ActorProvider.tsx:
|
|
9
|
+
Defined in: [packages/play-react/src/ActorProvider.tsx:202](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/ActorProvider.tsx#L202)
|
|
10
10
|
|
|
11
|
-
ActorProvider —
|
|
11
|
+
ActorProvider — the low-level provider that composes the actor lifecycle with your own providers.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
wraps children in StateProvider and
|
|
15
|
-
into the component registry.
|
|
13
|
+
It subscribes to the actor.currentView signal. It manages the StateStore
|
|
14
|
+
lifecycle of each view. It wraps the children in StateProvider and in
|
|
15
|
+
PlayErrorBoundary. It also puts onRenderError into the component registry.
|
|
16
16
|
|
|
17
|
-
Standard
|
|
17
|
+
Standard use: prefer <PlayUIProvider>, and use this component only when you
|
|
18
|
+
compose the providers yourself.
|
|
18
19
|
|
|
19
20
|
## Example
|
|
20
21
|
|
|
21
22
|
```tsx
|
|
22
|
-
//
|
|
23
|
+
// A custom composition:
|
|
23
24
|
<ActorProvider actor={actor} registryResult={registryResult}>
|
|
24
25
|
<JSONUIProvider registry={registryResult.registry}>
|
|
25
26
|
<PlayRenderer />
|
|
26
27
|
</JSONUIProvider>
|
|
27
28
|
</ActorProvider>
|
|
28
29
|
|
|
29
|
-
// Standard
|
|
30
|
+
// Standard use: prefer PlayUIProvider
|
|
30
31
|
<PlayUIProvider actor={actor} registryResult={registryResult}>
|
|
31
32
|
<PlayRenderer />
|
|
32
33
|
</PlayUIProvider>
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
const PlayRenderer: React.FC<Record<string, never>>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/PlayRenderer.tsx:
|
|
9
|
+
Defined in: [packages/play-react/src/PlayRenderer.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayRenderer.tsx#L40)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The leaf component without props that renders the current actor view.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
context
|
|
13
|
+
It reads the current PlaySpec, the handlers, and the registry from the
|
|
14
|
+
ActorProvider context with usePlayView(). It then renders them with the Renderer
|
|
15
|
+
of @xmachines/json-render-react.
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
const PlayUIProvider: React.FC<PlayUIProviderProps>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-react/src/PlayUIProvider.tsx:
|
|
9
|
+
Defined in: [packages/play-react/src/PlayUIProvider.tsx:106](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react/src/PlayUIProvider.tsx#L106)
|
|
10
10
|
|
|
11
|
-
PlayUIProvider —
|
|
11
|
+
PlayUIProvider — the standard entry point for an actor-driven UI.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
(JSONUIProvider
|
|
15
|
-
StateProvider, and ConfirmDialogManager).
|
|
13
|
+
It joins the actor lifecycle (ActorProvider) with the complete UI provider setup
|
|
14
|
+
(JSONUIProvider, which holds ActionProvider, ValidationProvider,
|
|
15
|
+
VisibilityProvider, StateProvider, and ConfirmDialogManager).
|
|
16
16
|
|
|
17
17
|
## Example
|
|
18
18
|
|
|
@@ -31,7 +31,7 @@ const registryResult = defineRegistry(catalog, {
|
|
|
31
31
|
<PlayRenderer />
|
|
32
32
|
</PlayUIProvider>
|
|
33
33
|
|
|
34
|
-
// With
|
|
34
|
+
// With the options of JSONUIProvider:
|
|
35
35
|
<PlayUIProvider
|
|
36
36
|
actor={actor}
|
|
37
37
|
registryResult={registryResult}
|