@xmachines/docs 1.0.0 → 2.0.0-alpha.1
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 +1 -1
- package/api/@xmachines/play/classes/NonNullableError.md +11 -11
- package/api/@xmachines/play/classes/PlayError.md +11 -11
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +4 -4
- package/api/@xmachines/play-actor/classes/AbstractActor.md +20 -19
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +1 -1
- package/api/@xmachines/play-actor/functions/toAtomState.md +1 -1
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +7 -7
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +7 -7
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -5
- package/api/@xmachines/play-actor/interfaces/Viewable.md +4 -4
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +10 -10
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -5
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +12 -12
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +1 -1
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +6 -6
- package/api/@xmachines/play-react/README.md +1 -1
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +5 -5
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +7 -7
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +1 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +4 -4
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-router/README.md +15 -7
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +4 -4
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +2 -2
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
- package/api/@xmachines/play-router/interfaces/LocationLike.md +5 -5
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -5
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +5 -5
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteNode.md +12 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteTree.md +7 -7
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +4 -4
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +4 -4
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +7 -7
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +5 -5
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +5 -5
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +20 -19
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +7 -7
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-svelte/README.md +1 -1
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +10 -10
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +6 -6
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +7 -7
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +24 -18
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +5 -5
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +7 -7
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +2 -2
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/README.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +7 -7
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-vue/README.md +1 -1
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +7 -7
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +10 -10
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +7 -7
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +1 -1
- 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 +4 -4
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +1 -1
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +7 -7
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +88 -25
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +34 -33
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +23 -17
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +16 -16
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +87 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +3 -3
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +45 -11
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +15 -15
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +5 -5
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +4 -4
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +8 -8
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +26 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +30 -0
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +13 -6
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +16 -4
- package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +33 -0
- package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +31 -0
- package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +37 -0
- package/api/@xmachines/play-xstate/variables/playMetaSchema.md +40 -0
- package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +9 -0
- 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 +4 -4
- 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 +6 -6
- package/contributing/architecture.md +9 -6
- package/contributing/development.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
- package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
- package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
- package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
- package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
- package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
- package/examples/README.md +1 -1
- package/examples/basic-state-machine.md +22 -24
- package/examples/form-validation.md +118 -109
- package/examples/routing-patterns.md +92 -60
- package/examples/traffic-light.md +46 -57
- package/guides/getting-started.md +79 -68
- package/guides/state-machines.md +68 -52
- package/package.json +2 -2
- package/rfc/play.md +4 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouterBridge
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:
|
|
5
|
+
Defined in: [play-router/src/types.ts:360](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L360)
|
|
6
6
|
|
|
7
7
|
RouterBridge interface for runtime infrastructure adapters
|
|
8
8
|
|
|
@@ -54,7 +54,7 @@ class MyRouterBridge implements RouterBridge {
|
|
|
54
54
|
connect(): void | Promise<void>;
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Defined in: [play-router/src/types.ts:
|
|
57
|
+
Defined in: [play-router/src/types.ts:376](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L376)
|
|
58
58
|
|
|
59
59
|
Connect the router bridge to the Actor
|
|
60
60
|
|
|
@@ -83,7 +83,7 @@ await bridge.connect();
|
|
|
83
83
|
disconnect(): void | Promise<void>;
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Defined in: [play-router/src/types.ts:
|
|
86
|
+
Defined in: [play-router/src/types.ts:392](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L392)
|
|
87
87
|
|
|
88
88
|
Disconnect the router bridge from the Actor
|
|
89
89
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type RoutableActor = PlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-vue-router/src/play-router-provider.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [play-vue-router/src/play-router-provider.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-vue-router/src/play-router-provider.ts#L10)
|
|
10
10
|
|
|
11
11
|
## Deprecated
|
|
12
12
|
|
|
@@ -64,7 +64,7 @@ const PlayRouterProvider: DefineComponent<
|
|
|
64
64
|
>;
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Defined in: [play-vue-router/src/play-router-provider.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
67
|
+
Defined in: [play-vue-router/src/play-router-provider.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-vue-router/src/play-router-provider.ts#L19)
|
|
68
68
|
|
|
69
69
|
PlayRouterProvider — Vue convenience wrapper for VueRouterBridge.
|
|
70
70
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @xmachines/play-xstate
|
|
6
6
|
|
|
7
|
-
> XState
|
|
7
|
+
> XState v6 adapter for the XMachines Play Architecture — bind state machines to the actor base with signal-driven reactivity and router integration.
|
|
8
8
|
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
10
|
[](https://www.npmjs.com/package/@xmachines/play-xstate)
|
|
@@ -19,7 +19,7 @@ Part of the [XMachines Play](../../README.md) monorepo.
|
|
|
19
19
|
pnpm add @xmachines/play-xstate xstate
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`xstate ^
|
|
22
|
+
`xstate ^6.0.0-alpha.19` is a peer dependency and must be installed alongside this package.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -27,13 +27,18 @@ pnpm add @xmachines/play-xstate xstate
|
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
29
|
import { setup } from "xstate";
|
|
30
|
-
import { definePlayer } from "@xmachines/play-xstate";
|
|
30
|
+
import { definePlayer, emptyEventSchema, playMetaSchema } from "@xmachines/play-xstate";
|
|
31
31
|
|
|
32
|
-
// 1. Define your XState
|
|
33
|
-
const machine = setup({
|
|
32
|
+
// 1. Define your XState v6 machine
|
|
33
|
+
const machine = setup({
|
|
34
|
+
schemas: {
|
|
35
|
+
events: { activate: emptyEventSchema },
|
|
36
|
+
meta: playMetaSchema, // types meta.route / meta.view on state nodes
|
|
37
|
+
},
|
|
38
|
+
}).createMachine({
|
|
34
39
|
initial: "idle",
|
|
35
40
|
states: {
|
|
36
|
-
idle: { meta: { route: "/" } },
|
|
41
|
+
idle: { meta: { route: "/" }, on: { activate: { target: "active" } } },
|
|
37
42
|
active: { meta: { route: "/active" } },
|
|
38
43
|
},
|
|
39
44
|
});
|
|
@@ -61,16 +66,16 @@ actor.stop();
|
|
|
61
66
|
|
|
62
67
|
### `definePlayer(config)`
|
|
63
68
|
|
|
64
|
-
Creates a `PlayerFactory` from an XState
|
|
69
|
+
Creates a `PlayerFactory` from an XState v6 machine. The factory pattern enables multiple independent actor instances from a single configuration — useful for multi-user scenarios, SSR, or testing.
|
|
65
70
|
|
|
66
71
|
```typescript
|
|
67
|
-
import { setup } from "xstate";
|
|
72
|
+
import { setup, types } from "xstate";
|
|
68
73
|
import { definePlayer } from "@xmachines/play-xstate";
|
|
69
74
|
|
|
70
75
|
const machine = setup({
|
|
71
|
-
|
|
72
|
-
context: {
|
|
73
|
-
input: {
|
|
76
|
+
schemas: {
|
|
77
|
+
context: types<{ userId: string }>(),
|
|
78
|
+
input: types<{ userId: string }>(),
|
|
74
79
|
},
|
|
75
80
|
}).createMachine({
|
|
76
81
|
context: ({ input }) => ({ userId: input.userId }),
|
|
@@ -119,7 +124,7 @@ console.log(restored.currentRoute.get()); // same route as when saved
|
|
|
119
124
|
|
|
120
125
|
### `PlayerActor<TMachine>`
|
|
121
126
|
|
|
122
|
-
Concrete actor class that wraps an XState
|
|
127
|
+
Concrete actor class that wraps an XState v6 actor and exposes TC39 Signal-based reactive signals. Implements both `Routable` and `Viewable` interfaces from `@xmachines/play-actor`.
|
|
123
128
|
|
|
124
129
|
#### Signals
|
|
125
130
|
|
|
@@ -160,7 +165,7 @@ actor.start();
|
|
|
160
165
|
|
|
161
166
|
### Guard utilities
|
|
162
167
|
|
|
163
|
-
Composable guard helpers that
|
|
168
|
+
Composable guard helpers that combine predicates with AND, OR, and NOT logic. Each helper returns a plain predicate — call it inside a transition function with the transition arguments and return early to block the transition. String guard names are resolved against the named guards declared in `setup({ guards })`.
|
|
164
169
|
|
|
165
170
|
```typescript
|
|
166
171
|
import { setup } from "xstate";
|
|
@@ -173,20 +178,24 @@ import {
|
|
|
173
178
|
contextFieldMatches, // guard: context field equals a value
|
|
174
179
|
} from "@xmachines/play-xstate";
|
|
175
180
|
|
|
181
|
+
const canAccessAdmin = composeGuards(["isLoggedIn", "hasAdminRole"]);
|
|
182
|
+
const isAuthenticated = negateGuard("isGuest");
|
|
183
|
+
|
|
176
184
|
const machine = setup({
|
|
177
185
|
guards: {
|
|
178
186
|
isLoggedIn: ({ context }) => !!context.userId,
|
|
179
187
|
hasAdminRole: ({ context }) => context.role === "admin",
|
|
188
|
+
isGuest: ({ context }) => !context.userId,
|
|
180
189
|
},
|
|
181
190
|
}).createMachine({
|
|
182
191
|
on: {
|
|
183
|
-
accessAdmin: {
|
|
184
|
-
|
|
185
|
-
target: "adminPanel"
|
|
192
|
+
accessAdmin: (args) => {
|
|
193
|
+
if (!canAccessAdmin(args)) return;
|
|
194
|
+
return { target: "adminPanel" };
|
|
186
195
|
},
|
|
187
|
-
accessDashboard: {
|
|
188
|
-
|
|
189
|
-
target: "dashboard"
|
|
196
|
+
accessDashboard: (args) => {
|
|
197
|
+
if (!isAuthenticated(args)) return;
|
|
198
|
+
return { target: "dashboard" };
|
|
190
199
|
},
|
|
191
200
|
},
|
|
192
201
|
// ...
|
|
@@ -199,13 +208,42 @@ const machine = setup({
|
|
|
199
208
|
|
|
200
209
|
Helper functions for declarative route configuration in XState machines.
|
|
201
210
|
|
|
211
|
+
#### `createRoutedMachine(setup)`
|
|
212
|
+
|
|
213
|
+
The recommended entry point: returns a `createMachine` with the same signature as the setup's own — full contextual typing for the config — that wires routing up at runtime.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { setup } from "xstate";
|
|
217
|
+
import { createRoutedMachine } from "@xmachines/play-xstate";
|
|
218
|
+
|
|
219
|
+
const appSetup = setup({/* schemas, guards, ... */});
|
|
220
|
+
|
|
221
|
+
const machine = createRoutedMachine(appSetup)({
|
|
222
|
+
id: "app",
|
|
223
|
+
states: {
|
|
224
|
+
home: {
|
|
225
|
+
id: "home",
|
|
226
|
+
meta: { route: "/home" },
|
|
227
|
+
},
|
|
228
|
+
profile: {
|
|
229
|
+
id: "profile",
|
|
230
|
+
meta: { route: "/users/:userId" },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
```
|
|
235
|
+
|
|
202
236
|
#### `formatPlayRouteTransitions(machineConfig)`
|
|
203
237
|
|
|
204
|
-
Crawls machine states with `meta.route` and
|
|
238
|
+
The underlying transform. Crawls machine states with `meta.route` and wires them to XState v6's native routing: each routed state gets a native `route: {}` config (targetable via the built-in `xstate.route` event and visible to graph tooling), and one root `play.route` forwarder navigates those targets in a single atomic transition — patching `params`/`query` into context — while re-raising `xstate.route` only for states that declare their own `route` config. Unknown targets fall through to user-defined `play.route` fallbacks (e.g. a 404 route); one `play.route` send is one atomic transition, so exit actions see the old `params` and entry actions the new ones.
|
|
205
239
|
|
|
206
240
|
```typescript
|
|
207
241
|
import { setup } from "xstate";
|
|
208
|
-
import {
|
|
242
|
+
import {
|
|
243
|
+
formatPlayRouteTransitions,
|
|
244
|
+
playMetaSchema,
|
|
245
|
+
playRouteEventSchema,
|
|
246
|
+
} from "@xmachines/play-xstate";
|
|
209
247
|
|
|
210
248
|
const config = formatPlayRouteTransitions({
|
|
211
249
|
id: "app",
|
|
@@ -221,17 +259,30 @@ const config = formatPlayRouteTransitions({
|
|
|
221
259
|
},
|
|
222
260
|
});
|
|
223
261
|
|
|
224
|
-
// config now
|
|
225
|
-
//
|
|
226
|
-
|
|
262
|
+
// config now carries native route configs plus the play.route forwarder:
|
|
263
|
+
// states: { home: { ..., route: {} }, profile: { ..., route: {} } }
|
|
264
|
+
// on: { "play.route": [forwarder, ...userFallbacks] }
|
|
265
|
+
// The forwarder navigates injected-route targets directly (atomically);
|
|
266
|
+
// xstate.route is raised only for states declaring their own route config.
|
|
267
|
+
const machine = setup({
|
|
268
|
+
schemas: {
|
|
269
|
+
events: { "play.route": playRouteEventSchema },
|
|
270
|
+
meta: playMetaSchema,
|
|
271
|
+
},
|
|
272
|
+
}).createMachine(config);
|
|
227
273
|
```
|
|
228
274
|
|
|
275
|
+
Because the injected `route` configs are static, route transitions keep statically-known targets — `machineToGraph()` sees real edges to every routed state, so reachability queries work.
|
|
276
|
+
|
|
229
277
|
> **Note:** Every state with `meta.route` must also have an explicit `id` field; omitting it throws `MissingStateIdError` at machine-definition time.
|
|
230
278
|
|
|
231
279
|
#### Other routing exports
|
|
232
280
|
|
|
233
281
|
| Export | Description |
|
|
234
282
|
| ---------------------------------- | ------------------------------------------------------------------------- |
|
|
283
|
+
| `playMetaSchema` | Shared `schemas.meta` declaration for `meta.route` / `meta.view` metadata |
|
|
284
|
+
| `playRouteEventSchema` | Shared `schemas.events` entry for the `play.route` event payload |
|
|
285
|
+
| `emptyEventSchema` | Shared `schemas.events` entry for events that carry no payload |
|
|
235
286
|
| `deriveRoute(meta)` | Extract the route template string from a state's metadata object |
|
|
236
287
|
| `isAbsoluteRoute(route)` | Returns `true` if the route string is an absolute URL path |
|
|
237
288
|
| `buildRouteUrl(template, context)` | Substitute `:param` placeholders in a route template using context values |
|
|
@@ -272,6 +323,8 @@ import {
|
|
|
272
323
|
InvalidEventError, // actor.send() called with null/undefined/non-object
|
|
273
324
|
InvalidRouteMetadataError, // meta.route is neither a string nor { path: string }
|
|
274
325
|
EmptyGuardArrayError, // composeGuards/composeGuardsOr called with empty array
|
|
326
|
+
UnresolvableGuardNameError, // string guard name could not be resolved at call time
|
|
327
|
+
InvalidGuardEntryError, // guard entry was neither a predicate nor a name (e.g. undefined)
|
|
275
328
|
} from "@xmachines/play-xstate/errors";
|
|
276
329
|
```
|
|
277
330
|
|
|
@@ -297,7 +350,7 @@ Tests use [Vitest](https://vitest.dev/) and live in `packages/play-xstate/test/`
|
|
|
297
350
|
|
|
298
351
|
MIT — see [LICENSE](LICENSE) for details.
|
|
299
352
|
|
|
300
|
-
@xmachines/play-xstate - XState
|
|
353
|
+
@xmachines/play-xstate - XState v6 adapter for Play Architecture
|
|
301
354
|
|
|
302
355
|
Provides definePlayer() API for binding XState state machines to the
|
|
303
356
|
actor base with signal lifecycle and DevTools integration.
|
|
@@ -324,9 +377,18 @@ reactivity.
|
|
|
324
377
|
- [Guard](type-aliases/Guard.md)
|
|
325
378
|
- [GuardArray](type-aliases/GuardArray.md)
|
|
326
379
|
- [PlayerFactory](type-aliases/PlayerFactory.md)
|
|
380
|
+
- [PlayRoutePayload](type-aliases/PlayRoutePayload.md)
|
|
327
381
|
- [RouteMachineConfig](type-aliases/RouteMachineConfig.md)
|
|
328
382
|
- [RouteMetadata](type-aliases/RouteMetadata.md)
|
|
329
383
|
- [RouteStateNode](type-aliases/RouteStateNode.md)
|
|
384
|
+
- [SetupLike](type-aliases/SetupLike.md)
|
|
385
|
+
- [WithOptional](type-aliases/WithOptional.md)
|
|
386
|
+
|
|
387
|
+
## Variables
|
|
388
|
+
|
|
389
|
+
- [emptyEventSchema](variables/emptyEventSchema.md)
|
|
390
|
+
- [playMetaSchema](variables/playMetaSchema.md)
|
|
391
|
+
- [playRouteEventSchema](variables/playRouteEventSchema.md)
|
|
330
392
|
|
|
331
393
|
## Functions
|
|
332
394
|
|
|
@@ -334,6 +396,7 @@ reactivity.
|
|
|
334
396
|
- [composeGuards](functions/composeGuards.md)
|
|
335
397
|
- [composeGuardsOr](functions/composeGuardsOr.md)
|
|
336
398
|
- [contextFieldMatches](functions/contextFieldMatches.md)
|
|
399
|
+
- [createRoutedMachine](functions/createRoutedMachine.md)
|
|
337
400
|
- [definePlayer](functions/definePlayer.md)
|
|
338
401
|
- [deriveRoute](functions/deriveRoute.md)
|
|
339
402
|
- [eventMatches](functions/eventMatches.md)
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: PlayerActor\<TMachine\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:362](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
5
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:362](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L362)
|
|
6
6
|
|
|
7
7
|
Concrete XState actor implementing Play Architecture signal protocol
|
|
8
8
|
|
|
9
|
-
Extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) to provide XState
|
|
9
|
+
Extends [@xmachines/play-actor!AbstractActor](../../play-actor/classes/AbstractActor.md) to provide XState v6 integration
|
|
10
10
|
while maintaining ecosystem compatibility (XState inspection, devtools). This actor
|
|
11
11
|
wraps an internal XState actor and exposes TC39 Signal-based reactive state for
|
|
12
12
|
Infrastructure observation.
|
|
@@ -89,7 +89,7 @@ cached and updated at state entry, not computed on every read.
|
|
|
89
89
|
|
|
90
90
|
| Type Parameter | Description |
|
|
91
91
|
| ---------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
92
|
-
| `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState
|
|
92
|
+
| `TMachine` _extends_ [`AnyStateMachine`](https://www.jsdocs.io/package/xstate#AnyStateMachine) | XState v6 state machine type |
|
|
93
93
|
|
|
94
94
|
## Implements
|
|
95
95
|
|
|
@@ -108,7 +108,7 @@ new PlayerActor<TMachine>(
|
|
|
108
108
|
restoredSnapshot?): PlayerActor<TMachine>;
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
111
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:459](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L459)
|
|
112
112
|
|
|
113
113
|
#### Parameters
|
|
114
114
|
|
|
@@ -129,22 +129,23 @@ Defined in: [packages/play-xstate/src/player-actor.ts:454](https://gitlab.com/xm
|
|
|
129
129
|
|
|
130
130
|
## Properties
|
|
131
131
|
|
|
132
|
-
| Property | Modifier | Type
|
|
133
|
-
| ------------------------------------------------- | ---------- |
|
|
134
|
-
| <a id="property-_parent"></a> `_parent?` | `public` |
|
|
135
|
-
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock)
|
|
136
|
-
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\>
|
|
137
|
-
| <a id="property-currentview"></a> `currentView` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\>
|
|
138
|
-
| <a id="property-id"></a> `id` | `public` | `string`
|
|
139
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null`
|
|
140
|
-
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic)
|
|
141
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\>
|
|
142
|
-
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, `any`\>
|
|
143
|
-
| <a id="property-
|
|
144
|
-
| <a id="property-
|
|
145
|
-
| <a id="property-
|
|
146
|
-
| <a id="property-
|
|
147
|
-
| <a id="property-
|
|
132
|
+
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|
|
133
|
+
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
134
|
+
| <a id="property-_parent"></a> `_parent?` | `public` | `AnyActor` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`_parent`](../../play-actor/classes/AbstractActor.md#property-_parent) | - |
|
|
135
|
+
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`clock`](../../play-actor/classes/AbstractActor.md#property-clock) | - |
|
|
136
|
+
| <a id="property-currentroute"></a> `currentRoute` | `public` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | A TC39 `Signal.Computed` that derives the current URL path from the active machine state's `meta.route` template and the actor's context. Returns `null` when the current state has no `meta.route`, or when the route template cannot be fully resolved (e.g. a required parameter is absent from context). **Throws** When a required `:param` placeholder in the route template has no matching value in the actor's context. Import the class from `@xmachines/play-xstate/errors`. **Example** `// Returns "/profile/alice" when context.userId === "alice" const route = actor.currentRoute.get();` | - | - | [packages/play-xstate/src/player-actor.ts:413](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L413) |
|
|
137
|
+
| <a id="property-currentview"></a> `currentView` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | Reactive signal containing the current view spec derived from the active state's `meta.view` metadata. Emits a **fresh object reference** whenever the rendered view actually changes — a different state's view, or a param/context change that alters the resolved spec (including `reenter: true` re-entries with new params). Snapshots that do not change the rendered view (e.g. context-only assigns) keep the previous reference so downstream providers do not remount the UI on every event. The emitted `PlaySpec` has its element `props` enriched with `context.params` before emission — URL path parameters (e.g. `:section?`) flow into component props automatically. See `mergeRouteParamsIntoProps` for the merge priority rules. Returns `null` when the current state has no `meta.view` metadata. **Example** `const view = actor.currentView.get(); if (view) { console.log(view.root); // e.g. "root" console.log(view.elements); // @xmachines/json-render-core Spec elements }` | - | - | [packages/play-xstate/src/player-actor.ts:457](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L457) |
|
|
138
|
+
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`id`](../../play-actor/classes/AbstractActor.md#property-id) | - |
|
|
139
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route derived from the machine's initial state — fixed at construction, never changes even when the actor is restored from a snapshot. Router bridges compare this against the browser URL to distinguish a deep-link (non-initial URL → router wins) from a restore (initial URL + actor at a different restored route → actor wins). Derived statically from the machine definition via `deriveInitialRoute` (XState's pure `initialTransition` helper): the initial state chain and its `meta.route` templates are fixed at machine definition time, while `:param` substitution uses the machine's real initial context for this actor's `input`. No extra actor is ever created, and a restored snapshot never influences the value — it is always the machine's **default** initial route. | - | - | [packages/play-xstate/src/player-actor.ts:430](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L430) |
|
|
140
|
+
| <a id="property-logic"></a> `logic` | `public` | [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`logic`](../../play-actor/classes/AbstractActor.md#property-logic) | - |
|
|
141
|
+
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`options`](../../play-actor/classes/AbstractActor.md#property-options) | - |
|
|
142
|
+
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<`any`, `any`, [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject), `any`\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`ref`](../../play-actor/classes/AbstractActor.md#property-ref) | - |
|
|
143
|
+
| <a id="property-registrykey"></a> `registryKey` | `public` | `string` \| `undefined` | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`registryKey`](../../play-actor/classes/AbstractActor.md#property-registrykey) | - |
|
|
144
|
+
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`sessionId`](../../play-actor/classes/AbstractActor.md#property-sessionid) | - |
|
|
145
|
+
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`src`](../../play-actor/classes/AbstractActor.md#property-src) | - |
|
|
146
|
+
| <a id="property-state"></a> `state` | `public` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TMachine`\>\> | Reactive snapshot of current actor state. Infrastructure observes this signal to react to state changes without directly coupling to the actor's internal state machine implementation. | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`state`](../../play-actor/classes/AbstractActor.md#property-state) | - | [packages/play-xstate/src/player-actor.ts:375](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L375) |
|
|
147
|
+
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`system`](../../play-actor/classes/AbstractActor.md#property-system) | - |
|
|
148
|
+
| <a id="property-trigger"></a> `trigger` | `public` | `ActorTrigger`\<`SendableEventFromLogic`\<`TLogic`\>\> | - | - | [`AbstractActor`](../../play-actor/classes/AbstractActor.md).[`trigger`](../../play-actor/classes/AbstractActor.md#property-trigger) | - |
|
|
148
149
|
|
|
149
150
|
## Methods
|
|
150
151
|
|
|
@@ -172,7 +173,7 @@ Defined in: `xstate`
|
|
|
172
173
|
can(event): boolean;
|
|
173
174
|
```
|
|
174
175
|
|
|
175
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
176
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:388](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L388)
|
|
176
177
|
|
|
177
178
|
Returns whether the actor's current state can accept the given event.
|
|
178
179
|
|
|
@@ -203,7 +204,7 @@ if (actor.can({ type: "auth.logout" })) { ... }
|
|
|
203
204
|
dispose(): void;
|
|
204
205
|
```
|
|
205
206
|
|
|
206
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
207
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:731](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L731)
|
|
207
208
|
|
|
208
209
|
Convenience dispose method for cleanup
|
|
209
210
|
|
|
@@ -221,7 +222,7 @@ Per CONTEXT.md: "Both .dispose() convenience method and manual machine.stop()"
|
|
|
221
222
|
getPersistedSnapshot(): Snapshot<unknown>;
|
|
222
223
|
```
|
|
223
224
|
|
|
224
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
225
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:689](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L689)
|
|
225
226
|
|
|
226
227
|
Get the persisted snapshot of the wrapped XState actor.
|
|
227
228
|
|
|
@@ -244,7 +245,7 @@ Suitable for serialization and later restoration via the factory's
|
|
|
244
245
|
getSnapshot(): SnapshotFrom<TMachine>;
|
|
245
246
|
```
|
|
246
247
|
|
|
247
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
248
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:613](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L613)
|
|
248
249
|
|
|
249
250
|
Get current snapshot
|
|
250
251
|
|
|
@@ -264,15 +265,15 @@ Get current snapshot
|
|
|
264
265
|
on<TType>(type, handler): Subscription;
|
|
265
266
|
```
|
|
266
267
|
|
|
267
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
268
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:674](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L674)
|
|
268
269
|
|
|
269
270
|
Listen for events emitted by the wrapped XState actor via the `emit` action.
|
|
270
271
|
|
|
271
272
|
#### Type Parameters
|
|
272
273
|
|
|
273
|
-
| Type Parameter
|
|
274
|
-
|
|
|
275
|
-
| `TType` _extends_ `
|
|
274
|
+
| Type Parameter |
|
|
275
|
+
| -------------------------- |
|
|
276
|
+
| `TType` _extends_ `string` |
|
|
276
277
|
|
|
277
278
|
#### Parameters
|
|
278
279
|
|
|
@@ -330,7 +331,7 @@ Defined in: `xstate`
|
|
|
330
331
|
send(event): void;
|
|
331
332
|
```
|
|
332
333
|
|
|
333
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
334
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:590](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L590)
|
|
334
335
|
|
|
335
336
|
Send an event to the underlying XState actor.
|
|
336
337
|
|
|
@@ -374,7 +375,7 @@ actor.send({ type: "play.route", to: "#home" });
|
|
|
374
375
|
start(): this;
|
|
375
376
|
```
|
|
376
377
|
|
|
377
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
378
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:545](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L545)
|
|
378
379
|
|
|
379
380
|
Start the actor
|
|
380
381
|
|
|
@@ -396,7 +397,7 @@ Per RESEARCH.md Pitfall 1: Always call start() after creation
|
|
|
396
397
|
stop(): this;
|
|
397
398
|
```
|
|
398
399
|
|
|
399
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
400
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:559](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L559)
|
|
400
401
|
|
|
401
402
|
Stop the actor and cleanup
|
|
402
403
|
|
|
@@ -418,7 +419,7 @@ Stop the actor and cleanup
|
|
|
418
419
|
subscribe(observer): Subscription;
|
|
419
420
|
```
|
|
420
421
|
|
|
421
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
422
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:635](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L635)
|
|
422
423
|
|
|
423
424
|
Subscribe to snapshot updates from the wrapped XState actor.
|
|
424
425
|
|
|
@@ -449,7 +450,7 @@ subscribe(
|
|
|
449
450
|
completeListener?): Subscription;
|
|
450
451
|
```
|
|
451
452
|
|
|
452
|
-
Defined in: [packages/play-xstate/src/player-actor.ts:
|
|
453
|
+
Defined in: [packages/play-xstate/src/player-actor.ts:646](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/player-actor.ts#L646)
|
|
453
454
|
|
|
454
455
|
Subscribe to snapshot updates from the wrapped XState actor.
|
|
455
456
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function buildRouteUrl(routeTemplate, context?): string;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-xstate/src/routing/build-url.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [packages/play-xstate/src/routing/build-url.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-xstate/src/routing/build-url.ts#L40)
|
|
10
10
|
|
|
11
11
|
Build a full URL from a route template and the actor's context.
|
|
12
12
|
|