@xmachines/docs 2.1.1 → 2.2.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 +2 -2
- package/api/@xmachines/play/README.md +1 -1
- package/api/@xmachines/play/classes/NonNullableError.md +4 -4
- package/api/@xmachines/play/classes/PlayError.md +4 -4
- package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +1 -1
- package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +1 -1
- package/api/@xmachines/play-actor/functions/composePlayState.md +1 -1
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +1 -1
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +1 -1
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +1 -1
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +1 -1
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +1 -1
- package/api/@xmachines/play-actor/functions/toAtomState.md +1 -1
- package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +2 -2
- package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +3 -3
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +1 -1
- package/api/@xmachines/play-dom/README.md +1 -1
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +2 -2
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +4 -4
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +3 -1
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +149 -7
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +6 -5
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +12 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +76 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
- package/api/@xmachines/play-react/README.md +1 -1
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +1 -1
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react-router/README.md +2 -2
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +172 -15
- package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +7 -18
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -8
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +297 -11
- package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +178 -19
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/cleanFrameworkParams.md +40 -0
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouterConnection.md +21 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
- package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +24 -0
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +36 -0
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRouteMappings.md +67 -0
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isMountableBridge.md +26 -0
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/mountKey.md +28 -0
- package/api/@xmachines/play-router/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/functions/openProviderBridge.md +41 -0
- package/api/@xmachines/play-router/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/functions/repointProviderBridge.md +27 -0
- package/api/@xmachines/play-router/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/functions/resolveFrameworkParams.md +51 -0
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
- package/api/@xmachines/play-router/interfaces/MountableRouterBridge.md +130 -0
- package/api/@xmachines/play-router/interfaces/OpenProviderBridgeArgs.md +28 -0
- package/api/@xmachines/play-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-router/interfaces/PlayRouterProviderBaseProps.md +33 -0
- package/api/@xmachines/play-router/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +3 -3
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +4 -4
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +7 -3
- package/api/@xmachines/play-router/interfaces/RouterConnection.md +76 -0
- package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +1 -1
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +36 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-router/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-signals/README.md +1 -1
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +1 -1
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +19 -3
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +166 -18
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +8 -18
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +10 -8
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +14 -12
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +1 -1
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/README.md +3 -1
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +148 -6
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +12 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +76 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +3 -1
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +148 -6
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +28 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +76 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +148 -6
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +7 -18
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +1 -1
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +153 -11
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +149 -7
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +7 -17
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-vue/README.md +1 -1
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +1 -1
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +154 -12
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +25 -2
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +1 -1
- package/api/@xmachines/play-xstate/README.md +1 -1
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +16 -16
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
- package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
- package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
- 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/configuration.md +1 -1
- package/contributing/development.md +16 -16
- package/contributing/testing.md +31 -4
- package/examples/README.md +1 -1
- package/examples/multi-router-integration.md +126 -1
- package/examples/routing-patterns.md +1 -1
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -30
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -31
|
@@ -2,13 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
# Abstract Class: RouterBridgeBase
|
|
4
4
|
|
|
5
|
-
Defined in: [router-bridge-base.ts:
|
|
5
|
+
Defined in: [router-bridge-base.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L112)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A `RouterBridge` whose machine is mounted at a URL prefix that can MOVE while the
|
|
8
|
+
bridge stays connected.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
that
|
|
10
|
+
Every bridge on `RouterBridgeBase` satisfies this interface. The interface exists
|
|
11
|
+
so that a provider component moves a live bridge instead of a teardown of it: a
|
|
12
|
+
host route that renders again with a new prefix keeps the actor, the route map, and
|
|
13
|
+
its LRU cache.
|
|
14
|
+
|
|
15
|
+
The mount that moves says WHERE an actor lives, and never WHICH actor lives there.
|
|
16
|
+
An actor never changes identity, so a new identity is a new actor, and a new actor
|
|
17
|
+
takes a new bridge.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// The host moved this actor to another place in its URL space. `machineId` names
|
|
23
|
+
// WHICH document the actor runs, and it does not change: a new identity is a new
|
|
24
|
+
// actor, and therefore a new bridge, because one actor takes one bridge.
|
|
25
|
+
bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
26
|
+
```
|
|
12
27
|
|
|
13
28
|
## Extended by
|
|
14
29
|
|
|
@@ -23,31 +38,113 @@ that are different in each framework, and it implements nothing more.
|
|
|
23
38
|
|
|
24
39
|
## Implements
|
|
25
40
|
|
|
26
|
-
- [`
|
|
41
|
+
- [`MountableRouterBridge`](../interfaces/MountableRouterBridge.md)
|
|
27
42
|
|
|
28
43
|
## Constructors
|
|
29
44
|
|
|
30
45
|
### Constructor
|
|
31
46
|
|
|
32
47
|
```ts
|
|
33
|
-
new RouterBridgeBase(
|
|
48
|
+
new RouterBridgeBase(
|
|
49
|
+
actor,
|
|
50
|
+
routeMap,
|
|
51
|
+
options?): RouterBridgeBase;
|
|
34
52
|
```
|
|
35
53
|
|
|
36
|
-
Defined in: [router-bridge-base.ts:
|
|
54
|
+
Defined in: [router-bridge-base.ts:230](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L230)
|
|
37
55
|
|
|
38
56
|
#### Parameters
|
|
39
57
|
|
|
40
|
-
| Parameter
|
|
41
|
-
|
|
|
42
|
-
| `actor`
|
|
43
|
-
| `routeMap`
|
|
44
|
-
| `routeMap.getPathByStateId`
|
|
45
|
-
| `routeMap.getStateIdByPath
|
|
58
|
+
| Parameter | Type | Description |
|
|
59
|
+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
60
|
+
| `actor` | [`RoutableActor`](../interfaces/RoutableActor.md) | A `RoutableActor`, with `currentRoute`, `initialRoute`, and `send`. |
|
|
61
|
+
| `routeMap` | \{ `getPathByStateId`: `string` \| `null` \| `undefined`; `getStateIdByPath`: `string` \| `null` \| `undefined`; \} | The route map of both directions, for the resolution between a `stateId` and a `path`. Give `getStateIdByPath` and `getPathByStateId`. A framework adapter usually wraps the result of `createRouteMap(machine)`, or an equivalent value. The key of `getPathByStateId` is the form `"#stateId"` or the bare form `"stateId"`. The bridge tries both forms. Therefore an implementation of your own, for example a plain test object, handles one form only. |
|
|
62
|
+
| `routeMap.getPathByStateId` | - |
|
|
63
|
+
| `routeMap.getStateIdByPath?` | - |
|
|
64
|
+
| `options?` | [`BasePathOptions`](../interfaces/BasePathOptions.md) | - |
|
|
46
65
|
|
|
47
66
|
#### Returns
|
|
48
67
|
|
|
49
68
|
`RouterBridgeBase`
|
|
50
69
|
|
|
70
|
+
## Accessors
|
|
71
|
+
|
|
72
|
+
### basePath
|
|
73
|
+
|
|
74
|
+
#### Get Signature
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
get basePath(): string;
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Defined in: [router-bridge-base.ts:255](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L255)
|
|
81
|
+
|
|
82
|
+
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
83
|
+
when the machine owns the complete router.
|
|
84
|
+
|
|
85
|
+
##### Returns
|
|
86
|
+
|
|
87
|
+
`string`
|
|
88
|
+
|
|
89
|
+
The resolved URL prefix of the mount, or `""` when the machine owns the complete router.
|
|
90
|
+
|
|
91
|
+
#### Implementation of
|
|
92
|
+
|
|
93
|
+
[`MountableRouterBridge`](../interfaces/MountableRouterBridge.md).[`basePath`](../interfaces/MountableRouterBridge.md#property-basepath)
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### basePathParams
|
|
98
|
+
|
|
99
|
+
#### Get Signature
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
get basePathParams(): Readonly<Record<string, string>>;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Defined in: [router-bridge-base.ts:284](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L284)
|
|
106
|
+
|
|
107
|
+
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
108
|
+
without a param.
|
|
109
|
+
|
|
110
|
+
These params belong to the HOST: the host wrote the prefix and resolved the
|
|
111
|
+
values, and they describe the route of the host and not the route of the machine.
|
|
112
|
+
They therefore travel in NO `play.route` event. The machine is authoritative over
|
|
113
|
+
its own params, and `event.params` holds what the pattern of the machine
|
|
114
|
+
declares, and nothing else.
|
|
115
|
+
|
|
116
|
+
They live here instead, because a value that reached the actor on a navigation
|
|
117
|
+
ALONE would go stale: `setBasePath()` can move the mount while the machine stays
|
|
118
|
+
on the same route, no event goes out, and `event.params` would then contradict
|
|
119
|
+
`basePath`. A read of this accessor cannot go stale.
|
|
120
|
+
|
|
121
|
+
A machine that needs the identity of its host — a `machineId`, a tenant — takes
|
|
122
|
+
it through the `input` of the actor, where it belongs: that identity decides
|
|
123
|
+
WHICH machine runs, and it is not a param of a route inside the machine.
|
|
124
|
+
|
|
125
|
+
##### Example
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
bridge.basePath; // "/abc123/play"
|
|
129
|
+
bridge.basePathParams; // { machineId: "abc123" }
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
##### Returns
|
|
133
|
+
|
|
134
|
+
`Readonly`\<`Record`\<`string`, `string`\>\>
|
|
135
|
+
|
|
136
|
+
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
137
|
+
without a param.
|
|
138
|
+
|
|
139
|
+
These params belong to the HOST, so they travel in NO `play.route` event — the
|
|
140
|
+
machine is authoritative over its own params. This accessor is therefore the one
|
|
141
|
+
way a host reads them back, and it cannot go stale: `setBasePath()` can move the
|
|
142
|
+
mount while the machine stays on the same route, and no event goes out.
|
|
143
|
+
|
|
144
|
+
#### Implementation of
|
|
145
|
+
|
|
146
|
+
[`MountableRouterBridge`](../interfaces/MountableRouterBridge.md).[`basePathParams`](../interfaces/MountableRouterBridge.md#property-basepathparams)
|
|
147
|
+
|
|
51
148
|
## Methods
|
|
52
149
|
|
|
53
150
|
### connect()
|
|
@@ -56,7 +153,7 @@ Defined in: [router-bridge-base.ts:127](https://gitlab.com/xmachin-es/xmachines-
|
|
|
56
153
|
connect(): void;
|
|
57
154
|
```
|
|
58
155
|
|
|
59
|
-
Defined in: [router-bridge-base.ts:
|
|
156
|
+
Defined in: [router-bridge-base.ts:506](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L506)
|
|
60
157
|
|
|
61
158
|
Connects the router bridge to the Actor.
|
|
62
159
|
|
|
@@ -66,7 +163,7 @@ in its own way.
|
|
|
66
163
|
|
|
67
164
|
The order of these steps is part of the contract of the bridge:
|
|
68
165
|
|
|
69
|
-
- The constructor seeds `
|
|
166
|
+
- The constructor seeds `lastActorRoute` from `actor.currentRoute`, and it records no location
|
|
70
167
|
- The method installs the actor watcher before the router subscriptions of the adapter
|
|
71
168
|
- The first synchronization then separates a deep link from a restore, with `actor.initialRoute`
|
|
72
169
|
|
|
@@ -80,7 +177,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
80
177
|
|
|
81
178
|
#### Implementation of
|
|
82
179
|
|
|
83
|
-
[`
|
|
180
|
+
[`MountableRouterBridge`](../interfaces/MountableRouterBridge.md).[`connect`](../interfaces/MountableRouterBridge.md#connect)
|
|
84
181
|
|
|
85
182
|
---
|
|
86
183
|
|
|
@@ -90,7 +187,7 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
90
187
|
disconnect(): void;
|
|
91
188
|
```
|
|
92
189
|
|
|
93
|
-
Defined in: [router-bridge-base.ts:
|
|
190
|
+
Defined in: [router-bridge-base.ts:728](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L728)
|
|
94
191
|
|
|
95
192
|
Disconnects the router bridge from the Actor.
|
|
96
193
|
|
|
@@ -103,4 +200,66 @@ framework.
|
|
|
103
200
|
|
|
104
201
|
#### Implementation of
|
|
105
202
|
|
|
106
|
-
[`
|
|
203
|
+
[`MountableRouterBridge`](../interfaces/MountableRouterBridge.md).[`disconnect`](../interfaces/MountableRouterBridge.md#disconnect)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
### setBasePath()
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
setBasePath(basePath?, basePathParams?): void;
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Defined in: [router-bridge-base.ts:324](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-bridge-base.ts#L324)
|
|
214
|
+
|
|
215
|
+
Moves the machine to a different mount point, while it stays connected.
|
|
216
|
+
|
|
217
|
+
This is the "load and unload" half of a shared router. It moves WHERE an actor is
|
|
218
|
+
mounted, and never WHICH actor is mounted: the actor, the route map, and its LRU
|
|
219
|
+
cache all stay, and nothing goes away.
|
|
220
|
+
|
|
221
|
+
An actor never changes identity. A prefix that IDENTIFIES the actor — a
|
|
222
|
+
`machineId` that names the document it runs — therefore never moves through this
|
|
223
|
+
method: a new identity is a new actor, and a new actor takes a new bridge, because
|
|
224
|
+
`connect()` permits one bridge for each actor. The segments that move here are the
|
|
225
|
+
ones that LOCATE: a region, a locale, a tenant, a workspace slug.
|
|
226
|
+
|
|
227
|
+
The call then brings the location in step with the NEW prefix. A location inside
|
|
228
|
+
the new mount runs the same first-synchronization decision as `connect()`: it
|
|
229
|
+
drives the actor, and a restore keeps the route of the actor. A location OUTSIDE
|
|
230
|
+
the new mount is the old mount in practice, so the bridge writes the new one
|
|
231
|
+
itself, and it keeps the route of the actor while it does so — nothing else moves
|
|
232
|
+
the address bar. A call that resolves to the current prefix changes no location,
|
|
233
|
+
and it therefore reconciles nothing.
|
|
234
|
+
|
|
235
|
+
#### Parameters
|
|
236
|
+
|
|
237
|
+
| Parameter | Type | Description |
|
|
238
|
+
| ----------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
239
|
+
| `basePath?` | `string` | The new prefix, as a pattern or as a concrete path. An absent value, `""`, and `"/"` all remove the prefix, and they give the machine the complete router again. |
|
|
240
|
+
| `basePathParams?` | `Record`\<`string`, `string` \| `number`\> | The values of the `:param` segments of `basePath`. |
|
|
241
|
+
|
|
242
|
+
#### Returns
|
|
243
|
+
|
|
244
|
+
`void`
|
|
245
|
+
|
|
246
|
+
#### Throws
|
|
247
|
+
|
|
248
|
+
For a prefix that resolves to one concrete path never.
|
|
249
|
+
|
|
250
|
+
#### Throws
|
|
251
|
+
|
|
252
|
+
When a `:param` of the prefix has no value.
|
|
253
|
+
|
|
254
|
+
#### Example
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
// The host moved this actor to another place in its URL space. `machineId` names
|
|
258
|
+
// WHICH document the actor runs, and it does not change: a new identity is a new
|
|
259
|
+
// actor, and therefore a new bridge, because one actor takes one bridge.
|
|
260
|
+
bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### Implementation of
|
|
264
|
+
|
|
265
|
+
[`MountableRouterBridge`](../interfaces/MountableRouterBridge.md).[`setBasePath`](../interfaces/MountableRouterBridge.md#setbasepath)
|
|
@@ -9,7 +9,7 @@ function buildPlayRouteEvent(options): {
|
|
|
9
9
|
} | null;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [router-sync.ts:175](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
12
|
+
Defined in: [router-sync.ts:175](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-sync.ts#L175)
|
|
13
13
|
|
|
14
14
|
Builds a normalized `play.route` event from the raw input of a router or of a
|
|
15
15
|
browser.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function buildRouteTree(routes): RouteTree;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [build-tree.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [build-tree.ts:22](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/build-tree.ts#L22)
|
|
10
10
|
|
|
11
11
|
Builds the hierarchical route tree from the flat list of the routes
|
|
12
12
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / cleanFrameworkParams
|
|
2
|
+
|
|
3
|
+
# Function: cleanFrameworkParams()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function cleanFrameworkParams(params): Record<string, string>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [framework-params.ts:182](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/framework-params.ts#L182)
|
|
10
|
+
|
|
11
|
+
The params of a framework router, in the shape that [pickOwnParams](pickOwnParams.md) reads.
|
|
12
|
+
|
|
13
|
+
Every framework reports a param that its own route DECLARES and that the location
|
|
14
|
+
did not fill: Vue Router gives `undefined` or `""`, and SolidJS Router does the
|
|
15
|
+
same. Such an entry is not an answer, and a pick that kept it would send an empty
|
|
16
|
+
value to the actor as though the path carried one. Drop it here instead, one time,
|
|
17
|
+
because the rule belongs to the decision of [resolveFrameworkParams](resolveFrameworkParams.md) and not
|
|
18
|
+
to a bridge: `VueRouterBridge` and `SolidRouterBridge` held one copy each.
|
|
19
|
+
|
|
20
|
+
A value of an array — the splat of a catch-all route of Vue Router — becomes its
|
|
21
|
+
`String()` form, exactly as a single value does.
|
|
22
|
+
|
|
23
|
+
The result has a null prototype, for the same reason [pickOwnParams](pickOwnParams.md) gives: a
|
|
24
|
+
plain `{}` accumulator turns `cleaned["__proto__"] = value` into a write of the
|
|
25
|
+
PROTOTYPE setter, which drops a string value in silence. `pickOwnParams` then read
|
|
26
|
+
`Object.hasOwn(params, "__proto__")` as `false`, called the pick incomplete, and fell
|
|
27
|
+
back to the URLPattern extraction — which THROWS on a runtime with no URLPattern, for
|
|
28
|
+
a route the framework had answered already.
|
|
29
|
+
|
|
30
|
+
## Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type | Description |
|
|
33
|
+
| --------- | ------------------------------- | --------------------------------------- |
|
|
34
|
+
| `params` | `Record`\<`string`, `unknown`\> | The raw params of the framework router. |
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
`Record`\<`string`, `string`\>
|
|
39
|
+
|
|
40
|
+
The params with no absent value, each one a string.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouteMap(machine, options?): RouteMap;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [create-route-map.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [create-route-map.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/create-route-map.ts#L47)
|
|
10
10
|
|
|
11
11
|
Creates a `RouteMap` from an XState state machine.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouteMapFromTree(routeTree, options?): RouteMap;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [create-route-map-from-tree.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [create-route-map-from-tree.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/create-route-map-from-tree.ts#L33)
|
|
10
10
|
|
|
11
11
|
Creates a `RouteMap` from the node structure of a `RouteTree`.
|
|
12
12
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / createRouterConnection
|
|
2
|
+
|
|
3
|
+
# Function: createRouterConnection()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function createRouterConnection(bridge): RouterConnection;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [provider-lifecycle.ts:284](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/provider-lifecycle.ts#L284)
|
|
10
|
+
|
|
11
|
+
Wraps a live bridge in the [RouterConnection](../interfaces/RouterConnection.md) that `connectRouter` returns.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| --------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
|
|
17
|
+
| `bridge` | [`MountableRouterBridge`](../interfaces/MountableRouterBridge.md) | The bridge that `connectRouter` built and connected. |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
[`RouterConnection`](../interfaces/RouterConnection.md)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function detectDuplicateRoutes(routes): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [validate-routes.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [validate-routes.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/validate-routes.ts#L70)
|
|
10
10
|
|
|
11
11
|
Finds each duplicate route path
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractMachineRoutes(machine): RouteTree;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [extract-routes.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [extract-routes.ts:92](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/extract-routes.ts#L92)
|
|
10
10
|
|
|
11
11
|
Reads the complete route tree from the graph of a state machine
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractQuery(search): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [router-sync.ts:155](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [router-sync.ts:155](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-sync.ts#L155)
|
|
10
10
|
|
|
11
11
|
Parses a URL search string into the plain object that a `play.route` event
|
|
12
12
|
needs.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractRouteParams(pathname, pattern): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [router-sync.ts:117](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [router-sync.ts:117](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/router-sync.ts#L117)
|
|
10
10
|
|
|
11
11
|
Reads the named path parameters of a URL, with the URLPattern API.
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function findRouteById(tree, id): RouteNode | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [find-route.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [find-route.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/find-route.ts#L59)
|
|
10
10
|
|
|
11
11
|
Finds a route node by its state ID
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function findRouteByPath(tree, path): RouteNode | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [find-route.ts:86](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.
|
|
9
|
+
Defined in: [find-route.ts:86](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/find-route.ts#L86)
|
|
10
10
|
|
|
11
11
|
Finds a route node by its URL path
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getNavigableRoutes(tree, stateId): RouteNode[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/query.ts#L48)
|
|
10
10
|
|
|
11
11
|
Returns every route of a navigation from the given state
|
|
12
12
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getPatternParamNames
|
|
2
|
+
|
|
3
|
+
# Function: getPatternParamNames()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function getPatternParamNames(pattern): string[];
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [framework-params.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/framework-params.ts#L27)
|
|
10
|
+
|
|
11
|
+
Reads the names of every `:param` of a route pattern of the route map.
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| --------- | -------- | ------------------------------------------------ |
|
|
17
|
+
| `pattern` | `string` | A route pattern, for example `/profile/:userId`. |
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`string`[]
|
|
22
|
+
|
|
23
|
+
The names, in the order that the pattern declares them. A fresh array, because
|
|
24
|
+
`readPatternParams` caches the one it holds.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getRequiredPatternParamNames
|
|
2
|
+
|
|
3
|
+
# Function: getRequiredPatternParamNames()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function getRequiredPatternParamNames(pattern): string[];
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [framework-params.ts:85](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/framework-params.ts#L85)
|
|
10
|
+
|
|
11
|
+
The names of every param the pattern REQUIRES, so `:name?` is left out.
|
|
12
|
+
|
|
13
|
+
An optional segment that did not match has no value, and a framework reports none.
|
|
14
|
+
That is a complete answer and not a partial one, so a MIXED pattern such as
|
|
15
|
+
`/profile/:userId/:tab?` keeps the parse of the framework when only `:tab` is absent.
|
|
16
|
+
A caller that counted that absence as a gap would fall back to the URLPattern
|
|
17
|
+
extraction, which THROWS on a runtime with no URLPattern — for a route the framework
|
|
18
|
+
had already answered.
|
|
19
|
+
|
|
20
|
+
A pattern whose params are ALL optional reports nothing at all, which reads the same
|
|
21
|
+
as "the framework matched another route", so [pickOwnParams](pickOwnParams.md) falls back for it.
|
|
22
|
+
[resolveFrameworkParams](resolveFrameworkParams.md) settles that case from the PATH instead, and it needs
|
|
23
|
+
no URLPattern to do it.
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Description |
|
|
28
|
+
| --------- | -------- | ------------------------------------------------------ |
|
|
29
|
+
| `pattern` | `string` | A route pattern, for example `/profile/:userId/:tab?`. |
|
|
30
|
+
|
|
31
|
+
## Returns
|
|
32
|
+
|
|
33
|
+
`string`[]
|
|
34
|
+
|
|
35
|
+
The required names, in the order that the pattern declares them. A fresh
|
|
36
|
+
array, because `readPatternParams` caches the one it holds.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getRoutableRoutes(tree): RouteNode[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:113](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/query.ts#L113)
|
|
10
10
|
|
|
11
11
|
Returns every route of the tree that has a route, in one flat array
|
|
12
12
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / getRouteMappings
|
|
2
|
+
|
|
3
|
+
# Function: getRouteMappings()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function getRouteMappings(tree, options?): RouteMapping[];
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [query.ts:250](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/query.ts#L250)
|
|
10
|
+
|
|
11
|
+
Returns the `{ stateId, path }` entries that a host router needs, so that it can
|
|
12
|
+
register the routes of a machine under a base path, and remove them again later.
|
|
13
|
+
|
|
14
|
+
This function makes the routes dynamic. `getStateIdByPath` and `getPathByStateId`
|
|
15
|
+
answer the question "what is this URL?" at the moment of a navigation, but a host
|
|
16
|
+
that declares real route objects — a route tree of TanStack, a `RouteObject[]`, an
|
|
17
|
+
`addRoute` call of vue-router — needs the LIST in advance, and it needs that list
|
|
18
|
+
with the prefix of the mount. A registration of these paths, and a removal of them
|
|
19
|
+
when the machine unloads, keeps the route table of the host in step with the mount.
|
|
20
|
+
|
|
21
|
+
`basePathParams` decides the form of each path, and both forms are useful:
|
|
22
|
+
|
|
23
|
+
- **Given** → a concrete path (`/abc123/play/profile/:userId`), for a route that
|
|
24
|
+
the host adds at run time, after a loader resolved the mount.
|
|
25
|
+
- **Absent** → the pattern stays (`/:machineId/play/profile/:userId`), for a static
|
|
26
|
+
route declaration of the host.
|
|
27
|
+
|
|
28
|
+
The function ALWAYS keeps each `:param` segment that the machine declares itself:
|
|
29
|
+
those are the params that the route of the host must match.
|
|
30
|
+
|
|
31
|
+
## Parameters
|
|
32
|
+
|
|
33
|
+
| Parameter | Type | Description |
|
|
34
|
+
| ---------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `tree` | [`RouteTree`](../interfaces/RouteTree.md) | The route tree of extractMachineRoutes() |
|
|
36
|
+
| `options?` | [`BasePathOptions`](../interfaces/BasePathOptions.md) | The optional `{ basePath, basePathParams }`, the same option as the bridge takes. Each `stateId` comes from the route tree, so it carries NO `#` prefix. A host that keys its route table on the target of a `play.route` event adds the `#` itself, because the event always carries the prefixed form. |
|
|
37
|
+
|
|
38
|
+
## Returns
|
|
39
|
+
|
|
40
|
+
[`RouteMapping`](../interfaces/RouteMapping.md)[]
|
|
41
|
+
|
|
42
|
+
One entry for each state with a route, in the order of the route tree.
|
|
43
|
+
|
|
44
|
+
## Throws
|
|
45
|
+
|
|
46
|
+
For a base path that resolves to one concrete path never.
|
|
47
|
+
|
|
48
|
+
## Throws
|
|
49
|
+
|
|
50
|
+
When `basePathParams` is present and it omits a `:param`.
|
|
51
|
+
|
|
52
|
+
## Example
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
const tree = extractMachineRoutes(machine);
|
|
56
|
+
|
|
57
|
+
// Concrete, for a route that the host adds after a loader resolved the mount
|
|
58
|
+
getRouteMappings(tree, { basePath: "/:machineId/play", basePathParams: { machineId: "abc123" } });
|
|
59
|
+
// [
|
|
60
|
+
// { stateId: "app.home", path: "/abc123/play" },
|
|
61
|
+
// { stateId: "app.profile", path: "/abc123/play/profile/:userId" },
|
|
62
|
+
// ]
|
|
63
|
+
|
|
64
|
+
// The pattern, for a static route declaration of the host
|
|
65
|
+
getRouteMappings(tree, { basePath: "/:machineId/play" });
|
|
66
|
+
// [{ stateId: "app.home", path: "/:machineId/play" }, ...]
|
|
67
|
+
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function getTransitionReachableRoutes(graph, stateId): string[];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:165](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/query.ts#L165)
|
|
10
10
|
|
|
11
11
|
Returns the routes that a transition from the current state can reach
|
|
12
12
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / isMountableBridge
|
|
2
|
+
|
|
3
|
+
# Function: isMountableBridge()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function isMountableBridge(bridge): bridge is MountableRouterBridge;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [provider-lifecycle.ts:116](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/provider-lifecycle.ts#L116)
|
|
10
|
+
|
|
11
|
+
Tells you whether a bridge can move its mount.
|
|
12
|
+
|
|
13
|
+
[PlayRouterBridgeConstructor](../type-aliases/PlayRouterBridgeConstructor.md) asks for a `RouterBridge`, the published
|
|
14
|
+
contract, so a consumer bridge that never heard of `basePath` still compiles. Such a
|
|
15
|
+
bridge ignores the prefix, exactly as it did before the option existed, so the probe
|
|
16
|
+
runs at run time rather than in the type system.
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
| Parameter | Type |
|
|
21
|
+
| --------- | ------------------------------------------------------------------------ |
|
|
22
|
+
| `bridge` | [`RouterBridge`](../interfaces/RouterBridge.md) \| `null` \| `undefined` |
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
`bridge is MountableRouterBridge`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function isRouteReachable(graph, fromStateId, toStateId): boolean;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [query.ts:
|
|
9
|
+
Defined in: [query.ts:193](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-router/src/query.ts#L193)
|
|
10
10
|
|
|
11
11
|
Tells you if a transition from the current state can reach a route
|
|
12
12
|
|