@ssgoi/qwik 7.1.2 → 7.1.3-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/README.md +25 -9
- package/lib/qwik-city.qwik.cjs +12 -0
- package/lib/qwik-city.qwik.mjs +12 -0
- package/lib-types/routers/qwik-city.d.ts +11 -0
- package/lib-types/ssgoi-transition.d.ts +2 -2
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -12,6 +12,17 @@ npm install @ssgoi/qwik
|
|
|
12
12
|
|
|
13
13
|
Agent setup guide: https://ssgoi.dev/llms/qwik.txt
|
|
14
14
|
|
|
15
|
+
## Router helpers
|
|
16
|
+
|
|
17
|
+
Install this framework package once; router helpers are optional subpaths.
|
|
18
|
+
These router helpers are experimental APIs and may change.
|
|
19
|
+
|
|
20
|
+
| Router | Import | API |
|
|
21
|
+
| --------- | ----------------------- | ----------------------- |
|
|
22
|
+
| Qwik City | `@ssgoi/qwik/qwik-city` | `useSsgoiRouteBoundary` |
|
|
23
|
+
|
|
24
|
+
See the [framework guide](https://ssgoi.dev/docs/frameworks/qwik) for wiring and limits.
|
|
25
|
+
|
|
15
26
|
## Root
|
|
16
27
|
|
|
17
28
|
Qwik configs contain functions, so pass a QRL factory.
|
|
@@ -39,20 +50,25 @@ export default component$(() => {
|
|
|
39
50
|
|
|
40
51
|
## Route boundary
|
|
41
52
|
|
|
42
|
-
|
|
53
|
+
Use the experimental Qwik City helper on the page's own root:
|
|
43
54
|
|
|
44
55
|
```tsx
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
));
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Dynamic route:
|
|
56
|
+
import { component$ } from "@builder.io/qwik";
|
|
57
|
+
import { useSsgoiRouteBoundary } from "@ssgoi/qwik/qwik-city";
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
export default component$(() => {
|
|
60
|
+
const boundary = useSsgoiRouteBoundary();
|
|
61
|
+
return (
|
|
62
|
+
<section key={boundary.value.key} data-ssgoi-transition={boundary.value.id}>
|
|
63
|
+
Page
|
|
64
|
+
</section>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
54
67
|
```
|
|
55
68
|
|
|
69
|
+
The key replaces the root when City reuses a parameterized page. A stable key
|
|
70
|
+
can be passed for a persistent shell. Keep Slot ownership in the route/layout.
|
|
71
|
+
|
|
56
72
|
## Persistent layouts
|
|
57
73
|
|
|
58
74
|
Put an outer marker in the persistent route layout and markers on child route
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const qwik = require("@builder.io/qwik");
|
|
4
|
+
const qwikCity = require("@builder.io/qwik-city");
|
|
5
|
+
function useSsgoiRouteBoundary(routeKey) {
|
|
6
|
+
const location = qwikCity.useLocation();
|
|
7
|
+
return qwik.useComputed$(() => ({
|
|
8
|
+
id: location.url.pathname,
|
|
9
|
+
key: routeKey ?? location.url.pathname
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
exports.useSsgoiRouteBoundary = useSsgoiRouteBoundary;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useComputed$ } from "@builder.io/qwik";
|
|
2
|
+
import { useLocation } from "@builder.io/qwik-city";
|
|
3
|
+
function useSsgoiRouteBoundary(routeKey) {
|
|
4
|
+
const location = useLocation();
|
|
5
|
+
return useComputed$(() => ({
|
|
6
|
+
id: location.url.pathname,
|
|
7
|
+
key: routeKey ?? location.url.pathname
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useSsgoiRouteBoundary
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Signal } from "@builder.io/qwik";
|
|
2
|
+
export interface RouteBoundaryState {
|
|
3
|
+
id: string;
|
|
4
|
+
key: string | number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @experimental Qwik City route boundary helper. The API may change.
|
|
8
|
+
* Apply id and key to the page's own DOM root. Keeping Slot ownership in the
|
|
9
|
+
* route avoids moving projected content between outgoing and incoming pages.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSsgoiRouteBoundary(routeKey?: string | number): Signal<RouteBoundaryState>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/qwik",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.3-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,
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"types": "./lib-types/view-transitions.d.ts",
|
|
24
24
|
"import": "./lib/view-transitions.qwik.mjs",
|
|
25
25
|
"require": "./lib/view-transitions.qwik.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./qwik-city": {
|
|
28
|
+
"types": "./lib-types/routers/qwik-city.d.ts",
|
|
29
|
+
"import": "./lib/qwik-city.qwik.mjs",
|
|
30
|
+
"require": "./lib/qwik-city.qwik.cjs"
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
33
|
"files": [
|
|
@@ -30,10 +35,11 @@
|
|
|
30
35
|
"lib-types"
|
|
31
36
|
],
|
|
32
37
|
"dependencies": {
|
|
33
|
-
"@ssgoi/core": "^7.1.
|
|
38
|
+
"@ssgoi/core": "^7.1.3-beta.0"
|
|
34
39
|
},
|
|
35
40
|
"peerDependencies": {
|
|
36
|
-
"@builder.io/qwik": "^1.20.0"
|
|
41
|
+
"@builder.io/qwik": "^1.20.0",
|
|
42
|
+
"@builder.io/qwik-city": "*"
|
|
37
43
|
},
|
|
38
44
|
"devDependencies": {
|
|
39
45
|
"@builder.io/qwik": "^1.20.0",
|
|
@@ -45,7 +51,8 @@
|
|
|
45
51
|
"typescript": "~5.8.3",
|
|
46
52
|
"typescript-eslint": "^8.35.1",
|
|
47
53
|
"vite": "^7.0.4",
|
|
48
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
54
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
55
|
+
"@builder.io/qwik-city": "^1.20.0"
|
|
49
56
|
},
|
|
50
57
|
"keywords": [
|
|
51
58
|
"qwik",
|
|
@@ -79,6 +86,11 @@
|
|
|
79
86
|
"engines": {
|
|
80
87
|
"node": ">=18.0.0"
|
|
81
88
|
},
|
|
89
|
+
"peerDependenciesMeta": {
|
|
90
|
+
"@builder.io/qwik-city": {
|
|
91
|
+
"optional": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
82
94
|
"scripts": {
|
|
83
95
|
"build": "pnpm run build.lib && pnpm run build.types",
|
|
84
96
|
"build.lib": "vite build --mode lib",
|