@vertz/ui 0.2.28 → 0.2.30
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-djvarb8r.js → chunk-1j59xzqm.js} +13 -2
- package/dist/shared/{chunk-ppr06jgn.js → chunk-1yd6jfw5.js} +14 -7
- package/dist/shared/{chunk-1jgws7rs.js → chunk-5vcnmqck.js} +6 -6
- package/dist/shared/{chunk-2krx4aqe.js → chunk-5xm1w16j.js} +11 -7
- package/dist/shared/{chunk-7nr2ebrf.js → chunk-9p84cvet.js} +1 -1
- package/dist/shared/{chunk-am9zaw4h.js → chunk-ah86rm07.js} +7 -0
- package/dist/shared/{chunk-h2sjma78.js → chunk-hcgnfw27.js} +1 -1
- package/dist/shared/{chunk-e09mdqcx.js → chunk-mm9ms792.js} +192 -22
- package/dist/shared/{chunk-svvqjmyy.js → chunk-mntc8w0g.js} +1 -1
- package/dist/shared/{chunk-ymc3wwam.js → chunk-n824qrvk.js} +2 -2
- package/dist/shared/{chunk-09ntccdx.js → chunk-pv0apt9z.js} +1 -1
- package/dist/shared/{chunk-j1a7t906.js → chunk-pwmjtxpn.js} +2 -2
- package/dist/shared/{chunk-xs5s8gqe.js → chunk-sjypbv24.js} +1 -1
- package/dist/src/auth/public.d.ts +4 -0
- package/dist/src/auth/public.js +4 -4
- package/dist/src/css/public.js +3 -3
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +43 -6
- package/dist/src/index.js +13 -13
- package/dist/src/internals.js +9 -9
- package/dist/src/query/public.js +4 -4
- package/dist/src/router/public.d.ts +43 -6
- package/dist/src/router/public.js +8 -8
- package/dist/src/test/index.d.ts +9 -0
- package/dist/src/test/index.js +4 -4
- package/package.json +3 -3
- package/reactivity.json +6 -0
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
styleObjectToString
|
|
6
6
|
} from "./chunk-h1fsr8kv.js";
|
|
7
7
|
import {
|
|
8
|
+
advanceCursor,
|
|
8
9
|
claimComment,
|
|
9
10
|
claimElement,
|
|
10
11
|
claimText,
|
|
@@ -19,7 +20,7 @@ import {
|
|
|
19
20
|
pushScope,
|
|
20
21
|
resumeHydration,
|
|
21
22
|
runCleanups
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-1yd6jfw5.js";
|
|
23
24
|
|
|
24
25
|
// src/dom/dom-adapter.ts
|
|
25
26
|
function createDOMAdapter() {
|
|
@@ -131,18 +132,26 @@ function __child(fn) {
|
|
|
131
132
|
if (getIsHydrating()) {
|
|
132
133
|
const claimed = claimComment();
|
|
133
134
|
if (claimed) {
|
|
135
|
+
if (typeof process !== "undefined" && true && claimed.data.trim() !== "child") {
|
|
136
|
+
console.warn(`[hydrate] __child expected <!--child--> but claimed <!--${claimed.data}-->. ` + "Cursor may be misaligned.");
|
|
137
|
+
}
|
|
134
138
|
const anchor2 = claimed;
|
|
135
139
|
const managed2 = [];
|
|
136
140
|
const childCleanups2 = { value: [] };
|
|
137
141
|
let sibling = anchor2.nextSibling;
|
|
138
142
|
while (sibling) {
|
|
143
|
+
const next = sibling.nextSibling;
|
|
144
|
+
if (sibling.nodeType === 8 && sibling.data.trim() === "/child") {
|
|
145
|
+
sibling.parentNode?.removeChild(sibling);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
139
148
|
if (sibling.nodeType === 8 && sibling.data.trim() === "child") {
|
|
140
149
|
break;
|
|
141
150
|
}
|
|
142
|
-
const next = sibling.nextSibling;
|
|
143
151
|
sibling.parentNode?.removeChild(sibling);
|
|
144
152
|
sibling = next;
|
|
145
153
|
}
|
|
154
|
+
advanceCursor(anchor2.nextSibling);
|
|
146
155
|
pauseHydration();
|
|
147
156
|
try {
|
|
148
157
|
const dispose2 = childEffect(anchor2, ((originalFn) => () => {
|
|
@@ -169,8 +178,10 @@ function __child(fn) {
|
|
|
169
178
|
}
|
|
170
179
|
}
|
|
171
180
|
const anchor = getAdapter().createComment("child");
|
|
181
|
+
const endMarker = getAdapter().createComment("/child");
|
|
172
182
|
const fragment = getAdapter().createDocumentFragment();
|
|
173
183
|
fragment.appendChild(anchor);
|
|
184
|
+
fragment.appendChild(endMarker);
|
|
174
185
|
const managed = [];
|
|
175
186
|
const childCleanups = { value: [] };
|
|
176
187
|
const dispose = childEffect(anchor, fn, managed, childCleanups);
|
|
@@ -368,6 +368,9 @@ function pauseHydration() {
|
|
|
368
368
|
function resumeHydration() {
|
|
369
369
|
isHydrating = true;
|
|
370
370
|
}
|
|
371
|
+
function advanceCursor(node) {
|
|
372
|
+
currentNode = node;
|
|
373
|
+
}
|
|
371
374
|
function claimElement(tag) {
|
|
372
375
|
const upperTag = tag.toUpperCase();
|
|
373
376
|
const savedNode = currentNode;
|
|
@@ -469,8 +472,15 @@ function findUnclaimedNodes(root, claimed) {
|
|
|
469
472
|
if (child.nodeType === Node.COMMENT_NODE && claimed.has(child) && child.data.trim() === "child") {
|
|
470
473
|
child = child.nextSibling;
|
|
471
474
|
while (child) {
|
|
472
|
-
if (child.nodeType === Node.COMMENT_NODE
|
|
473
|
-
|
|
475
|
+
if (child.nodeType === Node.COMMENT_NODE) {
|
|
476
|
+
const data = child.data.trim();
|
|
477
|
+
if (data === "/child") {
|
|
478
|
+
child = child.nextSibling;
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
if (data === "child") {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
474
484
|
}
|
|
475
485
|
child = child.nextSibling;
|
|
476
486
|
}
|
|
@@ -502,10 +512,7 @@ function describeNode(node) {
|
|
|
502
512
|
const preview = data.length > 20 ? data.slice(0, 20) + "..." : data;
|
|
503
513
|
return `text("${preview}")`;
|
|
504
514
|
}
|
|
505
|
-
|
|
506
|
-
return `<!-- ${node.data} -->`;
|
|
507
|
-
}
|
|
508
|
-
return `[node type=${node.nodeType}]`;
|
|
515
|
+
return `<!-- ${node.data} -->`;
|
|
509
516
|
}
|
|
510
517
|
|
|
511
518
|
// src/runtime/signal.ts
|
|
@@ -722,4 +729,4 @@ function lifecycleEffect(fn) {
|
|
|
722
729
|
return dispose;
|
|
723
730
|
}
|
|
724
731
|
|
|
725
|
-
export { registerSSRResolver, getSSRContext, hasSSRResolver, createContext, useContext, getContextScope, setContextScope, startHydration, endHydration, discardDeferredEffects, getIsHydrating, pauseHydration, resumeHydration, claimElement, claimText, claimComment, enterChildren, exitChildren, DisposalScopeError, onCleanup, _tryOnCleanup, pushScope, popScope, runCleanups, batch, setReadValueCallback, untrack, startSignalCollection, stopSignalCollection, signal, computed, domEffect, deferredDomEffect, lifecycleEffect };
|
|
732
|
+
export { registerSSRResolver, getSSRContext, hasSSRResolver, createContext, useContext, getContextScope, setContextScope, startHydration, endHydration, discardDeferredEffects, getIsHydrating, pauseHydration, resumeHydration, advanceCursor, claimElement, claimText, claimComment, enterChildren, exitChildren, DisposalScopeError, onCleanup, _tryOnCleanup, pushScope, popScope, runCleanups, batch, setReadValueCallback, untrack, startSignalCollection, stopSignalCollection, signal, computed, domEffect, deferredDomEffect, lifecycleEffect };
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-jrtrk5z4.js";
|
|
4
4
|
import {
|
|
5
5
|
registerActiveQuery
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-pv0apt9z.js";
|
|
7
7
|
import {
|
|
8
8
|
isBrowser
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-sjypbv24.js";
|
|
10
10
|
import {
|
|
11
11
|
_tryOnCleanup,
|
|
12
12
|
batch,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
setReadValueCallback,
|
|
17
17
|
signal,
|
|
18
18
|
untrack
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-1yd6jfw5.js";
|
|
20
20
|
|
|
21
21
|
// src/query/cache.ts
|
|
22
22
|
class MemoryCache {
|
|
@@ -1144,6 +1144,8 @@ function query(source, options = {}) {
|
|
|
1144
1144
|
getInflight().delete(key);
|
|
1145
1145
|
refetchTrigger.value = refetchTrigger.peek() + 1;
|
|
1146
1146
|
}
|
|
1147
|
+
let unsubscribeBus;
|
|
1148
|
+
let unregisterFromRegistry;
|
|
1147
1149
|
let disposeFn;
|
|
1148
1150
|
let isFirst = true;
|
|
1149
1151
|
disposeFn = lifecycleEffect(() => {
|
|
@@ -1332,9 +1334,7 @@ function query(source, options = {}) {
|
|
|
1332
1334
|
getQueryEnvelopeStore().delete(queryKey);
|
|
1333
1335
|
};
|
|
1334
1336
|
}
|
|
1335
|
-
|
|
1336
|
-
let unregisterFromRegistry;
|
|
1337
|
-
if (entityMeta && !isSSR()) {
|
|
1337
|
+
if (entityMeta && !isSSR() && !unsubscribeBus) {
|
|
1338
1338
|
unsubscribeBus = getMutationEventBus().subscribe(entityMeta.entityType, refetch);
|
|
1339
1339
|
unregisterFromRegistry = registerActiveQuery(entityMeta, refetch, createClearData(entityMeta));
|
|
1340
1340
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
beginDeferringMounts,
|
|
4
4
|
discardDeferredMounts,
|
|
5
5
|
flushDeferredMounts
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-mntc8w0g.js";
|
|
7
7
|
import {
|
|
8
8
|
__append,
|
|
9
9
|
__classList,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
__enterChildren,
|
|
12
12
|
__exitChildren,
|
|
13
13
|
__staticText
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-1j59xzqm.js";
|
|
15
15
|
import {
|
|
16
16
|
RouterContext
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-9p84cvet.js";
|
|
18
18
|
import {
|
|
19
19
|
isBrowser
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-sjypbv24.js";
|
|
21
21
|
import {
|
|
22
22
|
_tryOnCleanup,
|
|
23
23
|
createContext,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
startHydration,
|
|
33
33
|
untrack,
|
|
34
34
|
useContext
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-1yd6jfw5.js";
|
|
36
36
|
|
|
37
37
|
// src/component/error-boundary-context.ts
|
|
38
38
|
var handlerStack = [];
|
|
@@ -551,8 +551,12 @@ function parseSearchParams(urlParams, schema) {
|
|
|
551
551
|
}
|
|
552
552
|
return raw;
|
|
553
553
|
}
|
|
554
|
-
function useSearchParams(
|
|
555
|
-
|
|
554
|
+
function useSearchParams() {
|
|
555
|
+
const router = useContext(RouterContext);
|
|
556
|
+
if (!router) {
|
|
557
|
+
throw new Error("useSearchParams() must be called within RouterContext.Provider");
|
|
558
|
+
}
|
|
559
|
+
return router._reactiveSearchParams;
|
|
556
560
|
}
|
|
557
561
|
|
|
558
562
|
export { getCurrentErrorHandler, ErrorBoundary, createLink, Link, OutletContext, Outlet, RouterView, parseSearchParams, useSearchParams };
|
|
@@ -76,8 +76,10 @@ function matchRoute(routes, url) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
let search = {};
|
|
79
|
+
let foundSchema = false;
|
|
79
80
|
for (const m of matched) {
|
|
80
81
|
if (m.route.searchParams) {
|
|
82
|
+
foundSchema = true;
|
|
81
83
|
const raw = {};
|
|
82
84
|
for (const [key, value] of searchParams.entries()) {
|
|
83
85
|
raw[key] = value;
|
|
@@ -89,6 +91,11 @@ function matchRoute(routes, url) {
|
|
|
89
91
|
break;
|
|
90
92
|
}
|
|
91
93
|
}
|
|
94
|
+
if (!foundSchema) {
|
|
95
|
+
for (const [key, value] of searchParams.entries()) {
|
|
96
|
+
search[key] = value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
92
99
|
return {
|
|
93
100
|
matched,
|
|
94
101
|
params: allParams,
|
|
@@ -1,17 +1,128 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeLoaders,
|
|
3
3
|
matchRoute
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ah86rm07.js";
|
|
5
5
|
import {
|
|
6
6
|
prefetchNavData
|
|
7
7
|
} from "./chunk-jrtrk5z4.js";
|
|
8
8
|
import {
|
|
9
9
|
isBrowser
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-sjypbv24.js";
|
|
11
11
|
import {
|
|
12
12
|
getSSRContext,
|
|
13
13
|
signal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-1yd6jfw5.js";
|
|
15
|
+
|
|
16
|
+
// src/router/reactive-search-params.ts
|
|
17
|
+
function shallowEqual(a, b) {
|
|
18
|
+
const keysA = Object.keys(a);
|
|
19
|
+
const keysB = Object.keys(b);
|
|
20
|
+
if (keysA.length !== keysB.length)
|
|
21
|
+
return false;
|
|
22
|
+
for (const key of keysA) {
|
|
23
|
+
if (a[key] !== b[key])
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function buildMergedSearch(current, pending) {
|
|
29
|
+
const merged = { ...current };
|
|
30
|
+
for (const [key, value] of Object.entries(pending)) {
|
|
31
|
+
if (value === undefined || value === null) {
|
|
32
|
+
delete merged[key];
|
|
33
|
+
} else {
|
|
34
|
+
merged[key] = value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return merged;
|
|
38
|
+
}
|
|
39
|
+
function currentPathname() {
|
|
40
|
+
return typeof window !== "undefined" ? window.location.pathname : "/";
|
|
41
|
+
}
|
|
42
|
+
function createReactiveSearchParams(rawSearchParamsSignal, navigateFn) {
|
|
43
|
+
let pending = null;
|
|
44
|
+
let capturedPathname = null;
|
|
45
|
+
function flush() {
|
|
46
|
+
if (!pending)
|
|
47
|
+
return;
|
|
48
|
+
const merged = buildMergedSearch(rawSearchParamsSignal.value, pending);
|
|
49
|
+
const pathname = capturedPathname ?? currentPathname();
|
|
50
|
+
pending = null;
|
|
51
|
+
capturedPathname = null;
|
|
52
|
+
if (shallowEqual(merged, rawSearchParamsSignal.value))
|
|
53
|
+
return;
|
|
54
|
+
navigateFn({
|
|
55
|
+
to: pathname,
|
|
56
|
+
search: merged,
|
|
57
|
+
replace: true
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function navigateWithOptions(partial, options) {
|
|
61
|
+
pending = null;
|
|
62
|
+
capturedPathname = null;
|
|
63
|
+
const merged = buildMergedSearch(rawSearchParamsSignal.value, partial);
|
|
64
|
+
navigateFn({
|
|
65
|
+
to: currentPathname(),
|
|
66
|
+
search: merged,
|
|
67
|
+
replace: !options?.push
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return new Proxy({}, {
|
|
71
|
+
get(_target, key) {
|
|
72
|
+
if (key === "navigate")
|
|
73
|
+
return navigateWithOptions;
|
|
74
|
+
if (typeof key === "symbol")
|
|
75
|
+
return;
|
|
76
|
+
if (pending && key in pending)
|
|
77
|
+
return pending[key];
|
|
78
|
+
return rawSearchParamsSignal.value[key];
|
|
79
|
+
},
|
|
80
|
+
set(_target, key, value) {
|
|
81
|
+
if (typeof key === "symbol")
|
|
82
|
+
return false;
|
|
83
|
+
if (!pending) {
|
|
84
|
+
pending = {};
|
|
85
|
+
capturedPathname = currentPathname();
|
|
86
|
+
queueMicrotask(flush);
|
|
87
|
+
}
|
|
88
|
+
pending[key] = value;
|
|
89
|
+
return true;
|
|
90
|
+
},
|
|
91
|
+
deleteProperty(_target, key) {
|
|
92
|
+
if (typeof key === "symbol")
|
|
93
|
+
return false;
|
|
94
|
+
if (!pending) {
|
|
95
|
+
pending = {};
|
|
96
|
+
capturedPathname = currentPathname();
|
|
97
|
+
queueMicrotask(flush);
|
|
98
|
+
}
|
|
99
|
+
pending[key] = undefined;
|
|
100
|
+
return true;
|
|
101
|
+
},
|
|
102
|
+
ownKeys() {
|
|
103
|
+
const current = pending ? buildMergedSearch(rawSearchParamsSignal.value, pending) : rawSearchParamsSignal.value;
|
|
104
|
+
return Object.keys(current);
|
|
105
|
+
},
|
|
106
|
+
getOwnPropertyDescriptor(_target, key) {
|
|
107
|
+
if (typeof key === "symbol")
|
|
108
|
+
return;
|
|
109
|
+
const val = pending && key in pending ? pending[key] : rawSearchParamsSignal.value[key];
|
|
110
|
+
if (val === undefined || val === null)
|
|
111
|
+
return;
|
|
112
|
+
return { configurable: true, enumerable: true, writable: true, value: val };
|
|
113
|
+
},
|
|
114
|
+
has(_target, key) {
|
|
115
|
+
if (typeof key === "symbol")
|
|
116
|
+
return false;
|
|
117
|
+
if (key === "navigate")
|
|
118
|
+
return true;
|
|
119
|
+
if (pending && key in pending) {
|
|
120
|
+
return pending[key] !== undefined && pending[key] !== null;
|
|
121
|
+
}
|
|
122
|
+
return key in rawSearchParamsSignal.value;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
15
126
|
|
|
16
127
|
// src/router/view-transitions.ts
|
|
17
128
|
var transitionGen = 0;
|
|
@@ -124,7 +235,82 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
|
|
|
124
235
|
};
|
|
125
236
|
const ssrUrl = initialUrl ?? ssrCtx?.url ?? "/";
|
|
126
237
|
const fallbackMatch = matchRoute(routes, ssrUrl);
|
|
238
|
+
const ssrSearchParamsSignal = {
|
|
239
|
+
get value() {
|
|
240
|
+
const ctx = getSSRContext();
|
|
241
|
+
if (ctx) {
|
|
242
|
+
const m = matchRoute(routes, ctx.url);
|
|
243
|
+
return m?.search ?? {};
|
|
244
|
+
}
|
|
245
|
+
return fallbackMatch?.search ?? {};
|
|
246
|
+
},
|
|
247
|
+
peek() {
|
|
248
|
+
const ctx = getSSRContext();
|
|
249
|
+
if (ctx) {
|
|
250
|
+
const m = matchRoute(routes, ctx.url);
|
|
251
|
+
return m?.search ?? {};
|
|
252
|
+
}
|
|
253
|
+
return fallbackMatch?.search ?? {};
|
|
254
|
+
},
|
|
255
|
+
notify() {}
|
|
256
|
+
};
|
|
257
|
+
const ssrReactiveSearchParams = new Proxy({}, {
|
|
258
|
+
get(_target, key) {
|
|
259
|
+
if (key === "navigate") {
|
|
260
|
+
return () => {
|
|
261
|
+
if (true) {
|
|
262
|
+
throw new Error("useSearchParams().navigate() is not supported during SSR. " + "Use schema defaults for initial values.");
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
if (typeof key === "symbol")
|
|
267
|
+
return;
|
|
268
|
+
const ctx = getSSRContext();
|
|
269
|
+
if (ctx) {
|
|
270
|
+
const m = matchRoute(routes, ctx.url);
|
|
271
|
+
return m?.search?.[key];
|
|
272
|
+
}
|
|
273
|
+
return fallbackMatch?.search?.[key];
|
|
274
|
+
},
|
|
275
|
+
set() {
|
|
276
|
+
if (true) {
|
|
277
|
+
throw new Error("useSearchParams() writes are not supported during SSR. " + "Use schema defaults for initial values.");
|
|
278
|
+
}
|
|
279
|
+
return true;
|
|
280
|
+
},
|
|
281
|
+
deleteProperty() {
|
|
282
|
+
if (true) {
|
|
283
|
+
throw new Error("useSearchParams() writes are not supported during SSR. " + "Use schema defaults for initial values.");
|
|
284
|
+
}
|
|
285
|
+
return true;
|
|
286
|
+
},
|
|
287
|
+
ownKeys() {
|
|
288
|
+
const ctx = getSSRContext();
|
|
289
|
+
const search = ctx ? matchRoute(routes, ctx.url)?.search ?? {} : fallbackMatch?.search ?? {};
|
|
290
|
+
return Object.keys(search);
|
|
291
|
+
},
|
|
292
|
+
getOwnPropertyDescriptor(_target, key) {
|
|
293
|
+
if (typeof key === "symbol")
|
|
294
|
+
return;
|
|
295
|
+
const ctx = getSSRContext();
|
|
296
|
+
const search = ctx ? matchRoute(routes, ctx.url)?.search ?? {} : fallbackMatch?.search ?? {};
|
|
297
|
+
const val = search[key];
|
|
298
|
+
if (val === undefined)
|
|
299
|
+
return;
|
|
300
|
+
return { configurable: true, enumerable: true, writable: true, value: val };
|
|
301
|
+
},
|
|
302
|
+
has(_target, key) {
|
|
303
|
+
if (typeof key === "symbol")
|
|
304
|
+
return false;
|
|
305
|
+
if (key === "navigate")
|
|
306
|
+
return true;
|
|
307
|
+
const ctx = getSSRContext();
|
|
308
|
+
const search = ctx ? matchRoute(routes, ctx.url)?.search ?? {} : fallbackMatch?.search ?? {};
|
|
309
|
+
return key in search;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
127
312
|
return {
|
|
313
|
+
_reactiveSearchParams: ssrReactiveSearchParams,
|
|
128
314
|
current: {
|
|
129
315
|
get value() {
|
|
130
316
|
const ctx = getSSRContext();
|
|
@@ -142,25 +328,7 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
|
|
|
142
328
|
},
|
|
143
329
|
notify() {}
|
|
144
330
|
},
|
|
145
|
-
searchParams:
|
|
146
|
-
get value() {
|
|
147
|
-
const ctx = getSSRContext();
|
|
148
|
-
if (ctx) {
|
|
149
|
-
const m = matchRoute(routes, ctx.url);
|
|
150
|
-
return m?.search ?? {};
|
|
151
|
-
}
|
|
152
|
-
return fallbackMatch?.search ?? {};
|
|
153
|
-
},
|
|
154
|
-
peek() {
|
|
155
|
-
const ctx = getSSRContext();
|
|
156
|
-
if (ctx) {
|
|
157
|
-
const m = matchRoute(routes, ctx.url);
|
|
158
|
-
return m?.search ?? {};
|
|
159
|
-
}
|
|
160
|
-
return fallbackMatch?.search ?? {};
|
|
161
|
-
},
|
|
162
|
-
notify() {}
|
|
163
|
-
},
|
|
331
|
+
searchParams: ssrSearchParamsSignal,
|
|
164
332
|
loaderData: { value: [], peek: () => [], notify() {} },
|
|
165
333
|
loaderError: { value: null, peek: () => null, notify() {} },
|
|
166
334
|
navigate: () => Promise.resolve(),
|
|
@@ -367,7 +535,9 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
|
|
|
367
535
|
activePrefetchUrl = null;
|
|
368
536
|
}
|
|
369
537
|
}
|
|
538
|
+
const _reactiveSearchParams = createReactiveSearchParams(_searchParams, navigate);
|
|
370
539
|
return {
|
|
540
|
+
_reactiveSearchParams,
|
|
371
541
|
current,
|
|
372
542
|
dispose,
|
|
373
543
|
loaderData,
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
__element,
|
|
5
5
|
__enterChildren,
|
|
6
6
|
__exitChildren
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-1j59xzqm.js";
|
|
8
8
|
import {
|
|
9
9
|
getSSRContext
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-1yd6jfw5.js";
|
|
11
11
|
|
|
12
12
|
// src/component/children.ts
|
|
13
13
|
var MAX_RESOLVE_DEPTH = 100;
|
|
@@ -76,6 +76,7 @@ interface DenialMeta {
|
|
|
76
76
|
requiredRoles?: string[];
|
|
77
77
|
disabledFlags?: string[];
|
|
78
78
|
limit?: {
|
|
79
|
+
key?: string;
|
|
79
80
|
max: number;
|
|
80
81
|
consumed: number;
|
|
81
82
|
remaining: number;
|
|
@@ -91,7 +92,10 @@ interface AccessCheckData {
|
|
|
91
92
|
interface AccessSet {
|
|
92
93
|
entitlements: Record<string, AccessCheckData>;
|
|
93
94
|
flags: Record<string, boolean>;
|
|
95
|
+
/** @deprecated Use `plans` for multi-level. Kept for backward compat. */
|
|
94
96
|
plan: string | null;
|
|
97
|
+
/** Plan per billing level. Keys are entity names. */
|
|
98
|
+
plans: Record<string, string | null>;
|
|
95
99
|
computedAt: string;
|
|
96
100
|
}
|
|
97
101
|
/** Public return type of can(). All properties are ReadonlySignal (compiler auto-unwraps). */
|
package/dist/src/auth/public.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RouterContext
|
|
3
|
-
} from "../../shared/chunk-
|
|
3
|
+
} from "../../shared/chunk-9p84cvet.js";
|
|
4
4
|
import {
|
|
5
5
|
invalidateTenantQueries
|
|
6
|
-
} from "../../shared/chunk-
|
|
6
|
+
} from "../../shared/chunk-pv0apt9z.js";
|
|
7
7
|
import {
|
|
8
8
|
isBrowser
|
|
9
|
-
} from "../../shared/chunk-
|
|
9
|
+
} from "../../shared/chunk-sjypbv24.js";
|
|
10
10
|
import {
|
|
11
11
|
_tryOnCleanup,
|
|
12
12
|
computed,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
getSSRContext,
|
|
15
15
|
signal,
|
|
16
16
|
useContext
|
|
17
|
-
} from "../../shared/chunk-
|
|
17
|
+
} from "../../shared/chunk-1yd6jfw5.js";
|
|
18
18
|
|
|
19
19
|
// src/auth/access-context.ts
|
|
20
20
|
var AccessContext = createContext(undefined, "@vertz/ui::AccessContext");
|
package/dist/src/css/public.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
globalCss,
|
|
9
9
|
s,
|
|
10
10
|
variants
|
|
11
|
-
} from "../../shared/chunk-
|
|
12
|
-
import"../../shared/chunk-
|
|
11
|
+
} from "../../shared/chunk-pwmjtxpn.js";
|
|
12
|
+
import"../../shared/chunk-1j59xzqm.js";
|
|
13
13
|
import"../../shared/chunk-h1fsr8kv.js";
|
|
14
|
-
import"../../shared/chunk-
|
|
14
|
+
import"../../shared/chunk-1yd6jfw5.js";
|
|
15
15
|
export {
|
|
16
16
|
variants,
|
|
17
17
|
s,
|
package/dist/src/form/public.js
CHANGED
package/dist/src/index.d.ts
CHANGED
|
@@ -1423,6 +1423,20 @@ type TypedRoutes<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
1423
1423
|
* Usage: `useRouter<InferRouteMap<typeof routes>>()`
|
|
1424
1424
|
*/
|
|
1425
1425
|
type InferRouteMap<T> = T extends TypedRoutes<infer R> ? R : T;
|
|
1426
|
+
/**
|
|
1427
|
+
* Extract the search params type from a route definition map for a given path.
|
|
1428
|
+
*
|
|
1429
|
+
* If the route at `TPath` has a `searchParams` schema, resolves to the schema's
|
|
1430
|
+
* output type `T`. Otherwise resolves to `Record<string, string>` (raw URL params).
|
|
1431
|
+
*
|
|
1432
|
+
* Parallel to `ExtractParams<TPath>` which extracts path params from the URL pattern.
|
|
1433
|
+
*/
|
|
1434
|
+
type ExtractSearchParams<
|
|
1435
|
+
TPath extends string,
|
|
1436
|
+
TMap extends Record<string, RouteConfigLike> = RouteDefinitionMap
|
|
1437
|
+
> = TPath extends keyof TMap ? TMap[TPath] extends {
|
|
1438
|
+
searchParams: SearchParamSchema<infer T>;
|
|
1439
|
+
} ? T : Record<string, string> : Record<string, string>;
|
|
1426
1440
|
/** Internal compiled route. */
|
|
1427
1441
|
interface CompiledRoute {
|
|
1428
1442
|
/** The original path pattern. */
|
|
@@ -1526,6 +1540,13 @@ declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url:
|
|
|
1526
1540
|
* Just use `<Link href="/about">About</Link>` inside a router-provided tree.
|
|
1527
1541
|
*/
|
|
1528
1542
|
declare function Link({ href, children, activeClass, class: classProp, className }: LinkProps): HTMLAnchorElement;
|
|
1543
|
+
interface ReactiveSearchParams<T = Record<string, unknown>> {
|
|
1544
|
+
/** Batch-navigate with explicit push/replace option. Merges partial with current params. */
|
|
1545
|
+
navigate(partial: Partial<T>, options?: {
|
|
1546
|
+
push?: boolean;
|
|
1547
|
+
}): void;
|
|
1548
|
+
[key: string]: unknown;
|
|
1549
|
+
}
|
|
1529
1550
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
1530
1551
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
1531
1552
|
/** Options for router.navigate(). */
|
|
@@ -1600,6 +1621,8 @@ interface Router<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
1600
1621
|
loaderError: Signal<Error | null>;
|
|
1601
1622
|
/** Parsed search params from the current route (reactive signal). */
|
|
1602
1623
|
searchParams: Signal<Record<string, unknown>>;
|
|
1624
|
+
/** @internal Reactive search params proxy — accessed via useSearchParams(). */
|
|
1625
|
+
_reactiveSearchParams: ReactiveSearchParams;
|
|
1603
1626
|
/** Navigate to a route pattern, interpolating params and search into the final URL. */
|
|
1604
1627
|
navigate<TPath extends RoutePattern<T>>(input: NavigateInput<TPath>): Promise<void>;
|
|
1605
1628
|
/** Re-run all loaders for the current route. */
|
|
@@ -1688,13 +1711,27 @@ declare function RouterView({ router, fallback, errorFallback }: RouterViewProps
|
|
|
1688
1711
|
*/
|
|
1689
1712
|
declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSearchParams, schema?: SearchParamSchema<T>): T;
|
|
1690
1713
|
/**
|
|
1691
|
-
* Read the current search params
|
|
1692
|
-
* Intended to be called inside a reactive context (effect/computed).
|
|
1714
|
+
* Read the current search params as a reactive, writable proxy.
|
|
1693
1715
|
*
|
|
1694
|
-
*
|
|
1695
|
-
*
|
|
1716
|
+
* Overload 1: `useSearchParams<'/search'>()` — infers search param types from
|
|
1717
|
+
* the route's `searchParams` schema via `ExtractSearchParams`. Requires codegen
|
|
1718
|
+
* augmentation or explicit `TMap` generic for full type inference.
|
|
1719
|
+
*
|
|
1720
|
+
* Overload 2: `useSearchParams<{ q: string; page: number }>()` — explicit type.
|
|
1721
|
+
*
|
|
1722
|
+
* Overload 3: `useSearchParams()` — no generic, returns `Record<string, string>`.
|
|
1723
|
+
*
|
|
1724
|
+
* Reads are reactive (trigger signal tracking), writes batch-navigate
|
|
1725
|
+
* to update the URL. Must be called within a `RouterContext.Provider`.
|
|
1726
|
+
*/
|
|
1727
|
+
declare function useSearchParams<
|
|
1728
|
+
TPath extends string = string,
|
|
1729
|
+
TMap extends Record<string, RouteConfigLike> = RouteDefinitionMap
|
|
1730
|
+
>(): ReactiveSearchParams<ExtractSearchParams<TPath, TMap>>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Read the current search params with an explicit type assertion.
|
|
1696
1733
|
*/
|
|
1697
|
-
declare function useSearchParams<T
|
|
1734
|
+
declare function useSearchParams<T extends Record<string, unknown>>(): ReactiveSearchParams<T>;
|
|
1698
1735
|
/**
|
|
1699
1736
|
* Error thrown when `onCleanup()` is called outside a disposal scope.
|
|
1700
1737
|
* Similar to React's invalid hook call error — fail-fast so developers
|
|
@@ -2074,4 +2111,4 @@ interface RegisterThemeInput {
|
|
|
2074
2111
|
* ```
|
|
2075
2112
|
*/
|
|
2076
2113
|
declare function registerTheme(resolved: RegisterThemeInput): void;
|
|
2077
|
-
export { zoomOut, zoomIn, variants, validate, useSearchParams, useRouter, useParams, useDialogStack, useDialog, useContext, untrack, slideOutToTop, slideOutToRight, slideOutToLeft, slideOutToBottom, slideInFromTop, slideInFromRight, slideInFromLeft, slideInFromBottom, signal, setAdapter, s, resolveChildren, resetRelationSchemas_TEST_ONLY, resetInjectedStyles, registerTheme, registerRelationSchema, ref, query, parseSearchParams, palettes, onMount2 as onMount, onCleanup, onAnimationsComplete, mount, keyframes, isRenderNode, isQueryDescriptor, isBrowser, invalidateTenantQueries, invalidate, injectCSS, hydrateIslands, hydrate, globalCss, getRelationSchema, getQueryEnvelopeStore, getInjectedCSS, getEntityStore, getAdapter, formatRelativeTime, formDataToObject, form, font, fadeOut, fadeIn, defineTheme, defineRoutes, css, createTestStore, createRouter, createOptimisticHandler, createLink, createFieldState, createDialogStack, createDOMAdapter, createContext, configureImageOptimizer, computed, compileTheme, compileFonts, children, buildOptimizedUrl, batch, accordionUp, accordionDown, __staticText, __exitChildren, __enterChildren, __element, __append, VariantsConfig, VariantProps, VariantFunction, ValidationResult, UnwrapSignals, TypedRoutes, TypedRouter, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, SuspenseProps, Suspense, StyleValue, StyleEntry, Signal, SerializedStore, SearchParamSchema, SdkMethodWithMeta, SdkMethod, RouterViewProps, RouterView, RouterOptions, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, RenderText, RenderNode, RenderElement, RenderAdapter, RelativeTimeProps, RelativeTime, RelationSchema, RelationFieldDef, RegisterThemeInput, Ref, ReadonlySignal, RENDER_NODE_BRAND, QueryResult, QueryOptions, QueryEnvelopeStore, QueryEnvelope, QueryDescriptor3 as QueryDescriptor, PresenceProps, Presence, PreloadItem, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MountOptions, MountHandle, MergeSelectOptions, MatchedRoute, LoaderData, ListAnimationHooks, ListAnimationContext, LinkProps, LinkFactoryOptions, Link, IslandRegistry, IslandProps, Island, InferRouteMap, ImageProps, Image, GlobalCSSOutput, GlobalCSSInput, FormatRelativeTimeOptions, FormSchema, FormOptions, FormInstance, FormDataOptions, ForeignProps, Foreign, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FieldState, FieldSelectionTracker, FallbackFontName, ExtractParams, ErrorFallbackProps, ErrorBoundaryProps, ErrorBoundary, EntityStoreOptions, EntityStore, DisposeFn, DisposalScopeError, DialogStackProvider, DialogStackContext, DialogStack, DialogResult, DialogOpenOptions, DialogIdContext, DialogHandleContext, DialogHandle, DialogComponent, DefaultErrorFallback, DateInput, Context, ConfirmOptions, Computed, ComponentRegistry, ComponentLoader, ComponentFunction, CompiledTheme, CompiledRoute, CompiledFonts, CompileThemeOptions, CompileFontsOptions, ColorPalette, ChildrenAccessor, ChildValue, CacheStore, CSSOutput, CSSInput, ANIMATION_EASING, ANIMATION_DURATION };
|
|
2114
|
+
export { zoomOut, zoomIn, variants, validate, useSearchParams, useRouter, useParams, useDialogStack, useDialog, useContext, untrack, slideOutToTop, slideOutToRight, slideOutToLeft, slideOutToBottom, slideInFromTop, slideInFromRight, slideInFromLeft, slideInFromBottom, signal, setAdapter, s, resolveChildren, resetRelationSchemas_TEST_ONLY, resetInjectedStyles, registerTheme, registerRelationSchema, ref, query, parseSearchParams, palettes, onMount2 as onMount, onCleanup, onAnimationsComplete, mount, keyframes, isRenderNode, isQueryDescriptor, isBrowser, invalidateTenantQueries, invalidate, injectCSS, hydrateIslands, hydrate, globalCss, getRelationSchema, getQueryEnvelopeStore, getInjectedCSS, getEntityStore, getAdapter, formatRelativeTime, formDataToObject, form, font, fadeOut, fadeIn, defineTheme, defineRoutes, css, createTestStore, createRouter, createOptimisticHandler, createLink, createFieldState, createDialogStack, createDOMAdapter, createContext, configureImageOptimizer, computed, compileTheme, compileFonts, children, buildOptimizedUrl, batch, accordionUp, accordionDown, __staticText, __exitChildren, __enterChildren, __element, __append, VariantsConfig, VariantProps, VariantFunction, ValidationResult, UnwrapSignals, TypedRoutes, TypedRouter, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, SuspenseProps, Suspense, StyleValue, StyleEntry, Signal, SerializedStore, SearchParamSchema, SdkMethodWithMeta, SdkMethod, RouterViewProps, RouterView, RouterOptions, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, RenderText, RenderNode, RenderElement, RenderAdapter, RelativeTimeProps, RelativeTime, RelationSchema, RelationFieldDef, RegisterThemeInput, Ref, ReadonlySignal, ReactiveSearchParams, RENDER_NODE_BRAND, QueryResult, QueryOptions, QueryEnvelopeStore, QueryEnvelope, QueryDescriptor3 as QueryDescriptor, PresenceProps, Presence, PreloadItem, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MountOptions, MountHandle, MergeSelectOptions, MatchedRoute, LoaderData, ListAnimationHooks, ListAnimationContext, LinkProps, LinkFactoryOptions, Link, IslandRegistry, IslandProps, Island, InferRouteMap, ImageProps, Image, GlobalCSSOutput, GlobalCSSInput, FormatRelativeTimeOptions, FormSchema, FormOptions, FormInstance, FormDataOptions, ForeignProps, Foreign, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FieldState, FieldSelectionTracker, FallbackFontName, ExtractSearchParams, ExtractParams, ErrorFallbackProps, ErrorBoundaryProps, ErrorBoundary, EntityStoreOptions, EntityStore, DisposeFn, DisposalScopeError, DialogStackProvider, DialogStackContext, DialogStack, DialogResult, DialogOpenOptions, DialogIdContext, DialogHandleContext, DialogHandle, DialogComponent, DefaultErrorFallback, DateInput, Context, ConfirmOptions, Computed, ComponentRegistry, ComponentLoader, ComponentFunction, CompiledTheme, CompiledRoute, CompiledFonts, CompileThemeOptions, CompileFontsOptions, ColorPalette, ChildrenAccessor, ChildValue, CacheStore, CSSOutput, CSSInput, ANIMATION_EASING, ANIMATION_DURATION };
|
package/dist/src/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
slideOutToTop,
|
|
26
26
|
zoomIn,
|
|
27
27
|
zoomOut
|
|
28
|
-
} from "../shared/chunk-
|
|
28
|
+
} from "../shared/chunk-n824qrvk.js";
|
|
29
29
|
import {
|
|
30
30
|
ErrorBoundary,
|
|
31
31
|
Link,
|
|
@@ -36,25 +36,25 @@ import {
|
|
|
36
36
|
getCurrentErrorHandler,
|
|
37
37
|
parseSearchParams,
|
|
38
38
|
useSearchParams
|
|
39
|
-
} from "../shared/chunk-
|
|
39
|
+
} from "../shared/chunk-5xm1w16j.js";
|
|
40
40
|
import {
|
|
41
41
|
beginDeferringMounts,
|
|
42
42
|
discardDeferredMounts,
|
|
43
43
|
flushDeferredMounts,
|
|
44
44
|
onMount
|
|
45
|
-
} from "../shared/chunk-
|
|
45
|
+
} from "../shared/chunk-mntc8w0g.js";
|
|
46
46
|
import {
|
|
47
47
|
createRouter
|
|
48
|
-
} from "../shared/chunk-
|
|
48
|
+
} from "../shared/chunk-mm9ms792.js";
|
|
49
49
|
import {
|
|
50
50
|
defineRoutes
|
|
51
|
-
} from "../shared/chunk-
|
|
51
|
+
} from "../shared/chunk-ah86rm07.js";
|
|
52
52
|
import {
|
|
53
53
|
createFieldState,
|
|
54
54
|
form,
|
|
55
55
|
formDataToObject,
|
|
56
56
|
validate
|
|
57
|
-
} from "../shared/chunk-
|
|
57
|
+
} from "../shared/chunk-hcgnfw27.js";
|
|
58
58
|
import {
|
|
59
59
|
EntityStore,
|
|
60
60
|
FieldSelectionTracker,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
query,
|
|
67
67
|
registerRelationSchema,
|
|
68
68
|
resetRelationSchemas_TEST_ONLY
|
|
69
|
-
} from "../shared/chunk-
|
|
69
|
+
} from "../shared/chunk-5vcnmqck.js";
|
|
70
70
|
import"../shared/chunk-jrtrk5z4.js";
|
|
71
71
|
import {
|
|
72
72
|
ThemeProvider,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
resolveChildren,
|
|
84
84
|
s,
|
|
85
85
|
variants
|
|
86
|
-
} from "../shared/chunk-
|
|
86
|
+
} from "../shared/chunk-pwmjtxpn.js";
|
|
87
87
|
import {
|
|
88
88
|
RENDER_NODE_BRAND,
|
|
89
89
|
__append,
|
|
@@ -96,20 +96,20 @@ import {
|
|
|
96
96
|
getAdapter,
|
|
97
97
|
isRenderNode,
|
|
98
98
|
setAdapter
|
|
99
|
-
} from "../shared/chunk-
|
|
99
|
+
} from "../shared/chunk-1j59xzqm.js";
|
|
100
100
|
import"../shared/chunk-h1fsr8kv.js";
|
|
101
101
|
import {
|
|
102
102
|
RouterContext,
|
|
103
103
|
useParams,
|
|
104
104
|
useRouter
|
|
105
|
-
} from "../shared/chunk-
|
|
105
|
+
} from "../shared/chunk-9p84cvet.js";
|
|
106
106
|
import {
|
|
107
107
|
invalidate,
|
|
108
108
|
invalidateTenantQueries
|
|
109
|
-
} from "../shared/chunk-
|
|
109
|
+
} from "../shared/chunk-pv0apt9z.js";
|
|
110
110
|
import {
|
|
111
111
|
isBrowser
|
|
112
|
-
} from "../shared/chunk-
|
|
112
|
+
} from "../shared/chunk-sjypbv24.js";
|
|
113
113
|
import {
|
|
114
114
|
DisposalScopeError,
|
|
115
115
|
_tryOnCleanup,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
startHydration,
|
|
135
135
|
untrack,
|
|
136
136
|
useContext
|
|
137
|
-
} from "../shared/chunk-
|
|
137
|
+
} from "../shared/chunk-1yd6jfw5.js";
|
|
138
138
|
// src/component/default-error-fallback.ts
|
|
139
139
|
function DefaultErrorFallback({ error, retry }) {
|
|
140
140
|
const container = document.createElement("div");
|
package/dist/src/internals.js
CHANGED
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
deserializeProps,
|
|
4
4
|
onAnimationsComplete,
|
|
5
5
|
resolveComponent
|
|
6
|
-
} from "../shared/chunk-
|
|
6
|
+
} from "../shared/chunk-n824qrvk.js";
|
|
7
7
|
import {
|
|
8
8
|
__discardMountFrame,
|
|
9
9
|
__flushMountFrame,
|
|
10
10
|
__on,
|
|
11
11
|
__pushMountFrame
|
|
12
|
-
} from "../shared/chunk-
|
|
12
|
+
} from "../shared/chunk-mntc8w0g.js";
|
|
13
13
|
import {
|
|
14
14
|
executeLoaders,
|
|
15
15
|
matchPath,
|
|
16
16
|
matchRoute
|
|
17
|
-
} from "../shared/chunk-
|
|
17
|
+
} from "../shared/chunk-ah86rm07.js";
|
|
18
18
|
import {
|
|
19
19
|
EntityStore,
|
|
20
20
|
MemoryCache,
|
|
21
21
|
QueryEnvelopeStore,
|
|
22
22
|
deriveKey
|
|
23
|
-
} from "../shared/chunk-
|
|
23
|
+
} from "../shared/chunk-5vcnmqck.js";
|
|
24
24
|
import"../shared/chunk-jrtrk5z4.js";
|
|
25
25
|
import {
|
|
26
26
|
ALIGNMENT_MAP,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
SIZE_KEYWORDS,
|
|
42
42
|
SPACING_SCALE,
|
|
43
43
|
compileTheme
|
|
44
|
-
} from "../shared/chunk-
|
|
44
|
+
} from "../shared/chunk-pwmjtxpn.js";
|
|
45
45
|
import {
|
|
46
46
|
RENDER_NODE_BRAND,
|
|
47
47
|
__append,
|
|
@@ -60,16 +60,16 @@ import {
|
|
|
60
60
|
getAdapter,
|
|
61
61
|
isRenderNode,
|
|
62
62
|
setAdapter
|
|
63
|
-
} from "../shared/chunk-
|
|
63
|
+
} from "../shared/chunk-1j59xzqm.js";
|
|
64
64
|
import {
|
|
65
65
|
SVG_NS,
|
|
66
66
|
normalizeSVGAttr,
|
|
67
67
|
styleObjectToString
|
|
68
68
|
} from "../shared/chunk-h1fsr8kv.js";
|
|
69
|
-
import"../shared/chunk-
|
|
69
|
+
import"../shared/chunk-pv0apt9z.js";
|
|
70
70
|
import {
|
|
71
71
|
isBrowser
|
|
72
|
-
} from "../shared/chunk-
|
|
72
|
+
} from "../shared/chunk-sjypbv24.js";
|
|
73
73
|
import {
|
|
74
74
|
_tryOnCleanup,
|
|
75
75
|
claimComment,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
startSignalCollection,
|
|
91
91
|
stopSignalCollection,
|
|
92
92
|
useContext
|
|
93
|
-
} from "../shared/chunk-
|
|
93
|
+
} from "../shared/chunk-1yd6jfw5.js";
|
|
94
94
|
// src/dom/conditional.ts
|
|
95
95
|
function clearBetween(start, end) {
|
|
96
96
|
let current = start.nextSibling;
|
package/dist/src/query/public.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
query
|
|
3
|
-
} from "../../shared/chunk-
|
|
3
|
+
} from "../../shared/chunk-5vcnmqck.js";
|
|
4
4
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
5
|
-
import"../../shared/chunk-
|
|
6
|
-
import"../../shared/chunk-
|
|
7
|
-
import"../../shared/chunk-
|
|
5
|
+
import"../../shared/chunk-pv0apt9z.js";
|
|
6
|
+
import"../../shared/chunk-sjypbv24.js";
|
|
7
|
+
import"../../shared/chunk-1yd6jfw5.js";
|
|
8
8
|
|
|
9
9
|
// src/query/public.ts
|
|
10
10
|
import { isQueryDescriptor } from "@vertz/fetch";
|
|
@@ -161,6 +161,20 @@ type TypedRoutes<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
161
161
|
* Usage: `useRouter<InferRouteMap<typeof routes>>()`
|
|
162
162
|
*/
|
|
163
163
|
type InferRouteMap<T> = T extends TypedRoutes<infer R> ? R : T;
|
|
164
|
+
/**
|
|
165
|
+
* Extract the search params type from a route definition map for a given path.
|
|
166
|
+
*
|
|
167
|
+
* If the route at `TPath` has a `searchParams` schema, resolves to the schema's
|
|
168
|
+
* output type `T`. Otherwise resolves to `Record<string, string>` (raw URL params).
|
|
169
|
+
*
|
|
170
|
+
* Parallel to `ExtractParams<TPath>` which extracts path params from the URL pattern.
|
|
171
|
+
*/
|
|
172
|
+
type ExtractSearchParams<
|
|
173
|
+
TPath extends string,
|
|
174
|
+
TMap extends Record<string, RouteConfigLike> = RouteDefinitionMap
|
|
175
|
+
> = TPath extends keyof TMap ? TMap[TPath] extends {
|
|
176
|
+
searchParams: SearchParamSchema<infer T>;
|
|
177
|
+
} ? T : Record<string, string> : Record<string, string>;
|
|
164
178
|
/** Internal compiled route. */
|
|
165
179
|
interface CompiledRoute {
|
|
166
180
|
/** The original path pattern. */
|
|
@@ -307,6 +321,13 @@ declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url:
|
|
|
307
321
|
* Just use `<Link href="/about">About</Link>` inside a router-provided tree.
|
|
308
322
|
*/
|
|
309
323
|
declare function Link({ href, children, activeClass, class: classProp, className }: LinkProps): HTMLAnchorElement;
|
|
324
|
+
interface ReactiveSearchParams<T = Record<string, unknown>> {
|
|
325
|
+
/** Batch-navigate with explicit push/replace option. Merges partial with current params. */
|
|
326
|
+
navigate(partial: Partial<T>, options?: {
|
|
327
|
+
push?: boolean;
|
|
328
|
+
}): void;
|
|
329
|
+
[key: string]: unknown;
|
|
330
|
+
}
|
|
310
331
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
311
332
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
312
333
|
/** Options for router.navigate(). */
|
|
@@ -381,6 +402,8 @@ interface Router<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
381
402
|
loaderError: Signal<Error | null>;
|
|
382
403
|
/** Parsed search params from the current route (reactive signal). */
|
|
383
404
|
searchParams: Signal<Record<string, unknown>>;
|
|
405
|
+
/** @internal Reactive search params proxy — accessed via useSearchParams(). */
|
|
406
|
+
_reactiveSearchParams: ReactiveSearchParams;
|
|
384
407
|
/** Navigate to a route pattern, interpolating params and search into the final URL. */
|
|
385
408
|
navigate<TPath extends RoutePattern<T>>(input: NavigateInput<TPath>): Promise<void>;
|
|
386
409
|
/** Re-run all loaders for the current route. */
|
|
@@ -497,11 +520,25 @@ declare function RouterView({ router, fallback, errorFallback }: RouterViewProps
|
|
|
497
520
|
*/
|
|
498
521
|
declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSearchParams, schema?: SearchParamSchema<T>): T;
|
|
499
522
|
/**
|
|
500
|
-
* Read the current search params
|
|
501
|
-
*
|
|
523
|
+
* Read the current search params as a reactive, writable proxy.
|
|
524
|
+
*
|
|
525
|
+
* Overload 1: `useSearchParams<'/search'>()` — infers search param types from
|
|
526
|
+
* the route's `searchParams` schema via `ExtractSearchParams`. Requires codegen
|
|
527
|
+
* augmentation or explicit `TMap` generic for full type inference.
|
|
502
528
|
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
529
|
+
* Overload 2: `useSearchParams<{ q: string; page: number }>()` — explicit type.
|
|
530
|
+
*
|
|
531
|
+
* Overload 3: `useSearchParams()` — no generic, returns `Record<string, string>`.
|
|
532
|
+
*
|
|
533
|
+
* Reads are reactive (trigger signal tracking), writes batch-navigate
|
|
534
|
+
* to update the URL. Must be called within a `RouterContext.Provider`.
|
|
535
|
+
*/
|
|
536
|
+
declare function useSearchParams<
|
|
537
|
+
TPath extends string = string,
|
|
538
|
+
TMap extends Record<string, RouteConfigLike> = RouteDefinitionMap
|
|
539
|
+
>(): ReactiveSearchParams<ExtractSearchParams<TPath, TMap>>;
|
|
540
|
+
/**
|
|
541
|
+
* Read the current search params with an explicit type assertion.
|
|
505
542
|
*/
|
|
506
|
-
declare function useSearchParams<T
|
|
507
|
-
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 };
|
|
543
|
+
declare function useSearchParams<T extends Record<string, unknown>>(): ReactiveSearchParams<T>;
|
|
544
|
+
export { useSearchParams, useRouter, useParams, parseSearchParams, defineRoutes, createRouter, createLink, TypedRoutes, TypedRouter, SearchParamSchema, RouterViewProps, RouterView, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, ReactiveSearchParams, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MatchedRoute, LoaderData, LinkProps, Link, InferRouteMap, ExtractSearchParams, ExtractParams, CompiledRoute };
|
|
@@ -6,24 +6,24 @@ import {
|
|
|
6
6
|
createLink,
|
|
7
7
|
parseSearchParams,
|
|
8
8
|
useSearchParams
|
|
9
|
-
} from "../../shared/chunk-
|
|
10
|
-
import"../../shared/chunk-
|
|
9
|
+
} from "../../shared/chunk-5xm1w16j.js";
|
|
10
|
+
import"../../shared/chunk-mntc8w0g.js";
|
|
11
11
|
import {
|
|
12
12
|
createRouter
|
|
13
|
-
} from "../../shared/chunk-
|
|
13
|
+
} from "../../shared/chunk-mm9ms792.js";
|
|
14
14
|
import {
|
|
15
15
|
defineRoutes
|
|
16
|
-
} from "../../shared/chunk-
|
|
16
|
+
} from "../../shared/chunk-ah86rm07.js";
|
|
17
17
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
18
|
-
import"../../shared/chunk-
|
|
18
|
+
import"../../shared/chunk-1j59xzqm.js";
|
|
19
19
|
import"../../shared/chunk-h1fsr8kv.js";
|
|
20
20
|
import {
|
|
21
21
|
RouterContext,
|
|
22
22
|
useParams,
|
|
23
23
|
useRouter
|
|
24
|
-
} from "../../shared/chunk-
|
|
25
|
-
import"../../shared/chunk-
|
|
26
|
-
import"../../shared/chunk-
|
|
24
|
+
} from "../../shared/chunk-9p84cvet.js";
|
|
25
|
+
import"../../shared/chunk-sjypbv24.js";
|
|
26
|
+
import"../../shared/chunk-1yd6jfw5.js";
|
|
27
27
|
export {
|
|
28
28
|
useSearchParams,
|
|
29
29
|
useRouter,
|
package/dist/src/test/index.d.ts
CHANGED
|
@@ -298,6 +298,13 @@ interface Signal<T> {
|
|
|
298
298
|
/** Manually notify all subscribers (useful after mutating the value in place). */
|
|
299
299
|
notify(): void;
|
|
300
300
|
}
|
|
301
|
+
interface ReactiveSearchParams<T = Record<string, unknown>> {
|
|
302
|
+
/** Batch-navigate with explicit push/replace option. Merges partial with current params. */
|
|
303
|
+
navigate(partial: Partial<T>, options?: {
|
|
304
|
+
push?: boolean;
|
|
305
|
+
}): void;
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
}
|
|
301
308
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
302
309
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
303
310
|
/** Options for router.navigate(). */
|
|
@@ -345,6 +352,8 @@ interface Router<T extends Record<string, RouteConfigLike> = RouteDefinitionMap>
|
|
|
345
352
|
loaderError: Signal<Error | null>;
|
|
346
353
|
/** Parsed search params from the current route (reactive signal). */
|
|
347
354
|
searchParams: Signal<Record<string, unknown>>;
|
|
355
|
+
/** @internal Reactive search params proxy — accessed via useSearchParams(). */
|
|
356
|
+
_reactiveSearchParams: ReactiveSearchParams;
|
|
348
357
|
/** Navigate to a route pattern, interpolating params and search into the final URL. */
|
|
349
358
|
navigate<TPath extends RoutePattern<T>>(input: NavigateInput<TPath>): Promise<void>;
|
|
350
359
|
/** Re-run all loaders for the current route. */
|
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-mm9ms792.js";
|
|
4
4
|
import {
|
|
5
5
|
defineRoutes
|
|
6
|
-
} from "../../shared/chunk-
|
|
6
|
+
} from "../../shared/chunk-ah86rm07.js";
|
|
7
7
|
import"../../shared/chunk-jrtrk5z4.js";
|
|
8
|
-
import"../../shared/chunk-
|
|
9
|
-
import"../../shared/chunk-
|
|
8
|
+
import"../../shared/chunk-sjypbv24.js";
|
|
9
|
+
import"../../shared/chunk-1yd6jfw5.js";
|
|
10
10
|
|
|
11
11
|
// src/test/interactions.ts
|
|
12
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.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Vertz UI framework — signals, components, JSX runtime",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"typecheck": "tsc --noEmit"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@vertz/fetch": "^0.2.
|
|
77
|
+
"@vertz/fetch": "^0.2.29"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@happy-dom/global-registrator": "^20.7.0",
|
|
81
|
-
"@vertz/schema": "^0.2.
|
|
81
|
+
"@vertz/schema": "^0.2.29",
|
|
82
82
|
"bunup": "^0.16.31",
|
|
83
83
|
"happy-dom": "^20.7.0",
|
|
84
84
|
"typescript": "^5.7.0"
|