@xmachines/docs 1.0.0-beta.24 → 1.0.0-beta.26
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/api/@xmachines/play/classes/PlayError.md +10 -4
- package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
- package/api/@xmachines/play-actor/README.md +4 -0
- package/api/@xmachines/play-actor/classes/AbstractActor.md +49 -92
- package/api/@xmachines/play-actor/functions/typedSpec.md +57 -0
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +9 -18
- package/api/@xmachines/play-actor/interfaces/Routable.md +5 -21
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +6 -6
- package/api/@xmachines/play-actor/interfaces/Viewable.md +5 -6
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
- package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
- package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
- package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +7 -7
- package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +7 -7
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +3 -3
- package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
- package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
- package/api/@xmachines/play-dom-router/README.md +10 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +18 -46
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +114 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapLike.md +50 -0
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +6 -6
- package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-react/README.md +4 -4
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +31 -5
- package/api/@xmachines/play-react/functions/defineRegistry.md +2 -0
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/useBoundProp.md +2 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/functions/useStateBinding.md +2 -0
- package/api/@xmachines/play-react/interfaces/ComponentContext.md +2 -0
- 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/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-react/type-aliases/ComponentFn.md +2 -0
- package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react-router/README.md +5 -1
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +102 -25
- package/api/@xmachines/play-react-router/classes/RouteMap.md +17 -33
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +8 -1
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +21 -11
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +7 -7
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +18 -8
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/README.md +42 -5
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +12 -17
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +100 -25
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
- package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-router/functions/createRouteMapFromMachine.md +38 -0
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +45 -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 +46 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
- package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
- package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +1 -1
- package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
- package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +27 -0
- 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/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
- package/api/@xmachines/play-router/interfaces/RouteMap.md +4 -4
- package/api/@xmachines/play-router/interfaces/{BaseRouteMapping.md → RouteMapping.md} +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteNode.md +12 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +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/namespaces/Signal/classes/Computed.md +6 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +8 -0
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +10 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +2 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +2 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +4 -4
- package/api/@xmachines/play-solid/functions/defineRegistry.md +2 -0
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/useStateBinding.md +2 -0
- package/api/@xmachines/play-solid/interfaces/ComponentContext.md +2 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +7 -7
- package/api/@xmachines/play-solid/type-aliases/ComponentFn.md +2 -0
- package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid-router/README.md +2 -2
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +13 -26
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +121 -46
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +15 -9
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +47 -92
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +19 -6
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +21 -18
- package/api/@xmachines/play-svelte/README.md +119 -0
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +54 -0
- package/api/@xmachines/play-svelte/interfaces/BaseComponentProps.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/ComponentContext.md +29 -0
- package/api/@xmachines/play-svelte/interfaces/PlayRendererProps.md +22 -0
- package/api/@xmachines/play-svelte/type-aliases/ComponentFn.md +18 -0
- package/api/@xmachines/play-svelte/type-aliases/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-svelte/variables/getBoundProp.md +7 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +54 -0
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +17 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +65 -0
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-svelte-spa-router-demo/README.md +23 -0
- package/api/@xmachines/play-sveltekit-router/README.md +54 -0
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +32 -0
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +38 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +27 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-sveltekit-router-demo/README.md +23 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +5 -3
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +17 -33
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +93 -25
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +21 -11
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +18 -8
- 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/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +6 -26
- package/api/@xmachines/play-tanstack-solid-router/README.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +13 -26
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +101 -36
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +15 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +13 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- 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 +23 -24
- package/api/@xmachines/play-vue/README.md +4 -4
- 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/useStateBinding.md +2 -0
- package/api/@xmachines/play-vue/interfaces/ComponentContext.md +2 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +5 -5
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentFn.md +2 -0
- 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/type-aliases/PlayActor.md +1 -1
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue-router/README.md +2 -2
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +18 -108
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +44 -104
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +127 -62
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +8 -8
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +19 -7
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
- package/api/@xmachines/play-xstate/README.md +15 -15
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +46 -30
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +20 -15
- 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 +2 -2
- 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 +6 -6
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +14 -12
- 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/RouteStateNode.md +4 -4
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +2 -2
- package/api/@xmachines/shared/functions/xmAliases.md +1 -1
- package/api/README.md +9 -4
- package/api/llms.txt +6 -3
- package/examples/README.md +5 -0
- package/examples/multi-router-integration.md +34 -6
- package/examples/routing-patterns.md +6 -4
- package/package.json +2 -2
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +0 -38
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +0 -33
|
@@ -106,8 +106,8 @@ export const machine = setup({
|
|
|
106
106
|
context: {} as {
|
|
107
107
|
isAuthenticated: boolean;
|
|
108
108
|
username: string | null;
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
params: Record<string, string>;
|
|
110
|
+
query: Record<string, string>;
|
|
111
111
|
},
|
|
112
112
|
events: {} as
|
|
113
113
|
| { type: "auth.login"; username: string }
|
|
@@ -118,7 +118,7 @@ export const machine = setup({
|
|
|
118
118
|
formatPlayRouteTransitions({
|
|
119
119
|
id: "app",
|
|
120
120
|
initial: "login",
|
|
121
|
-
context: { isAuthenticated: false, username: null,
|
|
121
|
+
context: { isAuthenticated: false, username: null, params: {}, query: {} },
|
|
122
122
|
states: {
|
|
123
123
|
login: {
|
|
124
124
|
id: "login",
|
|
@@ -272,7 +272,7 @@ When using `formatPlayRouteTransitions`, URL path parameters flow automatically
|
|
|
272
272
|
|
|
273
273
|
```ts
|
|
274
274
|
// spec: { section: undefined, user: "alice" }
|
|
275
|
-
// After play.route to /settings/profile → context.
|
|
275
|
+
// After play.route to /settings/profile → context.params = { section: "profile" }
|
|
276
276
|
// Component receives: { section: "profile", user: "alice" }
|
|
277
277
|
```
|
|
278
278
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineRegistry<C>(catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:114](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:114](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/define-registry.ts#L114)
|
|
10
10
|
|
|
11
11
|
Create a component registry, automatically wrapping `.vue` SFCs so they work
|
|
12
12
|
correctly with `@json-render/vue`'s rendering pipeline.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function useActor(): PlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/useActor.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/useActor.ts:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/useActor.ts#L42)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
function useStateBinding<T>(path): [ComputedRef<T | undefined>, (value) => void];
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
Defined in: `@json-render/vue`
|
|
10
|
+
|
|
9
11
|
Composable to get and set a value from the state model by path.
|
|
10
12
|
|
|
11
13
|
This is the path-based variant for use in arbitrary composables. For
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: PlayRendererProps\<TLogic\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-vue/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
5
|
+
Defined in: [packages/play-vue/src/types.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/types.ts#L25)
|
|
6
6
|
|
|
7
7
|
Props for PlayRenderer component
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ Props for PlayRenderer component
|
|
|
16
16
|
|
|
17
17
|
| Property | Type | Description | Defined in |
|
|
18
18
|
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
-
| <a id="property-actions"></a> `actions?` | `object` | Optional map of json-render action names to XState event type strings. Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent event type string is a compile error when TLogic is specified. | [packages/play-vue/src/types.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
20
|
-
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`TLogic`, [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability) | [packages/play-vue/src/types.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
21
|
-
| <a id="property-registry"></a> `registry` | `ComponentRegistry` | Component registry from @json-render/vue defineRegistry | [packages/play-vue/src/types.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
22
|
-
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored and this store is the single source of truth for UI state (form values, etc.). When omitted, a fresh @xstate/store atom is created internally per view transition, seeded from spec.state. | [packages/play-vue/src/types.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
19
|
+
| <a id="property-actions"></a> `actions?` | `object` | Optional map of json-render action names to XState event type strings. Values are constrained to `EventFromLogic<TLogic>["type"]` — passing a non-existent event type string is a compile error when TLogic is specified. | [packages/play-vue/src/types.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/types.ts#L46) |
|
|
20
|
+
| <a id="property-actor"></a> `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<`TLogic`, [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | Actor instance with currentView signal (requires Viewable capability) | [packages/play-vue/src/types.ts:27](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/types.ts#L27) |
|
|
21
|
+
| <a id="property-registry"></a> `registry` | `ComponentRegistry` | Component registry from @json-render/vue defineRegistry | [packages/play-vue/src/types.ts:30](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/types.ts#L30) |
|
|
22
|
+
| <a id="property-store"></a> `store?` | `StateStore` | Optional external StateStore (e.g. from `xstateStoreStateStore` in @json-render/xstate). When provided, PlayRenderer operates in controlled mode — spec.state is ignored and this store is the single source of truth for UI state (form values, etc.). When omitted, a fresh @xstate/store atom is created internally per view transition, seeded from spec.state. | [packages/play-vue/src/types.ts:39](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/types.ts#L39) |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComponentEntry<C, K> = ComponentFn<C, K> | Component;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/define-registry.ts#L89)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
type ComponentsMap<C> = { [K in keyof InferCatalogComponents<C>]?: ComponentEntry<C, K> };
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:93](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/define-registry.ts#L93)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
type DefineRegistryOptions<C> = Parameters<typeof defineRegistryBase>[1] & object;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:97](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:97](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/define-registry.ts#L97)
|
|
10
10
|
|
|
11
11
|
## Type Declaration
|
|
12
12
|
|
|
13
13
|
| Name | Type | Defined in |
|
|
14
14
|
| ------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
-
| `components?` | [`ComponentsMap`](ComponentsMap.md)\<`C`\> | [packages/play-vue/src/define-registry.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
15
|
+
| `components?` | [`ComponentsMap`](ComponentsMap.md)\<`C`\> | [packages/play-vue/src/define-registry.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/define-registry.ts#L100) |
|
|
16
16
|
|
|
17
17
|
## Type Parameters
|
|
18
18
|
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
type PlayActor = AbstractActor<AnyActorLogic>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/useActor.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/useActor.ts:25](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/useActor.ts#L25)
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
const PlayRenderer: DefineComponent<{}, {}, unknown>;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/vue-shim.d.ts:3](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.
|
|
9
|
+
Defined in: [packages/play-vue/src/vue-shim.d.ts:3](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue/src/vue-shim.d.ts#L3)
|
|
@@ -125,7 +125,7 @@ class VueRouterBridge {
|
|
|
125
125
|
|
|
126
126
|
**Methods:**
|
|
127
127
|
|
|
128
|
-
- `connect()` - Start bidirectional synchronization.
|
|
128
|
+
- `connect()` - Start bidirectional synchronization. Both pathname and query string from `router.currentRoute.value.fullPath` are forwarded to the actor on first connect, so users landing on `/profile?tab=posts` have `query: { tab: "posts" }` in the initial `play.route` event.
|
|
129
129
|
- `disconnect()` - Stop synchronization and unhook listeners.
|
|
130
130
|
- `dispose()` - Alias of `disconnect()` for ergonomic teardown.
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ class VueRouterBridge {
|
|
|
133
133
|
|
|
134
134
|
- Watches `actor.currentRoute` signal via `Signal.subtle.Watcher`
|
|
135
135
|
- Updates Vue Router via `router.push({ name, params })` when actor state changes
|
|
136
|
-
- Listens to router navigation via `router.afterEach()` hook
|
|
136
|
+
- Listens to router navigation via `router.afterEach()` hook using Vue's native `to.params` / `to.query` for accurate extraction (no URLPattern re-parsing)
|
|
137
137
|
- Applies `sanitizePathname()` to all incoming router paths before route-map lookup (defense-in-depth: rejects malformed/oversized paths)
|
|
138
138
|
- Sends `play.route` events to actor when user navigates
|
|
139
139
|
- Prevents circular updates with multi-layer guards
|
|
@@ -2,31 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: RouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-vue-router/src/route-map.ts:
|
|
5
|
+
Defined in: [play-vue-router/src/route-map.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-vue-router/src/route-map.ts#L10)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Bidirectional route mapper for Vue Router.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
cache) and adds the Vue-specific adapter layer: `routeName` ↔ `stateId` bidirectional
|
|
11
|
-
lookup and optional URL pattern access.
|
|
12
|
-
|
|
13
|
-
**Why a separate base class?** Vue Router uses named routes (`routeName`) rather than
|
|
14
|
-
URL paths for navigation. `BaseRouteMap` operates on path strings; `VueBaseRouteMap`
|
|
15
|
-
bridges the two by translating `RouteMapping` entries at construction time — only
|
|
16
|
-
mappings with a `pattern` field participate in URL path resolution via `BaseRouteMap`.
|
|
17
|
-
|
|
18
|
-
Exported from `@xmachines/play-vue-router` for consumers who need to extend or test
|
|
19
|
-
the Vue routing layer directly. Most consumers use `RouteMap` instead.
|
|
20
|
-
|
|
21
|
-
## Example
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import { VueBaseRouteMap } from "@xmachines/play-vue-router";
|
|
25
|
-
|
|
26
|
-
class MyVueRouteMap extends VueBaseRouteMap {
|
|
27
|
-
// add custom resolution logic
|
|
28
|
-
}
|
|
29
|
-
```
|
|
9
|
+
Alias for [BaseRouteMap](VueBaseRouteMap.md) from `@xmachines/play-router`.
|
|
30
10
|
|
|
31
11
|
## Extends
|
|
32
12
|
|
|
@@ -37,16 +17,24 @@ class MyVueRouteMap extends VueBaseRouteMap {
|
|
|
37
17
|
### Constructor
|
|
38
18
|
|
|
39
19
|
```ts
|
|
40
|
-
new RouteMap(mappings): RouteMap;
|
|
20
|
+
new RouteMap(mappings, options?): RouteMap;
|
|
41
21
|
```
|
|
42
22
|
|
|
43
|
-
Defined in: [play-
|
|
23
|
+
Defined in: [play-router/src/base-route-map.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L125)
|
|
24
|
+
|
|
25
|
+
Build a route map from an array of state ID ↔ path mappings.
|
|
26
|
+
|
|
27
|
+
Static paths (no `:param`) are indexed in an O(1) `Map`.
|
|
28
|
+
Parameterized paths are compiled to `URLPattern` and grouped into first-segment
|
|
29
|
+
buckets for efficient candidate selection.
|
|
44
30
|
|
|
45
31
|
#### Parameters
|
|
46
32
|
|
|
47
|
-
| Parameter
|
|
48
|
-
|
|
|
49
|
-
| `mappings`
|
|
33
|
+
| Parameter | Type | Description |
|
|
34
|
+
| -------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
35
|
+
| `mappings` | [`RouteMapping`](../interfaces/RouteMapping.md)[] | Array of `{ stateId, path }` entries. Order determines priority when multiple patterns could match the same path. |
|
|
36
|
+
| `options` | \{ `cacheSize?`: `number`; \} | Optional configuration. `options.cacheSize`: Maximum number of resolved parameterized path lookups to cache. Defaults to `500`. Increase for applications with many unique parameterized URL values (e.g. user profile pages with thousands of distinct IDs). After eviction the path falls back to the O(k) bucket pattern scan — correct but slower. Minimum effective value is `1` (QuickLRU constraint). |
|
|
37
|
+
| `options.cacheSize?` | `number` | - |
|
|
50
38
|
|
|
51
39
|
#### Returns
|
|
52
40
|
|
|
@@ -64,7 +52,7 @@ Defined in: [play-vue-router/src/vue-base-route-map.ts:32](https://gitlab.com/xm
|
|
|
64
52
|
getPathByStateId(stateId): string | null;
|
|
65
53
|
```
|
|
66
54
|
|
|
67
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
55
|
+
Defined in: [play-router/src/base-route-map.ts:209](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L209)
|
|
68
56
|
|
|
69
57
|
Look up the path pattern registered for a state ID.
|
|
70
58
|
|
|
@@ -93,91 +81,13 @@ map.getPathByStateId("missing"); // null
|
|
|
93
81
|
|
|
94
82
|
---
|
|
95
83
|
|
|
96
|
-
### getPattern()
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
getPattern(stateId): string | undefined;
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L58)
|
|
103
|
-
|
|
104
|
-
Get the URL path pattern for a given state ID (e.g. `"/profile/:userId"`).
|
|
105
|
-
|
|
106
|
-
#### Parameters
|
|
107
|
-
|
|
108
|
-
| Parameter | Type |
|
|
109
|
-
| --------- | -------- |
|
|
110
|
-
| `stateId` | `string` |
|
|
111
|
-
|
|
112
|
-
#### Returns
|
|
113
|
-
|
|
114
|
-
`string` \| `undefined`
|
|
115
|
-
|
|
116
|
-
#### Inherited from
|
|
117
|
-
|
|
118
|
-
[`VueBaseRouteMap`](VueBaseRouteMap.md).[`getPattern`](VueBaseRouteMap.md#getpattern)
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### getRouteName()
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
getRouteName(stateId): string | undefined;
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L48)
|
|
129
|
-
|
|
130
|
-
Get the Vue Router route name for a given state ID.
|
|
131
|
-
|
|
132
|
-
#### Parameters
|
|
133
|
-
|
|
134
|
-
| Parameter | Type |
|
|
135
|
-
| --------- | -------- |
|
|
136
|
-
| `stateId` | `string` |
|
|
137
|
-
|
|
138
|
-
#### Returns
|
|
139
|
-
|
|
140
|
-
`string` \| `undefined`
|
|
141
|
-
|
|
142
|
-
#### Inherited from
|
|
143
|
-
|
|
144
|
-
[`VueBaseRouteMap`](VueBaseRouteMap.md).[`getRouteName`](VueBaseRouteMap.md#getroutename)
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
### getStateId()
|
|
149
|
-
|
|
150
|
-
```ts
|
|
151
|
-
getStateId(routeName): string | undefined;
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L53)
|
|
155
|
-
|
|
156
|
-
Get the state ID for a given Vue Router route name.
|
|
157
|
-
|
|
158
|
-
#### Parameters
|
|
159
|
-
|
|
160
|
-
| Parameter | Type |
|
|
161
|
-
| ----------- | -------- |
|
|
162
|
-
| `routeName` | `string` |
|
|
163
|
-
|
|
164
|
-
#### Returns
|
|
165
|
-
|
|
166
|
-
`string` \| `undefined`
|
|
167
|
-
|
|
168
|
-
#### Inherited from
|
|
169
|
-
|
|
170
|
-
[`VueBaseRouteMap`](VueBaseRouteMap.md).[`getStateId`](VueBaseRouteMap.md#getstateid)
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
84
|
### getStateIdByPath()
|
|
175
85
|
|
|
176
86
|
```ts
|
|
177
87
|
getStateIdByPath(path): string | null;
|
|
178
88
|
```
|
|
179
89
|
|
|
180
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
90
|
+
Defined in: [play-router/src/base-route-map.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L174)
|
|
181
91
|
|
|
182
92
|
Resolve a URL path to its mapped state ID.
|
|
183
93
|
|
|
@@ -2,35 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: VueBaseRouteMap
|
|
4
4
|
|
|
5
|
-
Defined in: [play-
|
|
5
|
+
Defined in: [play-router/src/base-route-map.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L100)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Shared bidirectional route map base class.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
lookup and optional URL pattern access.
|
|
9
|
+
All framework adapter `RouteMap` classes extend this — they add no logic of their
|
|
10
|
+
own and inherit the full public API from here.
|
|
12
11
|
|
|
13
|
-
**
|
|
14
|
-
URL paths for navigation. `BaseRouteMap` operates on path strings; `VueBaseRouteMap`
|
|
15
|
-
bridges the two by translating `RouteMapping` entries at construction time — only
|
|
16
|
-
mappings with a `pattern` field participate in URL path resolution via `BaseRouteMap`.
|
|
12
|
+
**Lookup strategy:**
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
- Static paths (no `:param`) → O(1) `Map` lookup
|
|
15
|
+
- Dynamic paths → O(k) bucket-indexed scan using `URLPattern`, where `k` is the number
|
|
16
|
+
of routes sharing the same first path segment
|
|
17
|
+
- Results are cached after the first match in an LRU cache (default 500 entries,
|
|
18
|
+
configurable via the `cacheSize` constructor option)
|
|
19
|
+
|
|
20
|
+
**Pattern syntax** (`:param` / `:param?`):
|
|
21
|
+
|
|
22
|
+
- `:param` — required segment, matches exactly one non-`/` segment
|
|
23
|
+
- `:param?` — optional segment, matches zero or one non-`/` segment
|
|
20
24
|
|
|
21
25
|
## Example
|
|
22
26
|
|
|
23
27
|
```typescript
|
|
24
|
-
import {
|
|
28
|
+
import { BaseRouteMap } from "@xmachines/play-router";
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
+
const map = new BaseRouteMap([
|
|
31
|
+
{ stateId: "home", path: "/" },
|
|
32
|
+
{ stateId: "profile", path: "/profile/:userId" },
|
|
33
|
+
{ stateId: "settings", path: "/settings/:section?" },
|
|
34
|
+
]);
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
map.getStateIdByPath("/"); // "home"
|
|
37
|
+
map.getStateIdByPath("/profile/123"); // "profile"
|
|
38
|
+
map.getStateIdByPath("/settings"); // "settings"
|
|
39
|
+
map.getStateIdByPath("/unknown"); // null
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
map.getPathByStateId("profile"); // "/profile/:userId"
|
|
42
|
+
map.getPathByStateId("missing"); // null
|
|
43
|
+
```
|
|
34
44
|
|
|
35
45
|
## Extended by
|
|
36
46
|
|
|
@@ -41,24 +51,28 @@ class MyVueRouteMap extends VueBaseRouteMap {
|
|
|
41
51
|
### Constructor
|
|
42
52
|
|
|
43
53
|
```ts
|
|
44
|
-
new VueBaseRouteMap(mappings):
|
|
54
|
+
new VueBaseRouteMap(mappings, options?): BaseRouteMap;
|
|
45
55
|
```
|
|
46
56
|
|
|
47
|
-
Defined in: [play-
|
|
57
|
+
Defined in: [play-router/src/base-route-map.ts:125](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L125)
|
|
48
58
|
|
|
49
|
-
|
|
59
|
+
Build a route map from an array of state ID ↔ path mappings.
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
Static paths (no `:param`) are indexed in an O(1) `Map`.
|
|
62
|
+
Parameterized paths are compiled to `URLPattern` and grouped into first-segment
|
|
63
|
+
buckets for efficient candidate selection.
|
|
54
64
|
|
|
55
|
-
####
|
|
65
|
+
#### Parameters
|
|
56
66
|
|
|
57
|
-
|
|
67
|
+
| Parameter | Type | Description |
|
|
68
|
+
| -------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
69
|
+
| `mappings` | [`RouteMapping`](../interfaces/RouteMapping.md)[] | Array of `{ stateId, path }` entries. Order determines priority when multiple patterns could match the same path. |
|
|
70
|
+
| `options` | \{ `cacheSize?`: `number`; \} | Optional configuration. `options.cacheSize`: Maximum number of resolved parameterized path lookups to cache. Defaults to `500`. Increase for applications with many unique parameterized URL values (e.g. user profile pages with thousands of distinct IDs). After eviction the path falls back to the O(k) bucket pattern scan — correct but slower. Minimum effective value is `1` (QuickLRU constraint). |
|
|
71
|
+
| `options.cacheSize?` | `number` | - |
|
|
58
72
|
|
|
59
|
-
####
|
|
73
|
+
#### Returns
|
|
60
74
|
|
|
61
|
-
|
|
75
|
+
`BaseRouteMap`
|
|
62
76
|
|
|
63
77
|
## Methods
|
|
64
78
|
|
|
@@ -68,7 +82,7 @@ Defined in: [play-vue-router/src/vue-base-route-map.ts:32](https://gitlab.com/xm
|
|
|
68
82
|
getPathByStateId(stateId): string | null;
|
|
69
83
|
```
|
|
70
84
|
|
|
71
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
85
|
+
Defined in: [play-router/src/base-route-map.ts:209](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L209)
|
|
72
86
|
|
|
73
87
|
Look up the path pattern registered for a state ID.
|
|
74
88
|
|
|
@@ -91,76 +105,6 @@ map.getPathByStateId("profile"); // "/profile/:userId"
|
|
|
91
105
|
map.getPathByStateId("missing"); // null
|
|
92
106
|
```
|
|
93
107
|
|
|
94
|
-
#### Inherited from
|
|
95
|
-
|
|
96
|
-
[`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md).[`getPathByStateId`](../../play-router/classes/BaseRouteMap.md#getpathbystateid)
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
### getPattern()
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
getPattern(stateId): string | undefined;
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L58)
|
|
107
|
-
|
|
108
|
-
Get the URL path pattern for a given state ID (e.g. `"/profile/:userId"`).
|
|
109
|
-
|
|
110
|
-
#### Parameters
|
|
111
|
-
|
|
112
|
-
| Parameter | Type |
|
|
113
|
-
| --------- | -------- |
|
|
114
|
-
| `stateId` | `string` |
|
|
115
|
-
|
|
116
|
-
#### Returns
|
|
117
|
-
|
|
118
|
-
`string` \| `undefined`
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### getRouteName()
|
|
123
|
-
|
|
124
|
-
```ts
|
|
125
|
-
getRouteName(stateId): string | undefined;
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:48](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L48)
|
|
129
|
-
|
|
130
|
-
Get the Vue Router route name for a given state ID.
|
|
131
|
-
|
|
132
|
-
#### Parameters
|
|
133
|
-
|
|
134
|
-
| Parameter | Type |
|
|
135
|
-
| --------- | -------- |
|
|
136
|
-
| `stateId` | `string` |
|
|
137
|
-
|
|
138
|
-
#### Returns
|
|
139
|
-
|
|
140
|
-
`string` \| `undefined`
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
### getStateId()
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
getStateId(routeName): string | undefined;
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Defined in: [play-vue-router/src/vue-base-route-map.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.24/packages/play-vue-router/src/vue-base-route-map.ts#L53)
|
|
151
|
-
|
|
152
|
-
Get the state ID for a given Vue Router route name.
|
|
153
|
-
|
|
154
|
-
#### Parameters
|
|
155
|
-
|
|
156
|
-
| Parameter | Type |
|
|
157
|
-
| ----------- | -------- |
|
|
158
|
-
| `routeName` | `string` |
|
|
159
|
-
|
|
160
|
-
#### Returns
|
|
161
|
-
|
|
162
|
-
`string` \| `undefined`
|
|
163
|
-
|
|
164
108
|
---
|
|
165
109
|
|
|
166
110
|
### getStateIdByPath()
|
|
@@ -169,7 +113,7 @@ Get the state ID for a given Vue Router route name.
|
|
|
169
113
|
getStateIdByPath(path): string | null;
|
|
170
114
|
```
|
|
171
115
|
|
|
172
|
-
Defined in: [play-router/src/base-route-map.ts:
|
|
116
|
+
Defined in: [play-router/src/base-route-map.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v1.0.0-beta.26/packages/play-router/src/base-route-map.ts#L174)
|
|
173
117
|
|
|
174
118
|
Resolve a URL path to its mapped state ID.
|
|
175
119
|
|
|
@@ -195,7 +139,3 @@ The mapped state ID, or `null` if no route matches
|
|
|
195
139
|
map.getStateIdByPath("/profile/123"); // "profile"
|
|
196
140
|
map.getStateIdByPath("/unknown"); // null
|
|
197
141
|
```
|
|
198
|
-
|
|
199
|
-
#### Inherited from
|
|
200
|
-
|
|
201
|
-
[`BaseRouteMap`](../../play-router/classes/BaseRouteMap.md).[`getStateIdByPath`](../../play-router/classes/BaseRouteMap.md#getstateidbypath)
|