@xmachines/docs 3.0.0 → 5.0.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 +14 -20
- package/api/@xmachines/play/README.md +29 -118
- package/api/@xmachines/play/errors/README.md +8 -0
- package/api/@xmachines/play/{classes → errors/classes}/NonNullableError.md +6 -6
- package/api/@xmachines/play/{classes → errors/classes}/PlayError.md +36 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/index/functions/asCleanup.md +77 -0
- package/api/@xmachines/play/{functions → index/functions}/assertNonNullable.md +2 -2
- package/api/@xmachines/{play-actor → play/index}/functions/shallowEqualExcept.md +3 -3
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/Cleanup.md +5 -5
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/DisposeKey.md +2 -2
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/{variables → index/variables}/DISPOSE.md +2 -2
- package/api/@xmachines/play-actor/README.md +80 -231
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-atom/README.md +281 -0
- package/api/@xmachines/play-atom/functions/watchAtom.md +79 -0
- package/api/@xmachines/play-atom/interfaces/AsyncAtomOptions.md +16 -0
- package/api/@xmachines/play-atom/interfaces/Atom.md +149 -0
- package/api/@xmachines/play-atom/interfaces/AtomObserver.md +25 -0
- package/api/@xmachines/play-atom/interfaces/AtomOptions.md +33 -0
- package/api/@xmachines/play-atom/interfaces/AtomSubscription.md +23 -0
- package/api/@xmachines/play-atom/interfaces/BaseAtom.md +97 -0
- package/api/@xmachines/play-atom/interfaces/CreateAtom.md +91 -0
- package/api/@xmachines/play-atom/interfaces/Readable.md +93 -0
- package/api/@xmachines/play-atom/interfaces/ReadonlyAtom.md +108 -0
- package/api/@xmachines/play-atom/type-aliases/AnyAtom.md +13 -0
- package/api/@xmachines/play-atom/type-aliases/AsyncAtomState.md +32 -0
- package/api/@xmachines/{play-signals → play-atom}/type-aliases/Cleanup.md +5 -5
- package/api/@xmachines/play-atom/variables/createAsyncAtom.md +42 -0
- package/api/@xmachines/play-atom/variables/createAtom.md +18 -0
- package/api/@xmachines/play-atom/variables/createWritableAtom.md +70 -0
- package/api/@xmachines/play-dom/README.md +44 -52
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +17 -16
- package/api/@xmachines/play-dom/functions/asCleanup.md +77 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +4 -4
- package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +6 -6
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +4 -4
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +29 -12
- package/api/@xmachines/play-dom-router/README.md +83 -83
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +24 -23
- package/api/@xmachines/play-dom-router/{interfaces → classes}/RouteMap.md +42 -7
- package/api/@xmachines/{play → play-dom-router}/functions/asCleanup.md +5 -6
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +3 -8
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +9 -3
- package/api/@xmachines/play-dom-router/functions/createRouter.md +8 -14
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -9
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +70 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +11 -9
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +24 -21
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +36 -23
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +4 -4
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +2 -2
- package/api/@xmachines/play-pattern/README.md +115 -0
- package/api/@xmachines/play-pattern/functions/buildPath.md +46 -0
- package/api/@xmachines/play-pattern/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-pattern/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-pattern/functions/isDotSegment.md +40 -0
- package/api/@xmachines/play-pattern/functions/parsePattern.md +28 -0
- package/api/@xmachines/play-pattern/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-pattern/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-pattern/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-pattern/interfaces/ParseOptions.md +19 -0
- package/api/@xmachines/play-pattern/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-pattern/interfaces/PatternCache.md +65 -0
- package/api/@xmachines/play-pattern/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/play-pattern/type-aliases/PathBuildResult.md +74 -0
- package/api/@xmachines/play-pattern/type-aliases/PathParams.md +15 -0
- package/api/@xmachines/play-pattern/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-pattern/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-react/README.md +46 -58
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -10
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/useAtomEffect.md +103 -0
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +6 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-react/variables/ActorProvider.md +2 -2
- 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/variables/schema.md +52 -0
- package/api/@xmachines/play-react-router/README.md +23 -51
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +24 -23
- package/api/@xmachines/play-react-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -12
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +116 -197
- package/api/@xmachines/play-router/errors/README.md +15 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +191 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +192 -0
- package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +182 -0
- package/api/@xmachines/play-router/index/README.md +83 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +19 -13
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +22 -20
- package/api/@xmachines/play-router/{functions → index/functions}/buildPlayRouteEvent.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/buildRouteTree.md +14 -4
- package/api/@xmachines/play-router/{functions → index/functions}/cleanFrameworkParams.md +3 -4
- package/api/@xmachines/play-router/index/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +17 -10
- package/api/@xmachines/play-router/{functions → index/functions}/createRouterConnection.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/detectDuplicateRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractQuery.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractRouteParams.md +9 -8
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/index/functions/findRouteByPath.md +48 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +38 -0
- package/api/@xmachines/play-router/{functions → index/functions}/mountKey.md +2 -2
- package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/{functions → index/functions}/openProviderBridge.md +14 -14
- package/api/@xmachines/play-router/index/functions/parsePattern.md +28 -0
- package/api/@xmachines/play-router/index/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/{functions → index/functions}/repointProviderBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/play-router/index/functions/sanitizePathname.md +27 -0
- package/api/@xmachines/play-router/index/functions/splitLocation.md +37 -0
- package/api/@xmachines/play-router/index/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/{functions → index/functions}/validateRouteFormat.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/validateStateExists.md +2 -2
- package/api/@xmachines/play-router/index/interfaces/BasePathOptions.md +32 -0
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/CompileOptions.md +35 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +52 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +12 -12
- package/api/@xmachines/play-router/index/interfaces/OpenProviderBridgeArgs.md +30 -0
- package/api/@xmachines/play-router/index/interfaces/ParseOptions.md +24 -0
- package/api/@xmachines/play-router/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-router/index/interfaces/PatternCache.md +65 -0
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/index/interfaces/PlayRouterProviderBaseProps.md +39 -0
- package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/ResolvedRoutePath.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/Routable.md +26 -0
- package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/index/interfaces/RouteMapOptions.md +19 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteNode.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-router/index/interfaces/RouteTree.md +27 -0
- package/api/@xmachines/play-router/index/interfaces/RouteWatcherHandle.md +55 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +17 -19
- package/api/@xmachines/play-router/index/interfaces/RouterBridgeOptions.md +31 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +10 -10
- package/api/@xmachines/play-router/index/interfaces/SplitLocation.md +16 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +53 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-xstate → play-router/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +18 -0
- package/api/@xmachines/play-router/xstate/README.md +53 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/createRouteMap.md +11 -9
- package/api/@xmachines/play-router/xstate/functions/extractMachineRoutes.md +30 -0
- package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRoutableRoutes.md +6 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRouteMappings.md +7 -7
- package/api/@xmachines/play-router/{functions → xstate/functions}/getTransitionReachableRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/isRouteReachable.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/machineToGraph.md +2 -2
- package/api/@xmachines/play-router/xstate/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/{type-aliases → xstate/type-aliases}/MachineGraph.md +2 -2
- package/api/@xmachines/play-solid/README.md +21 -34
- 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 +11 -11
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +2 -2
- 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/variables/schema.md +71 -0
- package/api/@xmachines/play-solid-router/README.md +34 -55
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +33 -56
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +38 -35
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- 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 +18 -29
- 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 +12 -12
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-svelte/variables/schema.md +16 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -44
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +24 -23
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -9
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +11 -9
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/README.md +32 -50
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +24 -23
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +15 -23
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/README.md +25 -49
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +22 -21
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- 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 +6 -4
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +26 -29
- 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 +29 -55
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +18 -12
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +52 -48
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -12
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +10 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +15 -17
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +29 -12
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- 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-url/README.md +75 -0
- package/api/@xmachines/play-url/errors/README.md +17 -0
- package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-url/index/README.md +72 -0
- package/api/@xmachines/play-url/index/functions/buildPath.md +46 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/createPatternCache.md +47 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +32 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isDotSegment.md +40 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +3 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/parsePattern.md +28 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/pickOwnParams.md +4 -4
- package/api/@xmachines/{play-router → play-url/index}/functions/resolveBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/play-url/index/functions/sanitizePathname.md +27 -0
- package/api/@xmachines/play-url/index/functions/splitLocation.md +37 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/interfaces/BasePathOptions.md +6 -10
- package/api/@xmachines/play-url/index/interfaces/CompileOptions.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/FrameworkParamsSource.md +52 -0
- package/api/@xmachines/play-url/index/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-url/index/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/ParseOptions.md +24 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternCache.md +65 -0
- package/api/@xmachines/play-url/index/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/ResolvedBasePath.md +6 -6
- package/api/@xmachines/play-url/index/interfaces/SplitLocation.md +16 -0
- package/api/@xmachines/play-url/index/type-aliases/PathBuildResult.md +74 -0
- package/api/@xmachines/play-url/index/type-aliases/PathParams.md +15 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +22 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-router → play-url/index}/variables/NO_BASE_PATH.md +2 -2
- package/api/@xmachines/play-url/index/variables/URLPattern.md +21 -0
- package/api/@xmachines/play-view/README.md +176 -0
- package/api/@xmachines/play-view/errors/README.md +17 -0
- package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +192 -0
- package/api/@xmachines/play-view/index/README.md +55 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/attachRenderErrorHandler.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/functions/composePlayState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createFailureLatch.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createReportGuard.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/createViewStoreLifecycle.md +2 -2
- package/api/@xmachines/play-view/index/functions/guardContextWrites.md +19 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/refreshContextSubtree.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/reuseComposedState.md +3 -3
- package/api/@xmachines/{play-actor → play-view/index}/functions/sameViewInputs.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/toAtomState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/typedSpec.md +2 -2
- package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +49 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/BaseViewContextValue.md +12 -12
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/FailureLatch.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuard.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ReportGuardMessages.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewInputs.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreLifecycle.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-view/index/interfaces/Viewable.md +18 -0
- package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/variables/CONTEXT_STATE_KEY.md +2 -2
- package/api/@xmachines/play-vue/README.md +26 -40
- 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 +9 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +11 -11
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -3
- 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/schema.md +71 -0
- package/api/@xmachines/play-vue-router/README.md +42 -84
- package/api/@xmachines/play-vue-router/errors/README.md +8 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +193 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +177 -0
- package/api/@xmachines/play-vue-router/index/README.md +20 -0
- package/api/@xmachines/play-vue-router/{classes → index/classes}/RouteMap.md +19 -13
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +26 -45
- package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RouteMapOptions.md +19 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +17 -19
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +26 -4
- package/api/@xmachines/play-xstate/README.md +195 -116
- package/api/@xmachines/play-xstate/errors/README.md +14 -0
- package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +198 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +169 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +197 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +176 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteParamError.md +207 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +203 -0
- package/api/@xmachines/play-xstate/index/README.md +38 -0
- package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +583 -0
- package/api/@xmachines/play-xstate/index/functions/compose.md +224 -0
- package/api/@xmachines/play-xstate/index/functions/definePlayer.md +158 -0
- package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +22 -0
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerFactoryResumeOptions.md +3 -3
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +33 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +39 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +27 -0
- package/api/@xmachines/{play-router → play-xstate/index}/variables/DISPOSE.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/README.md +46 -0
- package/api/@xmachines/play-xstate/with-routing/functions/buildRouteUrl.md +57 -0
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/deriveRoute.md +4 -4
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/formatPlayRouteTransitions.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/isAbsoluteRoute.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +36 -0
- package/api/@xmachines/play-xstate/{interfaces → with-routing/interfaces}/RouteContext.md +6 -6
- package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteMachineConfig.md +5 -5
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteStateNode.md +21 -7
- package/api/@xmachines/play-xstate/with-view/README.md +31 -0
- package/api/@xmachines/play-xstate/with-view/functions/withView.md +33 -0
- package/api/@xmachines/shared/README.md +10 -32
- 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 +2 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/api/README.md +4 -1
- package/api/llms.txt +18 -12
- package/contributing/architecture.md +157 -148
- package/contributing/configuration.md +100 -41
- package/contributing/deployment.md +112 -34
- package/contributing/development.md +103 -34
- package/contributing/migrating-to-play-atom.md +209 -0
- package/contributing/testing.md +136 -80
- package/examples/README.md +11 -9
- package/examples/basic-state-machine.md +4 -4
- package/examples/form-validation.md +4 -3
- package/examples/multi-router-integration.md +81 -59
- package/examples/routing-patterns.md +20 -19
- package/examples/traffic-light.md +17 -11
- package/guides/README.md +2 -1
- package/guides/actor-model.md +50 -32
- package/guides/atoms.md +264 -0
- package/guides/getting-started.md +91 -53
- package/guides/inspector.md +7 -7
- package/guides/routing.md +265 -0
- package/guides/state-machines.md +20 -21
- package/package.json +10 -9
- package/rfc/play.md +104 -60
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +0 -43
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-actor/interfaces/Viewable.md +0 -18
- package/api/@xmachines/play-dom/type-aliases/DisposablePlayUI.md +0 -36
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +0 -262
- package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +0 -80
- package/api/@xmachines/play-react/functions/useSignalEffect.md +0 -77
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +0 -13
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-router/functions/findRouteByPath.md +0 -41
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +0 -35
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +0 -24
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +0 -36
- package/api/@xmachines/play-router/functions/resolveFrameworkParams.md +0 -51
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/functions/sanitizePathname.md +0 -42
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +0 -47
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +0 -15
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +0 -17
- package/api/@xmachines/play-router/interfaces/OpenProviderBridgeArgs.md +0 -28
- package/api/@xmachines/play-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-router/interfaces/PlayRouterProviderBaseProps.md +0 -33
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +0 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteTree.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +0 -55
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +0 -13
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +0 -36
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +0 -11
- package/api/@xmachines/play-signals/README.md +0 -231
- package/api/@xmachines/play-signals/functions/watchSignal.md +0 -65
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +0 -36
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +0 -49
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +0 -37
- package/api/@xmachines/play-signals/interfaces/SignalState.md +0 -68
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +0 -97
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +0 -22
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +0 -52
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +0 -72
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +0 -21
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +0 -85
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +0 -13
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +0 -25
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +0 -9
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +0 -9
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +0 -19
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +0 -19
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +0 -33
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +0 -471
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +0 -31
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +0 -9
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +0 -39
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +0 -13
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +0 -13
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +0 -568
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +0 -50
- package/api/@xmachines/play-xstate/functions/composeGuards.md +0 -86
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +0 -72
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +0 -43
- package/api/@xmachines/play-xstate/functions/definePlayer.md +0 -78
- package/api/@xmachines/play-xstate/functions/eventMatches.md +0 -45
- package/api/@xmachines/play-xstate/functions/hasContext.md +0 -45
- package/api/@xmachines/play-xstate/functions/negateGuard.md +0 -67
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +0 -20
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +0 -19
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +0 -36
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +0 -23
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +0 -26
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +0 -9
- package/guides/signals.md +0 -209
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[API](../../../README.md) / [@xmachines/play-router](../README.md) / index
|
|
2
|
+
|
|
3
|
+
# index
|
|
4
|
+
|
|
5
|
+
## Classes
|
|
6
|
+
|
|
7
|
+
- [RouteMap](classes/RouteMap.md)
|
|
8
|
+
- [RouterBridgeBase](classes/RouterBridgeBase.md)
|
|
9
|
+
|
|
10
|
+
## Interfaces
|
|
11
|
+
|
|
12
|
+
- [BasePathOptions](interfaces/BasePathOptions.md)
|
|
13
|
+
- [BuildPlayRouteEventOptions](interfaces/BuildPlayRouteEventOptions.md)
|
|
14
|
+
- [CompileOptions](interfaces/CompileOptions.md)
|
|
15
|
+
- [FrameworkParamsSource](interfaces/FrameworkParamsSource.md)
|
|
16
|
+
- [LocationLike](interfaces/LocationLike.md)
|
|
17
|
+
- [MountableRouterBridge](interfaces/MountableRouterBridge.md)
|
|
18
|
+
- [OpenProviderBridgeArgs](interfaces/OpenProviderBridgeArgs.md)
|
|
19
|
+
- [ParsedPattern](interfaces/ParsedPattern.md)
|
|
20
|
+
- [ParseOptions](interfaces/ParseOptions.md)
|
|
21
|
+
- [PatternCache](interfaces/PatternCache.md)
|
|
22
|
+
- [PlayRouteEvent](interfaces/PlayRouteEvent.md)
|
|
23
|
+
- [PlayRouterProviderBaseProps](interfaces/PlayRouterProviderBaseProps.md)
|
|
24
|
+
- [ResolvedBasePath](interfaces/ResolvedBasePath.md)
|
|
25
|
+
- [ResolvedRoutePath](interfaces/ResolvedRoutePath.md)
|
|
26
|
+
- [Routable](interfaces/Routable.md)
|
|
27
|
+
- [RoutableActor](interfaces/RoutableActor.md)
|
|
28
|
+
- [RouteInfo](interfaces/RouteInfo.md)
|
|
29
|
+
- [RouteMapOptions](interfaces/RouteMapOptions.md)
|
|
30
|
+
- [RouteMapping](interfaces/RouteMapping.md)
|
|
31
|
+
- [RouteMatch](interfaces/RouteMatch.md)
|
|
32
|
+
- [RouteNode](interfaces/RouteNode.md)
|
|
33
|
+
- [RouteObject](interfaces/RouteObject.md)
|
|
34
|
+
- [RouterBridge](interfaces/RouterBridge.md)
|
|
35
|
+
- [RouterBridgeOptions](interfaces/RouterBridgeOptions.md)
|
|
36
|
+
- [RouterConnection](interfaces/RouterConnection.md)
|
|
37
|
+
- [RouteTree](interfaces/RouteTree.md)
|
|
38
|
+
- [RouteWatcherHandle](interfaces/RouteWatcherHandle.md)
|
|
39
|
+
- [SplitLocation](interfaces/SplitLocation.md)
|
|
40
|
+
- [WindowLike](interfaces/WindowLike.md)
|
|
41
|
+
|
|
42
|
+
## Type Aliases
|
|
43
|
+
|
|
44
|
+
- [PlayRouterBridgeConstructor](type-aliases/PlayRouterBridgeConstructor.md)
|
|
45
|
+
- [RouteData](type-aliases/RouteData.md)
|
|
46
|
+
- [RouteDataResolver](type-aliases/RouteDataResolver.md)
|
|
47
|
+
- [RouteMetadata](type-aliases/RouteMetadata.md)
|
|
48
|
+
- [URLPatternLike](type-aliases/URLPatternLike.md)
|
|
49
|
+
|
|
50
|
+
## Variables
|
|
51
|
+
|
|
52
|
+
- [DISPOSE](variables/DISPOSE.md)
|
|
53
|
+
- [NO\_BASE\_PATH](variables/NO_BASE_PATH.md)
|
|
54
|
+
- [ROOT\_NODE\_ID](variables/ROOT_NODE_ID.md)
|
|
55
|
+
|
|
56
|
+
## Functions
|
|
57
|
+
|
|
58
|
+
- [buildPlayRouteEvent](functions/buildPlayRouteEvent.md)
|
|
59
|
+
- [buildRouteTree](functions/buildRouteTree.md)
|
|
60
|
+
- [cleanFrameworkParams](functions/cleanFrameworkParams.md)
|
|
61
|
+
- [createPatternCache](functions/createPatternCache.md)
|
|
62
|
+
- [createRouteMapFromTree](functions/createRouteMapFromTree.md)
|
|
63
|
+
- [createRouterConnection](functions/createRouterConnection.md)
|
|
64
|
+
- [detectDuplicateRoutes](functions/detectDuplicateRoutes.md)
|
|
65
|
+
- [extractQuery](functions/extractQuery.md)
|
|
66
|
+
- [extractRouteParams](functions/extractRouteParams.md)
|
|
67
|
+
- [findRouteById](functions/findRouteById.md)
|
|
68
|
+
- [findRouteByPath](functions/findRouteByPath.md)
|
|
69
|
+
- [isMountableBridge](functions/isMountableBridge.md)
|
|
70
|
+
- [joinBasePath](functions/joinBasePath.md)
|
|
71
|
+
- [mountKey](functions/mountKey.md)
|
|
72
|
+
- [normalizeBasePath](functions/normalizeBasePath.md)
|
|
73
|
+
- [openProviderBridge](functions/openProviderBridge.md)
|
|
74
|
+
- [parsePattern](functions/parsePattern.md)
|
|
75
|
+
- [pickOwnParams](functions/pickOwnParams.md)
|
|
76
|
+
- [repointProviderBridge](functions/repointProviderBridge.md)
|
|
77
|
+
- [resolveBasePath](functions/resolveBasePath.md)
|
|
78
|
+
- [resolveFrameworkParams](functions/resolveFrameworkParams.md)
|
|
79
|
+
- [sanitizePathname](functions/sanitizePathname.md)
|
|
80
|
+
- [splitLocation](functions/splitLocation.md)
|
|
81
|
+
- [stripBasePath](functions/stripBasePath.md)
|
|
82
|
+
- [validateRouteFormat](functions/validateRouteFormat.md)
|
|
83
|
+
- [validateStateExists](functions/validateStateExists.md)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / RouteMap
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
5
|
+
Defined in: [packages/play-router/src/base-route-map.ts:177](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/base-route-map.ts#L177)
|
|
6
6
|
|
|
7
7
|
The shared base class of the route map for both directions.
|
|
8
8
|
|
|
@@ -14,15 +14,22 @@ of its own, and it inherits the complete public API from here.
|
|
|
14
14
|
- A static path, without a `:param` → a `Map` lookup in O(1)
|
|
15
15
|
- A dynamic path → a scan of the bucket index in O(k), with `URLPattern`, where
|
|
16
16
|
`k` is the number of the routes with the same first path segment
|
|
17
|
-
- The class keeps each result of a first match in an LRU cache. The default
|
|
18
|
-
|
|
17
|
+
- The class keeps each result of a first match in an LRU cache. The default cache
|
|
18
|
+
holds between 500 and 1000 entries, and the `pathCache` constructor option
|
|
19
|
+
replaces it
|
|
19
20
|
|
|
20
|
-
**The syntax of a pattern
|
|
21
|
+
**The syntax of a pattern:** the whole URLPattern pathname grammar. The forms used most
|
|
22
|
+
often are:
|
|
21
23
|
|
|
22
24
|
- `:param` — a necessary segment. It matches exactly one segment without a `/`
|
|
23
25
|
- `:param?` — an optional segment. It matches zero segments or one segment without a `/`
|
|
24
26
|
- `*` — a wildcard. It matches each number of segments, as URLPattern defines
|
|
25
27
|
|
|
28
|
+
A `{…}` group, a `:param(\d+)` constraint, a `+` modifier and a `\:` escape are read
|
|
29
|
+
too. The [routing guide](../../../../../guides/routing.md) states every form, the prefix
|
|
30
|
+
rule, and the one divergence from the standard: a param name of this library can hold a
|
|
31
|
+
hyphen.
|
|
32
|
+
|
|
26
33
|
**The forms of a stateId:** you can register a stateId, and you can look one up,
|
|
27
34
|
in the form `"#stateId"` or in the form `"stateId"`. `RouteMap` makes the
|
|
28
35
|
canonical form itself. `getStateIdByPath` returns the stateId exactly as you
|
|
@@ -58,7 +65,7 @@ map.getPathByStateId("missing"); // null
|
|
|
58
65
|
new RouteMap(mappings, options?): RouteMap;
|
|
59
66
|
```
|
|
60
67
|
|
|
61
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
68
|
+
Defined in: [packages/play-router/src/base-route-map.ts:210](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/base-route-map.ts#L210)
|
|
62
69
|
|
|
63
70
|
Builds a route map from an array of the mappings between a state ID and a path.
|
|
64
71
|
|
|
@@ -69,11 +76,10 @@ candidates is therefore efficient.
|
|
|
69
76
|
|
|
70
77
|
#### Parameters
|
|
71
78
|
|
|
72
|
-
| Parameter
|
|
73
|
-
|
|
|
74
|
-
| `mappings`
|
|
75
|
-
| `options`
|
|
76
|
-
| `options.cacheSize?` | `number` | - |
|
|
79
|
+
| Parameter | Type | Description |
|
|
80
|
+
| ---------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `mappings` | [`RouteMapping`](../interfaces/RouteMapping.md)[] | The array of the `{ stateId, path }` entries. The order gives the priority when more than one pattern can match the same path. |
|
|
82
|
+
| `options` | [`RouteMapOptions`](../interfaces/RouteMapOptions.md) | See [RouteMapOptions](../interfaces/RouteMapOptions.md). A map holds TWO caches, so no option is named `cache`: each one names the cache that it carries. |
|
|
77
83
|
|
|
78
84
|
#### Returns
|
|
79
85
|
|
|
@@ -87,7 +93,7 @@ candidates is therefore efficient.
|
|
|
87
93
|
getPathByStateId(stateId): string | null;
|
|
88
94
|
```
|
|
89
95
|
|
|
90
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
96
|
+
Defined in: [packages/play-router/src/base-route-map.ts:324](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/base-route-map.ts#L324)
|
|
91
97
|
|
|
92
98
|
Returns the path pattern of a state ID.
|
|
93
99
|
|
|
@@ -123,7 +129,7 @@ map.getPathByStateId("missing"); // null
|
|
|
123
129
|
getStateIdByPath(path): string | null;
|
|
124
130
|
```
|
|
125
131
|
|
|
126
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
132
|
+
Defined in: [packages/play-router/src/base-route-map.ts:279](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/base-route-map.ts#L279)
|
|
127
133
|
|
|
128
134
|
Resolves a URL path to its state ID.
|
|
129
135
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / RouterBridgeBase
|
|
2
2
|
|
|
3
3
|
# Abstract Class: RouterBridgeBase
|
|
4
4
|
|
|
5
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
5
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:124](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L124)
|
|
6
6
|
|
|
7
7
|
A `RouterBridge` whose machine is mounted at a URL prefix that can MOVE while the
|
|
8
8
|
bridge stays connected.
|
|
@@ -27,14 +27,15 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
27
27
|
|
|
28
28
|
## Extended by
|
|
29
29
|
|
|
30
|
-
- [`DomRouterBridge`](
|
|
31
|
-
- [`ReactRouterBridge`](
|
|
32
|
-
- [`TanStackRouterBridgeBase`](
|
|
33
|
-
- [`SolidRouterBridge`](
|
|
34
|
-
- [`SvelteKitRouterBridge`](
|
|
35
|
-
- [`SvelteSpaRouterBridge`](
|
|
36
|
-
- [`TanStackReactRouterBridge`](
|
|
37
|
-
- [`
|
|
30
|
+
- [`DomRouterBridge`](../../../play-dom-router/classes/DomRouterBridge.md)
|
|
31
|
+
- [`ReactRouterBridge`](../../../play-react-router/classes/ReactRouterBridge.md)
|
|
32
|
+
- [`TanStackRouterBridgeBase`](../../../play-tanstack-router/classes/TanStackRouterBridgeBase.md)
|
|
33
|
+
- [`SolidRouterBridge`](../../../play-solid-router/classes/SolidRouterBridge.md)
|
|
34
|
+
- [`SvelteKitRouterBridge`](../../../play-sveltekit-router/classes/SvelteKitRouterBridge.md)
|
|
35
|
+
- [`SvelteSpaRouterBridge`](../../../play-svelte-spa-router/classes/SvelteSpaRouterBridge.md)
|
|
36
|
+
- [`TanStackReactRouterBridge`](../../../play-tanstack-react-router/classes/TanStackReactRouterBridge.md)
|
|
37
|
+
- [`TanStackSolidRouterBridge`](../../../play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md)
|
|
38
|
+
- [`VueRouterBridge`](../../../play-vue-router/index/classes/VueRouterBridge.md)
|
|
38
39
|
|
|
39
40
|
## Implements
|
|
40
41
|
|
|
@@ -48,10 +49,11 @@ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
|
|
|
48
49
|
new RouterBridgeBase(
|
|
49
50
|
actor,
|
|
50
51
|
routeMap,
|
|
51
|
-
options?
|
|
52
|
+
options?
|
|
53
|
+
): RouterBridgeBase;
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
56
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:249](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L249)
|
|
55
57
|
|
|
56
58
|
#### Parameters
|
|
57
59
|
|
|
@@ -61,7 +63,7 @@ Defined in: [play-router/src/router-bridge-base.ts:230](https://gitlab.com/xmach
|
|
|
61
63
|
| `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
64
|
| `routeMap.getPathByStateId` | - |
|
|
63
65
|
| `routeMap.getStateIdByPath?` | - |
|
|
64
|
-
| `options?` | [`
|
|
66
|
+
| `options?` | [`RouterBridgeOptions`](../interfaces/RouterBridgeOptions.md) | - |
|
|
65
67
|
|
|
66
68
|
#### Returns
|
|
67
69
|
|
|
@@ -77,7 +79,7 @@ Defined in: [play-router/src/router-bridge-base.ts:230](https://gitlab.com/xmach
|
|
|
77
79
|
get basePath(): string;
|
|
78
80
|
```
|
|
79
81
|
|
|
80
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
82
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:282](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L282)
|
|
81
83
|
|
|
82
84
|
The resolved URL prefix that the machine of this bridge is mounted under, or `""`
|
|
83
85
|
when the machine owns the complete router.
|
|
@@ -102,7 +104,7 @@ The resolved URL prefix of the mount, or `""` when the machine owns the complete
|
|
|
102
104
|
get basePathParams(): Readonly<Record<string, string>>;
|
|
103
105
|
```
|
|
104
106
|
|
|
105
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
107
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:311](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L311)
|
|
106
108
|
|
|
107
109
|
The resolved values of the `:param` segments of the mount, or `{}` for a prefix
|
|
108
110
|
without a param.
|
|
@@ -153,11 +155,11 @@ mount while the machine stays on the same route, and no event goes out.
|
|
|
153
155
|
connect(): void;
|
|
154
156
|
```
|
|
155
157
|
|
|
156
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
158
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:533](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L533)
|
|
157
159
|
|
|
158
160
|
Connects the router bridge to the Actor.
|
|
159
161
|
|
|
160
|
-
The method installs the
|
|
162
|
+
The method installs the atom watcher of the direction from the actor to the
|
|
161
163
|
router. It then starts the watch of the router changes, which each framework does
|
|
162
164
|
in its own way.
|
|
163
165
|
|
|
@@ -187,11 +189,11 @@ An adapter that needs a different behavior of the first synchronization override
|
|
|
187
189
|
disconnect(): void;
|
|
188
190
|
```
|
|
189
191
|
|
|
190
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
192
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:791](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L791)
|
|
191
193
|
|
|
192
194
|
Disconnects the router bridge from the Actor.
|
|
193
195
|
|
|
194
|
-
The method stops the watch of the
|
|
196
|
+
The method stops the watch of the atom, and it removes the router listener of the
|
|
195
197
|
framework.
|
|
196
198
|
|
|
197
199
|
#### Returns
|
|
@@ -210,7 +212,7 @@ framework.
|
|
|
210
212
|
setBasePath(basePath?, basePathParams?): void;
|
|
211
213
|
```
|
|
212
214
|
|
|
213
|
-
Defined in: [play-router/src/router-bridge-base.ts:
|
|
215
|
+
Defined in: [packages/play-router/src/router-bridge-base.ts:351](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-bridge-base.ts#L351)
|
|
214
216
|
|
|
215
217
|
Moves the machine to a different mount point, while it stays connected.
|
|
216
218
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / buildPlayRouteEvent
|
|
2
2
|
|
|
3
3
|
# Function: buildPlayRouteEvent()
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ function buildPlayRouteEvent(options): {
|
|
|
9
9
|
} | null;
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Defined in: [play-router/src/router-sync.ts:
|
|
12
|
+
Defined in: [packages/play-router/src/router-sync.ts:161](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-sync.ts#L161)
|
|
13
13
|
|
|
14
14
|
Builds a normalized `play.route` event from the raw input of a router or of a
|
|
15
15
|
browser.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / buildRouteTree
|
|
2
2
|
|
|
3
3
|
# Function: buildRouteTree()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function buildRouteTree(routes): RouteTree
|
|
6
|
+
function buildRouteTree<TGraph>(routes): RouteTree<TGraph>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/build-tree.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/build-tree.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/build-tree.ts#L38)
|
|
10
10
|
|
|
11
11
|
Builds the hierarchical route tree from the flat list of the routes
|
|
12
12
|
|
|
@@ -21,6 +21,16 @@ the same raw string below two different parents are valid, and two different raw
|
|
|
21
21
|
strings that resolve to the same complete path are not: those two overwrite each
|
|
22
22
|
other in `byPath` in silence.
|
|
23
23
|
|
|
24
|
+
`TGraph` names the type of the graph that a CALLER attaches afterwards. The builder
|
|
25
|
+
attaches none: it reads a list of routes and writes the maps of the tree.
|
|
26
|
+
`extractMachineRoutes` of `@xmachines/play-router/xstate` binds it to `MachineGraph`.
|
|
27
|
+
|
|
28
|
+
## Type Parameters
|
|
29
|
+
|
|
30
|
+
| Type Parameter | Default type |
|
|
31
|
+
| -------------- | ------------ |
|
|
32
|
+
| `TGraph` | `unknown` |
|
|
33
|
+
|
|
24
34
|
## Parameters
|
|
25
35
|
|
|
26
36
|
| Parameter | Type | Description |
|
|
@@ -29,7 +39,7 @@ other in `byPath` in silence.
|
|
|
29
39
|
|
|
30
40
|
## Returns
|
|
31
41
|
|
|
32
|
-
[`RouteTree`](../interfaces/RouteTree.md)
|
|
42
|
+
[`RouteTree`](../interfaces/RouteTree.md)\<`TGraph`\>
|
|
33
43
|
|
|
34
44
|
The RouteTree, with its root, its byStateId map, and its byPath map
|
|
35
45
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / cleanFrameworkParams
|
|
2
2
|
|
|
3
3
|
# Function: cleanFrameworkParams()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function cleanFrameworkParams(params): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-
|
|
9
|
+
Defined in: [packages/play-url/src/framework-params.ts:107](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-url/src/framework-params.ts#L107)
|
|
10
10
|
|
|
11
11
|
The params of a framework router, in the shape that [pickOwnParams](pickOwnParams.md) reads.
|
|
12
12
|
|
|
@@ -24,8 +24,7 @@ The result has a null prototype, for the same reason [pickOwnParams](pickOwnPara
|
|
|
24
24
|
plain `{}` accumulator turns `cleaned["__proto__"] = value` into a write of the
|
|
25
25
|
PROTOTYPE setter, which drops a string value in silence. `pickOwnParams` then read
|
|
26
26
|
`Object.hasOwn(params, "__proto__")` as `false`, called the pick incomplete, and fell
|
|
27
|
-
back to the URLPattern extraction
|
|
28
|
-
a route the framework had answered already.
|
|
27
|
+
back to the URLPattern extraction, for a route the framework had answered already.
|
|
29
28
|
|
|
30
29
|
## Parameters
|
|
31
30
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / createPatternCache
|
|
2
|
+
|
|
3
|
+
# Function: createPatternCache()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function createPatternCache<V>(maxSize?): PatternCache<V>;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-pattern/src/cache.ts:85](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-pattern/src/cache.ts#L85)
|
|
10
|
+
|
|
11
|
+
Builds a cache that forgets its least recently used entries.
|
|
12
|
+
|
|
13
|
+
## The algorithm
|
|
14
|
+
|
|
15
|
+
Two maps, and no list. `recent` takes every write. When a write fills `recent`, it
|
|
16
|
+
becomes `old` and a new `recent` opens, which drops the previous `old` whole. A read of
|
|
17
|
+
a key of `old` moves the entry into `recent`, and THAT is what makes the eviction an
|
|
18
|
+
LRU one rather than a FIFO one: an entry that every lookup reads moves forward, and an
|
|
19
|
+
entry that nothing reads falls out with the map that holds it.
|
|
20
|
+
|
|
21
|
+
The cache therefore holds between `maxSize` and `2 * maxSize` entries, and it does no
|
|
22
|
+
bookkeeping for a read that hits `recent`.
|
|
23
|
+
|
|
24
|
+
## Type Parameters
|
|
25
|
+
|
|
26
|
+
| Type Parameter |
|
|
27
|
+
| -------------- |
|
|
28
|
+
| `V` |
|
|
29
|
+
|
|
30
|
+
## Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Type | Default value | Description |
|
|
33
|
+
| --------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `maxSize` | `number` | `500` | The number of entries that `recent` holds. It is `1` at the least, and the default is `500`. A value that is not a finite number reads as the default, so a cache with no eviction at all cannot happen by accident. |
|
|
35
|
+
|
|
36
|
+
## Returns
|
|
37
|
+
|
|
38
|
+
[`PatternCache`](../interfaces/PatternCache.md)\<`V`\>
|
|
39
|
+
|
|
40
|
+
A cache. It is not shared: each call builds one.
|
|
41
|
+
|
|
42
|
+
## Example
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const cache = createPatternCache<ParsedPattern>(50);
|
|
46
|
+
parsePattern("/profile/:userId", { patternCache: cache });
|
|
47
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / createRouteMapFromTree
|
|
2
2
|
|
|
3
3
|
# Function: createRouteMapFromTree()
|
|
4
4
|
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
function createRouteMapFromTree(routeTree, options?): RouteMap;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/create-route-map-from-tree.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/create-route-map-from-tree.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/create-route-map-from-tree.ts#L40)
|
|
10
10
|
|
|
11
11
|
Creates a `RouteMap` from the node structure of a `RouteTree`.
|
|
12
12
|
|
|
13
|
-
A framework router adapter uses this function when it
|
|
14
|
-
`extractMachineRoutes()`, and not when it calls
|
|
13
|
+
A framework router adapter uses this function when it holds a `RouteTree`, for example
|
|
14
|
+
from `extractMachineRoutes()` of `@xmachines/play-router/xstate`, and not when it calls
|
|
15
|
+
`createRouteMap()` of that package directly.
|
|
15
16
|
|
|
16
17
|
The function walks every node, and it collects the pairs
|
|
17
18
|
`{ stateId: node.id, path: node.fullPath }`. `node.fullPath` is always the
|
|
@@ -19,12 +20,17 @@ absolute resolved path, for example `"/dashboard/overview"`, and `RouteMap` need
|
|
|
19
20
|
that path for the match of a browser URL. `createRouteMap(machine)` behaves in the
|
|
20
21
|
same way, because it also uses `node.fullPath`.
|
|
21
22
|
|
|
23
|
+
The walk SKIPS the synthetic root node. `buildRouteTree` makes that node to hold each
|
|
24
|
+
absolute route, and no state of a machine declares it. `createRouteMap` skips it as
|
|
25
|
+
well, through `getRoutableRoutes`, and the two functions therefore answer the same map
|
|
26
|
+
for the same tree.
|
|
27
|
+
|
|
22
28
|
## Parameters
|
|
23
29
|
|
|
24
|
-
| Parameter | Type | Description
|
|
25
|
-
| ----------- | ----------------------------------------------------- |
|
|
26
|
-
| `routeTree` | [`RouteTree`](../interfaces/RouteTree.md) | A `RouteTree`, as `extractMachineRoutes()` returns it.
|
|
27
|
-
| `options?` | [`RouteMapOptions`](../interfaces/RouteMapOptions.md) | The optional configuration, for example `{
|
|
30
|
+
| Parameter | Type | Description |
|
|
31
|
+
| ----------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `routeTree` | [`RouteTree`](../interfaces/RouteTree.md) | A `RouteTree`, as `extractMachineRoutes()` returns it. |
|
|
33
|
+
| `options?` | [`RouteMapOptions`](../interfaces/RouteMapOptions.md) | The optional configuration, for example `{ pathCache }` to replace the LRU cache of the resolved paths. |
|
|
28
34
|
|
|
29
35
|
## Returns
|
|
30
36
|
|
|
@@ -36,11 +42,12 @@ A `RouteMap` for each adapter on `RouterBridgeBase`.
|
|
|
36
42
|
|
|
37
43
|
```typescript
|
|
38
44
|
// The preferred form — one call for an XState machine:
|
|
39
|
-
import { createRouteMap } from "@xmachines/play-router";
|
|
45
|
+
import { createRouteMap } from "@xmachines/play-router/xstate";
|
|
40
46
|
const routeMap = createRouteMap(machine); // it takes an AnyStateMachine
|
|
41
47
|
|
|
42
48
|
// The two-step form, for a framework adapter that works with a route tree:
|
|
43
|
-
import {
|
|
49
|
+
import { createRouteMapFromTree } from "@xmachines/play-router";
|
|
50
|
+
import { extractMachineRoutes } from "@xmachines/play-router/xstate";
|
|
44
51
|
const routeTree = extractMachineRoutes(machine);
|
|
45
52
|
const routeMap = createRouteMapFromTree(routeTree); // it uses node.fullPath, which is absolute
|
|
46
53
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / createRouterConnection
|
|
2
2
|
|
|
3
3
|
# Function: createRouterConnection()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function createRouterConnection(bridge): RouterConnection;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/provider-lifecycle.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/provider-lifecycle.ts:330](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/provider-lifecycle.ts#L330)
|
|
10
10
|
|
|
11
11
|
Wraps a live bridge in the [RouterConnection](../interfaces/RouterConnection.md) that `connectRouter` returns.
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / detectDuplicateRoutes
|
|
2
2
|
|
|
3
3
|
# Function: detectDuplicateRoutes()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function detectDuplicateRoutes(routes): void;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/validate-routes.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [packages/play-router/src/validate-routes.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/validate-routes.ts#L70)
|
|
10
10
|
|
|
11
11
|
Finds each duplicate route path
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / extractQuery
|
|
2
2
|
|
|
3
3
|
# Function: extractQuery()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function extractQuery(search): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/router-sync.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/router-sync.ts:135](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-sync.ts#L135)
|
|
10
10
|
|
|
11
11
|
Parses a URL search string into the plain object that a `play.route` event
|
|
12
12
|
needs.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / extractRouteParams
|
|
2
2
|
|
|
3
3
|
# Function: extractRouteParams()
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
function extractRouteParams(pathname, pattern): Record<string, string>;
|
|
6
|
+
function extractRouteParams(pathname, pattern, options?): Record<string, string>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/router-sync.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/router-sync.ts:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/router-sync.ts#L84)
|
|
10
10
|
|
|
11
11
|
Reads the named path parameters of a URL, with the URLPattern API.
|
|
12
12
|
|
|
@@ -29,10 +29,11 @@ raw.
|
|
|
29
29
|
|
|
30
30
|
## Parameters
|
|
31
31
|
|
|
32
|
-
| Parameter | Type
|
|
33
|
-
| ---------- |
|
|
34
|
-
| `pathname` | `string`
|
|
35
|
-
| `pattern` | `string`
|
|
32
|
+
| Parameter | Type | Description |
|
|
33
|
+
| ---------- | --------------------------------------------------- | ----------------------------------------------------------------- |
|
|
34
|
+
| `pathname` | `string` | The concrete URL pathname, for example `/profile/alice` |
|
|
35
|
+
| `pattern` | `string` | The template of the URL pattern, for example `/profile/:username` |
|
|
36
|
+
| `options?` | [`CompileOptions`](../interfaces/CompileOptions.md) | - |
|
|
36
37
|
|
|
37
38
|
## Returns
|
|
38
39
|
|
|
@@ -42,7 +43,7 @@ The record of the parameter values of the read, or `{}` for a static pattern.
|
|
|
42
43
|
|
|
43
44
|
## Throws
|
|
44
45
|
|
|
45
|
-
When
|
|
46
|
+
When URLPattern cannot compile the pattern.
|
|
46
47
|
|
|
47
48
|
## Example
|
|
48
49
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / findRouteById
|
|
2
2
|
|
|
3
3
|
# Function: findRouteById()
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function findRouteById(tree, id): RouteNode | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [play-router/src/find-route.ts:
|
|
9
|
+
Defined in: [packages/play-router/src/find-route.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/find-route.ts#L58)
|
|
10
10
|
|
|
11
11
|
Finds a route node by its state ID
|
|
12
12
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-router](../../README.md) / [index](../README.md) / findRouteByPath
|
|
2
|
+
|
|
3
|
+
# Function: findRouteByPath()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function findRouteByPath(tree, path, options?): RouteNode | undefined;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-router/src/find-route.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v5.0.0/packages/play-router/src/find-route.ts#L96)
|
|
10
|
+
|
|
11
|
+
Finds a route node by its URL path
|
|
12
|
+
|
|
13
|
+
The function looks the route node up by the URL path. It gives you the state ID of
|
|
14
|
+
a browser URL, for the `play.route` event of a navigation.
|
|
15
|
+
|
|
16
|
+
When more than one state holds the same path, for example the root and a second
|
|
17
|
+
state both at "/", the function prefers a node with a route, which means a node
|
|
18
|
+
with a `meta.route` field, over a node without one.
|
|
19
|
+
|
|
20
|
+
The function also matches a pattern of a dynamic route, for example
|
|
21
|
+
'/settings/:section?'.
|
|
22
|
+
|
|
23
|
+
## Parameters
|
|
24
|
+
|
|
25
|
+
| Parameter | Type | Description |
|
|
26
|
+
| ---------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
27
|
+
| `tree` | [`RouteTree`](../interfaces/RouteTree.md) | The route tree, from extractMachineRoutes |
|
|
28
|
+
| `path` | `string` | The URL path, for example '/dashboard' or '/settings/profile' |
|
|
29
|
+
| `options?` | [`CompileOptions`](../interfaces/CompileOptions.md) | The caches that the pattern match reads. The default is the pair that `@xmachines/play-url` shares with every caller of the process. A server that serves many tenants passes a cache that the tenant owns, exactly as `RouteMap` and a bridge take one. A cache changes how often the work runs, and it changes no answer, so this argument is safe to leave out. |
|
|
30
|
+
|
|
31
|
+
## Returns
|
|
32
|
+
|
|
33
|
+
[`RouteNode`](../interfaces/RouteNode.md) \| `undefined`
|
|
34
|
+
|
|
35
|
+
The route node, or undefined when the function finds none
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const tree = extractMachineRoutes(machine);
|
|
41
|
+
const node = findRouteByPath(tree, "/dashboard");
|
|
42
|
+
|
|
43
|
+
// With a cache that one request owns and drops
|
|
44
|
+
const node = findRouteByPath(tree, "/dashboard", {
|
|
45
|
+
patternCache: createPatternCache(),
|
|
46
|
+
compiledCache: createPatternCache(),
|
|
47
|
+
});
|
|
48
|
+
```
|