@ssgoi/svelte 2.1.2 → 2.2.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 CHANGED
@@ -35,8 +35,8 @@ pnpm add @ssgoi/svelte
35
35
  ```svelte
36
36
  <!-- +layout.svelte -->
37
37
  <script>
38
- import { Ssgoi } from '@ssgoi/svelte';
39
- import { fade } from '@ssgoi/svelte/view-transitions';
38
+ import { Ssgoi } from "@ssgoi/svelte";
39
+ import { fade } from "@ssgoi/svelte/view-transitions";
40
40
  </script>
41
41
 
42
42
  <Ssgoi config={{ defaultTransition: fade() }}>
@@ -52,8 +52,8 @@ pnpm add @ssgoi/svelte
52
52
  ```svelte
53
53
  <!-- +page.svelte -->
54
54
  <script>
55
- import { SsgoiTransition } from '@ssgoi/svelte';
56
- import { page } from '$app/stores';
55
+ import { SsgoiTransition } from "@ssgoi/svelte";
56
+ import { page } from "$app/stores";
57
57
  </script>
58
58
 
59
59
  <SsgoiTransition id={$page.url.pathname}>
@@ -72,22 +72,35 @@ Define different transitions for different routes:
72
72
 
73
73
  ```svelte
74
74
  <script>
75
- import { Ssgoi } from '@ssgoi/svelte';
76
- import { slide, fade, scale, pinterest } from '@ssgoi/svelte/view-transitions';
75
+ import { Ssgoi } from "@ssgoi/svelte";
76
+ import {
77
+ scroll,
78
+ fade,
79
+ drill,
80
+ pinterest,
81
+ } from "@ssgoi/svelte/view-transitions";
77
82
 
78
83
  const config = {
79
84
  transitions: [
80
- // Slide between tabs
81
- { from: '/home', to: '/about', transition: slide({ direction: 'left' }) },
82
- { from: '/about', to: '/home', transition: slide({ direction: 'right' }) },
83
-
84
- // Scale up when entering details
85
- { from: '/products', to: '/products/*', transition: scale() },
86
-
85
+ // Scroll between tabs
86
+ { from: "/home", to: "/about", transition: scroll({ direction: "up" }) },
87
+ {
88
+ from: "/about",
89
+ to: "/home",
90
+ transition: scroll({ direction: "down" }),
91
+ },
92
+
93
+ // Drill in when entering details
94
+ {
95
+ from: "/products",
96
+ to: "/products/*",
97
+ transition: drill({ direction: "enter" }),
98
+ },
99
+
87
100
  // Pinterest-style image transitions
88
- { from: '/gallery', to: '/photo/*', transition: pinterest() }
101
+ { from: "/gallery", to: "/photo/*", transition: pinterest() },
89
102
  ],
90
- defaultTransition: fade()
103
+ defaultTransition: fade(),
91
104
  };
92
105
  </script>
93
106
 
@@ -103,8 +116,8 @@ Automatically create bidirectional transitions:
103
116
  ```svelte
104
117
  {
105
118
  from: '/home',
106
- to: '/about',
107
- transition: slide({ direction: 'left' }),
119
+ to: '/about',
120
+ transition: scroll({ direction: 'up' }),
108
121
  symmetric: true // Automatically creates reverse transition
109
122
  }
110
123
  ```
@@ -115,15 +128,17 @@ Animate specific elements during mount/unmount:
115
128
 
116
129
  ```svelte
117
130
  <script>
118
- import { transition } from '@ssgoi/svelte';
119
- import { fadeIn, slideUp } from '@ssgoi/svelte/transitions';
131
+ import { transition } from "@ssgoi/svelte";
132
+ import { fadeIn, slideUp } from "@ssgoi/svelte/transitions";
120
133
  </script>
121
134
 
122
- <div use:transition={{
123
- key: 'card',
124
- in: fadeIn(),
125
- out: slideUp()
126
- }}>
135
+ <div
136
+ use:transition={{
137
+ key: "card",
138
+ in: fadeIn(),
139
+ out: slideUp(),
140
+ }}
141
+ >
127
142
  <h2>Animated Card</h2>
128
143
  </div>
129
144
  ```
@@ -134,11 +149,11 @@ Animate specific elements during mount/unmount:
134
149
  <!-- +layout.svelte -->
135
150
  <script>
136
151
  import { Ssgoi } from '@ssgoi/svelte';
137
- import { slide } from '@ssgoi/svelte/view-transitions';
152
+ import { scroll } from '@ssgoi/svelte/view-transitions';
138
153
  </script>
139
154
 
140
155
  <Ssgoi config={{
141
- defaultTransition: slide({ direction: 'left' })
156
+ defaultTransition: scroll({ direction: 'up' })
142
157
  }}>
143
158
  <div style="position: relative; min-height: 100vh;">
144
159
  <nav>
@@ -166,6 +181,7 @@ Animate specific elements during mount/unmount:
166
181
  ### Components
167
182
 
168
183
  #### `<Ssgoi>`
184
+
169
185
  The provider component that manages transition context.
170
186
 
171
187
  ```svelte
