@xmachines/play-solid-router 1.0.0-beta.31 → 1.0.0-beta.33

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.
@@ -27,11 +27,46 @@ export type SolidRouterHooks = {
27
27
  params: Params;
28
28
  };
29
29
  export interface PlayRouterProviderProps<TActor extends RoutableActor = RoutableActor> {
30
+ /** The actor to sync with Solid Router. */
30
31
  actor: TActor;
32
+ /** Bidirectional route map for state ID ↔ URL path lookups. */
31
33
  routeMap: RouteMap;
34
+ /**
35
+ * The three Solid Router hook results that drive bidirectional sync.
36
+ * Obtain these from `useNavigate()`, `useLocation()`, and `useParams()`
37
+ * in the parent component (they must be called inside a router context).
38
+ */
32
39
  router: SolidRouterHooks;
33
40
  /** Renderer callback receives the same concrete actor type that was passed in. */
34
41
  renderer: (actor: TActor, router: SolidRouterHooks) => JSX.Element;
35
42
  }
43
+ /**
44
+ * Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
45
+ * 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
+ * The `router` prop must be obtained from Solid Router hooks in the parent component:
53
+ *
54
+ * ```tsx
55
+ * function AppShell() {
56
+ * const navigate = useNavigate();
57
+ * const location = useLocation();
58
+ * const params = useParams();
59
+ *
60
+ * return (
61
+ * <PlayRouterProvider
62
+ * actor={actor}
63
+ * routeMap={routeMap}
64
+ * router={{ navigate, location, params }}
65
+ * renderer={(a) => <PlayRenderer actor={a} registry={registry} />}
66
+ * />
67
+ * );
68
+ * }
69
+ * ```
70
+ */
36
71
  export declare function PlayRouterProvider<TActor extends RoutableActor>(props: PlayRouterProviderProps<TActor>): any;
37
72
  //# 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,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvE,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,uBAAuB,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kFAAkF;IAClF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,GAAG,CAAC,OAAO,CAAC;CACnE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,aAAa,EAC9D,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,OAgBtC"}
1
+ {"version":3,"file":"play-router-provider.d.ts","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvE,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,uBAAuB,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa;IACpF,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;OAIG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB,kFAAkF;IAClF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,KAAK,GAAG,CAAC,OAAO,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,SAAS,aAAa,EAC9D,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,OAgBtC"}
@@ -1,5 +1,33 @@
1
1
  import { onCleanup } from "solid-js";
2
2
  import { SolidRouterBridge } from "./solid-router-bridge.js";
3
+ /**
4
+ * Connects a `PlayerActor` to Solid Router, keeping actor state and browser URL
5
+ * in sync bidirectionally.
6
+ *
7
+ * The bridge is created synchronously at component evaluation time (Solid's
8
+ * execution model) and torn down via `onCleanup` when the component is disposed.
9
+ * Unlike React, prop stability is not a concern — Solid's `props` accessor is
10
+ * already reactive and the bridge is created once per component instance.
11
+ *
12
+ * The `router` prop must be obtained from Solid Router hooks in the parent component:
13
+ *
14
+ * ```tsx
15
+ * function AppShell() {
16
+ * const navigate = useNavigate();
17
+ * const location = useLocation();
18
+ * const params = useParams();
19
+ *
20
+ * return (
21
+ * <PlayRouterProvider
22
+ * actor={actor}
23
+ * routeMap={routeMap}
24
+ * router={{ navigate, location, params }}
25
+ * renderer={(a) => <PlayRenderer actor={a} registry={registry} />}
26
+ * />
27
+ * );
28
+ * }
29
+ * ```
30
+ */
3
31
  export function PlayRouterProvider(props) {
4
32
  const bridge = new SolidRouterBridge(props.router.navigate, props.router.location, props.router.params, props.actor, props.routeMap);
5
33
  bridge.connect();
@@ -1 +1 @@
1
- {"version":3,"file":"play-router-provider.jsx","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAI/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAoC7D,MAAM,UAAU,kBAAkB,CACjC,KAAsC;IAEtC,MAAM,MAAM,GAAG,IAAI,iBAAiB,CACnC,KAAK,CAAC,MAAM,CAAC,QAAQ,EACrB,KAAK,CAAC,MAAM,CAAC,QAAQ,EACrB,KAAK,CAAC,MAAM,CAAC,MAAM,EACnB,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,CAAC;IAEjB,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,UAAU,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;AACzD,CAAC"}
1
+ {"version":3,"file":"play-router-provider.jsx","sourceRoot":"","sources":["../src/play-router-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,UAAU,CAAC;AAI/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AA2C7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,kBAAkB,CACjC,KAAsC;IAEtC,MAAM,MAAM,GAAG,IAAI,iBAAiB,CACnC,KAAK,CAAC,MAAM,CAAC,QAAQ,EACrB,KAAK,CAAC,MAAM,CAAC,QAAQ,EACrB,KAAK,CAAC,MAAM,CAAC,MAAM,EACnB,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,CAAC;IAEjB,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,UAAU,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;AACzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/play-solid-router",
3
- "version": "1.0.0-beta.31",
3
+ "version": "1.0.0-beta.33",
4
4
  "description": "SolidJS Router adapter for XMachines Universal Player Architecture",
5
5
  "license": "MIT",
6
6
  "author": "XMachines Contributors",
@@ -33,26 +33,26 @@
33
33
  "format": "oxfmt .",
34
34
  "test": "vitest",
35
35
  "test:watch": "vitest",
36
- "clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.vite*",
36
+ "clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.svelte2tsx-*",
37
37
  "prepublishOnly": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@xmachines/play": "1.0.0-beta.31",
41
- "@xmachines/play-actor": "1.0.0-beta.31",
42
- "@xmachines/play-router": "1.0.0-beta.31",
43
- "@xmachines/play-signals": "1.0.0-beta.31"
40
+ "@xmachines/play": "1.0.0-beta.33",
41
+ "@xmachines/play-actor": "1.0.0-beta.33",
42
+ "@xmachines/play-router": "1.0.0-beta.33",
43
+ "@xmachines/play-signals": "1.0.0-beta.33"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@solidjs/router": "^0.16.1",
47
47
  "@solidjs/testing-library": "^0.8.10",
48
- "@xmachines/play-xstate": "1.0.0-beta.31",
49
- "@xmachines/shared": "1.0.0-beta.31",
50
- "jsdom": "^29.0.1",
51
- "oxfmt": "^0.43.0",
52
- "oxlint": "^1.57.0",
48
+ "@xmachines/play-xstate": "1.0.0-beta.33",
49
+ "@xmachines/shared": "1.0.0-beta.33",
50
+ "jsdom": "^29.0.2",
51
+ "oxfmt": "^0.45.0",
52
+ "oxlint": "^1.60.0",
53
53
  "solid-js": "^1.9.12",
54
54
  "vite-plugin-solid": "^2.11.11",
55
- "vitest": "^4.1.2",
55
+ "vitest": "^4.1.4",
56
56
  "xstate": "^5.30.0"
57
57
  },
58
58
  "peerDependencies": {