@vertz/ui 0.2.11 → 0.2.13
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 +70 -6
- package/dist/shared/{chunk-n91rwj2r.js → chunk-2sth83bd.js} +4 -2
- package/dist/shared/{chunk-9e92w0wt.js → chunk-83g4h38e.js} +13 -0
- package/dist/shared/{chunk-hrd0mft1.js → chunk-8hsz5y4a.js} +102 -37
- package/dist/shared/{chunk-q6cpe5k7.js → chunk-c30eg6wn.js} +1 -1
- package/dist/shared/{chunk-qacth5ah.js → chunk-c9xxsrat.js} +7 -2
- package/dist/shared/{chunk-v3yyf79g.js → chunk-dksg08fq.js} +1 -1
- package/dist/shared/{chunk-g4rch80a.js → chunk-h89w580h.js} +7 -0
- package/dist/shared/chunk-hw67ckr3.js +1212 -0
- package/dist/shared/{chunk-ryb49346.js → chunk-j6qyxfdc.js} +7 -7
- package/dist/shared/{chunk-ka5ked7n.js → chunk-mj7b4t40.js} +107 -41
- package/dist/shared/{chunk-0xcmwgdb.js → chunk-nn9v1zmk.js} +6 -6
- package/dist/src/auth/public.d.ts +303 -0
- package/dist/src/auth/public.js +773 -0
- package/dist/src/css/public.js +22 -0
- package/dist/{form → src/form}/public.js +2 -2
- package/dist/{index.d.ts → src/index.d.ts} +220 -15
- package/dist/{index.js → src/index.js} +96 -232
- package/dist/{internals.d.ts → src/internals.d.ts} +266 -4
- package/dist/{internals.js → src/internals.js} +35 -26
- package/dist/{jsx-runtime → src/jsx-runtime}/index.d.ts +1 -1
- package/dist/{jsx-runtime → src/jsx-runtime}/index.js +1 -1
- package/dist/{query → src/query}/public.d.ts +3 -1
- package/dist/src/query/public.js +15 -0
- package/dist/{router → src/router}/public.d.ts +25 -4
- package/dist/{router → src/router}/public.js +9 -9
- package/dist/{test → src/test}/index.d.ts +12 -2
- package/dist/{test → src/test}/index.js +4 -4
- package/package.json +31 -25
- package/reactivity.json +67 -0
- package/dist/css/public.js +0 -22
- package/dist/query/public.js +0 -15
- package/dist/shared/chunk-rjjjvmcf.js +0 -528
- /package/dist/{css → src/css}/public.d.ts +0 -0
- /package/dist/{form → src/form}/public.d.ts +0 -0
|
@@ -157,7 +157,7 @@ type PathWithParams<T extends string> = T extends `${infer Before}*` ? `${PathWi
|
|
|
157
157
|
* ```
|
|
158
158
|
*/
|
|
159
159
|
type RoutePaths<TRouteMap extends Record<string, unknown>> = { [K in keyof TRouteMap & string] : PathWithParams<K> }[keyof TRouteMap & string];
|
|
160
|
-
/**
|
|
160
|
+
/** Schema interface for parsing and validating values (search params, path params). */
|
|
161
161
|
interface SearchParamSchema<T> {
|
|
162
162
|
parse(data: unknown): {
|
|
163
163
|
ok: true;
|
|
@@ -167,11 +167,14 @@ interface SearchParamSchema<T> {
|
|
|
167
167
|
error: unknown;
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
+
/** Schema interface for parsing and validating route path params. */
|
|
171
|
+
type ParamSchema<T> = SearchParamSchema<T>;
|
|
170
172
|
/** A route configuration for a single path. */
|
|
171
173
|
interface RouteConfig<
|
|
172
174
|
TPath extends string = string,
|
|
173
175
|
TLoaderData = unknown,
|
|
174
|
-
TSearch = unknown
|
|
176
|
+
TSearch = unknown,
|
|
177
|
+
TParams = unknown
|
|
175
178
|
> {
|
|
176
179
|
/** Component factory (lazy for code splitting). */
|
|
177
180
|
component: () => Node | Promise<{
|
|
@@ -184,6 +187,8 @@ interface RouteConfig<
|
|
|
184
187
|
}) => Promise<TLoaderData> | TLoaderData;
|
|
185
188
|
/** Optional error component rendered when loader throws. */
|
|
186
189
|
errorComponent?: (error: Error) => Node;
|
|
190
|
+
/** Optional path params schema for validation/parsing. */
|
|
191
|
+
params?: ParamSchema<TParams>;
|
|
187
192
|
/** Optional search params schema for validation/coercion. */
|
|
188
193
|
searchParams?: SearchParamSchema<TSearch>;
|
|
189
194
|
/** Nested child routes. */
|
|
@@ -214,6 +219,7 @@ interface RouteConfigLike {
|
|
|
214
219
|
signal: AbortSignal;
|
|
215
220
|
}): unknown;
|
|
216
221
|
errorComponent?: (error: Error) => Node;
|
|
222
|
+
params?: ParamSchema<unknown>;
|
|
217
223
|
searchParams?: SearchParamSchema<unknown>;
|
|
218
224
|
children?: Record<string, RouteConfigLike>;
|
|
219
225
|
}
|
|
@@ -228,6 +234,8 @@ interface CompiledRoute {
|
|
|
228
234
|
signal: AbortSignal;
|
|
229
235
|
}) => Promise<unknown> | unknown;
|
|
230
236
|
errorComponent?: RouteConfig["errorComponent"];
|
|
237
|
+
/** Optional path params schema for validation/parsing. */
|
|
238
|
+
params?: ParamSchema<unknown>;
|
|
231
239
|
searchParams?: RouteConfig["searchParams"];
|
|
232
240
|
/** Compiled children. */
|
|
233
241
|
children?: CompiledRoute[];
|
|
@@ -241,6 +249,8 @@ interface MatchedRoute {
|
|
|
241
249
|
interface RouteMatch {
|
|
242
250
|
/** All params extracted from the full URL path. */
|
|
243
251
|
params: Record<string, string>;
|
|
252
|
+
/** Parsed params via schema (set when route has a params schema and parse succeeds). */
|
|
253
|
+
parsedParams?: Record<string, unknown>;
|
|
244
254
|
/** The leaf route config that matched. */
|
|
245
255
|
route: CompiledRoute;
|
|
246
256
|
/** The chain of matched routes from root to leaf (for nested layouts). */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouter
|
|
3
|
-
} from "
|
|
3
|
+
} from "../../shared/chunk-mj7b4t40.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRoutes
|
|
6
|
-
} from "
|
|
7
|
-
import"
|
|
8
|
-
import"
|
|
6
|
+
} from "../../shared/chunk-83g4h38e.js";
|
|
7
|
+
import"../../shared/chunk-jrtrk5z4.js";
|
|
8
|
+
import"../../shared/chunk-8hsz5y4a.js";
|
|
9
9
|
|
|
10
10
|
// src/test/interactions.ts
|
|
11
11
|
async function click(el) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI framework — signals, components, JSX runtime",
|
|
@@ -13,48 +13,54 @@
|
|
|
13
13
|
"access": "public",
|
|
14
14
|
"provenance": true
|
|
15
15
|
},
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
16
|
+
"main": "dist/src/index.js",
|
|
17
|
+
"types": "dist/src/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"types": "./dist/index.d.ts",
|
|
21
|
-
"import": "./dist/index.js"
|
|
20
|
+
"types": "./dist/src/index.d.ts",
|
|
21
|
+
"import": "./dist/src/index.js"
|
|
22
22
|
},
|
|
23
23
|
"./internals": {
|
|
24
|
-
"types": "./dist/internals.d.ts",
|
|
25
|
-
"import": "./dist/internals.js"
|
|
24
|
+
"types": "./dist/src/internals.d.ts",
|
|
25
|
+
"import": "./dist/src/internals.js"
|
|
26
26
|
},
|
|
27
27
|
"./test": {
|
|
28
|
-
"types": "./dist/test/index.d.ts",
|
|
29
|
-
"import": "./dist/test/index.js"
|
|
28
|
+
"types": "./dist/src/test/index.d.ts",
|
|
29
|
+
"import": "./dist/src/test/index.js"
|
|
30
30
|
},
|
|
31
31
|
"./router": {
|
|
32
|
-
"types": "./dist/router/public.d.ts",
|
|
33
|
-
"import": "./dist/router/public.js"
|
|
32
|
+
"types": "./dist/src/router/public.d.ts",
|
|
33
|
+
"import": "./dist/src/router/public.js"
|
|
34
34
|
},
|
|
35
35
|
"./form": {
|
|
36
|
-
"types": "./dist/form/public.d.ts",
|
|
37
|
-
"import": "./dist/form/public.js"
|
|
36
|
+
"types": "./dist/src/form/public.d.ts",
|
|
37
|
+
"import": "./dist/src/form/public.js"
|
|
38
38
|
},
|
|
39
39
|
"./query": {
|
|
40
|
-
"types": "./dist/query/public.d.ts",
|
|
41
|
-
"import": "./dist/query/public.js"
|
|
40
|
+
"types": "./dist/src/query/public.d.ts",
|
|
41
|
+
"import": "./dist/src/query/public.js"
|
|
42
42
|
},
|
|
43
43
|
"./css": {
|
|
44
|
-
"types": "./dist/css/public.d.ts",
|
|
45
|
-
"import": "./dist/css/public.js"
|
|
44
|
+
"types": "./dist/src/css/public.d.ts",
|
|
45
|
+
"import": "./dist/src/css/public.js"
|
|
46
46
|
},
|
|
47
47
|
"./jsx-runtime": {
|
|
48
|
-
"types": "./dist/jsx-runtime/index.d.ts",
|
|
49
|
-
"import": "./dist/jsx-runtime/index.js"
|
|
48
|
+
"types": "./dist/src/jsx-runtime/index.d.ts",
|
|
49
|
+
"import": "./dist/src/jsx-runtime/index.js"
|
|
50
50
|
},
|
|
51
51
|
"./jsx-dev-runtime": {
|
|
52
|
-
"types": "./dist/jsx-runtime/index.d.ts",
|
|
53
|
-
"import": "./dist/jsx-runtime/index.js"
|
|
54
|
-
}
|
|
52
|
+
"types": "./dist/src/jsx-runtime/index.d.ts",
|
|
53
|
+
"import": "./dist/src/jsx-runtime/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./auth": {
|
|
56
|
+
"types": "./dist/src/auth/public.d.ts",
|
|
57
|
+
"import": "./dist/src/auth/public.js"
|
|
58
|
+
},
|
|
59
|
+
"./reactivity.json": "./reactivity.json"
|
|
55
60
|
},
|
|
56
61
|
"files": [
|
|
57
|
-
"dist"
|
|
62
|
+
"dist",
|
|
63
|
+
"reactivity.json"
|
|
58
64
|
],
|
|
59
65
|
"scripts": {
|
|
60
66
|
"build": "bunup",
|
|
@@ -63,11 +69,11 @@
|
|
|
63
69
|
"typecheck": "tsc --noEmit"
|
|
64
70
|
},
|
|
65
71
|
"dependencies": {
|
|
66
|
-
"@vertz/fetch": "^0.2.
|
|
72
|
+
"@vertz/fetch": "^0.2.12"
|
|
67
73
|
},
|
|
68
74
|
"devDependencies": {
|
|
69
75
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
70
|
-
"@vertz/schema": "^0.2.
|
|
76
|
+
"@vertz/schema": "^0.2.12",
|
|
71
77
|
"bunup": "^0.16.31",
|
|
72
78
|
"happy-dom": "^20.7.0",
|
|
73
79
|
"typescript": "^5.7.0"
|
package/reactivity.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exports": {
|
|
3
|
+
"can": {
|
|
4
|
+
"kind": "function",
|
|
5
|
+
"reactivity": {
|
|
6
|
+
"plainProperties": [],
|
|
7
|
+
"signalProperties": ["allowed", "reasons", "reason", "meta", "loading"],
|
|
8
|
+
"type": "signal-api"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"createLoader": {
|
|
12
|
+
"kind": "function",
|
|
13
|
+
"reactivity": {
|
|
14
|
+
"plainProperties": ["refetch"],
|
|
15
|
+
"signalProperties": ["data", "loading", "error"],
|
|
16
|
+
"type": "signal-api"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"form": {
|
|
20
|
+
"kind": "function",
|
|
21
|
+
"reactivity": {
|
|
22
|
+
"fieldSignalProperties": ["value", "error", "dirty", "touched"],
|
|
23
|
+
"plainProperties": ["action", "method", "onSubmit", "reset", "setFieldError", "submit"],
|
|
24
|
+
"signalProperties": ["submitting", "dirty", "valid"],
|
|
25
|
+
"type": "signal-api"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"query": {
|
|
29
|
+
"kind": "function",
|
|
30
|
+
"reactivity": {
|
|
31
|
+
"plainProperties": ["refetch", "revalidate", "dispose"],
|
|
32
|
+
"signalProperties": ["data", "loading", "error", "revalidating"],
|
|
33
|
+
"type": "signal-api"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"signal": {
|
|
37
|
+
"kind": "function",
|
|
38
|
+
"reactivity": {
|
|
39
|
+
"type": "signal"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"useAuth": {
|
|
43
|
+
"kind": "function",
|
|
44
|
+
"reactivity": {
|
|
45
|
+
"plainProperties": [
|
|
46
|
+
"signIn",
|
|
47
|
+
"signUp",
|
|
48
|
+
"signOut",
|
|
49
|
+
"refresh",
|
|
50
|
+
"mfaChallenge",
|
|
51
|
+
"forgotPassword",
|
|
52
|
+
"resetPassword"
|
|
53
|
+
],
|
|
54
|
+
"signalProperties": ["user", "status", "isAuthenticated", "isLoading", "error"],
|
|
55
|
+
"type": "signal-api"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"useContext": {
|
|
59
|
+
"kind": "function",
|
|
60
|
+
"reactivity": {
|
|
61
|
+
"type": "reactive-source"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"filePath": "@vertz/ui",
|
|
66
|
+
"version": 1
|
|
67
|
+
}
|
package/dist/css/public.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ThemeProvider,
|
|
3
|
-
compileTheme,
|
|
4
|
-
css,
|
|
5
|
-
defineTheme,
|
|
6
|
-
globalCss,
|
|
7
|
-
s,
|
|
8
|
-
variants
|
|
9
|
-
} from "../shared/chunk-qacth5ah.js";
|
|
10
|
-
import"../shared/chunk-ryb49346.js";
|
|
11
|
-
import"../shared/chunk-g4rch80a.js";
|
|
12
|
-
import"../shared/chunk-hrd0mft1.js";
|
|
13
|
-
import"../shared/chunk-prj7nm08.js";
|
|
14
|
-
export {
|
|
15
|
-
variants,
|
|
16
|
-
s,
|
|
17
|
-
globalCss,
|
|
18
|
-
defineTheme,
|
|
19
|
-
css,
|
|
20
|
-
compileTheme,
|
|
21
|
-
ThemeProvider
|
|
22
|
-
};
|
package/dist/query/public.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
query,
|
|
3
|
-
queryMatch
|
|
4
|
-
} from "../shared/chunk-rjjjvmcf.js";
|
|
5
|
-
import"../shared/chunk-jrtrk5z4.js";
|
|
6
|
-
import"../shared/chunk-g4rch80a.js";
|
|
7
|
-
import"../shared/chunk-hrd0mft1.js";
|
|
8
|
-
|
|
9
|
-
// src/query/public.ts
|
|
10
|
-
import { isQueryDescriptor } from "@vertz/fetch";
|
|
11
|
-
export {
|
|
12
|
-
queryMatch,
|
|
13
|
-
query,
|
|
14
|
-
isQueryDescriptor
|
|
15
|
-
};
|