@@ -175,6 +191,7 @@ The provider component that manages transition context.
175
191
  ```
176
192
 
177
193
  #### `<SsgoiTransition>`
194
+
178
195
  Wrapper component for pages that should transition.
179
196
 
180
197
  ```svelte
@@ -186,14 +203,17 @@ Wrapper component for pages that should transition.
186
203
  ### Actions
187
204
 
188
205
  #### `use:transition`
206
+
189
207
  Apply transitions to individual elements.
190
208
 
191
209
  ```svelte
192
- <div use:transition={{
193
- key: 'unique-key',
194
- in: fadeIn(),
195
- out: fadeOut()
196
- }}>
210
+ <div
211
+ use:transition={{
212
+ key: "unique-key",
213
+ in: fadeIn(),
214
+ out: fadeOut(),
215
+ }}
216
+ >
197
217
  Content
198
218
  </div>
199
219
  ```
@@ -201,11 +221,12 @@ Apply transitions to individual elements.
201
221
  ### Stores
202
222
 
203
223
  #### `transitioning`
224
+
204
225
  Access transition state.
205
226
 
206
227
  ```svelte
207
228
  <script>
208
- import { transitioning } from '@ssgoi/svelte';
229
+ import { transitioning } from "@ssgoi/svelte";
209
230
  </script>
210
231
 
211
232
  {#if $transitioning}
@@ -216,14 +237,15 @@ Access transition state.
216
237
  ## Built-in Transitions
217
238
 
218
239
  ### Page Transitions (`@ssgoi/svelte/view-transitions`)
240
+
219
241
  - `fade()` - Smooth opacity transition
220
- - `slide()` - Directional sliding (left/right/up/down)
221
- - `scale()` - Zoom in/out effect
242
+ - `scroll()` - Vertical scrolling (up/down)
243
+ - `drill()` - Drill in/out effect (enter/exit)
222
244
  - `hero()` - Shared element transitions
223
245
  - `pinterest()` - Pinterest-style expand effect
224
- - `ripple()` - Material Design ripple effect
225
246
 
226
247
  ### Element Transitions (`@ssgoi/svelte/transitions`)
248
+
227
249
  - `fadeIn()` / `fadeOut()`
228
250
  - `slideUp()` / `slideDown()` / `slideLeft()` / `slideRight()`
229
251
  - `scaleIn()` / `scaleOut()`
@@ -237,12 +259,12 @@ All transitions use spring physics for natural motion:
237
259
 
238
260
  ```javascript
239
261
  slide({
240
- direction: 'left',
262
+ direction: "left",
241
263
  spring: {
242
- stiffness: 300, // 1-1000, higher = faster
243
- damping: 30 // 0-100, higher = less oscillation
244
- }
245
- })
264
+ stiffness: 300, // 1-1000, higher = faster
265
+ damping: 30, // 0-100, higher = less oscillation
266
+ },
267
+ });
246
268
  ```
247
269
 
248
270
  ## TypeScript Support
@@ -250,7 +272,7 @@ slide({
250
272
  SSGOI is written in TypeScript and provides full type definitions:
251
273
 
252
274
  ```typescript
253
- import type { SsgoiConfig, TransitionConfig } from '@ssgoi/svelte';
275
+ import type { SsgoiConfig, TransitionConfig } from "@ssgoi/svelte";
254
276
 
