@ssgoi/vue 6.6.6 → 7.0.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 +77 -174
- 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,230 +1,133 @@
|
|
|
1
1
|
# @ssgoi/vue
|
|
2
2
|
|
|
3
|
-
Vue bindings for SSGOI
|
|
3
|
+
Vue and Nuxt bindings for SSGOI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://ssgoi.dev)
|
|
6
6
|
|
|
7
|
-
|
|
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 Nuxt. No hydration issues, SEO-friendly
|
|
27
|
-
- **🎯 Use Your Router** - Keep your existing routing. Vue Router, Nuxt - all work seamlessly
|
|
28
|
-
- **💾 State Persistence** - Remembers animation state during navigation, even with browser back/forward
|
|
29
|
-
- **🖖 Vue Optimized** - Built specifically for Vue 3 with Composition API components
|
|
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/vue
|
|
35
|
-
# or
|
|
36
|
-
yarn add @ssgoi/vue
|
|
37
|
-
# or
|
|
38
|
-
pnpm add @ssgoi/vue
|
|
39
11
|
```
|
|
40
12
|
|
|
41
|
-
|
|
13
|
+
Agent setup guide: https://ssgoi.dev/llms/vue.txt
|
|
42
14
|
|
|
43
|
-
|
|
15
|
+
## Root
|
|
44
16
|
|
|
45
17
|
```vue
|
|
46
|
-
<
|
|
47
|
-
<Ssgoi :config="config">
|
|
48
|
-
<!-- position: relative + z-index: 0 are required (the outgoing page is cloned with position:absolute) -->
|
|
49
|
-
<div style="position: relative; z-index: 0">
|
|
50
|
-
<!-- Your app -->
|
|
51
|
-
<RouterView />
|
|
52
|
-
</div>
|
|
53
|
-
</Ssgoi>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<script setup>
|
|
18
|
+
<script setup lang="ts">
|
|
57
19
|
import { Ssgoi } from "@ssgoi/vue";
|
|
58
|
-
import {
|
|
20
|
+
import { drill } from "@ssgoi/vue/view-transitions";
|
|
59
21
|
|
|
60
22
|
const config = {
|
|
61
|
-
transitions: [
|
|
23
|
+
transitions: [{ on: "/posts/**", except: "/posts", transition: drill() }],
|
|
62
24
|
};
|
|
63
25
|
</script>
|
|
64
|
-
```
|
|
65
26
|
|
|
66
|
-
### 2. Mark your pages
|
|
67
|
-
|
|
68
|
-
```vue
|
|
69
27
|
<template>
|
|
70
|
-
<main
|
|
71
|
-
<
|
|
72
|
-
|
|
28
|
+
<main class="ssgoi-shell">
|
|
29
|
+
<Ssgoi :config="config">
|
|
30
|
+
<NuxtPage />
|
|
31
|
+
</Ssgoi>
|
|
73
32
|
</main>
|
|
74
33
|
</template>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**That's it!** Your pages now transition smoothly with the configured effect.
|
|
78
|
-
|
|
79
|
-
## Advanced Transitions
|
|
80
|
-
|
|
81
|
-
### Route-based Transitions
|
|
82
|
-
|
|
83
|
-
Define different transitions for different routes:
|
|
84
34
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// Shared element image transitions
|
|
95
|
-
zoom({ paths: ["/gallery", "/photo/*"], type: "expand" }),
|
|
96
|
-
],
|
|
97
|
-
};
|
|
35
|
+
<style>
|
|
36
|
+
.ssgoi-shell {
|
|
37
|
+
position: relative;
|
|
38
|
+
z-index: 0;
|
|
39
|
+
min-height: 100dvh;
|
|
40
|
+
overflow-x: clip;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
98
43
|
```
|
|
99
44
|
|
|
100
|
-
|
|
45
|
+
## Route boundary
|
|
101
46
|
|
|
102
|
-
|
|
47
|
+
Mark page roots:
|
|
103
48
|
|
|
104
49
|
```vue
|
|
105
|
-
<!-- app.vue -->
|
|
106
50
|
<template>
|
|
107
|
-
<
|
|
108
|
-
<div style="position: relative; z-index: 0; min-height: 100vh">
|
|
109
|
-
<NuxtPage />
|
|
110
|
-
</div>
|
|
111
|
-
</Ssgoi>
|
|
112
|
-
</template>
|
|
113
|
-
|
|
114
|
-
<script setup>
|
|
115
|
-
import { Ssgoi } from "@ssgoi/vue";
|
|
116
|
-
import { scroll } from "@ssgoi/vue/view-transitions";
|
|
117
|
-
|
|
118
|
-
const config = {
|
|
119
|
-
transitions: [scroll({ paths: ["/", "/about", "/products"] })],
|
|
120
|
-
};
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<!-- pages/index.vue -->
|
|
124
|
-
<template>
|
|
125
|
-
<main data-ssgoi-transition="/">
|
|
126
|
-
<!-- Your page content -->
|
|
127
|
-
</main>
|
|
51
|
+
<section data-ssgoi-transition="/posts">Posts</section>
|
|
128
52
|
</template>
|
|
129
53
|
```
|
|
130
54
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
### Components
|
|
134
|
-
|
|
135
|
-
#### `<Ssgoi>`
|
|
136
|
-
|
|
137
|
-
The provider component that manages transition context.
|
|
55
|
+
Dynamic route:
|
|
138
56
|
|
|
139
57
|
```vue
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
</
|
|
58
|
+
<section :data-ssgoi-transition="`/posts/${route.params.id}`">
|
|
59
|
+
...
|
|
60
|
+
</section>
|
|
143
61
|
```
|
|
144
62
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
- `config` - Transition configuration object
|
|
148
|
-
- `host` - Optional external playback host for debug tooling
|
|
149
|
-
|
|
150
|
-
#### `data-ssgoi-transition`
|
|
63
|
+
## Persistent layouts
|
|
151
64
|
|
|
152
|
-
|
|
153
|
-
|
|
65
|
+
Use the parent page/layout as the outer boundary and child page roots as inner
|
|
66
|
+
boundaries:
|
|
154
67
|
|
|
155
68
|
```vue
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
69
|
+
<template>
|
|
70
|
+
<section :data-ssgoi-transition="route.path">
|
|
71
|
+
<ProductTabs />
|
|
72
|
+
<NuxtPage />
|
|
73
|
+
</section>
|
|
74
|
+
</template>
|
|
159
75
|
```
|
|
160
76
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
### Page Transitions (`@ssgoi/vue/view-transitions`)
|
|
164
|
-
|
|
165
|
-
- `fade()` - Calm cross-fade. Safe default for unrelated pages
|
|
166
|
-
- `drill()` - iOS-style hierarchical navigation (list → detail)
|
|
167
|
-
- `slide()` - Horizontal push for tabs / sequential flows
|
|
168
|
-
- `scroll()` - Vertical page scroll for onboarding / paginated views
|
|
169
|
-
- `axis()` - Material/Flutter shared-axis swap for sibling/tab routes
|
|
170
|
-
- `sheet()` - Bottom sheet that slides up (modal-like flows)
|
|
171
|
-
- `hero()` - Shared element transition (matching `data-hero-enter-key` / `data-hero-exit-key`)
|
|
172
|
-
- `zoom()` - Card-to-detail expansion (matching `data-zoom-enter-key` / `data-zoom-exit-key`)
|
|
173
|
-
- `strip()` - 3D Y-axis perspective flip
|
|
174
|
-
- `blind()` - Window-blinds wipe reveal
|
|
175
|
-
- `film()` - Cinematic shrink + tile (gallery / lightbox)
|
|
176
|
-
- `rotate()` - Card flip between siblings
|
|
177
|
-
- `jaemin()` - Playful rotated zoom for special moments
|
|
77
|
+
Nuxt keeps the parent during child navigation. Leaving the parent uses the
|
|
78
|
+
outer boundary; changing a child route uses the child boundary.
|
|
178
79
|
|
|
179
|
-
|
|
80
|
+
If a Vue Router layout reuses the same component where a fresh DOM boundary is
|
|
81
|
+
required, use a resolved key:
|
|
180
82
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
paths: ["/products/all", "/products/fashion"],
|
|
186
|
-
});
|
|
83
|
+
```vue
|
|
84
|
+
<section :key="resolveKey(route.path)" :data-ssgoi-transition="route.path">
|
|
85
|
+
<RouterView />
|
|
86
|
+
</section>
|
|
187
87
|
```
|
|
188
88
|
|
|
189
|
-
##
|
|
190
|
-
|
|
191
|
-
SSGOI is written in TypeScript and provides full type definitions:
|
|
89
|
+
## Config
|
|
192
90
|
|
|
193
|
-
```
|
|
194
|
-
import
|
|
91
|
+
```ts
|
|
92
|
+
import { drill, slide, zoom } from "@ssgoi/vue/view-transitions";
|
|
195
93
|
|
|
196
|
-
const config
|
|
197
|
-
|
|
94
|
+
const config = {
|
|
95
|
+
transitions: [
|
|
96
|
+
{
|
|
97
|
+
on: "/posts/**",
|
|
98
|
+
except: "/posts",
|
|
99
|
+
transition: drill(),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
from: "/gallery",
|
|
103
|
+
to: "/gallery/*",
|
|
104
|
+
transition: zoom(),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
ordered: ["/tabs/a", "/tabs/b"],
|
|
108
|
+
transition: slide(),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
198
111
|
};
|
|
199
112
|
```
|
|
200
113
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- Firefox 78+
|
|
205
|
-
- Safari 14+
|
|
206
|
-
- All modern mobile browsers
|
|
207
|
-
|
|
208
|
-
## Performance
|
|
209
|
-
|
|
210
|
-
- Minimal bundle size (~8kb gzipped)
|
|
211
|
-
- Hardware-accelerated animations
|
|
212
|
-
- Automatic cleanup and memory management
|
|
213
|
-
- Smart preloading for instant transitions
|
|
214
|
-
|
|
215
|
-
## Documentation
|
|
114
|
+
Scroll is automatic: `on` and `from`/`to` restore `from` and reset `to`;
|
|
115
|
+
`ordered` restores both. Override with
|
|
116
|
+
`preserveScroll: { from: boolean, to: boolean }`.
|
|
216
117
|
|
|
217
|
-
|
|
118
|
+
## Effect index
|
|
218
119
|
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
120
|
+
- `fade`: unrelated pages.
|
|
121
|
+
- `drill`: list → detail.
|
|
122
|
+
- `slide` or `axis`: ordered tabs.
|
|
123
|
+
- `sheet`: modal-like routes.
|
|
124
|
+
- `zoom` or `hero`: shared-element details.
|
|
125
|
+
- `scroll`: vertical sequences.
|
|
223
126
|
|
|
224
|
-
|
|
127
|
+
All effects: https://ssgoi.dev/llms.txt#7-transition-index
|
|
225
128
|
|
|
226
|
-
|
|
129
|
+
`SsgoiTransition` is deprecated. Use the data attribute directly.
|
|
227
130
|
|
|
228
131
|
## License
|
|
229
132
|
|
|
230
|
-
MIT
|
|
133
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Vue bindings for SSGOI - Native app-like page transitions for Vue applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ssgoi/core": "^
|
|
36
|
+
"@ssgoi/core": "^7.0.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": "^3.5.0"
|