@vertz/ui 0.2.31 → 0.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -160,9 +160,7 @@ import { query } from '@vertz/ui';
160
160
  function UserProfile() {
161
161
  let userId = 1;
162
162
 
163
- const { data, loading } = query(() =>
164
- fetch(`/api/users/${userId}`).then((r) => r.json())
165
- );
163
+ const { data, loading } = query(() => fetch(`/api/users/${userId}`).then((r) => r.json()));
166
164
 
167
165
  return (
168
166
  <div>
@@ -316,10 +314,12 @@ const createUser = Object.assign(
316
314
  const res = await fetch('/api/users', { method: 'POST', body: JSON.stringify(body) });
317
315
  return res.json() as Promise<{ id: string }>;
318
316
  },
319
- { url: '/api/users', method: 'POST' }
317
+ { url: '/api/users', method: 'POST' },
320
318
  );
321
319
 
322
- const userSchema = { /* validation schema */ };
320
+ const userSchema = {
321
+ /* validation schema */
322
+ };
323
323
 
324
324
  function CreateUser() {
325
325
  const f = form(createUser, {
@@ -442,9 +442,7 @@ function ProjectToolbar() {
442
442
  <div>
443
443
  {deleteCheck.allowed && <button onClick={handleDelete}>Delete</button>}
444
444
  {deleteCheck.reason === 'plan_required' && <span>Upgrade to unlock</span>}
445
- {deleteCheck.meta?.limit && (
446
- <span>{deleteCheck.meta.limit.remaining} uses left</span>
447
- )}
445
+ {deleteCheck.meta?.limit && <span>{deleteCheck.meta.limit.remaining} uses left</span>}
448
446
  </div>
449
447
  );
450
448
  }
@@ -471,9 +469,7 @@ function App() {
471
469
 
472
470
  return (
473
471
  <AccessContext.Provider value={accessValue}>
474
- <AccessGate fallback={() => <Spinner />}>
475
- {() => <Router />}
476
- </AccessGate>
472
+ <AccessGate fallback={() => <Spinner />}>{() => <Router />}</AccessGate>
477
473
  </AccessContext.Provider>
478
474
  );
479
475
  }
@@ -497,7 +493,7 @@ function Logger() {
497
493
 
498
494
  watch(
499
495
  () => count,
500
- (value) => console.log('count changed to', value)
496
+ (value) => console.log('count changed to', value),
501
497
  );
502
498
 
503
499
  return <button onClick={() => count++}>Increment</button>;
@@ -545,23 +541,23 @@ unmount();
545
541
 
546
542
  ### Query Helpers
547
543
 
548
- | Export | Description |
549
- |---|---|
550
- | `findByTestId(id)` | Find element by `data-testid` — throws if not found |
551
- | `findByText(text)` | Find element by text content — throws if not found |
552
- | `queryByTestId(id)` | Find element by `data-testid` — returns `null` if not found |
553
- | `queryByText(text)` | Find element by text content — returns `null` if not found |
554
- | `waitFor(fn, options?)` | Retry an assertion until it passes |
544
+ | Export | Description |
545
+ | ----------------------- | ----------------------------------------------------------- |
546
+ | `findByTestId(id)` | Find element by `data-testid` — throws if not found |
547
+ | `findByText(text)` | Find element by text content — throws if not found |
548
+ | `queryByTestId(id)` | Find element by `data-testid` — returns `null` if not found |
549
+ | `queryByText(text)` | Find element by text content — returns `null` if not found |
550
+ | `waitFor(fn, options?)` | Retry an assertion until it passes |
555
551
 
556
552
  ### Interaction Helpers
557
553
 
558
- | Export | Description |
559
- |---|---|
560
- | `click(el)` | Simulate a click event |
561
- | `type(el, text)` | Simulate typing into an input |
562
- | `press(key)` | Simulate a key press |
563
- | `fillForm(form, values)` | Fill multiple form fields |
564
- | `submitForm(form)` | Submit a form |
554
+ | Export | Description |
555
+ | ------------------------ | ----------------------------- |
556
+ | `click(el)` | Simulate a click event |
557
+ | `type(el, text)` | Simulate typing into an input |
558
+ | `press(key)` | Simulate a key press |
559
+ | `fillForm(form, values)` | Fill multiple form fields |
560
+ | `submitForm(form)` | Submit a form |
565
561
 
566
562
  ### Route Testing
567
563
 
@@ -573,7 +569,7 @@ const { component, router, navigate } = await createTestRouter(
573
569
  '/': { component: () => <Home /> },
574
570
  '/about': { component: () => <About /> },
575
571
  },
576
- { initialPath: '/' }
572
+ { initialPath: '/' },
577
573
  );
578
574
 
579
575
  await navigate('/about');
@@ -638,93 +634,93 @@ onMount(() => {
638
634
 
639
635
  ### Lifecycle
640
636
 
641
- | Export | Description |
642
- |---|---|
637
+ | Export | Description |
638
+ | --------- | --------------------------------------------------------------------- |
643
639
  | `onMount` | Run code once when a component mounts (return a function for cleanup) |
644
- | `watch` | Watch a dependency and run a callback on change |
640
+ | `watch` | Watch a dependency and run a callback on change |
645
641
 
646
642
  ### Components
647
643
 
648
- | Export | Description |
649
- |---|---|
644
+ | Export | Description |
645
+ | --------------- | ----------------------------------------- |
650
646
  | `createContext` | Create a context for dependency injection |
651
- | `useContext` | Read a context value |
652
- | `children` | Access resolved children |
653
- | `ref` | Create a ref for DOM element access |
654
- | `ErrorBoundary` | Catch errors in a component tree |
655
- | `Suspense` | Show fallback while async content loads |
647
+ | `useContext` | Read a context value |
648
+ | `children` | Access resolved children |
649
+ | `ref` | Create a ref for DOM element access |
650
+ | `ErrorBoundary` | Catch errors in a component tree |
651
+ | `Suspense` | Show fallback while async content loads |
656
652
 
657
653
  ### Mounting
658
654
 
659
- | Export | Description |
660
- |---|---|
655
+ | Export | Description |
656
+ | ------- | ----------------------------- |
661
657
  | `mount` | Mount an app to a DOM element |
662
658
 
663
659
  ### CSS (`@vertz/ui/css`)
664
660
 
665
- | Export | Description |
666
- |---|---|
667
- | `css` | Create scoped styles |
668
- | `variants` | Create typed variant styles |
669
- | `s` | Inline dynamic styles |
670
- | `defineTheme` | Define a theme |
671
- | `compileTheme` | Compile a theme to CSS |
672
- | `ThemeProvider` | Provide a theme to descendants |
673
- | `globalCss` | Inject global CSS |
674
- | `font` | Declare a font family descriptor |
675
- | `compileFonts` | Compile font descriptors into CSS, vars, and preload tags |
661
+ | Export | Description |
662
+ | --------------- | --------------------------------------------------------- |
663
+ | `css` | Create scoped styles |
664
+ | `variants` | Create typed variant styles |
665
+ | `s` | Inline dynamic styles |
666
+ | `defineTheme` | Define a theme |
667
+ | `compileTheme` | Compile a theme to CSS |
668
+ | `ThemeProvider` | Provide a theme to descendants |
669
+ | `globalCss` | Inject global CSS |
670
+ | `font` | Declare a font family descriptor |
671
+ | `compileFonts` | Compile font descriptors into CSS, vars, and preload tags |
676
672
 
677
673
  ### Forms
678
674
 
679
- | Export | Description |
680
- |---|---|
681
- | `form` | Create a form bound to an SDK method |
682
- | `formDataToObject` | Convert FormData to a plain object |
683
- | `validate` | Run schema validation |
675
+ | Export | Description |
676
+ | ------------------ | ------------------------------------ |
677
+ | `form` | Create a form bound to an SDK method |
678
+ | `formDataToObject` | Convert FormData to a plain object |
679
+ | `validate` | Run schema validation |
684
680
 
685
681
  ### Data
686
682
 
687
- | Export | Description |
688
- |---|---|
683
+ | Export | Description |
684
+ | ------- | ---------------------- |
689
685
  | `query` | Reactive data fetching |
690
686
 
691
687
  ### Routing (`@vertz/ui/router`)
692
688
 
693
- | Export | Description |
694
- |---|---|
695
- | `defineRoutes` | Define route configuration |
696
- | `createRouter` | Create a router instance |
697
- | `createLink` | Create a `<Link>` component |
698
- | `createOutlet` | Create a route outlet |
689
+ | Export | Description |
690
+ | ------------------- | --------------------------- |
691
+ | `defineRoutes` | Define route configuration |
692
+ | `createRouter` | Create a router instance |
693
+ | `createLink` | Create a `<Link>` component |
694
+ | `createOutlet` | Create a route outlet |
699
695
  | `parseSearchParams` | Parse URL search parameters |
700
- | `useSearchParams` | Reactive search parameters |
696
+ | `useSearchParams` | Reactive search parameters |
701
697
 
702
698
  ### Auth (`@vertz/ui/auth`)
703
699
 
704
- | Export | Description |
705
- |---|---|
706
- | `AccessContext` | Context for access set data |
707
- | `can` | Check if the user has an entitlement |
708
- | `AccessGate` | Gate rendering until access set loads |
709
- | `createAccessProvider` | Bootstrap access context from SSR data |
710
- | `useAccessContext` | Read the access context (throws without provider) |
700
+ | Export | Description |
701
+ | ---------------------- | ------------------------------------------------- |
702
+ | `AccessContext` | Context for access set data |
703
+ | `can` | Check if the user has an entitlement |
704
+ | `AccessGate` | Gate rendering until access set loads |
705
+ | `createAccessProvider` | Bootstrap access context from SSR data |
706
+ | `useAccessContext` | Read the access context (throws without provider) |
711
707
 
712
708
  ### Testing (`@vertz/ui/test`)
713
709
 
714
- | Export | Description |
715
- |---|---|
716
- | `renderTest` | Mount a component for testing |
717
- | `findByTestId` | Find element by `data-testid` (throws) |
718
- | `findByText` | Find element by text content (throws) |
719
- | `queryByTestId` | Find element by `data-testid` (nullable) |
720
- | `queryByText` | Find element by text content (nullable) |
721
- | `waitFor` | Retry an assertion until it passes |
722
- | `click` | Simulate a click |
723
- | `type` | Simulate typing |
724
- | `press` | Simulate a key press |
725
- | `fillForm` | Fill multiple form fields |
726
- | `submitForm` | Submit a form |
727
- | `createTestRouter` | Create a router for testing |
710
+ | Export | Description |
711
+ | ------------------ | ---------------------------------------- |
712
+ | `renderTest` | Mount a component for testing |
713
+ | `findByTestId` | Find element by `data-testid` (throws) |
714
+ | `findByText` | Find element by text content (throws) |
715
+ | `queryByTestId` | Find element by `data-testid` (nullable) |
716
+ | `queryByText` | Find element by text content (nullable) |
717
+ | `waitFor` | Retry an assertion until it passes |
718
+ | `click` | Simulate a click |
719
+ | `type` | Simulate typing |
720
+ | `press` | Simulate a key press |
721
+ | `fillForm` | Fill multiple form fields |
722
+ | `submitForm` | Submit a form |
723
+ | `createTestRouter` | Create a router for testing |
728
724
 
729
725
  ---
730
726
 
@@ -139,14 +139,27 @@ function __child(fn) {
139
139
  const managed2 = [];
140
140
  const childCleanups2 = { value: [] };
141
141
  let sibling = anchor2.nextSibling;
142
+ let depth = 0;
142
143
  while (sibling) {
143
144
  const next = sibling.nextSibling;
144
- if (sibling.nodeType === 8 && sibling.data.trim() === "/child") {
145
- sibling.parentNode?.removeChild(sibling);
146
- break;
147
- }
148
- if (sibling.nodeType === 8 && sibling.data.trim() === "child") {
149
- break;
145
+ if (sibling.nodeType === 8) {
146
+ const data = sibling.data.trim();
147
+ if (data === "/child") {
148
+ if (depth > 0) {
149
+ depth--;
150
+ sibling.parentNode?.removeChild(sibling);
151
+ sibling = next;
152
+ continue;
153
+ }
154
+ sibling.parentNode?.removeChild(sibling);
155
+ break;
156
+ }
157
+ if (data === "child") {
158
+ depth++;
159
+ sibling.parentNode?.removeChild(sibling);
160
+ sibling = next;
161
+ continue;
162
+ }
150
163
  }
151
164
  sibling.parentNode?.removeChild(sibling);
152
165
  sibling = next;
@@ -844,6 +844,8 @@ function query(source, options = {}) {
844
844
  return result.data;
845
845
  }, { ...options, key: source._key, _entityMeta: entityMeta2 });
846
846
  }
847
+ let unsubscribeBus;
848
+ let unregisterFromRegistry;
847
849
  const thunk = source;
848
850
  const {
849
851
  initialData,
@@ -1144,8 +1146,6 @@ function query(source, options = {}) {
1144
1146
  getInflight().delete(key);
1145
1147
  refetchTrigger.value = refetchTrigger.peek() + 1;
1146
1148
  }
1147
- let unsubscribeBus;
1148
- let unregisterFromRegistry;
1149
1149
  let disposeFn;
1150
1150
  let isFirst = true;
1151
1151
  disposeFn = lifecycleEffect(() => {
@@ -1295,7 +1295,7 @@ function query(source, options = {}) {
1295
1295
  startFetch(promise, key);
1296
1296
  }
1297
1297
  });
1298
- function dispose() {
1298
+ const dispose = () => {
1299
1299
  if (referencedKeys.size > 0) {
1300
1300
  const store = getEntityStore();
1301
1301
  for (const key of referencedKeys) {
@@ -1319,7 +1319,7 @@ function query(source, options = {}) {
1319
1319
  getInflight().delete(key);
1320
1320
  }
1321
1321
  inflightKeys.clear();
1322
- }
1322
+ };
1323
1323
  function createClearData(meta) {
1324
1324
  return () => {
1325
1325
  untrack(() => {
@@ -11,7 +11,7 @@ import {
11
11
  __enterChildren,
12
12
  __exitChildren,
13
13
  __staticText
14
- } from "./chunk-1j59xzqm.js";
14
+ } from "./chunk-dh32wkrv.js";
15
15
  import {
16
16
  RouterContext
17
17
  } from "./chunk-9p84cvet.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  injectCSS
3
- } from "./chunk-pwmjtxpn.js";
3
+ } from "./chunk-zkh9sysw.js";
4
4
  import {
5
5
  createContext
6
6
  } from "./chunk-1yd6jfw5.js";
@@ -4,7 +4,7 @@ import {
4
4
  __element,
5
5
  __enterChildren,
6
6
  __exitChildren
7
- } from "./chunk-1j59xzqm.js";
7
+ } from "./chunk-dh32wkrv.js";
8
8
  import {
9
9
  getSSRContext
10
10
  } from "./chunk-1yd6jfw5.js";
@@ -8,8 +8,8 @@ import {
8
8
  globalCss,
9
9
  s,
10
10
  variants
11
- } from "../../shared/chunk-pwmjtxpn.js";
12
- import"../../shared/chunk-1j59xzqm.js";
11
+ } from "../../shared/chunk-zkh9sysw.js";
12
+ import"../../shared/chunk-dh32wkrv.js";
13
13
  import"../../shared/chunk-h1fsr8kv.js";
14
14
  import"../../shared/chunk-1yd6jfw5.js";
15
15
  export {
package/dist/src/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  slideOutToTop,
26
26
  zoomIn,
27
27
  zoomOut
28
- } from "../shared/chunk-n824qrvk.js";
28
+ } from "../shared/chunk-xyg724n1.js";
29
29
  import {
30
30
  ErrorBoundary,
31
31
  Link,
@@ -36,7 +36,7 @@ import {
36
36
  getCurrentErrorHandler,
37
37
  parseSearchParams,
38
38
  useSearchParams
39
- } from "../shared/chunk-5xm1w16j.js";
39
+ } from "../shared/chunk-jt34jcfg.js";
40
40
  import {
41
41
  beginDeferringMounts,
42
42
  discardDeferredMounts,
@@ -66,7 +66,7 @@ import {
66
66
  query,
67
67
  registerRelationSchema,
68
68
  resetRelationSchemas_TEST_ONLY
69
- } from "../shared/chunk-5vcnmqck.js";
69
+ } from "../shared/chunk-gz7rj5tv.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-pwmjtxpn.js";
86
+ } from "../shared/chunk-zkh9sysw.js";
87
87
  import {
88
88
  RENDER_NODE_BRAND,
89
89
  __append,
@@ -96,7 +96,7 @@ import {
96
96
  getAdapter,
97
97
  isRenderNode,
98
98
  setAdapter
99
- } from "../shared/chunk-1j59xzqm.js";
99
+ } from "../shared/chunk-dh32wkrv.js";
100
100
  import"../shared/chunk-h1fsr8kv.js";
101
101
  import {
102
102
  RouterContext,
@@ -3,7 +3,7 @@ import {
3
3
  deserializeProps,
4
4
  onAnimationsComplete,
5
5
  resolveComponent
6
- } from "../shared/chunk-n824qrvk.js";
6
+ } from "../shared/chunk-xyg724n1.js";
7
7
  import {
8
8
  __discardMountFrame,
9
9
  __flushMountFrame,
@@ -20,7 +20,7 @@ import {
20
20
  MemoryCache,
21
21
  QueryEnvelopeStore,
22
22
  deriveKey
23
- } from "../shared/chunk-5vcnmqck.js";
23
+ } from "../shared/chunk-gz7rj5tv.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-pwmjtxpn.js";
44
+ } from "../shared/chunk-zkh9sysw.js";
45
45
  import {
46
46
  RENDER_NODE_BRAND,
47
47
  __append,
@@ -60,7 +60,7 @@ import {
60
60
  getAdapter,
61
61
  isRenderNode,
62
62
  setAdapter
63
- } from "../shared/chunk-1j59xzqm.js";
63
+ } from "../shared/chunk-dh32wkrv.js";
64
64
  import {
65
65
  SVG_NS,
66
66
  normalizeSVGAttr,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  query
3
- } from "../../shared/chunk-5vcnmqck.js";
3
+ } from "../../shared/chunk-gz7rj5tv.js";
4
4
  import"../../shared/chunk-jrtrk5z4.js";
5
5
  import"../../shared/chunk-pv0apt9z.js";
6
6
  import"../../shared/chunk-sjypbv24.js";
@@ -6,7 +6,7 @@ import {
6
6
  createLink,
7
7
  parseSearchParams,
8
8
  useSearchParams
9
- } from "../../shared/chunk-5xm1w16j.js";
9
+ } from "../../shared/chunk-jt34jcfg.js";
10
10
  import"../../shared/chunk-mntc8w0g.js";
11
11
  import {
12
12
  createRouter
@@ -15,7 +15,7 @@ import {
15
15
  defineRoutes
16
16
  } from "../../shared/chunk-ah86rm07.js";
17
17
  import"../../shared/chunk-jrtrk5z4.js";
18
- import"../../shared/chunk-1j59xzqm.js";
18
+ import"../../shared/chunk-dh32wkrv.js";
19
19
  import"../../shared/chunk-h1fsr8kv.js";
20
20
  import {
21
21
  RouterContext,
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@vertz/ui",
3
- "version": "0.2.31",
4
- "type": "module",
5
- "license": "MIT",
3
+ "version": "0.2.33",
6
4
  "description": "Vertz UI framework — signals, components, JSX runtime",
5
+ "license": "MIT",
7
6
  "repository": {
8
7
  "type": "git",
9
8
  "url": "https://github.com/vertz-dev/vertz.git",
10
9
  "directory": "packages/ui"
11
10
  },
12
- "publishConfig": {
13
- "access": "public",
14
- "provenance": true
15
- },
11
+ "files": [
12
+ "dist",
13
+ "reactivity.json"
14
+ ],
15
+ "type": "module",
16
+ "sideEffects": [
17
+ "dist/shared/*.js"
18
+ ],
16
19
  "main": "dist/src/index.js",
17
20
  "types": "dist/src/index.d.ts",
18
21
  "exports": {
@@ -62,10 +65,10 @@
62
65
  },
63
66
  "./reactivity.json": "./reactivity.json"
64
67
  },
65
- "files": [
66
- "dist",
67
- "reactivity.json"
68
- ],
68
+ "publishConfig": {
69
+ "access": "public",
70
+ "provenance": true
71
+ },
69
72
  "scripts": {
70
73
  "build": "bunup",
71
74
  "test": "bun test",
@@ -74,19 +77,16 @@
74
77
  "typecheck": "tsc --noEmit"
75
78
  },
76
79
  "dependencies": {
77
- "@vertz/fetch": "^0.2.30"
80
+ "@vertz/fetch": "^0.2.31"
78
81
  },
79
82
  "devDependencies": {
80
83
  "@happy-dom/global-registrator": "^20.7.0",
81
- "@vertz/schema": "^0.2.30",
84
+ "@vertz/schema": "^0.2.31",
82
85
  "bunup": "^0.16.31",
83
86
  "happy-dom": "^20.7.0",
84
87
  "typescript": "^5.7.0"
85
88
  },
86
89
  "engines": {
87
90
  "node": ">=22"
88
- },
89
- "sideEffects": [
90
- "dist/shared/*.js"
91
- ]
91
+ }
92
92
  }