255
277
  const config: SsgoiConfig = {
256
278
  // Full type safety
@@ -274,6 +296,7 @@ const config: SsgoiConfig = {
274
296
  ## Documentation
275
297
 
276
298
  Visit [https://ssgoi.dev](https://ssgoi.dev) for:
299
+
277
300
  - Complete API reference
278
301
  - Interactive examples
279
302
  - Advanced patterns
@@ -285,4 +308,4 @@ We welcome contributions! Please see our [contributing guide](https://github.com
285
308
 
286
309
  ## License
287
310
 
288
- MIT © [MeurSyphus](https://github.com/meursyphus)
311
+ MIT © [MeurSyphus](https://github.com/meursyphus)
package/dist/context.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { SsgoiContext } from './types.js';
1
+ import type { SsgoiContext } from "./types.js";
2
2
  export declare function setSsgoiContext(context: SsgoiContext): void;
3
3
  export declare function getSsgoiContext(): SsgoiContext;
package/dist/context.js CHANGED
@@ -1,12 +1,12 @@
1
- import { getContext, setContext } from 'svelte';
2
- var SSGOI_CONTEXT_KEY = Symbol('ssgoi');
1
+ import { getContext, setContext } from "svelte";
2
+ var SSGOI_CONTEXT_KEY = Symbol("ssgoi");
3
3
  export function setSsgoiContext(context) {
4
4
  setContext(SSGOI_CONTEXT_KEY, context);
5
5
  }
6
6
  export function getSsgoiContext() {
7
7
  var context = getContext(SSGOI_CONTEXT_KEY);
8
8
  if (!context) {
9
- throw new Error('getSsgoiContext must be called within Ssgoi component');
9
+ throw new Error("getSsgoiContext must be called within Ssgoi component");
10
10
  }
11
11
  return context;
12
12
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { transition } from './transition.js';
2
- export { default as Ssgoi } from './ssgoi.svelte';
3
- export { default as SsgoiTransition } from './ssgoi-transition.svelte';
4
- export * from './types.js';
1
+ export { transition } from "./transition.js";
2
+ export { default as Ssgoi } from "./ssgoi.svelte";
3
+ export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
4
+ export * from "./types.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { transition } from './transition.js';
2
- export { default as Ssgoi } from './ssgoi.svelte';
3
- export { default as SsgoiTransition } from './ssgoi-transition.svelte';
4
- export * from './types.js';
1
+ export { transition } from "./transition.js";
2
+ export { default as Ssgoi } from "./ssgoi.svelte";
3
+ export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
4
+ export * from "./types.js";
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import { transition } from './transition';
3
- import { getSsgoiContext } from './context';
2
+ import { transition } from "./transition";
3
+ import { getSsgoiContext } from "./context";
4
4
 
5
5
  interface Props {
6
6
  id: string;
@@ -9,16 +9,16 @@
9
9
  class?: string;
10
10
  }
11
11
 
12
- let { id, children, as = 'div', class: className }: Props = $props();
12
+ let { id, children, as = "div", class: className }: Props = $props();
13
13
 
14
14
  const getTransition = getSsgoiContext();
15
15
  </script>
16
16
 
17
- <svelte:element
18
- this={as}
19
- use:transition={getTransition(id)}
17
+ <svelte:element
18
+ this={as}
19
+ use:transition={getTransition(id)}
20
20
  data-ssgoi-transition={id}
21
21
  class={className}
22
22
  >
23
23
  {@render children()}
24
- </svelte:element>
24
+ </svelte:element>
package/dist/ssgoi.svelte CHANGED
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import type { SsgoiConfig } from '@ssgoi/core/types';
3
- import { setSsgoiContext } from './context';
4
- import { createSggoiTransitionContext } from '@ssgoi/core';
2
+ import type { SsgoiConfig } from "@ssgoi/core/types";
3
+ import { setSsgoiContext } from "./context";
4
+ import { createSggoiTransitionContext } from "@ssgoi/core";
5
5
 
6
6
  interface Props {
7
7
  config: SsgoiConfig;
@@ -14,4 +14,4 @@
14
14
  setSsgoiContext(contextValue);
15
15
  </script>
16
16
 
17
- {@render children()}
17
+ {@render children()}
@@ -1,4 +1,4 @@
1
- import type { SsgoiConfig } from '@ssgoi/core/types';
1
+ import type { SsgoiConfig } from "@ssgoi/core/types";
2
2
  interface Props {
3
3
  config: SsgoiConfig;
4
4
  children: () => any;
@@ -1,4 +1,4 @@
1
- import { type Transition, type TransitionKey } from '@ssgoi/core';
1
+ import { type Transition, type TransitionKey } from "@ssgoi/core";
2
2
  export declare const transition: <TAnimationValue = number>(node: HTMLElement, params: Transition<undefined, TAnimationValue> & {
3
3
  key?: TransitionKey;
4
4
  }) => {
@@ -1,10 +1,10 @@
1
- import { transition as _transition } from '@ssgoi/core';
1
+ import { transition as _transition, } from "@ssgoi/core";
2
2
  export var transition = function (node, params) {
3
3
  var callback = _transition({
4
4
  key: params === null || params === void 0 ? void 0 : params.key,
5
5
  in: params === null || params === void 0 ? void 0 : params.in,
6
6
  out: params === null || params === void 0 ? void 0 : params.out,
7
- ref: node
7
+ ref: node,
8
8
  });
9
9
  var cleanup = callback(node);
10
10
  return {
@@ -13,12 +13,12 @@ export var transition = function (node, params) {
13
13
  key: newParams === null || newParams === void 0 ? void 0 : newParams.key,
14
14
  in: newParams === null || newParams === void 0 ? void 0 : newParams.in,
15
15
  out: newParams === null || newParams === void 0 ? void 0 : newParams.out,
16
- ref: node
16
+ ref: node,
17
17
  });
18
18
  cleanup = callback(node);
19
19
  },
20
20
  destroy: function () {
21
21
  cleanup === null || cleanup === void 0 ? void 0 : cleanup();
22
- }
22
+ },
23
23
  };
24
24
  };
@@ -1 +1 @@
1
- export * from '@ssgoi/core/transitions';
1
+ export * from "@ssgoi/core/transitions";
@@ -1 +1 @@
1
- export * from '@ssgoi/core/transitions';
1
+ export * from "@ssgoi/core/transitions";
@@ -1 +1 @@
1
- export * from '@ssgoi/core/view-transitions';
1
+ export * from "@ssgoi/core/view-transitions";
@@ -1 +1 @@
1
- export * from '@ssgoi/core/view-transitions';
1
+ export * from "@ssgoi/core/view-transitions";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/svelte",
3
- "version": "2.1.2",
3
+ "version": "2.2.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": "2.1.2"
17
+ "@ssgoi/core": "2.2.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "svelte": "^5.0.0"