@vertz/ui 0.2.20 → 0.2.22
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/dist/shared/{chunk-4fwcwxn6.js → chunk-2qe6aqhb.js} +235 -1
- package/dist/shared/{chunk-mtsvrj9e.js → chunk-4cmt1ve8.js} +1 -1
- package/dist/shared/chunk-4xkw6h1s.js +73 -0
- package/dist/shared/{chunk-j5qtsm0b.js → chunk-67z8b0q8.js} +97 -21
- package/dist/shared/{chunk-fkbgbf3n.js → chunk-7g722pdh.js} +70 -12
- package/dist/shared/{chunk-6wd36w21.js → chunk-am9zaw4h.js} +3 -1
- package/dist/shared/{chunk-14eqne2a.js → chunk-bybgyjye.js} +1 -1
- package/dist/shared/{chunk-afawz764.js → chunk-c61572xp.js} +1 -1
- package/dist/shared/{chunk-07bh4m1e.js → chunk-kjwp5q5s.js} +10 -5
- package/dist/shared/chunk-mwc4v48d.js +36 -0
- package/dist/shared/{chunk-yjs76c7v.js → chunk-pdqr78k9.js} +1 -1
- package/dist/shared/{chunk-c3r237f0.js → chunk-pq8khh47.js} +32 -11
- package/dist/shared/{chunk-fs3eec4b.js → chunk-szk0hyjg.js} +3 -3
- package/dist/shared/chunk-vwz86vg9.js +208 -0
- package/dist/shared/{chunk-j09yyh34.js → chunk-yb4a0smw.js} +1 -1
- package/dist/src/auth/public.d.ts +30 -2
- package/dist/src/auth/public.js +95 -136
- package/dist/src/components/index.d.ts +70 -0
- package/dist/src/components/index.js +213 -0
- package/dist/src/css/public.d.ts +48 -14
- package/dist/src/css/public.js +4 -4
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +131 -20
- package/dist/src/index.js +45 -36
- package/dist/src/internals.d.ts +110 -62
- package/dist/src/internals.js +18 -14
- package/dist/src/jsx-runtime/index.d.ts +20 -0
- package/dist/src/jsx-runtime/index.js +13 -3
- package/dist/src/query/public.js +4 -4
- package/dist/src/router/public.d.ts +47 -1
- package/dist/src/router/public.js +10 -9
- package/dist/src/test/index.d.ts +33 -0
- package/dist/src/test/index.js +4 -4
- package/package.json +7 -3
- package/dist/shared/chunk-mgfrrrjq.js +0 -384
package/dist/src/internals.d.ts
CHANGED
|
@@ -80,6 +80,69 @@ declare function getContextScope(): ContextScope | null;
|
|
|
80
80
|
* @internal
|
|
81
81
|
*/
|
|
82
82
|
declare function setContextScope(scope: ContextScope | null): ContextScope | null;
|
|
83
|
+
/**
|
|
84
|
+
* Shared CSS token lookup tables.
|
|
85
|
+
*
|
|
86
|
+
* This is the single source of truth for all CSS token resolution data.
|
|
87
|
+
* These tables are consumed by:
|
|
88
|
+
* 1. packages/ui/src/css/token-resolver.ts (runtime)
|
|
89
|
+
* 2. packages/ui-compiler/src/transformers/css-transformer.ts (compiler)
|
|
90
|
+
* 3. packages/ui-compiler/src/css-extraction/extractor.ts (extraction)
|
|
91
|
+
*
|
|
92
|
+
* DO NOT duplicate these tables elsewhere. If you need a new token,
|
|
93
|
+
* add it here and all consumers will pick it up automatically.
|
|
94
|
+
*
|
|
95
|
+
* TYPE SYNC: When adding or removing entries from any map/scale/set below,
|
|
96
|
+
* also update the corresponding exported union type immediately above
|
|
97
|
+
* the runtime constant. The types and runtime values must stay in sync.
|
|
98
|
+
*/
|
|
99
|
+
interface PropertyMapping {
|
|
100
|
+
/** CSS property name(s). If multiple, all get the same value. */
|
|
101
|
+
properties: string[];
|
|
102
|
+
/** Value resolver type. */
|
|
103
|
+
valueType: "spacing" | "color" | "radius" | "shadow" | "size" | "display" | "alignment" | "font-size" | "font-weight" | "line-height" | "ring" | "content" | "raw";
|
|
104
|
+
}
|
|
105
|
+
declare const PROPERTY_MAP: Record<string, PropertyMapping>;
|
|
106
|
+
/** A single CSS property-value pair. */
|
|
107
|
+
interface CSSDeclarationEntry {
|
|
108
|
+
property: string;
|
|
109
|
+
value: string;
|
|
110
|
+
}
|
|
111
|
+
/** Keyword map -- single keywords that resolve to one or more declarations. */
|
|
112
|
+
declare const KEYWORD_MAP: Record<string, CSSDeclarationEntry[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Display-only keyword map. Used by the compiler for quick display keyword
|
|
115
|
+
* lookup without processing the full KEYWORD_MAP.
|
|
116
|
+
*/
|
|
117
|
+
declare const DISPLAY_MAP: Record<string, string>;
|
|
118
|
+
/** Spacing scale: number -> rem. 1=0.25rem, 2=0.5rem, 4=1rem, 8=2rem, etc. */
|
|
119
|
+
declare const SPACING_SCALE: Record<string, string>;
|
|
120
|
+
/** Border radius scale — matches Tailwind v4 / shadcn. */
|
|
121
|
+
declare const RADIUS_SCALE: Record<string, string>;
|
|
122
|
+
/** Shadow scale. */
|
|
123
|
+
declare const SHADOW_SCALE: Record<string, string>;
|
|
124
|
+
/** Font size scale. */
|
|
125
|
+
declare const FONT_SIZE_SCALE: Record<string, string>;
|
|
126
|
+
/** Font weight scale. */
|
|
127
|
+
declare const FONT_WEIGHT_SCALE: Record<string, string>;
|
|
128
|
+
/** Line height scale. */
|
|
129
|
+
declare const LINE_HEIGHT_SCALE: Record<string, string>;
|
|
130
|
+
/** Alignment value map. */
|
|
131
|
+
declare const ALIGNMENT_MAP: Record<string, string>;
|
|
132
|
+
/** Size keywords for width/height. */
|
|
133
|
+
declare const SIZE_KEYWORDS: Record<string, string>;
|
|
134
|
+
/** Height-axis property shorthands that should use vh units. */
|
|
135
|
+
declare const HEIGHT_AXIS_PROPERTIES: ReadonlySet<string>;
|
|
136
|
+
/** Known color token namespaces -- values that resolve to CSS custom properties. */
|
|
137
|
+
declare const COLOR_NAMESPACES: ReadonlySet<string>;
|
|
138
|
+
/** CSS color keywords that pass through without token resolution. */
|
|
139
|
+
declare const CSS_COLOR_KEYWORDS: ReadonlySet<string>;
|
|
140
|
+
/** Content keywords. */
|
|
141
|
+
declare const CONTENT_MAP: Record<string, string>;
|
|
142
|
+
/** Supported pseudo-state prefixes. */
|
|
143
|
+
declare const PSEUDO_PREFIXES: ReadonlySet<string>;
|
|
144
|
+
/** Map pseudo shorthand names to CSS pseudo-selectors. */
|
|
145
|
+
declare const PSEUDO_MAP: Record<string, string>;
|
|
83
146
|
interface FontSrc {
|
|
84
147
|
path: string;
|
|
85
148
|
weight?: string | number;
|
|
@@ -164,65 +227,6 @@ interface CompileThemeOptions {
|
|
|
164
227
|
*/
|
|
165
228
|
declare function compileTheme(theme: Theme, options?: CompileThemeOptions): CompiledTheme;
|
|
166
229
|
/**
|
|
167
|
-
* Shared CSS token lookup tables.
|
|
168
|
-
*
|
|
169
|
-
* This is the single source of truth for all CSS token resolution data.
|
|
170
|
-
* These tables are consumed by:
|
|
171
|
-
* 1. packages/ui/src/css/token-resolver.ts (runtime)
|
|
172
|
-
* 2. packages/ui-compiler/src/transformers/css-transformer.ts (compiler)
|
|
173
|
-
* 3. packages/ui-compiler/src/css-extraction/extractor.ts (extraction)
|
|
174
|
-
*
|
|
175
|
-
* DO NOT duplicate these tables elsewhere. If you need a new token,
|
|
176
|
-
* add it here and all consumers will pick it up automatically.
|
|
177
|
-
*/
|
|
178
|
-
interface PropertyMapping {
|
|
179
|
-
/** CSS property name(s). If multiple, all get the same value. */
|
|
180
|
-
properties: string[];
|
|
181
|
-
/** Value resolver type. */
|
|
182
|
-
valueType: "spacing" | "color" | "radius" | "shadow" | "size" | "display" | "alignment" | "font-size" | "font-weight" | "line-height" | "ring" | "content" | "raw";
|
|
183
|
-
}
|
|
184
|
-
declare const PROPERTY_MAP: Record<string, PropertyMapping>;
|
|
185
|
-
/** A single CSS property-value pair. */
|
|
186
|
-
interface CSSDeclarationEntry {
|
|
187
|
-
property: string;
|
|
188
|
-
value: string;
|
|
189
|
-
}
|
|
190
|
-
/** Keyword map -- single keywords that resolve to one or more declarations. */
|
|
191
|
-
declare const KEYWORD_MAP: Record<string, CSSDeclarationEntry[]>;
|
|
192
|
-
/**
|
|
193
|
-
* Display-only keyword map. Used by the compiler for quick display keyword
|
|
194
|
-
* lookup without processing the full KEYWORD_MAP.
|
|
195
|
-
*/
|
|
196
|
-
declare const DISPLAY_MAP: Record<string, string>;
|
|
197
|
-
/** Spacing scale: number -> rem. 1=0.25rem, 2=0.5rem, 4=1rem, 8=2rem, etc. */
|
|
198
|
-
declare const SPACING_SCALE: Record<string, string>;
|
|
199
|
-
/** Border radius scale — matches Tailwind v4 / shadcn. */
|
|
200
|
-
declare const RADIUS_SCALE: Record<string, string>;
|
|
201
|
-
/** Shadow scale. */
|
|
202
|
-
declare const SHADOW_SCALE: Record<string, string>;
|
|
203
|
-
/** Font size scale. */
|
|
204
|
-
declare const FONT_SIZE_SCALE: Record<string, string>;
|
|
205
|
-
/** Font weight scale. */
|
|
206
|
-
declare const FONT_WEIGHT_SCALE: Record<string, string>;
|
|
207
|
-
/** Line height scale. */
|
|
208
|
-
declare const LINE_HEIGHT_SCALE: Record<string, string>;
|
|
209
|
-
/** Alignment value map. */
|
|
210
|
-
declare const ALIGNMENT_MAP: Record<string, string>;
|
|
211
|
-
/** Size keywords for width/height. */
|
|
212
|
-
declare const SIZE_KEYWORDS: Record<string, string>;
|
|
213
|
-
/** Height-axis property shorthands that should use vh units. */
|
|
214
|
-
declare const HEIGHT_AXIS_PROPERTIES: ReadonlySet<string>;
|
|
215
|
-
/** Known color token namespaces -- values that resolve to CSS custom properties. */
|
|
216
|
-
declare const COLOR_NAMESPACES: ReadonlySet<string>;
|
|
217
|
-
/** CSS color keywords that pass through without token resolution. */
|
|
218
|
-
declare const CSS_COLOR_KEYWORDS: ReadonlySet<string>;
|
|
219
|
-
/** Content keywords. */
|
|
220
|
-
declare const CONTENT_MAP: Record<string, string>;
|
|
221
|
-
/** Supported pseudo-state prefixes. */
|
|
222
|
-
declare const PSEUDO_PREFIXES: ReadonlySet<string>;
|
|
223
|
-
/** Map pseudo shorthand names to CSS pseudo-selectors. */
|
|
224
|
-
declare const PSEUDO_MAP: Record<string, string>;
|
|
225
|
-
/**
|
|
226
230
|
* Brand symbol for render nodes.
|
|
227
231
|
* SSR nodes add this to their prototype for fast identification.
|
|
228
232
|
* Browser DOM nodes use the `instanceof Node` fallback in `isRenderNode`.
|
|
@@ -284,8 +288,12 @@ declare function onAnimationsComplete(el: Element, callback: () => void): void;
|
|
|
284
288
|
*
|
|
285
289
|
* Compiler output target for reactive attribute expressions.
|
|
286
290
|
* Returns a dispose function to stop the reactive binding.
|
|
291
|
+
*
|
|
292
|
+
* Uses deferredDomEffect so the first run is skipped during hydration
|
|
293
|
+
* (SSR attributes are already correct). Dependency tracking is
|
|
294
|
+
* established when endHydration() flushes the deferred queue.
|
|
287
295
|
*/
|
|
288
|
-
declare function __attr(el: HTMLElement, name: string, fn: () => string | boolean | null | undefined): DisposeFn;
|
|
296
|
+
declare function __attr(el: HTMLElement, name: string, fn: () => string | boolean | Record<string, string | number> | null | undefined): DisposeFn;
|
|
289
297
|
/**
|
|
290
298
|
* Reactive display toggle.
|
|
291
299
|
* When fn() returns false, the element is hidden (display: none).
|
|
@@ -437,6 +445,7 @@ declare function clearChildren(container: Node): void;
|
|
|
437
445
|
* @returns A dispose function to stop the reactive list reconciliation
|
|
438
446
|
*/
|
|
439
447
|
declare function __list<T>(container: HTMLElement, items: Signal<T[]> | (() => T[]), keyFn: (item: T, index: number) => string | number, renderFn: (item: T) => Node): DisposeFn;
|
|
448
|
+
declare function styleObjectToString(style: Record<string, string | number | null | undefined>): string;
|
|
440
449
|
/**
|
|
441
450
|
* Returns true when running in a real browser environment.
|
|
442
451
|
* Returns false on the server, even if `window` exists (DOM shim).
|
|
@@ -534,6 +543,24 @@ type ExtractParams<T extends string> = [ExtractParamsFromSegments<WithoutWildcar
|
|
|
534
543
|
} : Record<string, never> : HasWildcard<T> extends true ? { [K in ExtractParamsFromSegments<WithoutWildcard<T>>] : string } & {
|
|
535
544
|
"*": string;
|
|
536
545
|
} : { [K in ExtractParamsFromSegments<WithoutWildcard<T>>] : string };
|
|
546
|
+
/**
|
|
547
|
+
* View Transitions API integration.
|
|
548
|
+
*
|
|
549
|
+
* Provides a utility to wrap DOM updates in browser view transitions,
|
|
550
|
+
* with graceful degradation for unsupported browsers, reduced motion
|
|
551
|
+
* preferences, and SSR environments.
|
|
552
|
+
*/
|
|
553
|
+
/** View transition configuration. */
|
|
554
|
+
interface ViewTransitionConfig {
|
|
555
|
+
/**
|
|
556
|
+
* CSS class name added to `<html>` during the transition,
|
|
557
|
+
* enabling per-transition CSS animation rules via
|
|
558
|
+
* `.className::view-transition-old(root)` etc.
|
|
559
|
+
*
|
|
560
|
+
* Omit for the default cross-fade.
|
|
561
|
+
*/
|
|
562
|
+
className?: string;
|
|
563
|
+
}
|
|
537
564
|
/** Schema interface for parsing and validating values (search params, path params). */
|
|
538
565
|
interface SearchParamSchema<T> {
|
|
539
566
|
parse(data: unknown): {
|
|
@@ -572,6 +599,10 @@ interface RouteConfig<
|
|
|
572
599
|
children?: RouteDefinitionMap;
|
|
573
600
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
574
601
|
prerender?: boolean;
|
|
602
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
603
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
604
|
+
/** Per-route view transition config. Overrides global RouterOptions.viewTransition. */
|
|
605
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
575
606
|
}
|
|
576
607
|
/** A map of path patterns to route configs (user input format). */
|
|
577
608
|
interface RouteDefinitionMap {
|
|
@@ -595,6 +626,10 @@ interface CompiledRoute {
|
|
|
595
626
|
children?: CompiledRoute[];
|
|
596
627
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
597
628
|
prerender?: boolean;
|
|
629
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
630
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
631
|
+
/** Per-route view transition config. */
|
|
632
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
598
633
|
}
|
|
599
634
|
/** A single matched route entry in the matched chain. */
|
|
600
635
|
interface MatchedRoute {
|
|
@@ -970,6 +1005,12 @@ interface SSRRenderContext {
|
|
|
970
1005
|
*/
|
|
971
1006
|
discoveredRoutes?: string[];
|
|
972
1007
|
/**
|
|
1008
|
+
* Route patterns that matched the current URL during SSR.
|
|
1009
|
+
* The full matched chain from root to leaf (e.g., ['/app', '/app/settings']).
|
|
1010
|
+
* Used by the SSR handler to inject per-route modulepreload tags.
|
|
1011
|
+
*/
|
|
1012
|
+
matchedRoutePatterns?: string[];
|
|
1013
|
+
/**
|
|
973
1014
|
* Auth state resolved by the server (e.g. from session cookie).
|
|
974
1015
|
* Set by ssrRenderToString() before Pass 1 so AuthProvider can
|
|
975
1016
|
* hydrate status/user synchronously during SSR.
|
|
@@ -985,7 +1026,7 @@ interface SSRRenderContext {
|
|
|
985
1026
|
};
|
|
986
1027
|
}
|
|
987
1028
|
/** Auth state injected into SSRRenderContext by the server. */
|
|
988
|
-
type SSRAuth = {
|
|
1029
|
+
type SSRAuth = ({
|
|
989
1030
|
status: "authenticated";
|
|
990
1031
|
user: {
|
|
991
1032
|
id: string;
|
|
@@ -996,6 +1037,13 @@ type SSRAuth = {
|
|
|
996
1037
|
expiresAt: number;
|
|
997
1038
|
} | {
|
|
998
1039
|
status: "unauthenticated";
|
|
1040
|
+
}) & {
|
|
1041
|
+
/** OAuth provider metadata for SSR rendering of login buttons. */
|
|
1042
|
+
providers?: {
|
|
1043
|
+
id: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
authUrl: string;
|
|
1046
|
+
}[];
|
|
999
1047
|
};
|
|
1000
1048
|
type SSRContextResolver = () => SSRRenderContext | undefined;
|
|
1001
1049
|
declare function registerSSRResolver(resolver: SSRContextResolver | null): void;
|
|
@@ -1010,4 +1058,4 @@ declare function getSSRContext(): SSRRenderContext | undefined;
|
|
|
1010
1058
|
* clears during HMR module re-evaluation.
|
|
1011
1059
|
*/
|
|
1012
1060
|
declare function hasSSRResolver(): boolean;
|
|
1013
|
-
export { stopSignalCollection, startSignalCollection, setContextScope, setAdapter, runCleanups, resolveComponent, removeNode, registerSSRResolver, pushScope, popScope, onCleanup, onAnimationsComplete, matchRoute, matchPath, lifecycleEffect, isRenderNode, isBrowser, insertBefore, hasSSRResolver, getSSRContext, getContextScope, getAdapter, executeLoaders, domEffect, deserializeProps, deriveKey, createDOMAdapter, compileTheme, clearChildren, _tryOnCleanup, __text, __staticText, __show, __on, __list, __insert, __exitChildren, __enterChildren, __element, __conditional, __classList, __child, __attr, __append, SSRRenderContext, SSRQueryEntry, SSRAuth, SPACING_SCALE, SIZE_KEYWORDS, SHADOW_SCALE, RenderText, RenderNode, RenderElement, RenderAdapter, RENDER_NODE_BRAND, RADIUS_SCALE, QueryEnvelopeStore, PropertyMapping, PSEUDO_PREFIXES, PSEUDO_MAP, PROPERTY_MAP, MemoryCache, MatchResult, LINE_HEIGHT_SCALE, KEYWORD_MAP, HEIGHT_AXIS_PROPERTIES, FONT_WEIGHT_SCALE, FONT_SIZE_SCALE, EntityStore, DISPLAY_MAP, CSS_COLOR_KEYWORDS, CSSDeclarationEntry, CONTENT_MAP, COLOR_NAMESPACES, ALIGNMENT_MAP };
|
|
1061
|
+
export { stopSignalCollection, startSignalCollection, setContextScope, setAdapter, runCleanups, resolveComponent, removeNode, registerSSRResolver, pushScope, popScope, onCleanup, onAnimationsComplete, matchRoute, matchPath, lifecycleEffect, isRenderNode, isBrowser, insertBefore, hasSSRResolver, getSSRContext, getContextScope, getAdapter, executeLoaders, domEffect, deserializeProps, deriveKey, createDOMAdapter, compileTheme, clearChildren, _tryOnCleanup, __text, styleObjectToString as __styleStr, __staticText, __show, __on, __list, __insert, __exitChildren, __enterChildren, __element, __conditional, __classList, __child, __attr, __append, SSRRenderContext, SSRQueryEntry, SSRAuth, SPACING_SCALE, SIZE_KEYWORDS, SHADOW_SCALE, RenderText, RenderNode, RenderElement, RenderAdapter, RENDER_NODE_BRAND, RADIUS_SCALE, QueryEnvelopeStore, PropertyMapping, PSEUDO_PREFIXES, PSEUDO_MAP, PROPERTY_MAP, MemoryCache, MatchResult, LINE_HEIGHT_SCALE, KEYWORD_MAP, HEIGHT_AXIS_PROPERTIES, FONT_WEIGHT_SCALE, FONT_SIZE_SCALE, EntityStore, DISPLAY_MAP, CSS_COLOR_KEYWORDS, CSSDeclarationEntry, CONTENT_MAP, COLOR_NAMESPACES, ALIGNMENT_MAP };
|
package/dist/src/internals.js
CHANGED
|
@@ -2,24 +2,27 @@ import {
|
|
|
2
2
|
deserializeProps,
|
|
3
3
|
onAnimationsComplete,
|
|
4
4
|
resolveComponent
|
|
5
|
-
} from "../shared/chunk-
|
|
5
|
+
} from "../shared/chunk-pdqr78k9.js";
|
|
6
6
|
import {
|
|
7
7
|
__attr,
|
|
8
8
|
__classList,
|
|
9
9
|
__on,
|
|
10
10
|
__show
|
|
11
|
-
} from "../shared/chunk-
|
|
11
|
+
} from "../shared/chunk-kjwp5q5s.js";
|
|
12
|
+
import {
|
|
13
|
+
styleObjectToString
|
|
14
|
+
} from "../shared/chunk-4xkw6h1s.js";
|
|
12
15
|
import {
|
|
13
16
|
executeLoaders,
|
|
14
17
|
matchPath,
|
|
15
18
|
matchRoute
|
|
16
|
-
} from "../shared/chunk-
|
|
19
|
+
} from "../shared/chunk-am9zaw4h.js";
|
|
17
20
|
import {
|
|
18
21
|
EntityStore,
|
|
19
22
|
MemoryCache,
|
|
20
23
|
QueryEnvelopeStore,
|
|
21
24
|
deriveKey
|
|
22
|
-
} from "../shared/chunk-
|
|
25
|
+
} from "../shared/chunk-szk0hyjg.js";
|
|
23
26
|
import"../shared/chunk-jrtrk5z4.js";
|
|
24
27
|
import {
|
|
25
28
|
ALIGNMENT_MAP,
|
|
@@ -40,7 +43,7 @@ import {
|
|
|
40
43
|
SIZE_KEYWORDS,
|
|
41
44
|
SPACING_SCALE,
|
|
42
45
|
compileTheme
|
|
43
|
-
} from "../shared/chunk-
|
|
46
|
+
} from "../shared/chunk-pq8khh47.js";
|
|
44
47
|
import {
|
|
45
48
|
__append,
|
|
46
49
|
__child,
|
|
@@ -49,11 +52,8 @@ import {
|
|
|
49
52
|
__exitChildren,
|
|
50
53
|
__insert,
|
|
51
54
|
__staticText,
|
|
52
|
-
__text
|
|
53
|
-
|
|
54
|
-
claimText,
|
|
55
|
-
getIsHydrating
|
|
56
|
-
} from "../shared/chunk-mgfrrrjq.js";
|
|
55
|
+
__text
|
|
56
|
+
} from "../shared/chunk-vwz86vg9.js";
|
|
57
57
|
import"../shared/chunk-prj7nm08.js";
|
|
58
58
|
import {
|
|
59
59
|
RENDER_NODE_BRAND,
|
|
@@ -61,14 +61,17 @@ import {
|
|
|
61
61
|
getAdapter,
|
|
62
62
|
isRenderNode,
|
|
63
63
|
setAdapter
|
|
64
|
-
} from "../shared/chunk-
|
|
64
|
+
} from "../shared/chunk-c61572xp.js";
|
|
65
65
|
import {
|
|
66
66
|
isBrowser
|
|
67
|
-
} from "../shared/chunk-
|
|
67
|
+
} from "../shared/chunk-bybgyjye.js";
|
|
68
68
|
import {
|
|
69
69
|
_tryOnCleanup,
|
|
70
|
+
claimComment,
|
|
71
|
+
claimText,
|
|
70
72
|
domEffect,
|
|
71
73
|
getContextScope,
|
|
74
|
+
getIsHydrating,
|
|
72
75
|
getSSRContext,
|
|
73
76
|
hasSSRResolver,
|
|
74
77
|
lifecycleEffect,
|
|
@@ -81,7 +84,7 @@ import {
|
|
|
81
84
|
signal,
|
|
82
85
|
startSignalCollection,
|
|
83
86
|
stopSignalCollection
|
|
84
|
-
} from "../shared/chunk-
|
|
87
|
+
} from "../shared/chunk-2qe6aqhb.js";
|
|
85
88
|
// src/dom/conditional.ts
|
|
86
89
|
function normalizeNode(branchResult) {
|
|
87
90
|
if (branchResult == null || typeof branchResult === "boolean") {
|
|
@@ -243,7 +246,7 @@ function __list(container, items, keyFn, renderFn) {
|
|
|
243
246
|
const outerScope = pushScope();
|
|
244
247
|
let isFirstRun = true;
|
|
245
248
|
domEffect(() => {
|
|
246
|
-
const newItems = getItems();
|
|
249
|
+
const newItems = getItems() ?? [];
|
|
247
250
|
if (isFirstRun && isHydrationRun) {
|
|
248
251
|
isFirstRun = false;
|
|
249
252
|
for (const [i, item] of newItems.entries()) {
|
|
@@ -344,6 +347,7 @@ export {
|
|
|
344
347
|
clearChildren,
|
|
345
348
|
_tryOnCleanup,
|
|
346
349
|
__text,
|
|
350
|
+
styleObjectToString as __styleStr,
|
|
347
351
|
__staticText,
|
|
348
352
|
__show,
|
|
349
353
|
__on,
|
|
@@ -3,6 +3,24 @@ interface Ref<T> {
|
|
|
3
3
|
current: T | undefined;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
+
* Extracts string-valued property names from CSSStyleDeclaration.
|
|
7
|
+
* Filters out methods (getPropertyValue, item, etc.), numeric properties (length),
|
|
8
|
+
* and non-string properties (parentRule). Uses Extract<keyof, string> to exclude
|
|
9
|
+
* numeric index signatures.
|
|
10
|
+
*/
|
|
11
|
+
type CSSPropertyName = { [K in Extract<keyof CSSStyleDeclaration, string>] : CSSStyleDeclaration[K] extends string ? K : never }[Extract<keyof CSSStyleDeclaration, string>];
|
|
12
|
+
/**
|
|
13
|
+
* CSS properties type for the style prop, derived from CSSStyleDeclaration.
|
|
14
|
+
* Provides autocomplete for all CSS properties the browser supports.
|
|
15
|
+
*
|
|
16
|
+
* - All properties accept string | number (numeric values get auto-px at runtime)
|
|
17
|
+
* - CSS custom properties (--*) are supported via template literal index signature
|
|
18
|
+
* - Stays current with whatever TypeScript version the developer uses
|
|
19
|
+
*/
|
|
20
|
+
type CSSProperties = { [K in CSSPropertyName]? : string | number } & {
|
|
21
|
+
[key: `--${string}`]: string | number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
6
24
|
* JSX namespace - required for TypeScript's react-jsx mode
|
|
7
25
|
* to understand intrinsic element types and component types.
|
|
8
26
|
*/
|
|
@@ -12,6 +30,8 @@ declare namespace JSX {
|
|
|
12
30
|
interface HTMLAttributes {
|
|
13
31
|
[key: string]: unknown;
|
|
14
32
|
children?: unknown;
|
|
33
|
+
className?: string;
|
|
34
|
+
style?: string | CSSProperties;
|
|
15
35
|
}
|
|
16
36
|
interface IntrinsicAttributes {
|
|
17
37
|
key?: string | number;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
styleObjectToString
|
|
3
|
+
} from "../../shared/chunk-4xkw6h1s.js";
|
|
1
4
|
import {
|
|
2
5
|
SVG_NS,
|
|
3
6
|
isSVGTag,
|
|
@@ -29,14 +32,21 @@ function jsxImpl(tag, props) {
|
|
|
29
32
|
const { children, ref: refProp, ...attrs } = props || {};
|
|
30
33
|
const svg = isSVGTag(tag);
|
|
31
34
|
const element = svg ? document.createElementNS(SVG_NS, tag) : document.createElement(tag);
|
|
35
|
+
const resolvedClass = attrs.className ?? attrs.class;
|
|
32
36
|
for (const [key, value] of Object.entries(attrs)) {
|
|
37
|
+
if (key === "className" || key === "class") {
|
|
38
|
+
if (key === "class" && attrs.className != null)
|
|
39
|
+
continue;
|
|
40
|
+
if (resolvedClass != null) {
|
|
41
|
+
element.setAttribute("class", String(resolvedClass));
|
|
42
|
+
}
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
33
45
|
if (key.startsWith("on") && typeof value === "function") {
|
|
34
46
|
const eventName = key.slice(2).toLowerCase();
|
|
35
47
|
element.addEventListener(eventName, value);
|
|
36
|
-
} else if (key === "class" && value != null) {
|
|
37
|
-
element.setAttribute("class", String(value));
|
|
38
48
|
} else if (key === "style" && value != null) {
|
|
39
|
-
element.setAttribute("style", String(value));
|
|
49
|
+
element.setAttribute("style", typeof value === "object" && !Array.isArray(value) ? styleObjectToString(value) : String(value));
|
|
40
50
|
} else if (value === true) {
|
|
41
51
|
element.setAttribute(key, "");
|
|
42
52
|
} else if (value != null && value !== false) {
|
package/dist/src/query/public.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
query,
|
|
3
3
|
queryMatch
|
|
4
|
-
} from "../../shared/chunk-
|
|
4
|
+
} from "../../shared/chunk-szk0hyjg.js";
|
|
5
5
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
6
|
-
import"../../shared/chunk-
|
|
7
|
-
import"../../shared/chunk-
|
|
8
|
-
import"../../shared/chunk-
|
|
6
|
+
import"../../shared/chunk-c61572xp.js";
|
|
7
|
+
import"../../shared/chunk-bybgyjye.js";
|
|
8
|
+
import"../../shared/chunk-2qe6aqhb.js";
|
|
9
9
|
|
|
10
10
|
// src/query/public.ts
|
|
11
11
|
import { isQueryDescriptor } from "@vertz/fetch";
|
|
@@ -46,6 +46,24 @@ type RoutePattern<TRouteMap extends Record<string, unknown>> = keyof TRouteMap &
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
type RoutePaths<TRouteMap extends Record<string, unknown>> = { [K in RoutePattern<TRouteMap>] : PathWithParams<K> }[RoutePattern<TRouteMap>];
|
|
49
|
+
/**
|
|
50
|
+
* View Transitions API integration.
|
|
51
|
+
*
|
|
52
|
+
* Provides a utility to wrap DOM updates in browser view transitions,
|
|
53
|
+
* with graceful degradation for unsupported browsers, reduced motion
|
|
54
|
+
* preferences, and SSR environments.
|
|
55
|
+
*/
|
|
56
|
+
/** View transition configuration. */
|
|
57
|
+
interface ViewTransitionConfig {
|
|
58
|
+
/**
|
|
59
|
+
* CSS class name added to `<html>` during the transition,
|
|
60
|
+
* enabling per-transition CSS animation rules via
|
|
61
|
+
* `.className::view-transition-old(root)` etc.
|
|
62
|
+
*
|
|
63
|
+
* Omit for the default cross-fade.
|
|
64
|
+
*/
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
|
49
67
|
/** Schema interface for parsing and validating values (search params, path params). */
|
|
50
68
|
interface SearchParamSchema<T> {
|
|
51
69
|
parse(data: unknown): {
|
|
@@ -84,6 +102,10 @@ interface RouteConfig<
|
|
|
84
102
|
children?: RouteDefinitionMap;
|
|
85
103
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
86
104
|
prerender?: boolean;
|
|
105
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
106
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
107
|
+
/** Per-route view transition config. Overrides global RouterOptions.viewTransition. */
|
|
108
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
87
109
|
}
|
|
88
110
|
/** A map of path patterns to route configs (user input format). */
|
|
89
111
|
interface RouteDefinitionMap {
|
|
@@ -114,6 +136,8 @@ interface RouteConfigLike {
|
|
|
114
136
|
searchParams?: SearchParamSchema<unknown>;
|
|
115
137
|
children?: Record<string, RouteConfigLike>;
|
|
116
138
|
prerender?: boolean;
|
|
139
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
140
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
117
141
|
}
|
|
118
142
|
/**
|
|
119
143
|
* Phantom branded array that carries the route map type `T`.
|
|
@@ -149,6 +173,10 @@ interface CompiledRoute {
|
|
|
149
173
|
children?: CompiledRoute[];
|
|
150
174
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
151
175
|
prerender?: boolean;
|
|
176
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
177
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
178
|
+
/** Per-route view transition config. */
|
|
179
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
152
180
|
}
|
|
153
181
|
/** A single matched route entry in the matched chain. */
|
|
154
182
|
interface MatchedRoute {
|
|
@@ -242,6 +270,11 @@ interface LinkProps<T extends Record<string, RouteConfigLike> = RouteDefinitionM
|
|
|
242
270
|
activeClass?: string;
|
|
243
271
|
/** Static class name for the anchor element. */
|
|
244
272
|
className?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Static class for the anchor element.
|
|
275
|
+
* @deprecated Use `className` instead.
|
|
276
|
+
*/
|
|
277
|
+
class?: string;
|
|
245
278
|
/** Prefetch strategy. 'hover' triggers server pre-fetch on mouseenter/focus. */
|
|
246
279
|
prefetch?: "hover";
|
|
247
280
|
}
|
|
@@ -264,7 +297,7 @@ declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url:
|
|
|
264
297
|
* Reads the router from `RouterContext` automatically — no manual wiring needed.
|
|
265
298
|
* Just use `<Link href="/about">About</Link>` inside a router-provided tree.
|
|
266
299
|
*/
|
|
267
|
-
declare function Link({ href, children, activeClass, className }: LinkProps): HTMLAnchorElement;
|
|
300
|
+
declare function Link({ href, children, activeClass, class: classProp, className }: LinkProps): HTMLAnchorElement;
|
|
268
301
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
269
302
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
270
303
|
/** Options for router.navigate(). */
|
|
@@ -275,6 +308,11 @@ interface NavigateOptions {
|
|
|
275
308
|
params?: Record<string, string>;
|
|
276
309
|
/** Search params appended to the final URL. */
|
|
277
310
|
search?: NavigateSearch;
|
|
311
|
+
/**
|
|
312
|
+
* Override view transition for this navigation only.
|
|
313
|
+
* `false` explicitly disables even if route/global config enables transitions.
|
|
314
|
+
*/
|
|
315
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
278
316
|
}
|
|
279
317
|
type NavigateOptionsFor<TPath extends string> = string extends TPath ? NavigateOptions : TPath extends `${string}:${string}` | `${string}*` ? Omit<NavigateOptions, "params"> & {
|
|
280
318
|
params: ExtractParams<TPath>;
|
|
@@ -302,6 +340,14 @@ interface RouterOptions {
|
|
|
302
340
|
_prefetchNavData?: (url: string, options?: {
|
|
303
341
|
timeout?: number;
|
|
304
342
|
}) => PrefetchHandle;
|
|
343
|
+
/**
|
|
344
|
+
* Global view transition setting.
|
|
345
|
+
* - `true` → all navigations use the default cross-fade
|
|
346
|
+
* - `ViewTransitionConfig` → all navigations use the config
|
|
347
|
+
* - Per-route and per-navigation overrides take precedence
|
|
348
|
+
* - Default: `undefined` (no transitions)
|
|
349
|
+
*/
|
|
350
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
305
351
|
}
|
|
306
352
|
/**
|
|
307
353
|
* The router instance returned by createRouter.
|
|
@@ -6,25 +6,26 @@ import {
|
|
|
6
6
|
createLink,
|
|
7
7
|
parseSearchParams,
|
|
8
8
|
useSearchParams
|
|
9
|
-
} from "../../shared/chunk-
|
|
10
|
-
import"../../shared/chunk-
|
|
9
|
+
} from "../../shared/chunk-67z8b0q8.js";
|
|
10
|
+
import"../../shared/chunk-kjwp5q5s.js";
|
|
11
|
+
import"../../shared/chunk-4xkw6h1s.js";
|
|
11
12
|
import {
|
|
12
13
|
createRouter
|
|
13
|
-
} from "../../shared/chunk-
|
|
14
|
+
} from "../../shared/chunk-7g722pdh.js";
|
|
14
15
|
import {
|
|
15
16
|
defineRoutes
|
|
16
|
-
} from "../../shared/chunk-
|
|
17
|
+
} from "../../shared/chunk-am9zaw4h.js";
|
|
17
18
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
18
|
-
import"../../shared/chunk-
|
|
19
|
+
import"../../shared/chunk-vwz86vg9.js";
|
|
19
20
|
import"../../shared/chunk-prj7nm08.js";
|
|
20
|
-
import"../../shared/chunk-
|
|
21
|
+
import"../../shared/chunk-c61572xp.js";
|
|
21
22
|
import {
|
|
22
23
|
RouterContext,
|
|
23
24
|
useParams,
|
|
24
25
|
useRouter
|
|
25
|
-
} from "../../shared/chunk-
|
|
26
|
-
import"../../shared/chunk-
|
|
27
|
-
import"../../shared/chunk-
|
|
26
|
+
} from "../../shared/chunk-4cmt1ve8.js";
|
|
27
|
+
import"../../shared/chunk-bybgyjye.js";
|
|
28
|
+
import"../../shared/chunk-2qe6aqhb.js";
|
|
28
29
|
export {
|
|
29
30
|
useSearchParams,
|
|
30
31
|
useRouter,
|
package/dist/src/test/index.d.ts
CHANGED
|
@@ -140,6 +140,24 @@ type ExtractParams<T extends string> = [ExtractParamsFromSegments<WithoutWildcar
|
|
|
140
140
|
} : { [K in ExtractParamsFromSegments<WithoutWildcard<T>>] : string };
|
|
141
141
|
/** Union of route pattern keys from a route map. */
|
|
142
142
|
type RoutePattern<TRouteMap extends Record<string, unknown>> = keyof TRouteMap & string;
|
|
143
|
+
/**
|
|
144
|
+
* View Transitions API integration.
|
|
145
|
+
*
|
|
146
|
+
* Provides a utility to wrap DOM updates in browser view transitions,
|
|
147
|
+
* with graceful degradation for unsupported browsers, reduced motion
|
|
148
|
+
* preferences, and SSR environments.
|
|
149
|
+
*/
|
|
150
|
+
/** View transition configuration. */
|
|
151
|
+
interface ViewTransitionConfig {
|
|
152
|
+
/**
|
|
153
|
+
* CSS class name added to `<html>` during the transition,
|
|
154
|
+
* enabling per-transition CSS animation rules via
|
|
155
|
+
* `.className::view-transition-old(root)` etc.
|
|
156
|
+
*
|
|
157
|
+
* Omit for the default cross-fade.
|
|
158
|
+
*/
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
143
161
|
/** Schema interface for parsing and validating values (search params, path params). */
|
|
144
162
|
interface SearchParamSchema<T> {
|
|
145
163
|
parse(data: unknown): {
|
|
@@ -178,6 +196,10 @@ interface RouteConfig<
|
|
|
178
196
|
children?: RouteDefinitionMap;
|
|
179
197
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
180
198
|
prerender?: boolean;
|
|
199
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
200
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
201
|
+
/** Per-route view transition config. Overrides global RouterOptions.viewTransition. */
|
|
202
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
181
203
|
}
|
|
182
204
|
/** A map of path patterns to route configs (user input format). */
|
|
183
205
|
interface RouteDefinitionMap {
|
|
@@ -208,6 +230,8 @@ interface RouteConfigLike {
|
|
|
208
230
|
searchParams?: SearchParamSchema<unknown>;
|
|
209
231
|
children?: Record<string, RouteConfigLike>;
|
|
210
232
|
prerender?: boolean;
|
|
233
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
234
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
211
235
|
}
|
|
212
236
|
/** Internal compiled route. */
|
|
213
237
|
interface CompiledRoute {
|
|
@@ -227,6 +251,10 @@ interface CompiledRoute {
|
|
|
227
251
|
children?: CompiledRoute[];
|
|
228
252
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
229
253
|
prerender?: boolean;
|
|
254
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
255
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
256
|
+
/** Per-route view transition config. */
|
|
257
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
230
258
|
}
|
|
231
259
|
/** A single matched route entry in the matched chain. */
|
|
232
260
|
interface MatchedRoute {
|
|
@@ -271,6 +299,11 @@ interface NavigateOptions {
|
|
|
271
299
|
params?: Record<string, string>;
|
|
272
300
|
/** Search params appended to the final URL. */
|
|
273
301
|
search?: NavigateSearch;
|
|
302
|
+
/**
|
|
303
|
+
* Override view transition for this navigation only.
|
|
304
|
+
* `false` explicitly disables even if route/global config enables transitions.
|
|
305
|
+
*/
|
|
306
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
274
307
|
}
|
|
275
308
|
type NavigateOptionsFor<TPath extends string> = string extends TPath ? NavigateOptions : TPath extends `${string}:${string}` | `${string}*` ? Omit<NavigateOptions, "params"> & {
|
|
276
309
|
params: ExtractParams<TPath>;
|
package/dist/src/test/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRouter
|
|
3
|
-
} from "../../shared/chunk-
|
|
3
|
+
} from "../../shared/chunk-7g722pdh.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRoutes
|
|
6
|
-
} from "../../shared/chunk-
|
|
6
|
+
} from "../../shared/chunk-am9zaw4h.js";
|
|
7
7
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
8
|
-
import"../../shared/chunk-
|
|
9
|
-
import"../../shared/chunk-
|
|
8
|
+
import"../../shared/chunk-bybgyjye.js";
|
|
9
|
+
import"../../shared/chunk-2qe6aqhb.js";
|
|
10
10
|
|
|
11
11
|
// src/test/interactions.ts
|
|
12
12
|
async function click(el) {
|