@ssgoi/qwik 6.6.10 → 7.0.1-beta.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 +83 -42
- 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,84 +1,125 @@
|
|
|
1
1
|
# @ssgoi/qwik
|
|
2
2
|
|
|
3
|
-
Qwik
|
|
3
|
+
Qwik and Qwik City bindings for SSGOI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://ssgoi.dev)
|
|
6
6
|
|
|
7
|
-
https://ssgoi.dev/
|
|
8
|
-
|
|
9
|
-
## Install
|
|
7
|
+
[Live demos](https://ssgoi.dev) · [Hero, Zoom, Film, and Sheet in motion](https://ssgoi.dev/blog/view-transition-api-limitations)
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
10
|
npm install @ssgoi/qwik
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
Agent setup guide: https://ssgoi.dev/llms/qwik.txt
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
## Root
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
Qwik configs contain functions, so pass a QRL factory.
|
|
20
18
|
|
|
21
19
|
```tsx
|
|
22
20
|
import { $, Slot, component$, useSignal } from "@builder.io/qwik";
|
|
23
|
-
import { Link, useLocation } from "@builder.io/qwik-city";
|
|
24
21
|
import { useSsgoi } from "@ssgoi/qwik";
|
|
25
|
-
import { drill
|
|
22
|
+
import { drill } from "@ssgoi/qwik/view-transitions";
|
|
26
23
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
transitions: [
|
|
30
|
-
zoom({ paths: ["/gallery", "/gallery/*"], type: "expand" }),
|
|
31
|
-
drill({ enter: "/posts/*", exit: "/posts" }),
|
|
32
|
-
],
|
|
24
|
+
const config$ = $(() => ({
|
|
25
|
+
transitions: [{ on: "/posts/**", except: "/posts", transition: drill() }],
|
|
33
26
|
}));
|
|
34
27
|
|
|
35
28
|
export default component$(() => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
useSsgoi(ssgoiRoot, { config$: ssgoiConfig$ });
|
|
29
|
+
const root = useSignal<HTMLElement>();
|
|
30
|
+
useSsgoi(root, { config$ });
|
|
40
31
|
|
|
41
32
|
return (
|
|
42
|
-
<main
|
|
43
|
-
ref={ssgoiRoot}
|
|
44
|
-
class="relative z-0 h-dvh overflow-y-auto overflow-x-clip"
|
|
45
|
-
>
|
|
33
|
+
<main ref={root} class="relative z-0 min-h-dvh overflow-x-clip">
|
|
46
34
|
<Slot />
|
|
47
|
-
<Link href="/posts/">Posts</Link>
|
|
48
|
-
<p>{location.url.pathname}</p>
|
|
49
35
|
</main>
|
|
50
36
|
);
|
|
51
37
|
});
|
|
52
38
|
```
|
|
53
39
|
|
|
54
|
-
|
|
40
|
+
## Route boundary
|
|
41
|
+
|
|
42
|
+
Mark route component roots:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
export default component$(() => (
|
|
46
|
+
<section data-ssgoi-transition="/posts">Posts</section>
|
|
47
|
+
));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Dynamic route:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<section data-ssgoi-transition={`/posts/${postId}`}>...</section>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Persistent layouts
|
|
57
|
+
|
|
58
|
+
Put an outer marker in the persistent route layout and markers on child route
|
|
59
|
+
roots:
|
|
55
60
|
|
|
56
61
|
```tsx
|
|
57
62
|
export default component$(() => {
|
|
63
|
+
const location = useLocation();
|
|
64
|
+
const pathname = location.url.pathname.replace(/\/$/, "");
|
|
65
|
+
|
|
58
66
|
return (
|
|
59
|
-
<section data-ssgoi-transition=
|
|
60
|
-
|
|
67
|
+
<section data-ssgoi-transition={pathname}>
|
|
68
|
+
<ProductTabs />
|
|
69
|
+
<Slot />
|
|
61
70
|
</section>
|
|
62
71
|
);
|
|
63
72
|
});
|
|
64
73
|
```
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
Qwik City replaces child route roots under `<Slot />`. Child navigation uses
|
|
76
|
+
the child boundary; leaving the layout uses the outer boundary.
|
|
77
|
+
|
|
78
|
+
## Config
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { $ } from "@builder.io/qwik";
|
|
82
|
+
import { drill, slide, zoom } from "@ssgoi/qwik/view-transitions";
|
|
83
|
+
|
|
84
|
+
const config$ = $(() => ({
|
|
85
|
+
transitions: [
|
|
86
|
+
{
|
|
87
|
+
on: "/posts/**",
|
|
88
|
+
except: "/posts",
|
|
89
|
+
transition: drill(),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
from: "/gallery",
|
|
93
|
+
to: "/gallery/*",
|
|
94
|
+
transition: zoom(),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
ordered: ["/tabs/a", "/tabs/b"],
|
|
98
|
+
transition: slide(),
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
}));
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Scroll is automatic: `on` and `from`/`to` restore `from` and reset `to`;
|
|
105
|
+
`ordered` restores both. Override with
|
|
106
|
+
`preserveScroll: { from: boolean, to: boolean }`.
|
|
67
107
|
|
|
68
|
-
##
|
|
108
|
+
## Effect index
|
|
69
109
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
110
|
+
- `fade`: unrelated pages.
|
|
111
|
+
- `drill`: list → detail.
|
|
112
|
+
- `slide` or `axis`: ordered tabs.
|
|
113
|
+
- `sheet`: modal-like routes.
|
|
114
|
+
- `zoom` or `hero`: shared-element details.
|
|
115
|
+
- `scroll`: vertical sequences.
|
|
74
116
|
|
|
75
|
-
|
|
117
|
+
All effects: https://ssgoi.dev/llms.txt#7-transition-index
|
|
76
118
|
|
|
77
|
-
|
|
119
|
+
`Ssgoi` remains available for concrete projected children. In Qwik City route
|
|
120
|
+
layouts, prefer `useSsgoi()` so `<Slot />` stays directly under the observed
|
|
121
|
+
root.
|
|
78
122
|
|
|
79
|
-
|
|
123
|
+
## License
|
|
80
124
|
|
|
81
|
-
|
|
82
|
-
2. Confirm `config$` is created with Qwik `$`.
|
|
83
|
-
3. Confirm the SSGOI root contains the route `<Slot />` directly.
|
|
84
|
-
4. Confirm every routed page has a `data-ssgoi-transition` value that matches your transition config.
|
|
125
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/qwik",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1-beta.0",
|
|
4
4
|
"description": "Qwik bindings for SSGOI - Native app-like page transitions for Qwik and Qwik City applications",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lib-types"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ssgoi/core": "^
|
|
33
|
+
"@ssgoi/core": "^7.0.1-beta.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@builder.io/qwik": "^1.20.0"
|