@ssgoi/angular 6.6.10 → 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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -112
  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,162 +1,125 @@
1
1
  # @ssgoi/angular
2
2
 
3
- Angular bindings for SSGOI that give any Angular 20+ app native-feeling page transitions powered by the `@ssgoi/core` animation engine.
3
+ Angular 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
- ## AI-Assisted Setup
8
-
9
- Using Claude, Cursor, ChatGPT, or another AI assistant? Point it at:
10
-
11
- ```
12
- https://ssgoi.dev/llms.txt
13
- ```
14
-
15
- It has the full setup guide, every transition, the API, and troubleshooting — everything an agent needs to wire SSGOI into your app.
16
-
17
- ## Installation
7
+ [Live demos](https://ssgoi.dev) · [Hero, Zoom, Film, and Sheet in motion](https://ssgoi.dev/blog/view-transition-api-limitations)
18
8
 
19
9
  ```bash
20
10
  npm install @ssgoi/angular
21
- # or
22
- pnpm add @ssgoi/angular
23
- # or
24
- yarn add @ssgoi/angular
25
11
  ```
26
12
 
27
- ## What You Get
28
-
29
- - `Ssgoi` directive (selector: `[ssgoi]`) that bootstraps the core transition context on the client and gracefully no-ops during SSR.
30
- - `data-ssgoi-transition` route markers discovered automatically inside `[ssgoi]`.
31
- - Deprecated `SsgoiTransition` directive (selector: `[ssgoiTransition]`) kept for backward compatibility.
32
- - `injectSsgoi()` helper and `SSGOI_CONTEXT` injection token for retrieving the transition context anywhere in your component tree.
33
- - Re-exported transition factories under `@ssgoi/angular/view-transitions`.
13
+ Agent setup guide: https://ssgoi.dev/llms.txt
34
14
 
35
- ## Quick Start
15
+ ## Setup
36
16
 
37
- ### 1. Provide the transition context once
17
+ Create one SSGOI root above the router outlet.
38
18
 
39
- ```typescript
19
+ ```ts
40
20
  import { Component, signal } from "@angular/core";
41
21
  import { RouterOutlet } from "@angular/router";
42
- import { Ssgoi, SsgoiConfig } from "@ssgoi/angular";
43
- import { fade } from "@ssgoi/angular/view-transitions";
22
+ import { Ssgoi, type SsgoiConfig } from "@ssgoi/angular";
23
+ import { drill } from "@ssgoi/angular/view-transitions";
44
24
 
45
25
  @Component({
46
26
  selector: "app-root",
47
27
  standalone: true,
48
28
  imports: [RouterOutlet, Ssgoi],
49
29
  template: `
50
- <!-- position: relative + z-index: 0 are required (the outgoing page is cloned with position:absolute) -->
51
- <div
30
+ <main
52
31
  ssgoi
53
- [config]="ssgoiConfig()"
54
- style="position: relative; z-index: 0; min-height: 100vh"
32
+ [config]="config()"
33
+ style="position:relative;z-index:0;overflow-x:clip"
55
34
  >
56
35
  <router-outlet />
57
- </div>
36
+ </main>
58
37
  `,
59
38
  })
60
39
  export class AppComponent {
61
- protected readonly ssgoiConfig = signal<SsgoiConfig>({
62
- transitions: [fade({ paths: ["/home", "/about"] })],
40
+ protected readonly config = signal<SsgoiConfig>({
41
+ transitions: [{ on: "/posts/**", except: "/posts", transition: drill() }],
63
42
  });
64
43
  }
65
44
  ```
66
45
 
67
- ### 2. Mark each routed view
46
+ ## Route boundary
68
47
 
69
- ```typescript
70
- import { Component } from "@angular/core";
48
+ Mark the root element of each routed component.
71
49
 
50
+ ```ts
72
51
  @Component({
73
- selector: "app-home",
52
+ selector: "app-post",
74
53
  standalone: true,
75
54
  template: `
76
- <section data-ssgoi-transition="/home">
77
- <h1>Home Page</h1>
78
- </section>
55
+ <article data-ssgoi-transition="/posts/42">
56
+ <!-- page -->
57
+ </article>
79
58
  `,
80
59
  })
81
- export class HomeComponent {}
60
+ export class PostComponent {}
82
61
  ```
83
62
 
84
- The `data-ssgoi-transition` value should uniquely identify the view (commonly the route path).
85
-
86
- ## How It Works
87
-
88
- - `Ssgoi` wraps `createSggoiTransitionContext` from `@ssgoi/core`, injects it via `SSGOI_CONTEXT`, and observes `data-ssgoi-transition` elements under the host. The directive guards against the server platform so SSR renders stay deterministic.
89
- - The deprecated `SsgoiTransition` directive still sets `data-ssgoi-transition` and registers the host directly for backward compatibility.
63
+ The id must match the config route patterns.
90
64
 
91
- Because everything is driven by signals, Angular change detection stays minimal and the bundle remains fully tree-shakeable.
65
+ ## Config
92
66
 
93
- ## API Reference
94
-
95
- - `Ssgoi`
96
- - `config: SsgoiConfig` (input, optional) – global transition configuration. Uses `{}` as default.
97
- - `host: HostAnimation | undefined` (input, optional) – external playback host for debug tooling.
98
- - `data-ssgoi-transition` – identifier for the target view/container.
99
- - `SsgoiTransition` is deprecated; use `data-ssgoi-transition` directly.
100
- - `injectSsgoi(): SsgoiContext` – returns the adapter context. During SSR it falls back to a no-op implementation so you can call it unconditionally.
101
-
102
- ## Available Transitions
103
-
104
- Import view-level factories from `@ssgoi/angular/view-transitions`:
105
-
106
- ```typescript
107
- import {
108
- fade,
109
- drill,
110
- slide,
111
- scroll,
112
- axis,
113
- sheet,
114
- hero,
115
- zoom,
116
- strip,
117
- blind,
118
- film,
119
- rotate,
120
- jaemin,
121
- } from "@ssgoi/angular/view-transitions";
122
- ```
123
-
124
- - `fade()` - Calm cross-fade. Safe default for unrelated pages
125
- - `drill()` - iOS-style hierarchical navigation (list → detail)
126
- - `slide()` - Horizontal push for tabs / sequential flows
127
- - `scroll()` - Vertical page scroll for onboarding / paginated views
128
- - `axis()` - Material/Flutter shared-axis swap for sibling/tab routes
129
- - `sheet()` - Bottom sheet that slides up (modal-like flows)
130
- - `hero()` - Shared element transition (matching `data-hero-enter-key` / `data-hero-exit-key`)
131
- - `zoom()` - Card-to-detail expansion (matching `data-zoom-enter-key` / `data-zoom-exit-key`)
132
- - `strip()` - 3D Y-axis perspective flip
133
- - `blind()` - Window-blinds wipe reveal
134
- - `film()` - Cinematic shrink + tile (gallery / lightbox)
135
- - `rotate()` - Card flip between siblings
136
- - `jaemin()` - Playful rotated zoom for special moments
137
-
138
- Each factory takes the unified config: `{ paths }` (symmetric), `{ enter, exit, type? }` (directional, e.g. `drill`/`sheet`), or `{ paths }` with order deciding direction (`slide`/`scroll`/`axis`).
139
-
140
- ## Sample Configuration
141
-
142
- ```typescript
143
- import { fade, scroll } from "@ssgoi/angular/view-transitions";
67
+ ```ts
144
68
  import type { SsgoiConfig } from "@ssgoi/angular";
69
+ import { drill, slide, zoom } from "@ssgoi/angular/view-transitions";
145
70
 
146
- export const config: SsgoiConfig = {
71
+ const config: SsgoiConfig = {
147
72
  transitions: [
148
- fade({ paths: ["/", "/home"] }),
149
- scroll({ paths: ["/home", "/about"] }),
73
+ {
74
+ on: "/posts/**",
75
+ except: "/posts",
76
+ transition: drill(),
77
+ },
78
+ {
79
+ from: "/gallery",
80
+ to: "/gallery/*",
81
+ transition: zoom(),
82
+ },
83
+ {
84
+ ordered: ["/tabs/a", "/tabs/b"],
85
+ transition: slide(),
86
+ },
150
87
  ],
151
88
  };
152
89
  ```
153
90
 
154
- ## License
155
-
156
- MIT © MeurSyphus
91
+ - `on`: route family.
92
+ - `from`/`to`: precise pair.
93
+ - `ordered`: directional sequence.
94
+ - Scroll is automatic: `on` and `from`/`to` restore `from` and reset `to`;
95
+ `ordered` restores both. Override with
96
+ `preserveScroll: { from: boolean, to: boolean }`.
97
+ - Patterns support exact paths, a `*` path segment, and suffix `**`.
98
+ - Higher `priority` wins before path specificity.
99
+
100
+ ## Effect index
101
+
102
+ - `fade`: unrelated pages.
103
+ - `drill`: list → detail.
104
+ - `slide`: ordered tabs.
105
+ - `axis`: sibling destinations.
106
+ - `sheet`: modal-like routes.
107
+ - `zoom`: card/image → detail.
108
+ - `hero`: shared elements and page chrome.
109
+ - `scroll`: vertical sequences.
110
+ - `strip`, `film`, `rotate`, `blind`, `jaemin`: expressive transitions.
111
+
112
+ Options: https://ssgoi.dev/llms.txt#7-transition-index
113
+
114
+ ## API
115
+
116
+ - `[ssgoi]`: creates the root transition context.
117
+ - `[config]`: accepts `SsgoiConfig`.
118
+ - `[host]`: accepts an optional `HostAnimation`.
119
+ - `data-ssgoi-transition`: marks a route boundary.
120
+ - `injectSsgoi()`: returns the transition context.
121
+ - `[ssgoiTransition]`: deprecated; use the data attribute.
157
122
 
158
- ## Links
123
+ ## License
159
124
 
160
- - [Documentation](https://ssgoi.dev)
161
- - [GitHub](https://github.com/meursyphus/ssgoi)
162
- - [Issues](https://github.com/meursyphus/ssgoi/issues)
125
+ MIT
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ssgoi/angular",
3
- "version": "6.6.10",
3
+ "version": "7.0.0",
4
4
  "description": "Angular bindings for SSGOI - Native app-like page transitions for Angular applications",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "types": "./dist/index.d.ts",
8
8
  "dependencies": {
9
- "@ssgoi/core": "^6.6.10"
9
+ "@ssgoi/core": "^7.0.0"
10
10
  },
11
11
  "peerDependencies": {
12
12
  "@angular/common": "^20.0.0",