@vertz/ui 0.2.15 → 0.2.17
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 +49 -0
- package/dist/shared/{chunk-dksg08fq.js → chunk-07bh4m1e.js} +1 -1
- package/dist/shared/chunk-14eqne2a.js +10 -0
- package/dist/shared/{chunk-nn9v1zmk.js → chunk-2wtb9x81.js} +83 -20
- package/dist/shared/{chunk-8hsz5y4a.js → chunk-4fwcwxn6.js} +14 -4
- package/dist/shared/{chunk-4txc67nd.js → chunk-6jyt4ycw.js} +67 -2
- package/dist/shared/{chunk-83g4h38e.js → chunk-6wd36w21.js} +1 -0
- package/dist/shared/{chunk-h89w580h.js → chunk-afawz764.js} +1 -1
- package/dist/shared/{chunk-1wby7nex.js → chunk-dhehvmj0.js} +161 -9
- package/dist/shared/{chunk-wymw818z.js → chunk-fkbgbf3n.js} +48 -9
- package/dist/shared/{chunk-hw67ckr3.js → chunk-fs3eec4b.js} +230 -19
- package/dist/shared/{chunk-5dbq8jp9.js → chunk-j09yyh34.js} +72 -6
- package/dist/shared/chunk-mtsvrj9e.js +23 -0
- package/dist/shared/{chunk-j6qyxfdc.js → chunk-vndfjfdy.js} +3 -3
- package/dist/src/auth/public.d.ts +40 -24
- package/dist/src/auth/public.js +110 -52
- package/dist/src/css/public.d.ts +110 -2
- package/dist/src/css/public.js +8 -4
- package/dist/src/form/public.d.ts +29 -6
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +284 -13
- package/dist/src/index.js +160 -14
- package/dist/src/internals.d.ts +168 -5
- package/dist/src/internals.js +14 -8
- package/dist/src/jsx-runtime/index.d.ts +5 -0
- package/dist/src/jsx-runtime/index.js +8 -1
- package/dist/src/query/public.js +4 -3
- package/dist/src/router/public.d.ts +17 -4
- package/dist/src/router/public.js +16 -11
- package/dist/src/test/index.d.ts +5 -0
- package/dist/src/test/index.js +4 -3
- package/package.json +3 -3
- package/reactivity.json +1 -11
|
@@ -82,6 +82,8 @@ interface RouteConfig<
|
|
|
82
82
|
searchParams?: SearchParamSchema<TSearch>;
|
|
83
83
|
/** Nested child routes. */
|
|
84
84
|
children?: RouteDefinitionMap;
|
|
85
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
86
|
+
prerender?: boolean;
|
|
85
87
|
}
|
|
86
88
|
/** A map of path patterns to route configs (user input format). */
|
|
87
89
|
interface RouteDefinitionMap {
|
|
@@ -111,6 +113,7 @@ interface RouteConfigLike {
|
|
|
111
113
|
params?: ParamSchema<unknown>;
|
|
112
114
|
searchParams?: SearchParamSchema<unknown>;
|
|
113
115
|
children?: Record<string, RouteConfigLike>;
|
|
116
|
+
prerender?: boolean;
|
|
114
117
|
}
|
|
115
118
|
/**
|
|
116
119
|
* Phantom branded array that carries the route map type `T`.
|
|
@@ -144,6 +147,8 @@ interface CompiledRoute {
|
|
|
144
147
|
searchParams?: RouteConfig["searchParams"];
|
|
145
148
|
/** Compiled children. */
|
|
146
149
|
children?: CompiledRoute[];
|
|
150
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
151
|
+
prerender?: boolean;
|
|
147
152
|
}
|
|
148
153
|
/** A single matched route entry in the matched chain. */
|
|
149
154
|
interface MatchedRoute {
|
|
@@ -231,8 +236,8 @@ type UnwrapSignals<T> = T extends object ? { [K in keyof T] : Unwrapped<T[K]> }
|
|
|
231
236
|
interface LinkProps<T extends Record<string, RouteConfigLike> = RouteDefinitionMap> {
|
|
232
237
|
/** The target URL path. */
|
|
233
238
|
href: RoutePaths<T>;
|
|
234
|
-
/** Text or content for the link.
|
|
235
|
-
children: string | (() => string | Node);
|
|
239
|
+
/** Text or content for the link. Accepts string, Node, or a thunk returning either. */
|
|
240
|
+
children: string | Node | (() => string | Node);
|
|
236
241
|
/** Class applied when the link's href matches the current path. */
|
|
237
242
|
activeClass?: string;
|
|
238
243
|
/** Static class name for the anchor element. */
|
|
@@ -253,6 +258,13 @@ interface LinkFactoryOptions {
|
|
|
253
258
|
* @returns A Link component function
|
|
254
259
|
*/
|
|
255
260
|
declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url: string) => void, factoryOptions?: LinkFactoryOptions): (props: LinkProps) => HTMLAnchorElement;
|
|
261
|
+
/**
|
|
262
|
+
* Context-based Link component for client-side navigation.
|
|
263
|
+
*
|
|
264
|
+
* Reads the router from `RouterContext` automatically — no manual wiring needed.
|
|
265
|
+
* Just use `<Link href="/about">About</Link>` inside a router-provided tree.
|
|
266
|
+
*/
|
|
267
|
+
declare function Link({ href, children, activeClass, className }: LinkProps): HTMLAnchorElement;
|
|
256
268
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
257
269
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
258
270
|
/** Options for router.navigate(). */
|
|
@@ -334,7 +346,8 @@ type TypedRouter<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
334
346
|
* @param initialUrl - The initial URL to match (optional; auto-detects from window.location or SSR context)
|
|
335
347
|
* @returns Router instance with reactive state and navigation methods
|
|
336
348
|
*/
|
|
337
|
-
declare function createRouter<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>(routes: TypedRoutes<T>, initialUrl
|
|
349
|
+
declare function createRouter<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>(routes: TypedRoutes<T>, initialUrl: string, options?: RouterOptions): Router<T>;
|
|
350
|
+
declare function createRouter<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>(routes: TypedRoutes<T>, options?: RouterOptions): Router<T>;
|
|
338
351
|
/**
|
|
339
352
|
* Props for the JSX pattern of Context.Provider.
|
|
340
353
|
*
|
|
@@ -422,4 +435,4 @@ declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSea
|
|
|
422
435
|
* @returns The current search params value
|
|
423
436
|
*/
|
|
424
437
|
declare function useSearchParams<T>(searchSignal: ReadonlySignal<T>): T;
|
|
425
|
-
export { useSearchParams, useRouter, useParams, parseSearchParams, defineRoutes, createRouter, createLink, TypedRoutes, TypedRouter, SearchParamSchema, RouterViewProps, RouterView, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MatchedRoute, LoaderData, LinkProps, InferRouteMap, ExtractParams, CompiledRoute };
|
|
438
|
+
export { useSearchParams, useRouter, useParams, parseSearchParams, defineRoutes, createRouter, createLink, TypedRoutes, TypedRouter, SearchParamSchema, RouterViewProps, RouterView, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MatchedRoute, LoaderData, LinkProps, Link, InferRouteMap, ExtractParams, CompiledRoute };
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Link,
|
|
2
3
|
Outlet,
|
|
3
4
|
OutletContext,
|
|
4
|
-
RouterContext,
|
|
5
5
|
RouterView,
|
|
6
6
|
createLink,
|
|
7
7
|
parseSearchParams,
|
|
8
|
-
useParams,
|
|
9
|
-
useRouter,
|
|
10
8
|
useSearchParams
|
|
11
|
-
} from "../../shared/chunk-
|
|
12
|
-
import"../../shared/chunk-
|
|
9
|
+
} from "../../shared/chunk-2wtb9x81.js";
|
|
10
|
+
import"../../shared/chunk-07bh4m1e.js";
|
|
13
11
|
import {
|
|
14
12
|
createRouter
|
|
15
|
-
} from "../../shared/chunk-
|
|
13
|
+
} from "../../shared/chunk-fkbgbf3n.js";
|
|
16
14
|
import {
|
|
17
15
|
defineRoutes
|
|
18
|
-
} from "../../shared/chunk-
|
|
16
|
+
} from "../../shared/chunk-6wd36w21.js";
|
|
19
17
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
20
|
-
import"../../shared/chunk-
|
|
18
|
+
import"../../shared/chunk-vndfjfdy.js";
|
|
21
19
|
import"../../shared/chunk-prj7nm08.js";
|
|
22
|
-
import"../../shared/chunk-
|
|
23
|
-
import
|
|
20
|
+
import"../../shared/chunk-afawz764.js";
|
|
21
|
+
import {
|
|
22
|
+
RouterContext,
|
|
23
|
+
useParams,
|
|
24
|
+
useRouter
|
|
25
|
+
} from "../../shared/chunk-mtsvrj9e.js";
|
|
26
|
+
import"../../shared/chunk-14eqne2a.js";
|
|
27
|
+
import"../../shared/chunk-4fwcwxn6.js";
|
|
24
28
|
export {
|
|
25
29
|
useSearchParams,
|
|
26
30
|
useRouter,
|
|
@@ -32,5 +36,6 @@ export {
|
|
|
32
36
|
RouterView,
|
|
33
37
|
RouterContext,
|
|
34
38
|
OutletContext,
|
|
35
|
-
Outlet
|
|
39
|
+
Outlet,
|
|
40
|
+
Link
|
|
36
41
|
};
|
package/dist/src/test/index.d.ts
CHANGED
|
@@ -176,6 +176,8 @@ interface RouteConfig<
|
|
|
176
176
|
searchParams?: SearchParamSchema<TSearch>;
|
|
177
177
|
/** Nested child routes. */
|
|
178
178
|
children?: RouteDefinitionMap;
|
|
179
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
180
|
+
prerender?: boolean;
|
|
179
181
|
}
|
|
180
182
|
/** A map of path patterns to route configs (user input format). */
|
|
181
183
|
interface RouteDefinitionMap {
|
|
@@ -205,6 +207,7 @@ interface RouteConfigLike {
|
|
|
205
207
|
params?: ParamSchema<unknown>;
|
|
206
208
|
searchParams?: SearchParamSchema<unknown>;
|
|
207
209
|
children?: Record<string, RouteConfigLike>;
|
|
210
|
+
prerender?: boolean;
|
|
208
211
|
}
|
|
209
212
|
/** Internal compiled route. */
|
|
210
213
|
interface CompiledRoute {
|
|
@@ -222,6 +225,8 @@ interface CompiledRoute {
|
|
|
222
225
|
searchParams?: RouteConfig["searchParams"];
|
|
223
226
|
/** Compiled children. */
|
|
224
227
|
children?: CompiledRoute[];
|
|
228
|
+
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
229
|
+
prerender?: boolean;
|
|
225
230
|
}
|
|
226
231
|
/** A single matched route entry in the matched chain. */
|
|
227
232
|
interface MatchedRoute {
|
package/dist/src/test/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouter
|
|
3
|
-
} from "../../shared/chunk-
|
|
3
|
+
} from "../../shared/chunk-fkbgbf3n.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRoutes
|
|
6
|
-
} from "../../shared/chunk-
|
|
6
|
+
} from "../../shared/chunk-6wd36w21.js";
|
|
7
7
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
8
|
-
import"../../shared/chunk-
|
|
8
|
+
import"../../shared/chunk-14eqne2a.js";
|
|
9
|
+
import"../../shared/chunk-4fwcwxn6.js";
|
|
9
10
|
|
|
10
11
|
// src/test/interactions.ts
|
|
11
12
|
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.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI framework — signals, components, JSX runtime",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"typecheck": "tsc --noEmit"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@vertz/fetch": "^0.2.
|
|
72
|
+
"@vertz/fetch": "^0.2.16"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
76
|
-
"@vertz/schema": "^0.2.
|
|
76
|
+
"@vertz/schema": "^0.2.16",
|
|
77
77
|
"bunup": "^0.16.31",
|
|
78
78
|
"happy-dom": "^20.7.0",
|
|
79
79
|
"typescript": "^5.7.0"
|
package/reactivity.json
CHANGED
|
@@ -42,17 +42,7 @@
|
|
|
42
42
|
"useAuth": {
|
|
43
43
|
"kind": "function",
|
|
44
44
|
"reactivity": {
|
|
45
|
-
"
|
|
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"
|
|
45
|
+
"type": "reactive-source"
|
|
56
46
|
}
|
|
57
47
|
},
|
|
58
48
|
"useContext": {
|