@ssgoi/react 7.1.2 → 7.1.3-beta.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.
Files changed (47) hide show
  1. package/README.md +28 -1
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.js +2 -2
  5. package/dist/nextjs.cjs +1 -1
  6. package/dist/nextjs.d.ts +1 -1
  7. package/dist/nextjs.js +2 -2
  8. package/dist/react-router.cjs +1 -1
  9. package/dist/react-router.d.ts +1 -1
  10. package/dist/react-router.js +11 -2
  11. package/dist/remix.cjs +2 -0
  12. package/dist/remix.d.ts +2 -0
  13. package/dist/{lib/react-router/ssgoi-route-boundary.js → remix.js} +2 -2
  14. package/dist/routers/nextjs/index.d.ts +4 -0
  15. package/dist/{lib/react-router/ssgoi-route-boundary.d.ts → routers/react-router.d.ts} +3 -1
  16. package/dist/routers/remix.d.ts +8 -0
  17. package/dist/{lib/tanstack-router/ssgoi-route-boundary.d.ts → routers/tanstack-router.d.ts} +3 -1
  18. package/dist/tanstack-router.cjs +1 -1
  19. package/dist/tanstack-router.d.ts +1 -1
  20. package/dist/tanstack-router.js +13 -2
  21. package/dist/types.d.ts +1 -2
  22. package/dist/view-transitions.d.ts +1 -2
  23. package/package.json +22 -9
  24. package/dist/lib/index.d.ts +0 -4
  25. package/dist/lib/nextjs.d.ts +0 -4
  26. package/dist/lib/react-router/ssgoi-route-boundary.cjs +0 -2
  27. package/dist/lib/react-router.d.ts +0 -3
  28. package/dist/lib/tanstack-router/ssgoi-route-boundary.cjs +0 -2
  29. package/dist/lib/tanstack-router/ssgoi-route-boundary.js +0 -16
  30. package/dist/lib/tanstack-router.d.ts +0 -3
  31. package/dist/lib/types.d.ts +0 -1
  32. package/dist/lib/view-transitions.d.ts +0 -1
  33. /package/dist/{lib → routers}/nextjs/selected-segments-to-path.cjs +0 -0
  34. /package/dist/{lib → routers}/nextjs/selected-segments-to-path.d.ts +0 -0
  35. /package/dist/{lib → routers}/nextjs/selected-segments-to-path.js +0 -0
  36. /package/dist/{lib → routers}/nextjs/ssgoi-route-boundary.cjs +0 -0
  37. /package/dist/{lib → routers}/nextjs/ssgoi-route-boundary.d.ts +0 -0
  38. /package/dist/{lib → routers}/nextjs/ssgoi-route-boundary.js +0 -0
  39. /package/dist/{lib → routers}/route-boundary.cjs +0 -0
  40. /package/dist/{lib → routers}/route-boundary.d.ts +0 -0
  41. /package/dist/{lib → routers}/route-boundary.js +0 -0
  42. /package/dist/{lib/ssgoi-transition.cjs → ssgoi-transition.cjs} +0 -0
  43. /package/dist/{lib/ssgoi-transition.d.ts → ssgoi-transition.d.ts} +0 -0
  44. /package/dist/{lib/ssgoi-transition.js → ssgoi-transition.js} +0 -0
  45. /package/dist/{lib/ssgoi.cjs → ssgoi.cjs} +0 -0
  46. /package/dist/{lib/ssgoi.d.ts → ssgoi.d.ts} +0 -0
  47. /package/dist/{lib/ssgoi.js → ssgoi.js} +0 -0
package/README.md CHANGED
@@ -12,6 +12,20 @@ npm install @ssgoi/react
12
12
 
13
13
  Agent setup guide: https://ssgoi.dev/llms.txt
14
14
 
