@xmachines/docs 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/api/@xmachines/play/README.md +58 -63
- package/api/@xmachines/play/classes/NonNullableError.md +7 -7
- package/api/@xmachines/play/classes/PlayError.md +25 -27
- package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
- package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
- package/api/@xmachines/play-actor/README.md +72 -63
- package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
- package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
- package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
- package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
- package/api/@xmachines/play-dom/README.md +119 -85
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
- package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
- package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
- package/api/@xmachines/play-dom-router/README.md +66 -49
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
- package/api/@xmachines/play-react/README.md +63 -54
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
- package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
- package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
- package/api/@xmachines/play-react-router/README.md +37 -28
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
- package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
- package/api/@xmachines/play-router/README.md +94 -82
- package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
- package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
- package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
- package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
- package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
- package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
- package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +8 -8
- package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
- package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +38 -36
- package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
- package/api/@xmachines/play-solid/README.md +46 -42
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
- package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
- package/api/@xmachines/play-solid-router/README.md +34 -29
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-svelte/README.md +40 -31
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
- package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +38 -34
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +37 -17
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
- package/api/@xmachines/play-vue/README.md +37 -35
- package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
- package/api/@xmachines/play-vue-router/README.md +65 -56
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
- package/api/@xmachines/play-xstate/README.md +72 -70
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
- package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
- package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
- package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
- package/api/@xmachines/shared/README.md +11 -13
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/development.md +28 -0
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: BrowserHistory
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:1](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:1](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L1)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
9
|
-
| Property | Modifier | Type | Description
|
|
10
|
-
| ----------------------------------------- | ---------- | --------- |
|
|
11
|
-
| <a id="property-location"></a> `location` | `readonly` | `object` |
|
|
12
|
-
| `location.hash` | `public` | `string` | -
|
|
13
|
-
| `location.pathname` | `public` | `string` | -
|
|
14
|
-
| `location.search` | `public` | `string` | -
|
|
15
|
-
| `location.state` | `public` | `unknown` | -
|
|
9
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
10
|
+
| ----------------------------------------- | ---------- | --------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-location"></a> `location` | `readonly` | `object` | Returns the state of the current location | [play-dom-router/src/create-browser-history.ts:5](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L5) |
|
|
12
|
+
| `location.hash` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:8](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L8) |
|
|
13
|
+
| `location.pathname` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:6](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L6) |
|
|
14
|
+
| `location.search` | `public` | `string` | - | [play-dom-router/src/create-browser-history.ts:7](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L7) |
|
|
15
|
+
| `location.state` | `public` | `unknown` | - | [play-dom-router/src/create-browser-history.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L9) |
|
|
16
16
|
|
|
17
17
|
## Methods
|
|
18
18
|
|
|
@@ -22,7 +22,7 @@ Defined in: [play-dom-router/src/create-browser-history.ts:1](https://gitlab.com
|
|
|
22
22
|
back(): void;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
25
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:26](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L26)
|
|
26
26
|
|
|
27
27
|
#### Returns
|
|
28
28
|
|
|
@@ -36,9 +36,9 @@ Defined in: [play-dom-router/src/create-browser-history.ts:26](https://gitlab.co
|
|
|
36
36
|
createHref(path): string;
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
39
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L38)
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Creates an href from a path
|
|
42
42
|
|
|
43
43
|
#### Parameters
|
|
44
44
|
|
|
@@ -58,13 +58,12 @@ Create href from path
|
|
|
58
58
|
destroy(): void;
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:
|
|
61
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L46)
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Cleans up.
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
`window.history`, the
|
|
67
|
-
wrapper is destroyed.
|
|
65
|
+
A second call is safe. When more than one wrapper shares the same
|
|
66
|
+
`window.history`, the last wrapper restores the original methods.
|
|
68
67
|
|
|
69
68
|
#### Returns
|
|
70
69
|
|
|
@@ -78,7 +77,7 @@ wrapper is destroyed.
|
|
|
78
77
|
forward(): void;
|
|
79
78
|
```
|
|
80
79
|
|
|
81
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
80
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L27)
|
|
82
81
|
|
|
83
82
|
#### Returns
|
|
84
83
|
|
|
@@ -92,9 +91,9 @@ Defined in: [play-dom-router/src/create-browser-history.ts:27](https://gitlab.co
|
|
|
92
91
|
go(delta): void;
|
|
93
92
|
```
|
|
94
93
|
|
|
95
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
94
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L25)
|
|
96
95
|
|
|
97
|
-
|
|
96
|
+
Moves back or forward in the history
|
|
98
97
|
|
|
99
98
|
#### Parameters
|
|
100
99
|
|
|
@@ -114,9 +113,9 @@ Go back/forward
|
|
|
114
113
|
push(path, state?): void;
|
|
115
114
|
```
|
|
116
115
|
|
|
117
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
116
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L15)
|
|
118
117
|
|
|
119
|
-
|
|
118
|
+
Pushes a new URL to the history
|
|
120
119
|
|
|
121
120
|
#### Parameters
|
|
122
121
|
|
|
@@ -137,9 +136,9 @@ Push new URL to history
|
|
|
137
136
|
replace(path, state?): void;
|
|
138
137
|
```
|
|
139
138
|
|
|
140
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
139
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L20)
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
Replaces the current URL in the history
|
|
143
142
|
|
|
144
143
|
#### Parameters
|
|
145
144
|
|
|
@@ -160,10 +159,10 @@ Replace current URL in history
|
|
|
160
159
|
subscribe(listener): () => void;
|
|
161
160
|
```
|
|
162
161
|
|
|
163
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
162
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L33)
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
Subscribes to the history changes.
|
|
165
|
+
It returns a function that cancels the subscription
|
|
167
166
|
|
|
168
167
|
#### Parameters
|
|
169
168
|
|
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: BrowserWindow
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L59)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The minimal window interface of createBrowserHistory
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
This structural interface holds only the properties that the package uses.
|
|
10
|
+
It accepts Window, a JSDOM window, and every compatible test double.
|
|
11
|
+
The package therefore does not depend on `Window & typeof globalThis`, which is
|
|
12
|
+
different in each environment.
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
14
15
|
|
|
15
16
|
| Property | Modifier | Type | Defined in |
|
|
16
17
|
| ----------------------------------------- | ---------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
-
| <a id="property-history"></a> `history` | `public` | `object` | [play-dom-router/src/create-browser-history.ts:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
18
|
-
| `history.state` | `readonly` | `unknown` | [play-dom-router/src/create-browser-history.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
19
|
-
| `history.back` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
20
|
-
| `history.forward` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
21
|
-
| `history.go` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
22
|
-
| `history.pushState` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
23
|
-
| `history.replaceState` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
24
|
-
| <a id="property-location"></a> `location` | `public` | `object` | [play-dom-router/src/create-browser-history.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
25
|
-
| `location.hash` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
26
|
-
| `location.pathname` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
27
|
-
| `location.search` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
18
|
+
| <a id="property-history"></a> `history` | `public` | `object` | [play-dom-router/src/create-browser-history.ts:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L60) |
|
|
19
|
+
| `history.state` | `readonly` | `unknown` | [play-dom-router/src/create-browser-history.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L61) |
|
|
20
|
+
| `history.back` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L65) |
|
|
21
|
+
| `history.forward` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L66) |
|
|
22
|
+
| `history.go` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L64) |
|
|
23
|
+
| `history.pushState` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L62) |
|
|
24
|
+
| `history.replaceState` | `public` | `void` | [play-dom-router/src/create-browser-history.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L63) |
|
|
25
|
+
| <a id="property-location"></a> `location` | `public` | `object` | [play-dom-router/src/create-browser-history.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L68) |
|
|
26
|
+
| `location.hash` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L71) |
|
|
27
|
+
| `location.pathname` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L69) |
|
|
28
|
+
| `location.search` | `readonly` | `string` | [play-dom-router/src/create-browser-history.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L70) |
|
|
28
29
|
|
|
29
30
|
## Methods
|
|
30
31
|
|
|
@@ -34,7 +35,7 @@ Avoids coupling to `Window & typeof globalThis` which varies across environments
|
|
|
34
35
|
addEventListener(type, listener): void;
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
38
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:73](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L73)
|
|
38
39
|
|
|
39
40
|
#### Parameters
|
|
40
41
|
|
|
@@ -55,7 +56,7 @@ Defined in: [play-dom-router/src/create-browser-history.ts:73](https://gitlab.co
|
|
|
55
56
|
removeEventListener(type, listener): void;
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
Defined in: [play-dom-router/src/create-browser-history.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
59
|
+
Defined in: [play-dom-router/src/create-browser-history.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/create-browser-history.ts#L74)
|
|
59
60
|
|
|
60
61
|
#### Parameters
|
|
61
62
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ConnectRouterOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/connect-router.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-dom-router/src/connect-router.ts:23](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L23)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The options of [connectRouter](../functions/connectRouter.md).
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Modifier | Type | Description
|
|
12
|
-
| ----------------------------------------- | ---------- | ----------------------------------------------- |
|
|
13
|
-
| <a id="property-actor"></a> `actor` | `readonly` | [`RoutableActor`](RoutableActor.md) | The actor to
|
|
14
|
-
| <a id="property-routemap"></a> `routeMap` | `readonly` | [`RouteLookupContract`](RouteLookupContract.md) |
|
|
15
|
-
| <a id="property-router"></a> `router` | `readonly` | [`VanillaRouter`](VanillaRouter.md) | The vanilla router
|
|
11
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
12
|
+
| ----------------------------------------- | ---------- | ----------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-actor"></a> `actor` | `readonly` | [`RoutableActor`](RoutableActor.md) | The actor to keep in step with the browser URL. It must implement `Routable`. | [play-dom-router/src/connect-router.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L25) |
|
|
14
|
+
| <a id="property-routemap"></a> `routeMap` | `readonly` | [`RouteLookupContract`](RouteLookupContract.md) | The route lookup that matches a URL pathname to a machine state ID. | [play-dom-router/src/connect-router.ts:29](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L29) |
|
|
15
|
+
| <a id="property-router"></a> `router` | `readonly` | [`VanillaRouter`](VanillaRouter.md) | The vanilla router from [createRouter](../functions/createRouter.md). | [play-dom-router/src/connect-router.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L27) |
|
|
@@ -2,57 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRouteEvent
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:
|
|
5
|
+
Defined in: [play-router/src/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` | [play-router/src/types.ts:
|
|
126
|
-
| <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:
|
|
127
|
-
| <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:
|
|
128
|
-
| <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:
|
|
129
|
-
| <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:
|
|
131
|
+
| <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/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`\> | [play-router/src/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`\> | [play-router/src/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` | [play-router/src/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"` | [play-router/src/types.ts:238](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L238) |
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RoutableActor
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/types.ts:
|
|
5
|
+
Defined in: [play-router/src/types.ts:272](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L272)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
The minimal actor interface that `RouterBridgeBase` and every framework router
|
|
8
|
+
adapter require.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
`RouterBridgeBase.actor.send`
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
This interface, and not `AbstractActor<AnyActorLogic> & Routable`, gives
|
|
11
|
+
`RouterBridgeBase.actor.send` the type that accepts a `PlayRouteEvent` directly.
|
|
12
|
+
It therefore removes the unsafe cast `(actor.send as (e: PlayRouteEvent) => void)`,
|
|
13
|
+
which the weaker `EventObject` constraint of the actor type needed before.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Every `AbstractActor` subclass satisfies this interface structurally, for two
|
|
16
|
+
reasons:
|
|
16
17
|
|
|
17
|
-
- `AbstractActor` implements `send(event: TEvent): void
|
|
18
|
-
|
|
19
|
-
- `Routable`
|
|
18
|
+
- `AbstractActor` implements `send(event: TEvent): void`, and `TEvent` accepts each
|
|
19
|
+
`EventObject`. Therefore it always accepts a `PlayRouteEvent`, which is a subtype.
|
|
20
|
+
- `Routable` gives `currentRoute` and `initialRoute`.
|
|
20
21
|
|
|
21
22
|
## Example
|
|
22
23
|
|
|
@@ -40,10 +41,10 @@ class MyBridge extends RouterBridgeBase {
|
|
|
40
41
|
|
|
41
42
|
## Properties
|
|
42
43
|
|
|
43
|
-
| Property | Modifier | Type | Description
|
|
44
|
-
| ------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- |
|
|
45
|
-
| <a id="property-currentroute"></a> `currentRoute` | `readonly` | [`Computed`](../../play-signals/namespaces/Signal/classes/Computed.md)\<`string` \| `null`\> | TC39 Signal
|
|
46
|
-
| <a id="property-initialroute"></a> `initialRoute` | `readonly` | `string` \| `null` | The route
|
|
44
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
45
|
+
| ------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
46
|
+
| <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. | [play-router/src/types.ts:274](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L274) |
|
|
47
|
+
| <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. | [play-router/src/types.ts:280](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L280) |
|
|
47
48
|
|
|
48
49
|
## Methods
|
|
49
50
|
|
|
@@ -53,9 +54,9 @@ class MyBridge extends RouterBridgeBase {
|
|
|
53
54
|
send(event): void;
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
Defined in: [play-router/src/types.ts:
|
|
57
|
+
Defined in: [play-router/src/types.ts:282](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L282)
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
Sends a route navigation event to the actor.
|
|
59
60
|
|
|
60
61
|
#### Parameters
|
|
61
62
|
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: RouteLookupContract
|
|
4
4
|
|
|
5
|
-
Defined in: [play-dom-router/src/connect-router.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
5
|
+
Defined in: [play-dom-router/src/connect-router.ts:15](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L15)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The structural route lookup interface that [connectRouter](../functions/connectRouter.md) accepts.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Every object with these two methods satisfies the constraint. A `RouteMap`
|
|
10
|
+
instance, a subclass, and a plain test object all work.
|
|
11
11
|
|
|
12
|
-
`getPathByStateId`
|
|
13
|
-
`"stateId"
|
|
14
|
-
|
|
12
|
+
`getPathByStateId` can receive the stateId in the form `"#stateId"` or in the
|
|
13
|
+
bare form `"stateId"`. The bridge tries both forms. Therefore an implementation
|
|
14
|
+
that holds one form only still resolves the path.
|
|
15
15
|
|
|
16
16
|
## Methods
|
|
17
17
|
|
|
@@ -21,7 +21,7 @@ implementations keyed on a single form still resolve.
|
|
|
21
21
|
getPathByStateId(id): string | null | undefined;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Defined in: [play-dom-router/src/connect-router.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
24
|
+
Defined in: [play-dom-router/src/connect-router.ts:17](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L17)
|
|
25
25
|
|
|
26
26
|
#### Parameters
|
|
27
27
|
|
|
@@ -41,7 +41,7 @@ Defined in: [play-dom-router/src/connect-router.ts:17](https://gitlab.com/xmachi
|
|
|
41
41
|
getStateIdByPath(path): string | null | undefined;
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Defined in: [play-dom-router/src/connect-router.ts:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
44
|
+
Defined in: [play-dom-router/src/connect-router.ts:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-dom-router/src/connect-router.ts#L16)
|
|
45
45
|
|
|
46
46
|
#### Parameters
|
|
47
47
|
|