@ssgoi/react 6.6.10 → 7.0.0-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 (2) hide show
  1. package/README.md +15 -11
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -48,7 +48,7 @@ import { fade } from "@ssgoi/react/view-transitions";
48
48
  import { SsgoiTransitionBoundary } from "./ssgoi-transition-boundary";
49
49
 
50
50
  const config = {
51
- transitions: [fade({ paths: ["/", "/about"] })],
51
+ transitions: [{ from: "/", to: "/about", transition: fade() }],
52
52
  };
53
53
 
54
54
  export default function App() {
@@ -137,7 +137,7 @@ route boundary marker.
137
137
 
138
138
  ### Route-based Transitions
139
139
 
140
- Each transition factory returns a path-transition group. Drop the results straight into `config.transitions` — nested arrays are flattened automatically:
140
+ Transition factories return effect configs. Put each effect in a flat route rule:
141
141
 
142
142
  ```tsx
143
143
  import { fade, drill, zoom } from "@ssgoi/react/view-transitions";
@@ -145,22 +145,26 @@ import { fade, drill, zoom } from "@ssgoi/react/view-transitions";
145
145
  const config = {
146
146
  transitions: [
147
147
  // Calm cross-fade between tabs
148
- fade({ paths: ["/home", "/about"] }),
148
+ { from: "/home", to: "/about", transition: fade() },
149
149
 
150
150
  // iOS-style drill-in when entering details
151
- drill({ enter: "/products/*", exit: "/products" }),
151
+ { from: "/products", to: "/products/*", transition: drill() },
152
152
 
153
153
  // Card-to-detail zoom (needs matching data-zoom-*-key)
154
- zoom({ paths: ["/gallery", "/photo/*"], type: "expand" }),
154
+ {
155
+ from: "/gallery",
156
+ to: "/photo/:id",
157
+ transition: zoom({ type: "expand" }),
158
+ },
155
159
  ],
156
160
  };
157
161
  ```
158
162
 
159
- Transitions come in three shapes:
163
+ Route rules come in three shapes:
160
164
 
161
- - **`{ paths }`** — symmetric: every pair animates with the same physics (`fade`, `hero`, `zoom`, `blind`, `film`, `rotate`, `strip`, `jaemin`)
162
- - **`{ enter, exit, type? }`** — directional: enter and exit get different physics (`drill`, `sheet`)
163
- - **`{ paths }`** — ordered: path order decides forward / back direction (`slide`, `scroll`, `axis`)
165
+ - **`{ on, except?, transition }`** — a route family / stack
166
+ - **`{ from, to, transition }`** — a precise bidirectional pair
167
+ - **`{ ordered, transition }`** — index order decides forward / backward
164
168
 
165
169
  ### Individual Element Animations
166
170
 
@@ -295,8 +299,8 @@ import { SsgoiTransitionBoundary } from "./ssgoi-transition-boundary";
295
299
 
296
300
  const config = {
297
301
  transitions: [
298
- drill({ enter: "/post/*", exit: "*" }),
299
- fade({ paths: ["/", "/about"] }),
302
+ { on: "/post/**", except: "/post", transition: drill() },
303
+ { from: "/", to: "/about", transition: fade() },
300
304
  ],
301
305
  };
302
306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/react",
3
- "version": "6.6.10",
3
+ "version": "7.0.0-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",
@@ -66,7 +66,7 @@
66
66
  "dependencies": {
67
67
  "unplugin": "^2.3.2",
68
68
  "@babel/core": "^7.26.10",
69
- "@ssgoi/core": "^6.6.10"
69
+ "@ssgoi/core": "^7.0.0-beta.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/babel__core": "^7.20.5",