@ssgoi/svelte 6.3.0 → 6.5.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/README.md +36 -20
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/ssgoi-transition.svelte +4 -0
- package/dist/ssgoi-transition.svelte.d.ts +4 -0
- package/dist/ssgoi.svelte +12 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,16 @@ try this: [ssgoi.dev](https://ssgoi.dev)
|
|
|
6
6
|
|
|
7
7
|

|
|
8
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
|
+
|
|
9
19
|
## What is SSGOI?
|
|
10
20
|
|
|
11
21
|
SSGOI brings native app-like page transitions to the web. Transform your static page navigations into smooth, delightful experiences that users love.
|
|
@@ -44,26 +54,25 @@ pnpm add @ssgoi/svelte
|
|
|
44
54
|
</script>
|
|
45
55
|
|
|
46
56
|
<Ssgoi {config}>
|
|
47
|
-
<!-- ⚠️ Important: position: relative
|
|
48
|
-
<div style="position: relative; min-height: 100vh;">
|
|
57
|
+
<!-- ⚠️ Important: position: relative + z-index: 0 are required (the outgoing page is cloned with position:absolute). Add overflow-x-clip if you use horizontal transitions. -->
|
|
58
|
+
<div style="position: relative; z-index: 0; min-height: 100vh;">
|
|
49
59
|
<slot />
|
|
50
60
|
</div>
|
|
51
61
|
</Ssgoi>
|
|
52
62
|
```
|
|
53
63
|
|
|
54
|
-
### 2.
|
|
64
|
+
### 2. Mark your pages
|
|
55
65
|
|
|
56
66
|
```svelte
|
|
57
67
|
<!-- +page.svelte -->
|
|
58
68
|
<script>
|
|
59
|
-
import { SsgoiTransition } from "@ssgoi/svelte";
|
|
60
69
|
import { page } from "$app/stores";
|
|
61
70
|
</script>
|
|
62
71
|
|
|
63
|
-
<
|
|
72
|
+
<main data-ssgoi-transition={$page.url.pathname}>
|
|
64
73
|
<h1>Welcome</h1>
|
|
65
74
|
<!-- Page content -->
|
|
66
|
-
</
|
|
75
|
+
</main>
|
|
67
76
|
```
|
|
68
77
|
|
|
69
78
|
**That's it!** Your pages now transition smoothly with the configured effect.
|
|
@@ -114,7 +123,7 @@ The route helpers return path transition groups, so nested arrays are accepted i
|
|
|
114
123
|
</script>
|
|
115
124
|
|
|
116
125
|
<Ssgoi {config}>
|
|
117
|
-
<div style="position: relative; min-height: 100vh;">
|
|
126
|
+
<div style="position: relative; z-index: 0; min-height: 100vh;">
|
|
118
127
|
<nav>
|
|
119
128
|
<a href="/">Home</a>
|
|
120
129
|
<a href="/about">About</a>
|
|
@@ -126,13 +135,12 @@ The route helpers return path transition groups, so nested arrays are accepted i
|
|
|
126
135
|
|
|
127
136
|
<!-- +page.svelte -->
|
|
128
137
|
<script>
|
|
129
|
-
import { SsgoiTransition } from '@ssgoi/svelte';
|
|
130
138
|
import { page } from '$app/stores';
|
|
131
139
|
</script>
|
|
132
140
|
|
|
133
|
-
<
|
|
141
|
+
<main data-ssgoi-transition={$page.url.pathname}>
|
|
134
142
|
<!-- Your page content -->
|
|
135
|
-
</
|
|
143
|
+
</main>
|
|
136
144
|
```
|
|
137
145
|
|
|
138
146
|
## API Reference
|
|
@@ -154,26 +162,34 @@ Props:
|
|
|
154
162
|
- `config` - Transition configuration object
|
|
155
163
|
- `host` - Optional external playback host for debug tooling
|
|
156
164
|
|
|
157
|
-
####
|
|
165
|
+
#### `data-ssgoi-transition`
|
|
158
166
|
|
|
159
|
-
|
|
167
|
+
Attribute for pages that should transition. Set it on the page boundary element
|
|
168
|
+
inside `<Ssgoi>`.
|
|
160
169
|
|
|
161
170
|
```svelte
|
|
162
|
-
<
|
|
171
|
+
<main data-ssgoi-transition="/page-id">
|
|
163
172
|
<slot />
|
|
164
|
-
</
|
|
173
|
+
</main>
|
|
165
174
|
```
|
|
166
175
|
|
|
167
176
|
## Built-in Transitions
|
|
168
177
|
|
|
169
178
|
### Page Transitions (`@ssgoi/svelte/view-transitions`)
|
|
170
179
|
|
|
171
|
-
- `fade()` -
|
|
172
|
-
- `
|
|
173
|
-
- `
|
|
174
|
-
- `
|
|
175
|
-
- `
|
|
176
|
-
- `
|
|
180
|
+
- `fade()` - Calm cross-fade. Safe default for unrelated pages
|
|
181
|
+
- `drill()` - iOS-style hierarchical navigation (list → detail)
|
|
182
|
+
- `slide()` - Horizontal push for tabs / sequential flows
|
|
183
|
+
- `scroll()` - Vertical page scroll for onboarding / paginated views
|
|
184
|
+
- `axis()` - Material/Flutter shared-axis swap for sibling/tab routes
|
|
185
|
+
- `sheet()` - Bottom sheet that slides up (modal-like flows)
|
|
186
|
+
- `hero()` - Shared element transition (matching `data-hero-enter-key` / `data-hero-exit-key`)
|
|
187
|
+
- `zoom()` - Card-to-detail expansion (matching `data-zoom-enter-key` / `data-zoom-exit-key`)
|
|
188
|
+
- `strip()` - 3D Y-axis perspective flip
|
|
189
|
+
- `blind()` - Window-blinds wipe reveal
|
|
190
|
+
- `film()` - Cinematic shrink + tile (gallery / lightbox)
|
|
191
|
+
- `rotate()` - Card flip between siblings
|
|
192
|
+
- `jaemin()` - Playful rotated zoom for special moments
|
|
177
193
|
|
|
178
194
|
## Typed Preset Configuration
|
|
179
195
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Ssgoi } from "./ssgoi.svelte";
|
|
2
|
+
/** @deprecated Set `data-ssgoi-transition` directly on an element inside `<Ssgoi>` instead. */
|
|
2
3
|
export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
|
|
3
4
|
export * from "./types.js";
|
|
4
5
|
export * from "@ssgoi/core";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Ssgoi } from "./ssgoi.svelte";
|
|
2
|
+
/** @deprecated Set `data-ssgoi-transition` directly on an element inside `<Ssgoi>` instead. */
|
|
2
3
|
export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
|
|
3
4
|
export * from "./types.js";
|
|
4
5
|
export * from "@ssgoi/core";
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
3
|
import { getSsgoiContext } from "./context";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Set `data-ssgoi-transition` directly on the page boundary
|
|
7
|
+
* element inside `<Ssgoi>` instead.
|
|
8
|
+
*/
|
|
5
9
|
interface Props {
|
|
6
10
|
id: string;
|
|
7
11
|
children: Snippet;
|
package/dist/ssgoi.svelte
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
import type { SsgoiConfig } from "@ssgoi/core/types";
|
|
4
4
|
import type { HostAnimation } from "@ssgoi/core/internal";
|
|
5
5
|
import { setSsgoiContext } from "./context";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
createSggoiTransitionContext,
|
|
8
|
+
observeSsgoiTransitions,
|
|
9
|
+
} from "@ssgoi/core/internal";
|
|
10
|
+
import { onMount } from "svelte";
|
|
7
11
|
|
|
8
12
|
interface Props {
|
|
9
13
|
config: SsgoiConfig;
|
|
@@ -15,6 +19,12 @@
|
|
|
15
19
|
|
|
16
20
|
const contextValue = createSggoiTransitionContext(config, { host });
|
|
17
21
|
setSsgoiContext(contextValue);
|
|
22
|
+
|
|
23
|
+
let root: HTMLDivElement;
|
|
24
|
+
|
|
25
|
+
onMount(() => observeSsgoiTransitions(root, contextValue));
|
|
18
26
|
</script>
|
|
19
27
|
|
|
20
|
-
{
|
|
28
|
+
<div bind:this={root} data-ssgoi-root="" style="display: contents">
|
|
29
|
+
{@render children()}
|
|
30
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/svelte",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"description": "Svelte bindings for SSGOI - Native app-like page transitions for Svelte and SvelteKit applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ssgoi/core": "^6.
|
|
17
|
+
"@ssgoi/core": "^6.5.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"svelte": "^5.0.0"
|