@ssgoi/solid 6.6.10 → 7.0.1-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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -163
  3. package/package.json +2 -2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MeurSyphus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,138 +1,38 @@
1
1
  # @ssgoi/solid
2
2
 
3
- Solid bindings for SSGOI - Native app-like page transitions for Solid and SolidStart.
3
+ Solid and SolidStart bindings for SSGOI.
4
4
 
5
- try this: [ssgoi.dev](https://ssgoi.dev)
5
+ [![SSGOI live showcase](https://ssgoi.dev/readme.png)](https://ssgoi.dev)
6
6
 
7
- ![https://ssgoi.dev](https://ssgoi.dev/ssgoi.gif)
8
-
9
- ## AI-Assisted Setup
10
-
11
- Using Claude, Cursor, ChatGPT, or another AI assistant? Point it at:
12
-
13
- ```
14
- https://ssgoi.dev/llms.txt
15
- ```
16
-
17
- It has the full setup guide, every transition, the API, and troubleshooting — everything an agent needs to wire SSGOI into your app.
18
-
19
- ## What is SSGOI?
20
-
21
- SSGOI brings native app-like page transitions to the web. Transform your static page navigations into smooth, delightful experiences that users love.
22
-
23
- ### ✨ Key Features
24
-
25
- - **🌍 Works Everywhere** - Unlike the browser's View Transition API, SSGOI works in all modern browsers (Chrome, Firefox, Safari)
26
- - **🚀 SSR Ready** - Perfect compatibility with SolidStart. No hydration issues, SEO-friendly
27
- - **🎯 Use Your Router** - Keep your existing routing. `@solidjs/router` and SolidStart work seamlessly
28
- - **💾 State Persistence** - Remembers animation state during navigation, even with browser back/forward
29
- - **⚡ Solid Native** - Built on Solid's fine-grained reactivity, so change detection stays minimal
30
-
31
- ## Installation
7
+ [Live demos](https://ssgoi.dev) · [Hero, Zoom, Film, and Sheet in motion](https://ssgoi.dev/blog/view-transition-api-limitations)
32
8
 
33
9
  ```bash
34
10
  npm install @ssgoi/solid
35
- # or
36
- yarn add @ssgoi/solid
37
- # or
38
- pnpm add @ssgoi/solid
39
- ```
40
-
41
- ## Quick Start
42
-
43
- ### 1. Wrap your app
44
-
45
- ```tsx
46
- import { Ssgoi } from "@ssgoi/solid";
47
- import { fade } from "@ssgoi/solid/view-transitions";
48
-
49
- const config = {
50
- transitions: [fade({ paths: ["/", "/about"] })],
51
- };
52
-
53
- export default function App(props) {
54
- return (
55
- <Ssgoi config={config}>
56
- {/* position: relative + z-index: 0 are required (see below) */}
57
- <div style="position: relative; z-index: 0; min-height: 100vh">
58
- {props.children}
59
- </div>
60
- </Ssgoi>
61
- );
62
- }
63
11
  ```
64
12
 
65
- ### 2. Mark your pages
13
+ Agent setup guide: https://ssgoi.dev/llms/solid.txt
66
14
 
67
- Set `data-ssgoi-transition` on each page boundary element inside `<Ssgoi>`:
15
+ ## Root
68
16
 
69
- ```tsx
70
- export default function Home() {
71
- return (
72
- <main data-ssgoi-transition="/">
73
- <h1>Welcome</h1>
74
- {/* Page content */}
75
- </main>
76
- );
77
- }
78
- ```
79
-
80
- **That's it!** Your pages now transition smoothly with the configured effect.
81
-
82
- > **Why `position: relative; z-index: 0`?** When a page leaves, SSGOI clones it back into the DOM with `position: absolute` so it can animate out while the new page animates in. The clone needs a positioned, stacking-context ancestor or it jumps / falls behind the background. Add `overflow-x-clip` too if you use horizontal transitions (`slide`, `drill`).
83
-
84
- ## Advanced Transitions
85
-
86
- Each transition factory returns a path-transition group. Drop the results straight into `config.transitions` — nested arrays are flattened automatically:
17
+ Use one `<Ssgoi>` around file routes.
87
18
 
88
19
  ```tsx
89
- import { Ssgoi } from "@ssgoi/solid";
90
- import { fade, drill, zoom } from "@ssgoi/solid/view-transitions";
91
-
92
- const config = {
93
- transitions: [
94
- // Calm cross-fade between tabs
95
- fade({ paths: ["/", "/about"] }),
96
-
97
- // iOS-style drill-in when entering a detail page
98
- drill({ enter: "/products/*", exit: "/products" }),
99
-
100
- // Card-to-detail zoom (needs matching data-zoom-*-key)
101
- zoom({ paths: ["/gallery", "/photo/*"], type: "expand" }),
102
- ],
103
- };
104
- ```
105
-
106
- Transitions come in three shapes:
107
-
108
- - **`{ paths }`** — symmetric: every pair animates with the same physics (`fade`, `hero`, `zoom`, `blind`, `film`, `rotate`, `strip`, `jaemin`)
109
- - **`{ enter, exit, type? }`** — directional: enter and exit get different physics (`drill`, `sheet`)
110
- - **`{ paths }`** — ordered: path order decides forward / back direction (`slide`, `scroll`, `axis`)
111
-
112
- ## SolidStart Example
113
-
114
- Wrap your root component once, then mark each route:
115
-
116
- ```tsx
117
- // src/app.tsx
118
20
  import { Router } from "@solidjs/router";
119
21
  import { FileRoutes } from "@solidjs/start/router";
120
22
  import { Ssgoi } from "@ssgoi/solid";
121
- import { scroll } from "@ssgoi/solid/view-transitions";
23
+ import { drill } from "@ssgoi/solid/view-transitions";
122
24
 
123
25
  const config = {
124
- transitions: [scroll({ paths: ["/", "/about", "/products"] })],
26
+ transitions: [{ on: "/posts/**", except: "/posts", transition: drill() }],
125
27
  };
126
28
 
127
29
  export default function App() {
128
30
  return (
129
31
  <Router
130
32
  root={(props) => (
131
- <Ssgoi config={config}>
132
- <div style="position: relative; z-index: 0; min-height: 100vh">
133
- {props.children}
134
- </div>
135
- </Ssgoi>
33
+ <main class="relative z-0 min-h-dvh overflow-x-clip">
34
+ <Ssgoi config={config}>{props.children}</Ssgoi>
35
+ </main>
136
36
  )}
137
37
  >
138
38
  <FileRoutes />
@@ -141,79 +41,85 @@ export default function App() {
141
41
  }
142
42
  ```
143
43
 
44
+ ## Route boundary
45
+
46
+ Mark the DOM root owned by a route:
47
+
144
48
  ```tsx
145
- // src/routes/index.tsx
146
- export default function Index() {
147
- return <main data-ssgoi-transition="/">{/* Your page content */}</main>;
49
+ export default function Posts() {
50
+ return <section data-ssgoi-transition="/posts">Posts</section>;
148
51
  }
149
52
  ```
150
53
 
151
- ## API Reference
152
-
153
- ### `<Ssgoi>`
154
-
155
- The provider component that manages transition context.
54
+ Use the real route path for dynamic pages:
156
55
 
157
56
  ```tsx
158
- <Ssgoi config={ssgoiConfig}>{/* children */}</Ssgoi>
57
+ <section data-ssgoi-transition={`/posts/${props.id}`}>...</section>
159
58
  ```
160
59
 
161
- Props:
162
-
163
- - `config: SsgoiConfig` - transition configuration object
164
- - `host?: HostAnimation` - optional external playback host for debug tooling
60
+ ## Persistent layouts
165
61
 
166
- ### `data-ssgoi-transition`
167
-
168
- Attribute for pages that should transition. Set it on the page boundary element inside `<Ssgoi>` — the value (commonly the route path) uniquely identifies the view.
62
+ Put one marker on the persistent layout and another on its child route.
63
+ SolidStart keeps the layout DOM while child routes change.
169
64
 
170
65
  ```tsx
171
- <main data-ssgoi-transition="/page-id">{/* children */}</main>
172
- ```
66
+ export default function ProductsLayout(props) {
67
+ const location = useLocation();
173
68
 
174
- ## Built-in Transitions
175
-
176
- Import from `@ssgoi/solid/view-transitions`:
177
-
178
- - `fade()` - Calm cross-fade. Safe default for unrelated pages
179
- - `drill()` - iOS-style hierarchical navigation (list → detail)
180
- - `slide()` - Horizontal push for tabs / sequential flows
181
- - `scroll()` - Vertical page scroll for onboarding / paginated views
182
- - `axis()` - Material/Flutter shared-axis swap for sibling/tab routes
183
- - `sheet()` - Bottom sheet that slides up (modal-like flows)
184
- - `hero()` - Shared element transition (matching `data-hero-enter-key` / `data-hero-exit-key`)
185
- - `zoom()` - Card-to-detail expansion (matching `data-zoom-enter-key` / `data-zoom-exit-key`)
186
- - `strip()` - 3D Y-axis perspective flip
187
- - `blind()` - Window-blinds wipe reveal
188
- - `film()` - Cinematic shrink + tile (gallery / lightbox)
189
- - `rotate()` - Card flip between siblings
190
- - `jaemin()` - Playful rotated zoom for special moments
69
+ return (
70
+ <section data-ssgoi-transition={location.pathname}>
71
+ <ProductTabs />
72
+ <div>{props.children}</div>
73
+ </section>
74
+ );
75
+ }
76
+ ```
191
77
 
192
- ## TypeScript Support
78
+ Each child route marks its own page root. Child navigation uses the child
79
+ boundary; leaving the layout uses the outer boundary.
193
80
 
194
- SSGOI is written in TypeScript and provides full type definitions:
81
+ ## Config
195
82
 
196
- ```typescript
197
- import type { SsgoiConfig } from "@ssgoi/solid";
83
+ ```ts
84
+ import { drill, slide, zoom } from "@ssgoi/solid/view-transitions";
198
85
 
199
- const config: SsgoiConfig = {
200
- // Full type safety
86
+ const config = {
87
+ transitions: [
88
+ {
89
+ on: "/posts/**",
90
+ except: "/posts",
91
+ transition: drill(),
92
+ },
93
+ {
94
+ from: "/gallery",
95
+ to: "/gallery/*",
96
+ transition: zoom(),
97
+ },
98
+ {
99
+ ordered: ["/tabs/a", "/tabs/b"],
100
+ transition: slide(),
101
+ },
102
+ ],
201
103
  };
202
104
  ```
203
105
 
204
- ## Browser Support
106
+ Scroll is automatic: `on` and `from`/`to` restore `from` and reset `to`;
107
+ `ordered` restores both. Override with
108
+ `preserveScroll: { from: boolean, to: boolean }`.
205
109
 
206
- - Chrome/Edge 88+
207
- - Firefox 78+
208
- - Safari 14+
209
- - All modern mobile browsers
110
+ ## Effect index
210
111
 
211
- ## License
112
+ - `fade`: unrelated pages.
113
+ - `drill`: list → detail.
114
+ - `slide` or `axis`: ordered tabs.
115
+ - `sheet`: modal-like routes.
116
+ - `zoom` or `hero`: shared-element details.
117
+ - `scroll`: vertical sequences.
212
118
 
213
- MIT © [MeurSyphus](https://github.com/meursyphus)
119
+ All effects: https://ssgoi.dev/llms.txt#7-transition-index
214
120
 
215
- ## Links
121
+ `SsgoiTransition` is deprecated. Use the data attribute directly.
122
+
123
+ ## License
216
124
 
217
- - [Documentation](https://ssgoi.dev)
218
- - [GitHub](https://github.com/meursyphus/ssgoi)
219
- - [Issues](https://github.com/meursyphus/ssgoi/issues)
125
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/solid",
3
- "version": "6.6.10",
3
+ "version": "7.0.1-beta.0",
4
4
  "description": "Solid.js bindings for SSGOI - Native app-like page transitions for Solid applications",
5
5
  "private": false,
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@ssgoi/core": "^6.6.10"
42
+ "@ssgoi/core": "^7.0.1-beta.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@eslint/js": "^9.30.1",