@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
|
@@ -6,26 +6,27 @@
|
|
|
6
6
|
function isRouteReachable(graph, fromStateId, toStateId): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:186](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/query.ts#L186)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Tells you if a transition from the current state can reach a route
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
The function uses the path search of @statelyai/graph. It decides if a chain of
|
|
14
|
+
transition edges is present from the state of the origin to the state of the
|
|
15
|
+
target.
|
|
15
16
|
|
|
16
17
|
## Parameters
|
|
17
18
|
|
|
18
|
-
| Parameter | Type | Description
|
|
19
|
-
| ------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
20
|
-
| `graph` | `Graph`\<[`MachineNodeData`](../interfaces/MachineNodeData.md), [`MachineEdgeData`](../interfaces/MachineEdgeData.md)\> |
|
|
21
|
-
| `fromStateId` | `string` |
|
|
22
|
-
| `toStateId` | `string` |
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
21
|
+
| `graph` | `Graph`\<[`MachineNodeData`](../interfaces/MachineNodeData.md), [`MachineEdgeData`](../interfaces/MachineEdgeData.md)\> | The machine graph, from RouteTree.graph |
|
|
22
|
+
| `fromStateId` | `string` | The ID of the state of the origin |
|
|
23
|
+
| `toStateId` | `string` | The ID of the state of the target |
|
|
23
24
|
|
|
24
25
|
## Returns
|
|
25
26
|
|
|
26
27
|
`boolean`
|
|
27
28
|
|
|
28
|
-
true
|
|
29
|
+
true when a transition path is present. In every other case, false
|
|
29
30
|
|
|
30
31
|
## Example
|
|
31
32
|
|
|
@@ -33,6 +34,6 @@ true if a transition path exists, false otherwise
|
|
|
33
34
|
const tree = extractMachineRoutes(machine);
|
|
34
35
|
if (tree.graph) {
|
|
35
36
|
const canReach = isRouteReachable(tree.graph, "auth.login", "auth.dashboard");
|
|
36
|
-
// true
|
|
37
|
+
// it is true when a transition path from login to dashboard is present
|
|
37
38
|
}
|
|
38
39
|
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function machineToGraph(machine): MachineGraph;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [machine-to-graph.ts:
|
|
9
|
+
Defined in: [machine-to-graph.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/machine-to-graph.ts#L73)
|
|
10
10
|
|
|
11
11
|
## Parameters
|
|
12
12
|
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
function routeExists(tree, path): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:128](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/query.ts#L128)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Tells you if a route path is in the tree
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The function tests if the path has a state with a `meta.route` field.
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
17
|
-
| Parameter | Type | Description
|
|
18
|
-
| --------- | ----------------------------------------- |
|
|
19
|
-
| `tree` | [`RouteTree`](../interfaces/RouteTree.md) |
|
|
20
|
-
| `path` | `string` |
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --------- | ----------------------------------------- | ---------------------------------------------------------- |
|
|
19
|
+
| `tree` | [`RouteTree`](../interfaces/RouteTree.md) | The route tree, from extractMachineRoutes() |
|
|
20
|
+
| `path` | `string` | The complete route path, for example '/dashboard/settings' |
|
|
21
21
|
|
|
22
22
|
## Returns
|
|
23
23
|
|
|
24
24
|
`boolean`
|
|
25
25
|
|
|
26
|
-
true
|
|
26
|
+
true when the tree holds the path. In every other case, false
|
|
@@ -6,29 +6,31 @@
|
|
|
6
6
|
function sanitizePathname(pathname): string | null;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [router-sync.ts:
|
|
9
|
+
Defined in: [router-sync.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/router-sync.ts#L74)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Normalizes a pathname before a lookup in the route map.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
The function removes a query fragment and a hash fragment, it joins each duplicate
|
|
14
|
+
slash into one, and it refuses a path of an improbable length, because such a path
|
|
15
|
+
must never enter the route resolution.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
It returns `null` for a path of more than 2048 characters, which is malformed or
|
|
18
|
+
hostile input. An adapter that passes around
|
|
19
|
+
`RouterBridgeBase.syncActorFromRouter()`, for example `VueRouterBridge`, must call
|
|
20
|
+
this function itself, and it must return at once on a `null` value. That adapter
|
|
21
|
+
then gives the same guarantee of the defense in depth as the shared base class.
|
|
20
22
|
|
|
21
23
|
## Parameters
|
|
22
24
|
|
|
23
|
-
| Parameter | Type | Description
|
|
24
|
-
| ---------- | -------- |
|
|
25
|
-
| `pathname` | `string` |
|
|
25
|
+
| Parameter | Type | Description |
|
|
26
|
+
| ---------- | -------- | -------------------------------------------------------- |
|
|
27
|
+
| `pathname` | `string` | The raw path string of a navigation event of the router. |
|
|
26
28
|
|
|
27
29
|
## Returns
|
|
28
30
|
|
|
29
31
|
`string` \| `null`
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
The normalized path string, or `null` when the path is malformed or too long.
|
|
32
34
|
|
|
33
35
|
## Example
|
|
34
36
|
|
|
@@ -36,5 +38,5 @@ Normalized path string, or `null` if the path is malformed/too long.
|
|
|
36
38
|
import { sanitizePathname } from "@xmachines/play-router";
|
|
37
39
|
|
|
38
40
|
const clean = sanitizePathname(to.path);
|
|
39
|
-
if (clean === null) return; //
|
|
41
|
+
if (clean === null) return; // refuse a malformed path
|
|
40
42
|
```
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
function validateRouteFormat(routePath, stateId): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [validate-routes.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/validate-routes.ts#L27)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Checks the format of a route path
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
and relative
|
|
15
|
-
|
|
13
|
+
The function requires a string that is not empty. It accepts an absolute path
|
|
14
|
+
("/foo") and also a relative path ("foo" or "child/nested"). A relative route
|
|
15
|
+
receives the path prefix of its parent state during the construction of the tree.
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
18
18
|
|
|
19
|
-
| Parameter | Type | Description
|
|
20
|
-
| ----------- | -------- |
|
|
21
|
-
| `routePath` | `string` |
|
|
22
|
-
| `stateId` | `string` |
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
| ----------- | -------- | -------------------------------------------------- |
|
|
21
|
+
| `routePath` | `string` | The route path to check: absolute or relative |
|
|
22
|
+
| `stateId` | `string` | The identifier of the state, for the error message |
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
@@ -27,4 +27,4 @@ inherit their parent state's path prefix when the tree is built.
|
|
|
27
27
|
|
|
28
28
|
## Throws
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
When the route path is empty
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
function validateStateExists(stateId, stateIds): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [validate-routes.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/validate-routes.ts#L43)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Checks that the set of the state IDs holds a state
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
The function requires each state ID of a reference in the machine graph. This
|
|
14
|
+
check at the build time therefore stops a broken route reference.
|
|
15
15
|
|
|
16
16
|
## Parameters
|
|
17
17
|
|
|
18
|
-
| Parameter | Type | Description
|
|
19
|
-
| ---------- | ----------------- |
|
|
20
|
-
| `stateId` | `string` |
|
|
21
|
-
| `stateIds` | `Set`\<`string`\> |
|
|
18
|
+
| Parameter | Type | Description |
|
|
19
|
+
| ---------- | ----------------- | ---------------------------------------------------- |
|
|
20
|
+
| `stateId` | `string` | The identifier of the state to check |
|
|
21
|
+
| `stateIds` | `Set`\<`string`\> | The set of every known state ID of the machine graph |
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
@@ -26,4 +26,4 @@ Build-time validation prevents broken route references.
|
|
|
26
26
|
|
|
27
27
|
## Throws
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
When the set does not hold the state ID
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: BuildPlayRouteEventOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [router-sync.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [router-sync.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/router-sync.ts#L17)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
9
9
|
| Property | Type | Defined in |
|
|
10
10
|
| ----------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
-
| <a id="property-match"></a> `match` | (`sanitizedPathname`) => [`RouteMatch`](RouteMatch.md) | [router-sync.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
12
|
-
| <a id="property-pathname"></a> `pathname` | `string` | [router-sync.ts:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
13
|
-
| <a id="property-search"></a> `search?` | `string` | [router-sync.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
11
|
+
| <a id="property-match"></a> `match` | (`sanitizedPathname`) => [`RouteMatch`](RouteMatch.md) | [router-sync.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/router-sync.ts#L20) |
|
|
12
|
+
| <a id="property-pathname"></a> `pathname` | `string` | [router-sync.ts:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/router-sync.ts#L18) |
|
|
13
|
+
| <a id="property-search"></a> `search?` | `string` | [router-sync.ts:19](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/router-sync.ts#L19) |
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: LocationLike
|
|
4
4
|
|
|
5
|
-
Defined in: [types.ts:
|
|
5
|
+
Defined in: [types.ts:432](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L432)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
`connect()
|
|
9
|
-
global `location` when
|
|
7
|
+
The minimal location interface of an adapter that reads the current URL at the
|
|
8
|
+
moment of `connect()`. You can inject it for SSR and for a test: give a mock in
|
|
9
|
+
place of the global `location` when no DOM is available.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
the DOM lib.
|
|
11
|
+
The definition is structural, and it holds no reference to `Location`. This package
|
|
12
|
+
therefore compiles without the DOM lib.
|
|
13
13
|
|
|
14
14
|
## Example
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
|
-
// SSR
|
|
17
|
+
// SSR or a test — an injected mock
|
|
18
18
|
const mockLoc: LocationLike = { pathname: "/dashboard", search: "?tab=posts" };
|
|
19
19
|
connectRouter({ actor, routeMap, location: mockLoc });
|
|
20
20
|
```
|
|
@@ -23,5 +23,5 @@ connectRouter({ actor, routeMap, location: mockLoc });
|
|
|
23
23
|
|
|
24
24
|
| Property | Modifier | Type | Defined in |
|
|
25
25
|
| ----------------------------------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------- |
|
|
26
|
-
| <a id="property-pathname"></a> `pathname` | `readonly` | `string` | [types.ts:
|
|
27
|
-
| <a id="property-search"></a> `search` | `readonly` | `string` | [types.ts:
|
|
26
|
+
| <a id="property-pathname"></a> `pathname` | `readonly` | `string` | [types.ts:433](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L433) |
|
|
27
|
+
| <a id="property-search"></a> `search` | `readonly` | `string` | [types.ts:434](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L434) |
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: MachineEdgeData
|
|
4
4
|
|
|
5
|
-
Defined in: [types.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [types.ts:24](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L24)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The data on each edge of the graph that represents the machine.
|
|
8
|
+
It holds the event of the transition and the information of its guard.
|
|
9
9
|
|
|
10
10
|
## Properties
|
|
11
11
|
|
|
12
|
-
| Property
|
|
13
|
-
|
|
|
14
|
-
| <a id="property-eventtype"></a> `eventType`
|
|
15
|
-
| <a id="property-guardtype"></a>
|
|
12
|
+
| Property | Type | Description | Defined in |
|
|
13
|
+
| ------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| <a id="property-eventtype"></a> `eventType` | `string` | The event type that starts this transition | [types.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L26) |
|
|
15
|
+
| <a id="property-guardtype"></a> ~~`guardType?`~~ | `string` | The guard as a string, when a guard is present **Deprecated** Will be removed in the next major. | [types.ts:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L32) |
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: MachineNodeData
|
|
4
4
|
|
|
5
|
-
Defined in: [types.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [types.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L9)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The data on each node of the graph that represents the machine.
|
|
8
|
+
It holds the state metadata that the route extraction and the queries need.
|
|
9
9
|
|
|
10
10
|
## Properties
|
|
11
11
|
|
|
12
|
-
| Property | Type | Description
|
|
13
|
-
| --------------------------------------- | ---------------------------------------------------------------------- |
|
|
14
|
-
| <a id="property-meta"></a> `meta?` | `Record`\<`string`, `unknown`\> |
|
|
15
|
-
| <a id="property-route"></a> `route?` | `string` |
|
|
16
|
-
| <a id="property-stateid"></a> `stateId` | `string` | XState state ID
|
|
17
|
-
| <a id="property-type"></a> `type` | `"atomic"` \| `"compound"` \| `"parallel"` \| `"final"` \| `"history"` |
|
|
12
|
+
| Property | Type | Description | Defined in |
|
|
13
|
+
| --------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| <a id="property-meta"></a> `meta?` | `Record`\<`string`, `unknown`\> | The original meta object of the state | [types.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L15) |
|
|
15
|
+
| <a id="property-route"></a> `route?` | `string` | The route path of meta.route, in its string form | [types.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L17) |
|
|
16
|
+
| <a id="property-stateid"></a> `stateId` | `string` | The XState state ID, for example "test.dashboard.overview" | [types.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L11) |
|
|
17
|
+
| <a id="property-type"></a> `type` | `"atomic"` \| `"compound"` \| `"parallel"` \| `"final"` \| `"history"` | The state type of XState | [types.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L13) |
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayActor
|
|
4
4
|
|
|
5
|
-
Defined in: [types.ts:
|
|
5
|
+
Defined in: [types.ts:312](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L312)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
The complete actor shape of the `PlayRouterProvider` component of each framework
|
|
8
|
+
adapter: `play-solid-router`, `play-vue-router`, `play-react-router`, and each
|
|
9
|
+
adapter on the shared framework router bridge bases.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
view spec
|
|
11
|
+
The shape extends `RoutableActor` with `currentView`, because the provider renders
|
|
12
|
+
the current view spec and also keeps the routes in step. It therefore needs both
|
|
13
|
+
capabilities.
|
|
13
14
|
|
|
14
|
-
- Use `RoutableActor` when
|
|
15
|
-
`connectRouter
|
|
16
|
-
- Use `PlayActor` when the component also renders the current view spec
|
|
17
|
-
|
|
15
|
+
- Use `RoutableActor` when you need the routing alone, for example in a
|
|
16
|
+
`RouterBridgeBase` subclass, or in `connectRouter`.
|
|
17
|
+
- Use `PlayActor` when the component also renders the current view spec, for
|
|
18
|
+
example for the renderer callback parameter of `PlayRouterProvider`, and in
|
|
19
|
+
`PlayRenderer`.
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
Every `AbstractActor` subclass that implements both `Routable` and `Viewable`
|
|
22
|
+
satisfies this interface structurally.
|
|
21
23
|
|
|
22
24
|
## Example
|
|
23
25
|
|
|
@@ -25,7 +27,7 @@ satisfy this interface structurally.
|
|
|
25
27
|
import type { PlayActor } from "@xmachines/play-router";
|
|
26
28
|
|
|
27
29
|
function MyRouterProvider({ actor }: { actor: PlayActor }) {
|
|
28
|
-
//
|
|
30
|
+
// it reads actor.currentRoute for the routing, and actor.currentView for the render
|
|
29
31
|
}
|
|
30
32
|
```
|
|
31
33
|
|
|
@@ -35,11 +37,11 @@ function MyRouterProvider({ actor }: { actor: PlayActor }) {
|
|
|
35
37
|
|
|
36
38
|
## Properties
|
|
37
39
|
|
|
38
|
-
| Property | Modifier | Type | Description
|
|
39
|
-
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
|
-
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | TC39 Signal
|
|
41
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | TC39 Signal
|
|
42
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route
|
|
40
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
41
|
+
| ------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | The TC39 Signal of the current URL path of the actor, or of its state ID. | [`RoutableActor`](RoutableActor.md).[`currentRoute`](RoutableActor.md#property-currentroute) | [types.ts:274](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L274) |
|
|
43
|
+
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](../../play-actor/interfaces/PlaySpec.md) \| `null`\> | The TC39 Signal of the current view spec of the actor, or `null` when no view is active. | - | [types.ts:314](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L314) |
|
|
44
|
+
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route of the initial state of the machine. The constructor fixes it. A router bridge compares it with the browser URL. It therefore separates a deep link, where the router wins, from a restore of a session, where the actor wins. | [`RoutableActor`](RoutableActor.md).[`initialRoute`](RoutableActor.md#property-initialroute) | [types.ts:280](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L280) |
|
|
43
45
|
|
|
44
46
|
## Methods
|
|
45
47
|
|
|
@@ -49,9 +51,9 @@ function MyRouterProvider({ actor }: { actor: PlayActor }) {
|
|
|
49
51
|
send(event): void;
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
Defined in: [types.ts:
|
|
54
|
+
Defined in: [types.ts:282](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L282)
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
Sends a route navigation event to the actor.
|
|
55
57
|
|
|
56
58
|
#### Parameters
|
|
57
59
|
|
|
@@ -2,57 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [types.ts:
|
|
5
|
+
Defined in: [types.ts:237](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L237)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The routing event, with its parameters and its query
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
navigation
|
|
9
|
+
This is the one routing event of the complete Play architecture. It supports a
|
|
10
|
+
navigation that knows the parameters, for example `/profile/:userId`, for a dynamic
|
|
11
|
+
route segment.
|
|
11
12
|
|
|
12
|
-
**Architectural
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
**Architectural context:** the event implements **Passive Infrastructure
|
|
14
|
+
(INV-04)**, because it holds the navigation intent of the user, and the Actor then
|
|
15
|
+
evaluates that intent with its guards. The infrastructure makes a request with a
|
|
16
|
+
`play.route` event, and the Actor decides with a transition of its state machine.
|
|
15
17
|
|
|
16
|
-
**
|
|
18
|
+
**The flow of a browser navigation:**
|
|
17
19
|
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4. Actor
|
|
20
|
+
1. The browser fires `popstate`
|
|
21
|
+
2. The router adapter resolves the URL to a route target
|
|
22
|
+
3. The adapter sends a `PlayRouteEvent` to the Actor
|
|
23
|
+
4. The Actor checks the transition with the guards of its state machine
|
|
22
24
|
|
|
23
25
|
## Param
|
|
24
26
|
|
|
25
27
|
**type**
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
The discriminator of the event. It is always "play.route"
|
|
28
30
|
|
|
29
31
|
## Param
|
|
30
32
|
|
|
31
33
|
**to**
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
The target state ID, with a # prefix, for example '#home' or '#profile'
|
|
34
36
|
|
|
35
37
|
## Param
|
|
36
38
|
|
|
37
39
|
**params**
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
The route parameters of the path only, from the URL path, for
|
|
42
|
+
example `{ userId: '123' }` of `/profile/123`. The `query` field holds the query
|
|
43
|
+
parameters separately.
|
|
40
44
|
|
|
41
45
|
## Param
|
|
42
46
|
|
|
43
47
|
**query**
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
The query parameters only. They stay separate from the params of the path
|
|
46
50
|
|
|
47
51
|
## Param
|
|
48
52
|
|
|
49
53
|
**match**
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
The complete match result of URLPattern, for the debug work and for
|
|
56
|
+
the observability. It is optional
|
|
52
57
|
|
|
53
58
|
## Examples
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
The base event and the routing event together
|
|
56
61
|
|
|
57
62
|
```typescript
|
|
58
63
|
import type { PlayEvent } from "@xmachines/play";
|
|
@@ -61,7 +66,7 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
|
61
66
|
type AppEvent = PlayEvent | PlayRouteEvent;
|
|
62
67
|
```
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
A basic navigation to a route
|
|
65
70
|
|
|
66
71
|
```typescript
|
|
67
72
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -73,7 +78,7 @@ const event: PlayRouteEvent = {
|
|
|
73
78
|
actor.send(event);
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
A navigation with route parameters
|
|
77
82
|
|
|
78
83
|
```typescript
|
|
79
84
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -84,10 +89,10 @@ const event: PlayRouteEvent = {
|
|
|
84
89
|
params: { userId: "123" },
|
|
85
90
|
};
|
|
86
91
|
actor.send(event);
|
|
87
|
-
//
|
|
92
|
+
// It resolves to the route /profile/123
|
|
88
93
|
```
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
A navigation with query parameters
|
|
91
96
|
|
|
92
97
|
```typescript
|
|
93
98
|
import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
@@ -95,11 +100,11 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
|
|
|
95
100
|
const event: PlayRouteEvent = {
|
|
96
101
|
type: "play.route",
|
|
97
102
|
to: "#settings",
|
|
98
|
-
params: { section: "profile" }, //
|
|
99
|
-
query: { tab: "security" }, //
|
|
103
|
+
params: { section: "profile" }, // a route parameter of the path only
|
|
104
|
+
query: { tab: "security" }, // the query only
|
|
100
105
|
};
|
|
101
106
|
actor.send(event);
|
|
102
|
-
//
|
|
107
|
+
// It resolves to the route /settings/profile?tab=security
|
|
103
108
|
```
|
|
104
109
|
|
|
105
110
|
## See
|
|
@@ -108,9 +113,10 @@ actor.send(event);
|
|
|
108
113
|
|
|
109
114
|
## Remarks
|
|
110
115
|
|
|
111
|
-
Use `play.route` when you need
|
|
112
|
-
config pattern on your state machine
|
|
113
|
-
URLPatternResult for advanced use
|
|
116
|
+
Use `play.route` when you need a navigation that knows the parameters, with the
|
|
117
|
+
`route: {}` config pattern on the nodes of your state machine. The `match` field
|
|
118
|
+
gives you the complete URLPatternResult, for an advanced use such as a debug or an
|
|
119
|
+
analysis of the pattern.
|
|
114
120
|
|
|
115
121
|
## Indexable
|
|
116
122
|
|
|
@@ -122,8 +128,8 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
|
|
|
122
128
|
|
|
123
129
|
| Property | Modifier | Type | Defined in |
|
|
124
130
|
| -------------------------------------- | ---------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
125
|
-
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [types.ts:
|
|
126
|
-
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [types.ts:
|
|
127
|
-
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [types.ts:
|
|
128
|
-
| <a id="property-to"></a> `to` | `readonly` | `string` | [types.ts:
|
|
129
|
-
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [types.ts:
|
|
131
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [types.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L242) |
|
|
132
|
+
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [types.ts:240](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L240) |
|
|
133
|
+
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [types.ts:241](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L241) |
|
|
134
|
+
| <a id="property-to"></a> `to` | `readonly` | `string` | [types.ts:239](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L239) |
|
|
135
|
+
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [types.ts:238](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L238) |
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ResolvedRoutePath
|
|
4
4
|
|
|
5
|
-
Defined in: [validate-routes.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [validate-routes.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/validate-routes.ts#L9)
|
|
6
6
|
|
|
7
|
-
A route entry with its RESOLVED
|
|
8
|
-
|
|
7
|
+
A route entry with its RESOLVED complete path, which is the path after the tree
|
|
8
|
+
construction put the path of the parent before each relative route.
|
|
9
9
|
|
|
10
10
|
`RouteNode` satisfies this shape structurally.
|
|
11
11
|
|
|
12
12
|
## Properties
|
|
13
13
|
|
|
14
|
-
| Property | Type | Description
|
|
15
|
-
| ----------------------------------------- | -------- |
|
|
16
|
-
| <a id="property-fullpath"></a> `fullPath` | `string` |
|
|
17
|
-
| <a id="property-stateid"></a> `stateId` | `string` |
|
|
14
|
+
| Property | Type | Description | Defined in |
|
|
15
|
+
| ----------------------------------------- | -------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| <a id="property-fullpath"></a> `fullPath` | `string` | The resolved absolute route path, for example `"/dashboard/settings"`. | [validate-routes.ts:13](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/validate-routes.ts#L13) |
|
|
17
|
+
| <a id="property-stateid"></a> `stateId` | `string` | The identifier of the state that owns the route, for example `"app.dashboard.settings"`. | [validate-routes.ts:11](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/validate-routes.ts#L11) |
|