15
+ ## Router helpers
16
+
17
+ Install this framework package once; router helpers are optional subpaths.
18
+ Next.js is the only helper not marked experimental. The other router helpers are experimental APIs.
19
+
20
+ | Router | Import | API |
21
+ | ----------------------- | ------------------------------ | -------------------- |
22
+ | Next.js | `@ssgoi/react/nextjs` | `SsgoiRouteBoundary` |
23
+ | Remix 2 | `@ssgoi/react/remix` | `SsgoiRouteBoundary` |
24
+ | React Router | `@ssgoi/react/react-router` | `SsgoiRouteBoundary` |
25
+ | TanStack Router / Start | `@ssgoi/react/tanstack-router` | `SsgoiRouteBoundary` |
26
+
27
+ See the [framework guide](https://ssgoi.dev/docs/frameworks/react) for wiring and limits.
28
+
15
29
  ## Contents
16
30
 
17
31
  - Next.js
@@ -21,6 +35,18 @@ Agent setup guide: https://ssgoi.dev/llms.txt
21
35
  - Config
22
36
  - Effect index
23
37
 
38
+ ## Tune or define motion
39
+
40
+ Built-in presets accept `{ override: { forward, backward } }` as their second
41
+ argument. Callbacks receive `{ animation, context }`, preserve the preset's
42
+ concrete animation type, and edit named children with
43
+ `animation.select("in").set({ integrator })`. Use `animation.set({ integrator })`
44
+ to retune the whole group. Springs use stiffness/damping; custom integrator
45
+ instances are accepted.
46
+
47
+ [Motion overrides](https://ssgoi.dev/docs/motion) ·
48
+ [Custom definitions and integrators](https://ssgoi.dev/docs/custom-transitions)
49
+
24
50
  ## Next.js
25
51
 
26
52
  Keep one config and one `<Ssgoi>` above route boundaries.
@@ -91,7 +117,8 @@ The legacy `<SsgoiTransition>` wrapper only added this attribute and is
91
117
  deprecated. Set `data-ssgoi-transition` directly on the keyed application
92
118
  boundary.
93
119
 
94
- Create a router-aware utility in the application. Keep its route logic behind
120
+ Use `@ssgoi/react/nextjs` for the ready-made boundary. If the application needs
121
+ its own policy layer, the following manual example keeps route logic behind
95
122
  semantic names so layouts cannot invent inconsistent keys:
96
123
 
97
124
  ```tsx
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/types"),o=require("./lib/ssgoi.cjs"),i=require("./lib/ssgoi-transition.cjs"),r=require("@ssgoi/core");exports.Ssgoi=o.Ssgoi;exports.SsgoiTransition=i.SsgoiTransition;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@ssgoi/core/types"),o=require("./ssgoi.cjs"),i=require("./ssgoi-transition.cjs"),r=require("@ssgoi/core");exports.Ssgoi=o.Ssgoi;exports.SsgoiTransition=i.SsgoiTransition;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})});
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export * from './lib/index'
2
- export {}
1
+ export * from './types';
2
+ export { Ssgoi } from './ssgoi';
3
+ export { SsgoiTransition } from './ssgoi-transition';
4
+ export * from '@ssgoi/core';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "@ssgoi/core/types";
2
- import { Ssgoi as e } from "./lib/ssgoi.js";
3
- import { SsgoiTransition as i } from "./lib/ssgoi-transition.js";
2
+ import { Ssgoi as e } from "./ssgoi.js";
3
+ import { SsgoiTransition as i } from "./ssgoi-transition.js";
4
4
  export * from "@ssgoi/core";
5
5
  export {
6
6
  e as Ssgoi,
package/dist/nextjs.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./lib/nextjs/ssgoi-route-boundary.cjs"),t=require("./lib/nextjs/selected-segments-to-path.cjs");exports.SsgoiRouteBoundary=e.SsgoiRouteBoundary;exports.selectedSegmentsToPath=t.selectedSegmentsToPath;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./routers/nextjs/ssgoi-route-boundary.cjs"),t=require("./routers/nextjs/selected-segments-to-path.cjs");exports.SsgoiRouteBoundary=e.SsgoiRouteBoundary;exports.selectedSegmentsToPath=t.selectedSegmentsToPath;
package/dist/nextjs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './lib/nextjs'
1
+ export * from './routers/nextjs/index'
2
2
  export {}
package/dist/nextjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { SsgoiRouteBoundary as t } from "./lib/nextjs/ssgoi-route-boundary.js";
3
- import { selectedSegmentsToPath as m } from "./lib/nextjs/selected-segments-to-path.js";
2
+ import { SsgoiRouteBoundary as t } from "./routers/nextjs/ssgoi-route-boundary.js";
3
+ import { selectedSegmentsToPath as m } from "./routers/nextjs/selected-segments-to-path.js";
4
4
  export {
5
5
  t as SsgoiRouteBoundary,
6
6
  m as selectedSegmentsToPath
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lib/react-router/ssgoi-route-boundary.cjs");exports.SsgoiRouteBoundary=o.SsgoiRouteBoundary;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),n=require("react-router"),i=require("./routers/route-boundary.cjs");function a({resolve:e,...t}){const o=n.useLocation(),r=e?.(o)??{id:o.pathname};return u.jsx(i.RouteBoundary,{...t,boundary:r})}exports.SsgoiRouteBoundary=a;
@@ -1,2 +1,2 @@
1
- export * from './lib/react-router'
1
+ export * from './routers/react-router'
2
2
  export {}
@@ -1,5 +1,14 @@
1
1
  "use client";
2
- import { SsgoiRouteBoundary as e } from "./lib/react-router/ssgoi-route-boundary.js";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { useLocation as u } from "react-router";
4
+ import { RouteBoundary as a } from "./routers/route-boundary.js";
5
+ function p({
6
+ resolve: t,
7
+ ...r
8
+ }) {
9
+ const o = u(), n = t?.(o) ?? { id: o.pathname };
10
+ return /* @__PURE__ */ i(a, { ...r, boundary: n });
11
+ }
3
12
  export {
4
- e as SsgoiRouteBoundary
13
+ p as SsgoiRouteBoundary
5
14
  };
package/dist/remix.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("@remix-run/react"),i=require("./routers/route-boundary.cjs");function a({resolve:e,...t}){const o=u.useLocation(),n=e?.(o)??{id:o.pathname};return r.jsx(i.RouteBoundary,{...t,boundary:n})}exports.SsgoiRouteBoundary=a;
@@ -0,0 +1,2 @@
1
+ export * from './routers/remix'
2
+ export {}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import { useLocation as u } from "react-router";
4
- import { RouteBoundary as a } from "../route-boundary.js";
3
+ import { useLocation as u } from "@remix-run/react";
4
+ import { RouteBoundary as a } from "./routers/route-boundary.js";
5
5
  function p({
6
6
  resolve: t,
7
7
  ...r
@@ -0,0 +1,4 @@
1
+ export { SsgoiRouteBoundary } from './ssgoi-route-boundary';
2
+ export type { SsgoiRouteBoundaryProps, NextjsRouteLocation, } from './ssgoi-route-boundary';
3
+ export type { RouteBoundaryState } from '../route-boundary';
4
+ export { selectedSegmentsToPath } from './selected-segments-to-path';
@@ -1,5 +1,7 @@
1
1
  import { ElementType } from 'react';
2
2
  import { Location } from 'react-router';
3
- import { RouteBoundaryProps } from '../route-boundary';
3
+ import { RouteBoundaryProps } from './route-boundary';
4
4
  export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<Location, T>;
5
+ /** @experimental React Router integration. The API may change. */
5
6
  export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export type { RouteBoundaryState } from './route-boundary';
@@ -0,0 +1,8 @@
1
+ import { ElementType } from 'react';
2
+ import { useLocation } from '@remix-run/react';
3
+ import { RouteBoundaryProps } from './route-boundary';
4
+ export type RemixRouteLocation = ReturnType<typeof useLocation>;
5
+ export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<RemixRouteLocation, T>;
6
+ /** @experimental Remix 2 integration. The API may change. */
7
+ export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export type { RouteBoundaryState } from './route-boundary';
@@ -1,4 +1,6 @@
1
1
  import { ElementType } from 'react';
2
- import { RouteBoundaryProps, RouteLocation } from '../route-boundary';
2
+ import { RouteBoundaryProps, RouteLocation } from './route-boundary';
3
3
  export type SsgoiRouteBoundaryProps<T extends ElementType = "div"> = RouteBoundaryProps<RouteLocation, T>;
4
+ /** @experimental TanStack Router integration. The API may change. */
4
5
  export declare function SsgoiRouteBoundary<T extends ElementType = "div">({ resolve, ...props }: SsgoiRouteBoundaryProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export type { RouteBoundaryState } from './route-boundary';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lib/tanstack-router/ssgoi-route-boundary.cjs");exports.SsgoiRouteBoundary=o.SsgoiRouteBoundary;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),a=require("@tanstack/react-router"),s=require("./routers/route-boundary.cjs");function c({resolve:e,...o}){const t={pathname:a.useRouterState({select:r=>r.location.pathname})},n=e?.(t)??{id:t.pathname};return u.jsx(s.RouteBoundary,{...o,boundary:n})}exports.SsgoiRouteBoundary=c;
@@ -1,2 +1,2 @@
1
- export * from './lib/tanstack-router'
1
+ export * from './routers/tanstack-router'
2
2
  export {}
@@ -1,5 +1,16 @@
1
1
  "use client";
2
- import { SsgoiRouteBoundary as e } from "./lib/tanstack-router/ssgoi-route-boundary.js";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { useRouterState as m } from "@tanstack/react-router";
4
+ import { RouteBoundary as u } from "./routers/route-boundary.js";
5
+ function d({
6
+ resolve: t,
7
+ ...n
8
+ }) {
9
+ const o = { pathname: m({
10
+ select: (e) => e.location.pathname
11
+ }) }, a = t?.(o) ?? { id: o.pathname };
12
+ return /* @__PURE__ */ r(u, { ...n, boundary: a });
13
+ }
3
14
  export {
4
- e as SsgoiRouteBoundary
15
+ d as SsgoiRouteBoundary
5
16
  };
package/dist/types.d.ts CHANGED
@@ -1,2 +1 @@
1
- export * from './lib/types'
2
- export {}
1
+ export * from '@ssgoi/core/types';
@@ -1,2 +1 @@
1
- export * from './lib/view-transitions'
2
- export {}
1
+ export * from '@ssgoi/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/react",
3
- "version": "7.1.2",
3
+ "version": "7.1.3-beta.0",
4
4
  "description": "React bindings for SSGOI - Native app-like page transitions for React applications",
5
5
  "private": false,
6
6
  "type": "module",
@@ -63,28 +63,34 @@
63
63
  "default": "./dist/unplugin/esbuild.js"
64
64
  },
65
65
  "./nextjs": {
66
- "types": "./dist/nextjs.d.ts",
66
+ "types": "./dist/routers/nextjs/index.d.ts",
67
67
  "import": "./dist/nextjs.js",
68
68
  "require": "./dist/nextjs.cjs",
69
69
  "default": "./dist/nextjs.js"
70
70
  },
71
71
  "./react-router": {
72
- "types": "./dist/react-router.d.ts",
72
+ "types": "./dist/routers/react-router.d.ts",
73
73
  "import": "./dist/react-router.js",
74
74
  "require": "./dist/react-router.cjs",
75
75
  "default": "./dist/react-router.js"
76
76
  },
77
77
  "./tanstack-router": {
78
- "types": "./dist/tanstack-router.d.ts",
78
+ "types": "./dist/routers/tanstack-router.d.ts",
79
79
  "import": "./dist/tanstack-router.js",
80
80
  "require": "./dist/tanstack-router.cjs",
81
81
  "default": "./dist/tanstack-router.js"
82
+ },
83
+ "./remix": {
84
+ "types": "./dist/routers/remix.d.ts",
85
+ "import": "./dist/remix.js",
86
+ "require": "./dist/remix.cjs",
87
+ "default": "./dist/remix.js"
82
88
  }
83
89
  },
84
90
  "dependencies": {
85
91
  "unplugin": "^2.3.2",
86
92
  "@babel/core": "^7.26.10",
87
- "@ssgoi/core": "^7.1.2"
93
+ "@ssgoi/core": "^7.1.3-beta.0"
88
94
  },
89
95
  "devDependencies": {
90
96
  "@babel/traverse": "7.28.5",
@@ -107,10 +113,11 @@
107
113
  "next": "16.1.0",
108
114
  "react-router": "7.10.1",
109
115
  "@tanstack/react-router": "^1.93.0",
110
- "react": "^19.2.3",
111
- "react-dom": "^19.2.3",
116
+ "react": "18.3.1",
117
+ "react-dom": "18.3.1",
112
118
  "vitest": "^3.2.4",
113
- "jsdom": "^26.1.0"
119
+ "jsdom": "^26.1.0",
120
+ "@remix-run/react": "2.17.5"
114
121
  },
115
122
  "keywords": [
116
123
  "react",
@@ -150,7 +157,10 @@
150
157
  "peerDependencies": {
151
158
  "next": "*",
152
159
  "react-router": "*",
153
- "@tanstack/react-router": "*"
160
+ "@tanstack/react-router": "*",
161
+ "react": "^18.0.0 || ^19.0.0",
162
+ "react-dom": "^18.0.0 || ^19.0.0",
163
+ "@remix-run/react": "*"
154
164
  },
155
165
  "peerDependenciesMeta": {
156
166
  "next": {
@@ -161,6 +171,9 @@
161
171
  },
162
172
  "@tanstack/react-router": {
163
173
  "optional": true
174
+ },
175
+ "@remix-run/react": {
176
+ "optional": true
164
177
  }
165
178
  },
166
179
  "scripts": {
@@ -1,4 +0,0 @@
1
- export * from './types';
2
- export { Ssgoi } from './ssgoi';
3
- export { SsgoiTransition } from './ssgoi-transition';
4
- export * from '@ssgoi/core';
@@ -1,4 +0,0 @@
1
- export { SsgoiRouteBoundary } from './nextjs/ssgoi-route-boundary';
2
- export type { SsgoiRouteBoundaryProps, NextjsRouteLocation, } from './nextjs/ssgoi-route-boundary';
3
- export type { RouteBoundaryState } from './route-boundary';
4
- export { selectedSegmentsToPath } from './nextjs/selected-segments-to-path';
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),n=require("react-router"),i=require("../route-boundary.cjs");function a({resolve:e,...t}){const o=n.useLocation(),r=e?.(o)??{id:o.pathname};return u.jsx(i.RouteBoundary,{...t,boundary:r})}exports.SsgoiRouteBoundary=a;
@@ -1,3 +0,0 @@
1
- export { SsgoiRouteBoundary } from './react-router/ssgoi-route-boundary';
2
- export type { SsgoiRouteBoundaryProps } from './react-router/ssgoi-route-boundary';
3
- export type { RouteBoundaryState } from './route-boundary';
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),a=require("@tanstack/react-router"),s=require("../route-boundary.cjs");function c({resolve:e,...o}){const t={pathname:a.useRouterState({select:r=>r.location.pathname})},n=e?.(t)??{id:t.pathname};return u.jsx(s.RouteBoundary,{...o,boundary:n})}exports.SsgoiRouteBoundary=c;
@@ -1,16 +0,0 @@
1
- "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { useRouterState as m } from "@tanstack/react-router";
4
- import { RouteBoundary as u } from "../route-boundary.js";
5
- function d({
6
- resolve: t,
7
- ...n
8
- }) {
9
- const o = { pathname: m({
10
- select: (e) => e.location.pathname
11
- }) }, a = t?.(o) ?? { id: o.pathname };
12
- return /* @__PURE__ */ r(u, { ...n, boundary: a });
13
- }
14
- export {
15
- d as SsgoiRouteBoundary
16
- };
@@ -1,3 +0,0 @@
1
- export { SsgoiRouteBoundary } from './tanstack-router/ssgoi-route-boundary';
2
- export type { SsgoiRouteBoundaryProps } from './tanstack-router/ssgoi-route-boundary';
3
- export type { RouteBoundaryState } from './route-boundary';
@@ -1 +0,0 @@
1
- export * from '@ssgoi/core/types';
@@ -1 +0,0 @@
1
- export * from '@ssgoi/core';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes