@vertz/ui 0.2.37 → 0.2.38

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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  injectCSS
3
- } from "./chunk-g60cswzm.js";
3
+ } from "./chunk-veqs3jgz.js";
4
4
  import {
5
5
  createContext
6
- } from "./chunk-1yd6jfw5.js";
6
+ } from "./chunk-pmyavtdp.js";
7
7
 
8
8
  // src/dom/animation.ts
9
9
  function onAnimationsComplete(el, callback) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createContext,
3
3
  useContext
4
- } from "./chunk-1yd6jfw5.js";
4
+ } from "./chunk-pmyavtdp.js";
5
5
 
6
6
  // src/router/router-context.ts
7
7
  var RouterContext = createContext(undefined, "@vertz/ui::RouterContext");
@@ -3,7 +3,7 @@ import {
3
3
  beginDeferringMounts,
4
4
  discardDeferredMounts,
5
5
  flushDeferredMounts
6
- } from "./chunk-mntc8w0g.js";
6
+ } from "./chunk-ksetw5t2.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-dh32wkrv.js";
14
+ } from "./chunk-xz8jq6w6.js";
15
15
  import {
16
16
  RouterContext
17
- } from "./chunk-9p84cvet.js";
17
+ } from "./chunk-4an2s6d7.js";
18
18
  import {
19
19
  isBrowser
20
- } from "./chunk-sjypbv24.js";
20
+ } from "./chunk-g5vzhext.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-1yd6jfw5.js";
35
+ } from "./chunk-pmyavtdp.js";
36
36
 
37
37
  // src/component/error-boundary-context.ts
38
38
  var handlerStack = [];
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computed,
3
3
  signal
4
- } from "./chunk-1yd6jfw5.js";
4
+ } from "./chunk-pmyavtdp.js";
5
5
 
6
6
  // src/form/field-state.ts
7
7
  function createFieldState(_name, initialValue) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getSSRContext
3
- } from "./chunk-1yd6jfw5.js";
3
+ } from "./chunk-pmyavtdp.js";
4
4
 
5
5
  // src/query/invalidate.ts
6
6
  var registry = new Set;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hasSSRResolver
3
- } from "./chunk-1yd6jfw5.js";
3
+ } from "./chunk-pmyavtdp.js";
4
4
 
5
5
  // src/env/is-browser.ts
6
6
  function isBrowser() {
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-jrtrk5z4.js";
4
4
  import {
5
5
  registerActiveQuery
6
- } from "./chunk-pv0apt9z.js";
6
+ } from "./chunk-dvzkge4z.js";
7
7
  import {
8
8
  isBrowser
9
- } from "./chunk-sjypbv24.js";
9
+ } from "./chunk-g5vzhext.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-1yd6jfw5.js";
19
+ } from "./chunk-pmyavtdp.js";
20
20
 
21
21
  // src/query/cache.ts
22
22
  class MemoryCache {
@@ -7,12 +7,14 @@ import {
7
7
  } from "./chunk-jrtrk5z4.js";
8
8
  import {
9
9
  isBrowser
10
- } from "./chunk-sjypbv24.js";
10
+ } from "./chunk-g5vzhext.js";
11
11
  import {
12
12
  batch,
13
+ getReadValueCallback,
13
14
  getSSRContext,
15
+ getSubscriber,
14
16
  signal
15
- } from "./chunk-1yd6jfw5.js";
17
+ } from "./chunk-pmyavtdp.js";
16
18
 
17
19
  // src/router/reactive-search-params.ts
18
20
  function shallowEqual(a, b) {
@@ -267,11 +269,14 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
267
269
  if (typeof key === "symbol")
268
270
  return;
269
271
  const ctx = getSSRContext();
270
- if (ctx) {
271
- const m = matchRoute(routes, ctx.url);
272
- return m?.search?.[key];
272
+ const search = ctx ? matchRoute(routes, ctx.url)?.search ?? {} : fallbackMatch?.search ?? {};
273
+ const sub = getSubscriber();
274
+ if (sub) {
275
+ const cb = getReadValueCallback();
276
+ if (cb)
277
+ cb(search);
273
278
  }
274
- return fallbackMatch?.search?.[key];
279
+ return search[key];
275
280
  },
276
281
  set() {
277
282
  if (true) {
@@ -337,7 +342,11 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
337
342
  dispose: () => {}
338
343
  };
339
344
  }
345
+ function extractPathname(rawUrl) {
346
+ return rawUrl.split("?")[0]?.split("#")[0] || "/";
347
+ }
340
348
  const url = initialUrl ?? window.location.pathname + window.location.search;
349
+ let lastPathname = extractPathname(url);
341
350
  const initialMatch = matchRoute(routes, url);
342
351
  function normalizeUrl(rawUrl) {
343
352
  const qIdx = rawUrl.indexOf("?");
@@ -495,21 +504,22 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
495
504
  async function navigate(input) {
496
505
  const navUrl = buildNavigationUrl(input.to, input);
497
506
  const navMatch = matchRoute(routes, navUrl);
498
- const navPathname = navUrl.split("?")[0]?.split("#")[0] || "/";
499
- const isSearchParamOnly = window.location.pathname === navPathname;
507
+ const navPathname = extractPathname(navUrl);
508
+ const isSearchParamOnly = lastPathname === navPathname;
500
509
  const gen = ++navigateGen;
501
510
  const handle = isSearchParamOnly ? null : startPrefetch(navUrl);
502
- if (input.replace) {
503
- window.history.replaceState(null, "", navUrl);
504
- } else {
505
- window.history.pushState(null, "", navUrl);
506
- }
507
511
  const isCachedNav = visitedUrls.has(normalizeUrl(navUrl));
508
512
  if (!isCachedNav && (handle?.firstEvent || handle?.done)) {
509
513
  await awaitPrefetch(handle);
510
514
  }
511
515
  if (gen !== navigateGen)
512
516
  return;
517
+ if (input.replace) {
518
+ window.history.replaceState(null, "", navUrl);
519
+ } else {
520
+ window.history.pushState(null, "", navUrl);
521
+ }
522
+ lastPathname = navPathname;
513
523
  const transitionConfig = isSearchParamOnly ? undefined : input.viewTransition ?? navMatch?.route.viewTransition ?? options?.viewTransition;
514
524
  await applyNavigation(navUrl, navMatch, transitionConfig, isSearchParamOnly);
515
525
  }
@@ -527,10 +537,14 @@ function createRouter(routes, initialUrlOrOptions, maybeOptions) {
527
537
  }
528
538
  const onPopState = () => {
529
539
  const popUrl = window.location.pathname + window.location.search;
530
- startPrefetch(popUrl);
540
+ const popPathname = extractPathname(popUrl);
541
+ const isSearchParamOnly = lastPathname === popPathname;
542
+ lastPathname = popPathname;
543
+ if (!isSearchParamOnly)
544
+ startPrefetch(popUrl);
531
545
  const match = matchRoute(routes, popUrl);
532
- const transitionConfig = match?.route.viewTransition ?? options?.viewTransition;
533
- applyNavigation(popUrl, match, transitionConfig).catch(() => {});
546
+ const transitionConfig = isSearchParamOnly ? undefined : match?.route.viewTransition ?? options?.viewTransition;
547
+ applyNavigation(popUrl, match, transitionConfig, isSearchParamOnly).catch(() => {});
534
548
  };
535
549
  window.addEventListener("popstate", onPopState);
536
550
  function dispose() {
@@ -5,7 +5,7 @@ import {
5
5
  pushScope,
6
6
  runCleanups,
7
7
  untrack
8
- } from "./chunk-1yd6jfw5.js";
8
+ } from "./chunk-pmyavtdp.js";
9
9
 
10
10
  // src/component/lifecycle.ts
11
11
  var mountFrames = [];
@@ -729,4 +729,4 @@ function lifecycleEffect(fn) {
729
729
  return dispose;
730
730
  }
731
731
 
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 };
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, getSubscriber, getReadValueCallback, setReadValueCallback, untrack, startSignalCollection, stopSignalCollection, signal, computed, domEffect, deferredDomEffect, lifecycleEffect };
@@ -4,10 +4,10 @@ import {
4
4
  __element,
5
5
  __enterChildren,
6
6
  __exitChildren
7
- } from "./chunk-dh32wkrv.js";
7
+ } from "./chunk-xz8jq6w6.js";
8
8
  import {
9
9
  getSSRContext
10
- } from "./chunk-1yd6jfw5.js";
10
+ } from "./chunk-pmyavtdp.js";
11
11
 
12
12
  // src/component/children.ts
13
13
  var MAX_RESOLVE_DEPTH = 100;
@@ -20,7 +20,7 @@ import {
20
20
  pushScope,
21
21
  resumeHydration,
22
22
  runCleanups
23
- } from "./chunk-1yd6jfw5.js";
23
+ } from "./chunk-pmyavtdp.js";
24
24
 
25
25
  // src/dom/dom-adapter.ts
26
26
  function createDOMAdapter() {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  RouterContext
3
- } from "../../shared/chunk-9p84cvet.js";
3
+ } from "../../shared/chunk-4an2s6d7.js";
4
4
  import {
5
5
  invalidateTenantQueries
6
- } from "../../shared/chunk-pv0apt9z.js";
6
+ } from "../../shared/chunk-dvzkge4z.js";
7
7
  import {
8
8
  isBrowser
9
- } from "../../shared/chunk-sjypbv24.js";
9
+ } from "../../shared/chunk-g5vzhext.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-1yd6jfw5.js";
17
+ } from "../../shared/chunk-pmyavtdp.js";
18
18
 
19
19
  // src/auth/access-context.ts
20
20
  var AccessContext = createContext(undefined, "@vertz/ui::AccessContext");
@@ -8,10 +8,10 @@ import {
8
8
  globalCss,
9
9
  s,
10
10
  variants
11
- } from "../../shared/chunk-g60cswzm.js";
12
- import"../../shared/chunk-dh32wkrv.js";
11
+ } from "../../shared/chunk-veqs3jgz.js";
12
+ import"../../shared/chunk-xz8jq6w6.js";
13
13
  import"../../shared/chunk-h1fsr8kv.js";
14
- import"../../shared/chunk-1yd6jfw5.js";
14
+ import"../../shared/chunk-pmyavtdp.js";
15
15
  export {
16
16
  variants,
17
17
  s,
@@ -3,8 +3,8 @@ import {
3
3
  form,
4
4
  formDataToObject,
5
5
  validate
6
- } from "../../shared/chunk-hcgnfw27.js";
7
- import"../../shared/chunk-1yd6jfw5.js";
6
+ } from "../../shared/chunk-9cbb9fbs.js";
7
+ import"../../shared/chunk-pmyavtdp.js";
8
8
  export {
9
9
  validate,
10
10
  formDataToObject,
package/dist/src/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  slideOutToTop,
26
26
  zoomIn,
27
27
  zoomOut
28
- } from "../shared/chunk-rxx916ae.js";
28
+ } from "../shared/chunk-14vwqf7c.js";
29
29
  import {
30
30
  ErrorBoundary,
31
31
  Link,
@@ -36,16 +36,16 @@ import {
36
36
  getCurrentErrorHandler,
37
37
  parseSearchParams,
38
38
  useSearchParams
39
- } from "../shared/chunk-jt34jcfg.js";
39
+ } from "../shared/chunk-5eszqmat.js";
40
40
  import {
41
41
  beginDeferringMounts,
42
42
  discardDeferredMounts,
43
43
  flushDeferredMounts,
44
44
  onMount
45
- } from "../shared/chunk-mntc8w0g.js";
45
+ } from "../shared/chunk-ksetw5t2.js";
46
46
  import {
47
47
  createRouter
48
- } from "../shared/chunk-9ybtmy8t.js";
48
+ } from "../shared/chunk-khtsbadc.js";
49
49
  import {
50
50
  defineRoutes
51
51
  } from "../shared/chunk-ah86rm07.js";
@@ -54,7 +54,7 @@ import {
54
54
  form,
55
55
  formDataToObject,
56
56
  validate
57
- } from "../shared/chunk-hcgnfw27.js";
57
+ } from "../shared/chunk-9cbb9fbs.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-4eatzp0p.js";
69
+ } from "../shared/chunk-ka8jeq0f.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-g60cswzm.js";
86
+ } from "../shared/chunk-veqs3jgz.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-dh32wkrv.js";
99
+ } from "../shared/chunk-xz8jq6w6.js";
100
100
  import"../shared/chunk-h1fsr8kv.js";
101
101
  import {
102
102
  RouterContext,
103
103
  useParams,
104
104
  useRouter
105
- } from "../shared/chunk-9p84cvet.js";
105
+ } from "../shared/chunk-4an2s6d7.js";
106
106
  import {
107
107
  invalidate,
108
108
  invalidateTenantQueries
109
- } from "../shared/chunk-pv0apt9z.js";
109
+ } from "../shared/chunk-dvzkge4z.js";
110
110
  import {
111
111
  isBrowser
112
- } from "../shared/chunk-sjypbv24.js";
112
+ } from "../shared/chunk-g5vzhext.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-1yd6jfw5.js";
137
+ } from "../shared/chunk-pmyavtdp.js";
138
138
  // src/component/default-error-fallback.ts
139
139
  function DefaultErrorFallback({ error, retry }) {
140
140
  const container = document.createElement("div");
@@ -3,13 +3,13 @@ import {
3
3
  deserializeProps,
4
4
  onAnimationsComplete,
5
5
  resolveComponent
6
- } from "../shared/chunk-rxx916ae.js";
6
+ } from "../shared/chunk-14vwqf7c.js";
7
7
  import {
8
8
  __discardMountFrame,
9
9
  __flushMountFrame,
10
10
  __on,
11
11
  __pushMountFrame
12
- } from "../shared/chunk-mntc8w0g.js";
12
+ } from "../shared/chunk-ksetw5t2.js";
13
13
  import {
14
14
  executeLoaders,
15
15
  matchPath,
@@ -20,7 +20,7 @@ import {
20
20
  MemoryCache,
21
21
  QueryEnvelopeStore,
22
22
  deriveKey
23
- } from "../shared/chunk-4eatzp0p.js";
23
+ } from "../shared/chunk-ka8jeq0f.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-g60cswzm.js";
44
+ } from "../shared/chunk-veqs3jgz.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-dh32wkrv.js";
63
+ } from "../shared/chunk-xz8jq6w6.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-pv0apt9z.js";
69
+ import"../shared/chunk-dvzkge4z.js";
70
70
  import {
71
71
  isBrowser
72
- } from "../shared/chunk-sjypbv24.js";
72
+ } from "../shared/chunk-g5vzhext.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-1yd6jfw5.js";
93
+ } from "../shared/chunk-pmyavtdp.js";
94
94
  // src/dom/conditional.ts
95
95
  function clearBetween(start, end) {
96
96
  let current = start.nextSibling;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  query
3
- } from "../../shared/chunk-4eatzp0p.js";
3
+ } from "../../shared/chunk-ka8jeq0f.js";
4
4
  import"../../shared/chunk-jrtrk5z4.js";
5
- import"../../shared/chunk-pv0apt9z.js";
6
- import"../../shared/chunk-sjypbv24.js";
7
- import"../../shared/chunk-1yd6jfw5.js";
5
+ import"../../shared/chunk-dvzkge4z.js";
6
+ import"../../shared/chunk-g5vzhext.js";
7
+ import"../../shared/chunk-pmyavtdp.js";
8
8
 
9
9
  // src/query/public.ts
10
10
  import { isQueryDescriptor } from "@vertz/fetch";
@@ -6,24 +6,24 @@ import {
6
6
  createLink,
7
7
  parseSearchParams,
8
8
  useSearchParams
9
- } from "../../shared/chunk-jt34jcfg.js";
10
- import"../../shared/chunk-mntc8w0g.js";
9
+ } from "../../shared/chunk-5eszqmat.js";
10
+ import"../../shared/chunk-ksetw5t2.js";
11
11
  import {
12
12
  createRouter
13
- } from "../../shared/chunk-9ybtmy8t.js";
13
+ } from "../../shared/chunk-khtsbadc.js";
14
14
  import {
15
15
  defineRoutes
16
16
  } from "../../shared/chunk-ah86rm07.js";
17
17
  import"../../shared/chunk-jrtrk5z4.js";
18
- import"../../shared/chunk-dh32wkrv.js";
18
+ import"../../shared/chunk-xz8jq6w6.js";
19
19
  import"../../shared/chunk-h1fsr8kv.js";
20
20
  import {
21
21
  RouterContext,
22
22
  useParams,
23
23
  useRouter
24
- } from "../../shared/chunk-9p84cvet.js";
25
- import"../../shared/chunk-sjypbv24.js";
26
- import"../../shared/chunk-1yd6jfw5.js";
24
+ } from "../../shared/chunk-4an2s6d7.js";
25
+ import"../../shared/chunk-g5vzhext.js";
26
+ import"../../shared/chunk-pmyavtdp.js";
27
27
  export {
28
28
  useSearchParams,
29
29
  useRouter,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRouter
3
- } from "../../shared/chunk-9ybtmy8t.js";
3
+ } from "../../shared/chunk-khtsbadc.js";
4
4
  import {
5
5
  defineRoutes
6
6
  } from "../../shared/chunk-ah86rm07.js";
7
7
  import"../../shared/chunk-jrtrk5z4.js";
8
- import"../../shared/chunk-sjypbv24.js";
9
- import"../../shared/chunk-1yd6jfw5.js";
8
+ import"../../shared/chunk-g5vzhext.js";
9
+ import"../../shared/chunk-pmyavtdp.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.37",
3
+ "version": "0.2.38",
4
4
  "description": "Vertz UI framework — signals, components, JSX runtime",
5
5
  "license": "MIT",
6
6
  "repository": {