void 0.7.4 → 0.7.6
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/{better-auth-shared-BrfZ78iY.mjs → better-auth-shared-CjnJZFC0.mjs} +3 -7
- package/dist/cli/cli.mjs +8 -8
- package/dist/{db-RqxhOT2E.mjs → db-DvBg7Oc5.mjs} +1 -1
- package/dist/{deploy-CRIz77mw.mjs → deploy-B5rTuzXw.mjs} +39 -12
- package/dist/index.mjs +463 -34
- package/dist/{init-FMZ29UZW.mjs → init-BiXWyKEf.mjs} +2 -2
- package/dist/pages/client.d.mts +4 -3
- package/dist/pages/client.mjs +18 -6
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/islands-plugin.d.mts +2 -11
- package/dist/pages/islands-plugin.mjs +1 -63
- package/dist/pages/protocol.d.mts +1 -1
- package/dist/pages/protocol.mjs +101 -12
- package/dist/plugin-inference-CXUuq0aC.mjs +577 -0
- package/dist/{prepare-PqAbhLte.mjs → prepare-BrfiJBju.mjs} +2 -2
- package/dist/{preset-jKn1hQwP.mjs → preset-BhnZpb7t.mjs} +1 -1
- package/dist/{protocol-CK4OFwfR.d.mts → protocol-COz1NHxc.d.mts} +4 -0
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/{scan-QtRTdh94.mjs → scan-vv5u7rHu.mjs} +1 -1
- package/dist/{types-AdKzPp2C.d.mts → types-D6AuY5Bf.d.mts} +9 -1
- package/package.json +3 -3
- package/skills/void/docs/guide/pages-routing/overview.md +11 -0
- package/skills/void/docs/reference/api.md +8 -4
- package/dist/plugin-inference-CCtRkt9O.mjs +0 -2476
|
@@ -195,6 +195,17 @@ router.refresh(); // re-fetch current page props
|
|
|
195
195
|
router.visit('/logout', { method: 'POST' }); // non-GET navigation
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
+
For dynamic route params, use `useParams()` from the same adapter package:
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
import { useParams } from '@void/react';
|
|
202
|
+
|
|
203
|
+
export default function PostPage() {
|
|
204
|
+
const { id } = useParams<{ id: string }>();
|
|
205
|
+
return <h1>Post {id}</h1>;
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
198
209
|
## Scroll Restoration
|
|
199
210
|
|
|
200
211
|
The Void Router automatically saves and restores scroll position during client-side navigation:
|
|
@@ -742,7 +742,8 @@ Imported from `"@void/vue"`.
|
|
|
742
742
|
| Export | Description |
|
|
743
743
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
744
744
|
| `Link` | Vue component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
745
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
745
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
746
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
746
747
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
747
748
|
| `useForm(url, defaults, options?)` | Typed reactive form helper bound to a page action URL. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }`. |
|
|
748
749
|
| `useShared()` | Returns shared data injected by middleware via `c.set("shared", {...})`. |
|
|
@@ -789,7 +790,8 @@ Imported from `"@void/react"`.
|
|
|
789
790
|
| Export | Description |
|
|
790
791
|
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
791
792
|
| `Link` | React component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
792
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. React navigations are scheduled as transitions.
|
|
793
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. React navigations are scheduled as transitions. |
|
|
794
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
793
795
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
794
796
|
| `useForm(url, defaults, options?)` | Form helper hook. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }`. |
|
|
795
797
|
| `action(url, options?)` | Awaitable one-shot page action helper. Uses `POST` by default and accepts `{ data, method, params }`, where `method` can be `"PUT"`, `"PATCH"`, or `"DELETE"`. Returns an `ActionResult`. |
|
|
@@ -845,7 +847,8 @@ Imported from `"@void/svelte"`.
|
|
|
845
847
|
| `Link` | Svelte component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
846
848
|
| `useForm(url, defaults, options?)` | Form helper using Svelte 5 runes. Returns `{ data, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }`. |
|
|
847
849
|
| `useShared()` | Returns shared data injected by middleware via `c.set("shared", {...})`. |
|
|
848
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
850
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
851
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
849
852
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
850
853
|
|
|
851
854
|
Svelte `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|
|
@@ -888,7 +891,8 @@ Imported from `"@void/solid"`.
|
|
|
888
891
|
| `Link` | Solid component for SPA navigation. Renders `<a>` for GET, `<button>` for non-GET methods. Props: `href`, `method`, `data`, `prefetch`, `cacheFor`, `preserveScroll`, `preserveState`, `replace`, `reloadDocument`, `viewTransition`, `onNavigate`. |
|
|
889
892
|
| `useForm(url, defaults, options?)` | Form helper using Solid stores. Returns `{ data, setData, post, put, patch, delete, pending, errors, error, hasChanges, wasSuccessful, recentlySuccessful, reset, clearErrors, clearError }`. |
|
|
890
893
|
| `useShared()` | Returns shared data injected by middleware via `c.set("shared", {...})`. |
|
|
891
|
-
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`.
|
|
894
|
+
| `useRouter()` | Returns the Void Router with current route state (`url`, `path`, `query`, `params`) and navigation methods: `visit`, `refresh`, awaitable `prefetch`, `flush`, `flushAll`. |
|
|
895
|
+
| `useParams()` | Returns dynamic route params for the page currently being rendered. |
|
|
892
896
|
| `useNavigation()` | Returns pending navigation state: `{ state, location, method }`, where `state` is `"idle"`, `"loading"`, or `"submitting"` and `location` is the pending destination. |
|
|
893
897
|
|
|
894
898
|
Solid `Link` GET `data` is merged into the rendered `href` query string. Primitive values are serialized with `String(value)`, arrays become repeated keys, `null` and `undefined` are omitted, and nested objects throw. `prefetch` and `reloadDocument` are GET-only and throw for mutation links.
|