@xmachines/play-solid-router 1.0.0-beta.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +140 -556
- package/dist/create-play-router-provider.d.ts +62 -0
- package/dist/create-play-router-provider.d.ts.map +1 -0
- package/dist/create-play-router-provider.jsx +45 -0
- package/dist/create-play-router-provider.jsx.map +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/play-router-provider.d.ts +69 -17
- package/dist/play-router-provider.d.ts.map +1 -1
- package/dist/play-router-provider.jsx +38 -8
- package/dist/play-router-provider.jsx.map +1 -1
- package/dist/solid-router-bridge.d.ts +55 -13
- package/dist/solid-router-bridge.d.ts.map +1 -1
- package/dist/solid-router-bridge.js +71 -15
- package/dist/solid-router-bridge.js.map +1 -1
- package/dist/types.d.ts +0 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +27 -16
- package/dist/create-route-map.d.ts +0 -25
- package/dist/create-route-map.d.ts.map +0 -1
- package/dist/create-route-map.js +0 -36
- package/dist/create-route-map.js.map +0 -1
- package/dist/route-map.d.ts +0 -27
- package/dist/route-map.d.ts.map +0 -1
- package/dist/route-map.js +0 -27
- package/dist/route-map.js.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createPlayRouterProvider — factory for Solid `PlayRouterProvider` components
|
|
3
|
+
*
|
|
4
|
+
* Captures the provider component shape used by this package's
|
|
5
|
+
* `PlayRouterProvider` — create a bridge synchronously at component evaluation
|
|
6
|
+
* time, `connect()` it, and `disconnect()` in `onCleanup` — so that Solid
|
|
7
|
+
* bridges with the standard `(router, actor, routeMap)` constructor can be
|
|
8
|
+
* wrapped in a provider with a single call. Only the bridge class (and
|
|
9
|
+
* therefore the `router` prop type) differs between providers created by this
|
|
10
|
+
* factory.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { type JSX } from "solid-js";
|
|
15
|
+
import type { PlayActor, RouteMap, RouterBridge } from "@xmachines/play-router";
|
|
16
|
+
/**
|
|
17
|
+
* Constructor shape a bridge class must satisfy to be used with
|
|
18
|
+
* `createPlayRouterProvider`: `(router, actor, routeMap) → RouterBridge`.
|
|
19
|
+
*
|
|
20
|
+
* Bridges with a different constructor shape (e.g. `SolidRouterBridge`, which
|
|
21
|
+
* takes the hook results as separate arguments) are adapted with a thin
|
|
22
|
+
* subclass that repackages the `router` prop.
|
|
23
|
+
*/
|
|
24
|
+
export type PlayRouterBridgeConstructor<TRouter> = new (router: TRouter, actor: PlayActor, routeMap: RouteMap) => RouterBridge;
|
|
25
|
+
/**
|
|
26
|
+
* Props shared by every factory-created Solid `PlayRouterProvider`.
|
|
27
|
+
*
|
|
28
|
+
* Adapter packages re-export a concrete alias with `TRouter` bound to their
|
|
29
|
+
* router type (e.g. `SolidRouterHooks` in `@xmachines/play-solid-router`).
|
|
30
|
+
*/
|
|
31
|
+
export interface PlayRouterProviderBaseProps<TRouter, TActor extends PlayActor = PlayActor> {
|
|
32
|
+
/** The actor to sync with the router. */
|
|
33
|
+
actor: TActor;
|
|
34
|
+
/** The router the bridge synchronizes with. */
|
|
35
|
+
router: TRouter;
|
|
36
|
+
/** Bidirectional route map for state ID ↔ URL path lookups. */
|
|
37
|
+
routeMap: RouteMap;
|
|
38
|
+
/** Renderer callback receives the same concrete actor type that was passed in. */
|
|
39
|
+
renderer: (actor: TActor, router: TRouter) => JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a Solid `PlayRouterProvider` component bound to a specific bridge class.
|
|
43
|
+
*
|
|
44
|
+
* The returned component connects a `PlayerActor` to the framework router,
|
|
45
|
+
* keeping actor state and browser URL in sync bidirectionally.
|
|
46
|
+
*
|
|
47
|
+
* The bridge is created synchronously at component evaluation time (Solid's
|
|
48
|
+
* execution model) and torn down via `onCleanup` when the component is disposed.
|
|
49
|
+
* Unlike React, prop stability is not a concern — Solid's `props` accessor is
|
|
50
|
+
* already reactive and the bridge is created once per component instance.
|
|
51
|
+
*
|
|
52
|
+
* @param BridgeCtor - Bridge class constructed as `new BridgeCtor(router, actor, routeMap)`.
|
|
53
|
+
* @returns A `PlayRouterProvider` component, generic over the actor type so the
|
|
54
|
+
* `renderer` callback receives the same concrete actor type that was passed in.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* export const PlayRouterProvider = createPlayRouterProvider(MySolidRouterBridge);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function createPlayRouterProvider<TRouter>(BridgeCtor: PlayRouterBridgeConstructor<TRouter>): <TActor extends PlayActor>(props: PlayRouterProviderBaseProps<TRouter, TActor>) => any;
|
|
62
|
+
//# sourceMappingURL=create-play-router-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-play-router-provider.d.ts","sourceRoot":"","sources":["../src/create-play-router-provider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,CAAC,OAAO,IAAI,KAClD,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,QAAQ,KACd,YAAY,CAAC;AAElB;;;;;GAKG;AACH,MAAM,WAAW,2BAA2B,CAAC,OAAO,EAAE,MAAM,SAAS,SAAS,GAAG,SAAS;IACzF,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB,kFAAkF;IAClF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAC/C,UAAU,EAAE,2BAA2B,CAAC,OAAO,CAAC,IAEb,MAAM,SAAS,SAAS,EAC1D,OAAO,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC,SAWpD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createPlayRouterProvider — factory for Solid `PlayRouterProvider` components
|
|
3
|
+
*
|
|
4
|
+
* Captures the provider component shape used by this package's
|
|
5
|
+
* `PlayRouterProvider` — create a bridge synchronously at component evaluation
|
|
6
|
+
* time, `connect()` it, and `disconnect()` in `onCleanup` — so that Solid
|
|
7
|
+
* bridges with the standard `(router, actor, routeMap)` constructor can be
|
|
8
|
+
* wrapped in a provider with a single call. Only the bridge class (and
|
|
9
|
+
* therefore the `router` prop type) differs between providers created by this
|
|
10
|
+
* factory.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { onCleanup } from "solid-js";
|
|
15
|
+
/**
|
|
16
|
+
* Create a Solid `PlayRouterProvider` component bound to a specific bridge class.
|
|
17
|
+
*
|
|
18
|
+
* The returned component connects a `PlayerActor` to the framework router,
|
|
19
|
+
* keeping actor state and browser URL in sync bidirectionally.
|
|
20
|
+
*
|
|
21
|
+
* The bridge is created synchronously at component evaluation time (Solid's
|
|
22
|
+
* execution model) and torn down via `onCleanup` when the component is disposed.
|
|
23
|
+
* Unlike React, prop stability is not a concern — Solid's `props` accessor is
|
|
24
|
+
* already reactive and the bridge is created once per component instance.
|
|
25
|
+
*
|
|
26
|
+
* @param BridgeCtor - Bridge class constructed as `new BridgeCtor(router, actor, routeMap)`.
|
|
27
|
+
* @returns A `PlayRouterProvider` component, generic over the actor type so the
|
|
28
|
+
* `renderer` callback receives the same concrete actor type that was passed in.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* export const PlayRouterProvider = createPlayRouterProvider(MySolidRouterBridge);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function createPlayRouterProvider(BridgeCtor) {
|
|
36
|
+
return function PlayRouterProvider(props) {
|
|
37
|
+
const bridge = new BridgeCtor(props.router, props.actor, props.routeMap);
|
|
38
|
+
void bridge.connect();
|
|
39
|
+
onCleanup(() => {
|
|
40
|
+
void bridge.disconnect();
|
|
41
|
+
});
|
|
42
|
+
return <>{props.renderer(props.actor, props.router)}</>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=create-play-router-provider.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-play-router-provider.jsx","sourceRoot":"","sources":["../src/create-play-router-provider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAkC/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,wBAAwB,CACvC,UAAgD;IAEhD,OAAO,SAAS,kBAAkB,CACjC,KAAmD;QAEnD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzE,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC;QAEtB,SAAS,CAAC,GAAG,EAAE;YACd,KAAK,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;IACzD,CAAC,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { SolidRouterBridge } from "./solid-router-bridge.js";
|
|
7
7
|
export { PlayRouterProvider } from "./play-router-provider.js";
|
|
8
|
-
export type { PlayRouterProviderProps,
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
8
|
+
export type { PlayRouterProviderProps, PlayActor, RoutableActor, // @deprecated — use PlayActor from @xmachines/play-router
|
|
9
|
+
SolidRouterHooks, } from "./play-router-provider.js";
|
|
10
|
+
export { createPlayRouterProvider } from "./create-play-router-provider.js";
|
|
11
|
+
export type { PlayRouterProviderBaseProps, PlayRouterBridgeConstructor, } from "./create-play-router-provider.js";
|
|
12
|
+
export { RouteMap, createRouteMap, type RouteMapping, type RouteMapOptions, } from "@xmachines/play-router";
|
|
13
|
+
export type { PlayRouteEvent, RouterBridge } from "./types.js";
|
|
14
|
+
export type { AbstractActor } from "@xmachines/play-actor";
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EACX,uBAAuB,EACvB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EACX,uBAAuB,EACvB,SAAS,EACT,aAAa,EAAE,0DAA0D;AACzE,gBAAgB,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,QAAQ,EACR,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,GACpB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { SolidRouterBridge } from "./solid-router-bridge.js";
|
|
7
7
|
export { PlayRouterProvider } from "./play-router-provider.js";
|
|
8
|
-
export {
|
|
9
|
-
export { createRouteMap } from "
|
|
8
|
+
export { createPlayRouterProvider } from "./create-play-router-provider.js";
|
|
9
|
+
export { RouteMap, createRouteMap, } from "@xmachines/play-router";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAO/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAK5E,OAAO,EACN,QAAQ,EACR,cAAc,GAGd,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,21 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* PlayRouterProvider — Solid convenience wrapper for SolidRouterBridge
|
|
3
|
+
*
|
|
4
|
+
* Created via the shared `createPlayRouterProvider` factory: the bridge is
|
|
5
|
+
* created synchronously at component evaluation time and disconnected via
|
|
6
|
+
* `onCleanup` when the component is disposed.
|
|
7
|
+
*/
|
|
8
|
+
import type { Navigator, Location, Params } from "@solidjs/router";
|
|
9
|
+
import type { PlayActor } from "@xmachines/play-router";
|
|
10
|
+
import { type PlayRouterProviderBaseProps } from "./create-play-router-provider.js";
|
|
11
|
+
export type { PlayActor };
|
|
12
|
+
/** @deprecated Use `PlayActor` from `@xmachines/play-router`. Will be removed in the next major version. */
|
|
13
|
+
export type RoutableActor = PlayActor;
|
|
14
|
+
/**
|
|
15
|
+
* The three Solid Router hook results that `PlayRouterProvider` and `SolidRouterBridge`
|
|
16
|
+
* require. Pass these directly from your component's hook calls:
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const navigate = useNavigate(); // → SolidRouterHooks.navigate
|
|
20
|
+
* const location = useLocation(); // → SolidRouterHooks.location
|
|
21
|
+
* const params = useParams(); // → SolidRouterHooks.params
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* - `navigate` — used to push URL changes when the actor's `currentRoute` changes.
|
|
25
|
+
* - `location` — `pathname` and `search` are read at `connect()` time for deep-link sync.
|
|
26
|
+
* Subsequent pathname changes drive router→actor sync via `createEffect`.
|
|
27
|
+
* - `params` — Solid's pre-parsed path parameters for the current route segment. Used
|
|
28
|
+
* directly in `extractParams()` to avoid re-parsing with URLPattern.
|
|
29
|
+
*/
|
|
6
30
|
export type SolidRouterHooks = {
|
|
7
|
-
navigate:
|
|
8
|
-
location:
|
|
9
|
-
|
|
10
|
-
search: string;
|
|
11
|
-
};
|
|
12
|
-
params: Record<string, string | undefined>;
|
|
31
|
+
navigate: Navigator;
|
|
32
|
+
location: Location;
|
|
33
|
+
params: Params;
|
|
13
34
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Props for the Solid Router `PlayRouterProvider`.
|
|
37
|
+
*
|
|
38
|
+
* `router` bundles the three Solid Router hook results that drive bidirectional
|
|
39
|
+
* sync. Obtain these from `useNavigate()`, `useLocation()`, and `useParams()`
|
|
40
|
+
* in the parent component (they must be called inside a router context).
|
|
41
|
+
*/
|
|
42
|
+
export interface PlayRouterProviderProps<TActor extends PlayActor = PlayActor> extends PlayRouterProviderBaseProps<SolidRouterHooks, TActor> {
|
|
19
43
|
}
|
|
20
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
|
|
46
|
+
* in sync bidirectionally.
|
|
47
|
+
*
|
|
48
|
+
* The bridge is created synchronously at component evaluation time (Solid's
|
|
49
|
+
* execution model) and torn down via `onCleanup` when the component is disposed.
|
|
50
|
+
* Unlike React, prop stability is not a concern — Solid's `props` accessor is
|
|
51
|
+
* already reactive and the bridge is created once per component instance.
|
|
52
|
+
*
|
|
53
|
+
* The `router` prop must be obtained from Solid Router hooks in the parent component:
|
|
54
|
+
*
|
|
55
|
+
* ```tsx
|
|
56
|
+
* function AppShell() {
|
|
57
|
+
* const navigate = useNavigate();
|
|
58
|
+
* const location = useLocation();
|
|
59
|
+
* const params = useParams();
|
|
60
|
+
*
|
|
61
|
+
* return (
|
|
62
|
+
* <PlayRouterProvider
|
|
63
|
+
* actor={actor}
|
|
64
|
+
* routeMap={routeMap}
|
|
65
|
+
* router={{ navigate, location, params }}
|
|
66
|
+
* renderer={(a) => <PlayRenderer actor={a} registry={registry} />}
|
|
67
|
+
* />
|
|
68
|
+
* );
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const PlayRouterProvider: <TActor extends PlayActor>(props: PlayRouterProviderBaseProps<SolidRouterHooks, TActor>) => any;
|
|
21
73
|
//# sourceMappingURL=play-router-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"play-router-provider.d.ts","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"play-router-provider.d.ts","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAEN,KAAK,2BAA2B,EAChC,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,4GAA4G;AAC5G,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB,CACvC,MAAM,SAAS,SAAS,GAAG,SAAS,CACnC,SAAQ,2BAA2B,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAAG;AAYlE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,kBAAkB,iGAAmD,CAAC"}
|
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
import { onCleanup } from "solid-js";
|
|
2
1
|
import { SolidRouterBridge } from "./solid-router-bridge.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { createPlayRouterProvider, } from "./create-play-router-provider.js";
|
|
3
|
+
/**
|
|
4
|
+
* Adapter binding `SolidRouterBridge`'s hook-argument constructor to the
|
|
5
|
+
* `(router, actor, routeMap)` shape expected by `createPlayRouterProvider`.
|
|
6
|
+
*/
|
|
7
|
+
class SolidHooksRouterBridge extends SolidRouterBridge {
|
|
8
|
+
constructor(router, actor, routeMap) {
|
|
9
|
+
super(router.navigate, router.location, router.params, actor, routeMap);
|
|
10
|
+
}
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
|
|
14
|
+
* in sync bidirectionally.
|
|
15
|
+
*
|
|
16
|
+
* The bridge is created synchronously at component evaluation time (Solid's
|
|
17
|
+
* execution model) and torn down via `onCleanup` when the component is disposed.
|
|
18
|
+
* Unlike React, prop stability is not a concern — Solid's `props` accessor is
|
|
19
|
+
* already reactive and the bridge is created once per component instance.
|
|
20
|
+
*
|
|
21
|
+
* The `router` prop must be obtained from Solid Router hooks in the parent component:
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* function AppShell() {
|
|
25
|
+
* const navigate = useNavigate();
|
|
26
|
+
* const location = useLocation();
|
|
27
|
+
* const params = useParams();
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <PlayRouterProvider
|
|
31
|
+
* actor={actor}
|
|
32
|
+
* routeMap={routeMap}
|
|
33
|
+
* router={{ navigate, location, params }}
|
|
34
|
+
* renderer={(a) => <PlayRenderer actor={a} registry={registry} />}
|
|
35
|
+
* />
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const PlayRouterProvider = createPlayRouterProvider(SolidHooksRouterBridge);
|
|
11
41
|
//# sourceMappingURL=play-router-provider.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"play-router-provider.jsx","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"play-router-provider.jsx","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EACN,wBAAwB,GAExB,MAAM,kCAAkC,CAAC;AAwC1C;;;GAGG;AACH,MAAM,sBAAuB,SAAQ,iBAAiB;IACrD,YAAY,MAAwB,EAAE,KAAgB,EAAE,QAAkB;QACzE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzE,CAAC;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* Uses Solid's native reactive primitives (createEffect) for router→actor direction.
|
|
6
6
|
*
|
|
7
7
|
* **IMPORTANT:** `connect()` MUST be called inside a Solid reactive owner (component
|
|
8
|
-
* or createRoot). The createEffect() in watchRouterChanges()
|
|
9
|
-
*
|
|
8
|
+
* or createRoot). The `createEffect()` in `watchRouterChanges()` runs inside
|
|
9
|
+
* `createRoot()`, which deliberately isolates it from any parent owner — automatic
|
|
10
|
+
* cleanup on component unmount does NOT happen. You MUST call `disconnect()` (or
|
|
11
|
+
* `dispose()`) explicitly, typically in `onCleanup()`.
|
|
10
12
|
*
|
|
11
13
|
* @example
|
|
12
14
|
* ```tsx
|
|
@@ -30,20 +32,31 @@
|
|
|
30
32
|
* }
|
|
31
33
|
* ```
|
|
32
34
|
*/
|
|
35
|
+
import type { Navigator, Params } from "@solidjs/router";
|
|
33
36
|
import { RouterBridgeBase } from "@xmachines/play-router";
|
|
34
|
-
import type {
|
|
35
|
-
import type {
|
|
36
|
-
import type { RouteMap } from "
|
|
37
|
+
import type { LocationLike } from "@xmachines/play-router";
|
|
38
|
+
import type { RoutableActor } from "@xmachines/play-router";
|
|
39
|
+
import type { RouteMap } from "@xmachines/play-router";
|
|
37
40
|
/**
|
|
38
41
|
* SolidJS Router integration bridge extending RouterBridgeBase
|
|
39
42
|
*
|
|
40
43
|
* Implements RouterBridge protocol for SolidJS Router using Solid's reactive
|
|
41
44
|
* primitives. The actor→router direction uses TC39 Signal watcher (from base class).
|
|
42
45
|
* The router→actor direction uses Solid's createEffect for native reactivity.
|
|
46
|
+
*
|
|
47
|
+
* Path parameters are extracted from Solid's `useParams()` reactive proxy rather than
|
|
48
|
+
* re-parsing the URL with URLPattern. This means parameterized routes work without the
|
|
49
|
+
* URLPattern polyfill — Solid's router has already extracted the values.
|
|
43
50
|
*/
|
|
44
51
|
export declare class SolidRouterBridge extends RouterBridgeBase {
|
|
45
52
|
private readonly solidNavigate;
|
|
46
53
|
private readonly location;
|
|
54
|
+
private disposeRouterWatcher;
|
|
55
|
+
/**
|
|
56
|
+
* Live reactive params object from Solid's `useParams()`.
|
|
57
|
+
* Read inside the createEffect callback so it always reflects the current route.
|
|
58
|
+
*/
|
|
59
|
+
private readonly solidParams;
|
|
47
60
|
/**
|
|
48
61
|
* Create a SolidJS Router bridge
|
|
49
62
|
*
|
|
@@ -51,14 +64,28 @@ export declare class SolidRouterBridge extends RouterBridgeBase {
|
|
|
51
64
|
*
|
|
52
65
|
* @param solidNavigate - Result of useNavigate() hook
|
|
53
66
|
* @param location - Result of useLocation() hook
|
|
54
|
-
* @param
|
|
67
|
+
* @param params - Result of useParams() hook — used directly for path parameter extraction,
|
|
68
|
+
* avoiding the URLPattern polyfill requirement for parameterized routes
|
|
55
69
|
* @param actor - XMachines actor instance
|
|
56
70
|
* @param routeMap - Bidirectional state ID ↔ path mapping
|
|
57
71
|
*/
|
|
58
|
-
constructor(solidNavigate:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
constructor(solidNavigate: Navigator, location: LocationLike, params: Params, actor: RoutableActor, routeMap: RouteMap);
|
|
73
|
+
/**
|
|
74
|
+
* Extract path parameters using Solid's pre-parsed `useParams()` values.
|
|
75
|
+
*
|
|
76
|
+
* Solid's router has already extracted all named parameters for the matched route
|
|
77
|
+
* segment. Reading `this.solidParams` inside the createEffect callback that drives
|
|
78
|
+
* `syncActorFromRouter` is safe — the reactive proxy always reflects the current
|
|
79
|
+
* route at the time the effect runs.
|
|
80
|
+
*
|
|
81
|
+
* Falls back to URLPattern-based extraction (base class) only when Solid provided
|
|
82
|
+
* no params for this route (i.e. the route has no `:param` segments).
|
|
83
|
+
*
|
|
84
|
+
* @param pathname - The actual URL path (unused — params already extracted by Solid)
|
|
85
|
+
* @param stateId - The matched state ID (unused — params already extracted by Solid)
|
|
86
|
+
* @returns Normalized path parameters with undefined/empty values filtered out
|
|
87
|
+
*/
|
|
88
|
+
protected extractParams(pathname: string, stateId: string): Record<string, string>;
|
|
62
89
|
/**
|
|
63
90
|
* Navigate SolidJS Router to the given path.
|
|
64
91
|
*/
|
|
@@ -67,17 +94,32 @@ export declare class SolidRouterBridge extends RouterBridgeBase {
|
|
|
67
94
|
* Get the current router pathname for initial URL -> actor sync on connect.
|
|
68
95
|
*/
|
|
69
96
|
protected getInitialRouterPath(): string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Return the initial URL search string for query-param forwarding on `connect()`.
|
|
99
|
+
*
|
|
100
|
+
* Reads `this.location.search` from Solid's `useLocation()` reactive object —
|
|
101
|
+
* the same source used by `getInitialRouterPath()`. An empty string (no query
|
|
102
|
+
* params) returns `undefined` so `syncActorFromRouter` produces `query: {}`.
|
|
103
|
+
*/
|
|
104
|
+
protected getInitialRouterSearch(): string | undefined;
|
|
70
105
|
/**
|
|
71
106
|
* Subscribe to SolidJS Router location changes using createEffect.
|
|
72
107
|
*
|
|
73
|
-
* MUST be called inside a Solid reactive owner (component
|
|
74
|
-
*
|
|
108
|
+
* MUST be called inside a Solid reactive owner (component or createRoot).
|
|
109
|
+
*
|
|
110
|
+
* The effect runs inside `createRoot()` to give it a stable owner independent
|
|
111
|
+
* of the calling component's lifecycle — this prevents the effect from being
|
|
112
|
+
* disposed if the component re-renders while the bridge should stay active.
|
|
113
|
+
* The trade-off is that component unmount does NOT automatically clean up the
|
|
114
|
+
* effect; `disconnect()` (or `dispose()`) MUST be called explicitly to avoid a leak.
|
|
75
115
|
*/
|
|
76
116
|
protected watchRouterChanges(): void;
|
|
77
117
|
/**
|
|
78
118
|
* Stop watching SolidJS Router changes.
|
|
79
119
|
*
|
|
80
|
-
*
|
|
120
|
+
* Calls the `dispose` function returned by `createRoot()` in `watchRouterChanges()`,
|
|
121
|
+
* tearing down the reactive effect and freeing the isolated owner. This is the only
|
|
122
|
+
* cleanup path — component unmount does NOT trigger this automatically.
|
|
81
123
|
*/
|
|
82
124
|
protected unwatchRouterChanges(): void;
|
|
83
125
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-router-bridge.d.ts","sourceRoot":"","sources":["../src/solid-router-bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"solid-router-bridge.d.ts","sourceRoot":"","sources":["../src/solid-router-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IAsBrD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAtB1B,OAAO,CAAC,oBAAoB,CAA6B;IAEzD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC;;;;;;;;;;;OAWG;gBAEe,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,YAAY,EACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ;IASnB;;;;;;;;;;;;;;OAcG;cACgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAY3F;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5C;;OAEG;cACgB,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAIxD;;;;;;OAMG;cACgB,sBAAsB,IAAI,MAAM,GAAG,SAAS;IAI/D;;;;;;;;;;OAUG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAepC;;;;;;OAMG;IACH,SAAS,CAAC,oBAAoB,IAAI,IAAI;IAKtC;;;;;;;OAOG;IACH,OAAO,IAAI,IAAI;CAGf"}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* Uses Solid's native reactive primitives (createEffect) for router→actor direction.
|
|
6
6
|
*
|
|
7
7
|
* **IMPORTANT:** `connect()` MUST be called inside a Solid reactive owner (component
|
|
8
|
-
* or createRoot). The createEffect() in watchRouterChanges()
|
|
9
|
-
*
|
|
8
|
+
* or createRoot). The `createEffect()` in `watchRouterChanges()` runs inside
|
|
9
|
+
* `createRoot()`, which deliberately isolates it from any parent owner — automatic
|
|
10
|
+
* cleanup on component unmount does NOT happen. You MUST call `disconnect()` (or
|
|
11
|
+
* `dispose()`) explicitly, typically in `onCleanup()`.
|
|
10
12
|
*
|
|
11
13
|
* @example
|
|
12
14
|
* ```tsx
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
* }
|
|
31
33
|
* ```
|
|
32
34
|
*/
|
|
33
|
-
import { createEffect, on } from "solid-js";
|
|
35
|
+
import { createEffect, createRoot, on } from "solid-js";
|
|
34
36
|
import { RouterBridgeBase } from "@xmachines/play-router";
|
|
35
37
|
/**
|
|
36
38
|
* SolidJS Router integration bridge extending RouterBridgeBase
|
|
@@ -38,10 +40,20 @@ import { RouterBridgeBase } from "@xmachines/play-router";
|
|
|
38
40
|
* Implements RouterBridge protocol for SolidJS Router using Solid's reactive
|
|
39
41
|
* primitives. The actor→router direction uses TC39 Signal watcher (from base class).
|
|
40
42
|
* The router→actor direction uses Solid's createEffect for native reactivity.
|
|
43
|
+
*
|
|
44
|
+
* Path parameters are extracted from Solid's `useParams()` reactive proxy rather than
|
|
45
|
+
* re-parsing the URL with URLPattern. This means parameterized routes work without the
|
|
46
|
+
* URLPattern polyfill — Solid's router has already extracted the values.
|
|
41
47
|
*/
|
|
42
48
|
export class SolidRouterBridge extends RouterBridgeBase {
|
|
43
49
|
solidNavigate;
|
|
44
50
|
location;
|
|
51
|
+
disposeRouterWatcher = null;
|
|
52
|
+
/**
|
|
53
|
+
* Live reactive params object from Solid's `useParams()`.
|
|
54
|
+
* Read inside the createEffect callback so it always reflects the current route.
|
|
55
|
+
*/
|
|
56
|
+
solidParams;
|
|
45
57
|
/**
|
|
46
58
|
* Create a SolidJS Router bridge
|
|
47
59
|
*
|
|
@@ -49,17 +61,42 @@ export class SolidRouterBridge extends RouterBridgeBase {
|
|
|
49
61
|
*
|
|
50
62
|
* @param solidNavigate - Result of useNavigate() hook
|
|
51
63
|
* @param location - Result of useLocation() hook
|
|
52
|
-
* @param
|
|
64
|
+
* @param params - Result of useParams() hook — used directly for path parameter extraction,
|
|
65
|
+
* avoiding the URLPattern polyfill requirement for parameterized routes
|
|
53
66
|
* @param actor - XMachines actor instance
|
|
54
67
|
* @param routeMap - Bidirectional state ID ↔ path mapping
|
|
55
68
|
*/
|
|
56
|
-
constructor(solidNavigate, location,
|
|
69
|
+
constructor(solidNavigate, location, params, actor, routeMap) {
|
|
57
70
|
super(actor, {
|
|
58
71
|
getStateIdByPath: (path) => routeMap.getStateIdByPath(path),
|
|
59
72
|
getPathByStateId: (id) => routeMap.getPathByStateId(id),
|
|
60
73
|
});
|
|
61
74
|
this.solidNavigate = solidNavigate;
|
|
62
75
|
this.location = location;
|
|
76
|
+
this.solidParams = params;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Extract path parameters using Solid's pre-parsed `useParams()` values.
|
|
80
|
+
*
|
|
81
|
+
* Solid's router has already extracted all named parameters for the matched route
|
|
82
|
+
* segment. Reading `this.solidParams` inside the createEffect callback that drives
|
|
83
|
+
* `syncActorFromRouter` is safe — the reactive proxy always reflects the current
|
|
84
|
+
* route at the time the effect runs.
|
|
85
|
+
*
|
|
86
|
+
* Falls back to URLPattern-based extraction (base class) only when Solid provided
|
|
87
|
+
* no params for this route (i.e. the route has no `:param` segments).
|
|
88
|
+
*
|
|
89
|
+
* @param pathname - The actual URL path (unused — params already extracted by Solid)
|
|
90
|
+
* @param stateId - The matched state ID (unused — params already extracted by Solid)
|
|
91
|
+
* @returns Normalized path parameters with undefined/empty values filtered out
|
|
92
|
+
*/
|
|
93
|
+
extractParams(pathname, stateId) {
|
|
94
|
+
const entries = Object.entries(this.solidParams).filter((entry) => entry[1] !== undefined && entry[1] !== null && entry[1] !== "");
|
|
95
|
+
if (entries.length > 0) {
|
|
96
|
+
return Object.fromEntries(entries);
|
|
97
|
+
}
|
|
98
|
+
// No params from Solid — fall back to URLPattern for routes with no segments
|
|
99
|
+
return super.extractParams(pathname, stateId);
|
|
63
100
|
}
|
|
64
101
|
/**
|
|
65
102
|
* Navigate SolidJS Router to the given path.
|
|
@@ -73,27 +110,46 @@ export class SolidRouterBridge extends RouterBridgeBase {
|
|
|
73
110
|
getInitialRouterPath() {
|
|
74
111
|
return this.location.pathname ?? null;
|
|
75
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Return the initial URL search string for query-param forwarding on `connect()`.
|
|
115
|
+
*
|
|
116
|
+
* Reads `this.location.search` from Solid's `useLocation()` reactive object —
|
|
117
|
+
* the same source used by `getInitialRouterPath()`. An empty string (no query
|
|
118
|
+
* params) returns `undefined` so `syncActorFromRouter` produces `query: {}`.
|
|
119
|
+
*/
|
|
120
|
+
getInitialRouterSearch() {
|
|
121
|
+
return this.location.search || undefined;
|
|
122
|
+
}
|
|
76
123
|
/**
|
|
77
124
|
* Subscribe to SolidJS Router location changes using createEffect.
|
|
78
125
|
*
|
|
79
|
-
* MUST be called inside a Solid reactive owner (component
|
|
80
|
-
*
|
|
126
|
+
* MUST be called inside a Solid reactive owner (component or createRoot).
|
|
127
|
+
*
|
|
128
|
+
* The effect runs inside `createRoot()` to give it a stable owner independent
|
|
129
|
+
* of the calling component's lifecycle — this prevents the effect from being
|
|
130
|
+
* disposed if the component re-renders while the bridge should stay active.
|
|
131
|
+
* The trade-off is that component unmount does NOT automatically clean up the
|
|
132
|
+
* effect; `disconnect()` (or `dispose()`) MUST be called explicitly to avoid a leak.
|
|
81
133
|
*/
|
|
82
134
|
watchRouterChanges() {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
135
|
+
this.disposeRouterWatcher = createRoot((dispose) => {
|
|
136
|
+
createEffect(on(() => this.location.pathname, (pathname) => {
|
|
137
|
+
const search = this.location.search ?? "";
|
|
138
|
+
this.syncActorFromRouter(pathname, search);
|
|
139
|
+
}));
|
|
140
|
+
return dispose;
|
|
141
|
+
});
|
|
89
142
|
}
|
|
90
143
|
/**
|
|
91
144
|
* Stop watching SolidJS Router changes.
|
|
92
145
|
*
|
|
93
|
-
*
|
|
146
|
+
* Calls the `dispose` function returned by `createRoot()` in `watchRouterChanges()`,
|
|
147
|
+
* tearing down the reactive effect and freeing the isolated owner. This is the only
|
|
148
|
+
* cleanup path — component unmount does NOT trigger this automatically.
|
|
94
149
|
*/
|
|
95
150
|
unwatchRouterChanges() {
|
|
96
|
-
|
|
151
|
+
this.disposeRouterWatcher?.();
|
|
152
|
+
this.disposeRouterWatcher = null;
|
|
97
153
|
}
|
|
98
154
|
/**
|
|
99
155
|
* Dispose the bridge (alias for disconnect).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solid-router-bridge.js","sourceRoot":"","sources":["../src/solid-router-bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"solid-router-bridge.js","sourceRoot":"","sources":["../src/solid-router-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAsBpC;IACA;IAtBV,oBAAoB,GAAwB,IAAI,CAAC;IAEzD;;;OAGG;IACc,WAAW,CAAS;IAErC;;;;;;;;;;;OAWG;IACH,YACkB,aAAwB,EACxB,QAAsB,EACvC,MAAc,EACd,KAAoB,EACpB,QAAkB;QAElB,KAAK,CAAC,KAAK,EAAE;YACZ,gBAAgB,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;YACnE,gBAAgB,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;SAC/D,CAAC,CAAC;QATc,kBAAa,GAAb,aAAa,CAAW;QACxB,aAAQ,GAAR,QAAQ,CAAc;QASvC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;IAC3B,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACgB,aAAa,CAAC,QAAgB,EAAE,OAAe;QACjE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CACtD,CAAC,KAAK,EAA6B,EAAE,CACpC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAC/D,CAAC;QACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QACD,6EAA6E;QAC7E,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,IAAY;QACpC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACgB,oBAAoB;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACgB,sBAAsB;QACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;OAUG;IACO,kBAAkB;QAC3B,IAAI,CAAC,oBAAoB,GAAG,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE;YAClD,YAAY,CACX,EAAE,CACD,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAC5B,CAAC,QAAgB,EAAE,EAAE;gBACpB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;gBAC1C,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC5C,CAAC,CACD,CACD,CAAC;YACF,OAAO,OAAO,CAAC;QAChB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACO,oBAAoB;QAC7B,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED;;;;;;;OAOG;IACH,OAAO;QACN,IAAI,CAAC,UAAU,EAAE,CAAC;IACnB,CAAC;CACD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for @xmachines/play-solid-router
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
* Mapping between state ID and URL path for SolidJS Router
|
|
6
|
-
*/
|
|
7
|
-
export interface RouteMapping {
|
|
8
|
-
/**
|
|
9
|
-
* XMachines state ID with # prefix
|
|
10
|
-
* @example '#home', '#profile'
|
|
11
|
-
*/
|
|
12
|
-
readonly stateId: string;
|
|
13
|
-
/**
|
|
14
|
-
* SolidJS Router path pattern
|
|
15
|
-
* @example '/', '/profile/:userId', '/settings/:section?'
|
|
16
|
-
*/
|
|
17
|
-
readonly path: string;
|
|
18
|
-
}
|
|
19
4
|
export type { PlayRouteEvent, RouterBridge } from "@xmachines/play-router";
|
|
20
5
|
export type { AbstractActor } from "@xmachines/play-actor";
|
|
21
6
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|