@ssgoi/svelte 7.4.0 → 7.4.1

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
@@ -1,6 +1,6 @@
1
1
  # @ssgoi/svelte
2
2
 
3
- Svelte and SvelteKit bindings for SSGOI.
3
+ Native app-like page transitions for Svelte and SvelteKit. Make a web app, PWA or WebView app (Capacitor, Tauri, Ionic) feel like a native app without replacing your router.
4
4
 
5
5
  [![SSGOI live showcase](https://ssgoi.dev/readme.png)](https://ssgoi.dev)
6
6
 
package/dist/context.d.ts CHANGED
@@ -1,3 +1,14 @@
1
- import type { SsgoiContext } from "./types.js";
1
+ import { type Readable } from "svelte/store";
2
+ import type { SsgoiContext, SsgoiTransitionState } from "./types.js";
2
3
  export declare function setSsgoiContext(context: SsgoiContext): void;
3
4
  export declare function getSsgoiContext(): SsgoiContext;
5
+ /**
6
+ * Store of the provider's transition lifecycle: whether a page transition is
7
+ * preparing or playing, and which routes it joins.
8
+ *
9
+ * Use it to defer work that would fight the animation, such as a programmatic
10
+ * scroll on the arriving page, until the status returns to `"idle"`.
11
+ *
12
+ * Must be called during component initialisation, under `<Ssgoi>`.
13
+ */
14
+ export declare function getSsgoiTransition(): Readable<SsgoiTransitionState>;
package/dist/context.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { getContext, setContext } from "svelte";
2
+ import { readable } from "svelte/store";
2
3
  var SSGOI_CONTEXT_KEY = Symbol("ssgoi");
3
4
  export function setSsgoiContext(context) {
4
5
  setContext(SSGOI_CONTEXT_KEY, context);
@@ -10,3 +11,22 @@ export function getSsgoiContext() {
10
11
  }
11
12
  return context;
12
13
  }
14
+ /**
15
+ * Store of the provider's transition lifecycle: whether a page transition is
16
+ * preparing or playing, and which routes it joins.
17
+ *
18
+ * Use it to defer work that would fight the animation, such as a programmatic
19
+ * scroll on the arriving page, until the status returns to `"idle"`.
20
+ *
21
+ * Must be called during component initialisation, under `<Ssgoi>`.
22
+ */
23
+ export function getSsgoiTransition() {
24
+ var context = getContext(SSGOI_CONTEXT_KEY);
25
+ if (!context) {
26
+ throw new Error("getSsgoiTransition must be called within Ssgoi component");
27
+ }
28
+ return readable(context.getTransitionState(), function (set) {
29
+ set(context.getTransitionState());
30
+ return context.subscribe(set);
31
+ });
32
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as Ssgoi } from "./ssgoi.svelte";
2
+ export { getSsgoiTransition } from "./context.js";
2
3
  /** @deprecated Set `data-ssgoi-transition` directly on an element inside `<Ssgoi>` instead. */
3
4
  export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
4
5
  export * from "./types.js";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as Ssgoi } from "./ssgoi.svelte";
2
+ export { getSsgoiTransition } from "./context.js";
2
3
  /** @deprecated Set `data-ssgoi-transition` directly on an element inside `<Ssgoi>` instead. */
3
4
  export { default as SsgoiTransition } from "./ssgoi-transition.svelte";
4
5
  export * from "./types.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ssgoi/svelte",
3
- "version": "7.4.0",
4
- "description": "Svelte bindings for SSGOI - Native app-like page transitions for Svelte and SvelteKit applications",
3
+ "version": "7.4.1",
4
+ "description": "Native app-like page transitions for Svelte and SvelteKit. Make a web app, PWA or WebView app feel native.",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -14,7 +14,7 @@
14
14
  "types": "./dist/index.d.ts",
15
15
  "type": "module",
16
16
  "dependencies": {
17
- "@ssgoi/core": "^7.4.0"
17
+ "@ssgoi/core": "^7.4.1"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "svelte": "^5.0.0",
@@ -47,15 +47,24 @@
47
47
  "sveltekit",
48
48
  "page-transition",
49
49
  "page-transitions",
50
+ "route-transition",
51
+ "navigation-animation",
52
+ "native-app",
53
+ "app-like",
54
+ "mobile-web",
55
+ "webview",
56
+ "pwa",
57
+ "capacitor",
58
+ "react-native-webview",
59
+ "hybrid-app",
50
60
  "view-transitions",
51
61
  "view-transition-api-alternative",
52
- "animation",
53
- "ssgoi",
54
- "spring-physics",
55
- "cross-browser",
56
- "navigation-animation",
62
+ "shared-element-transition",
57
63
  "hero-transition",
58
- "shared-element-transition"
64
+ "spring-physics",
65
+ "web-animations",
66
+ "animation",
67
+ "ssgoi"
59
68
  ],
60
69
  "author": "MeurSyphus <tmdeoans@snu.ac.kr>",
61
70
  "license": "MIT",