@k8ordo/state 1.0.0 → 1.1.0
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 +2 -2
- package/dist/page-state.d.mts +2 -1
- package/dist/register.d.mts +2 -1
- package/dist/storage-state.d.mts +2 -1
- package/dist/use-app-state.d.mts +2 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ pnpm add @k8ordo/state zod
|
|
|
31
31
|
| Package | Version | Required | Needed for |
|
|
32
32
|
| ---------------- | ------- | -------- | ------------------------------------------------------- |
|
|
33
33
|
| `react` | ≥19.3.0 | yes | `useAppState` |
|
|
34
|
-
| `zod` | ^4.
|
|
35
|
-
| `@k8ordo/router` | ^1.
|
|
34
|
+
| `zod` | ^4.6.6 | yes | the schemas (`zod/mini` works, and is the lighter pick) |
|
|
35
|
+
| `@k8ordo/router` | ^1.1.0 | optional | typed `href` paths from the app's route table |
|
|
36
36
|
| `typescript` | ≥7.0.0 | optional | the shipped type declarations |
|
|
37
37
|
| `@types/react` | ≥19.3.0 | optional | the shipped type declarations |
|
|
38
38
|
|
package/dist/page-state.d.mts
CHANGED
|
@@ -59,4 +59,5 @@ export declare function definePageState<Url extends StateSchema, Entry extends S
|
|
|
59
59
|
* codec is built once, when this is called.
|
|
60
60
|
*/
|
|
61
61
|
export declare const urlReader: <Url extends StateSchema>(schema: Url) => ((input: UrlInput) => output<Url>);
|
|
62
|
-
//#endregion
|
|
62
|
+
//#endregion
|
|
63
|
+
export {};
|
package/dist/register.d.mts
CHANGED
|
@@ -38,4 +38,5 @@ export type AcceptedPath<R, Path extends string> = R extends {
|
|
|
38
38
|
} ? [Path] extends [P] ? Path : P : [Path] extends [`/${string}`] ? Path : `/${string}`;
|
|
39
39
|
/** `href()`'s path check: `Path` when the registered router accepts it. */
|
|
40
40
|
export type RegisteredPath<Path extends string> = AcceptedPath<Register, Path>;
|
|
41
|
-
//#endregion
|
|
41
|
+
//#endregion
|
|
42
|
+
export {};
|
package/dist/storage-state.d.mts
CHANGED
|
@@ -34,4 +34,5 @@ export type SessionState<Schema extends StateSchema = StateSchema> = StorageStat
|
|
|
34
34
|
export declare const storageCodecOf: (def: LocalState | SessionState) => RowCodec;
|
|
35
35
|
export declare const defineLocalState: <Schema extends StateSchema>(key: string, schema: Schema, versioning?: Versioning<Schema>) => LocalState<Schema>;
|
|
36
36
|
export declare const defineSessionState: <Schema extends StateSchema>(key: string, schema: Schema) => SessionState<Schema>;
|
|
37
|
-
//#endregion
|
|
37
|
+
//#endregion
|
|
38
|
+
export {};
|
package/dist/use-app-state.d.mts
CHANGED
|
@@ -33,4 +33,5 @@ type OptionsFor<Def> = Def extends {
|
|
|
33
33
|
} : never;
|
|
34
34
|
export declare function useAppState<Def extends AnyState>(def: Def, options?: OptionsFor<Def>): [StateOf<Def>, UpdateFn<Def>];
|
|
35
35
|
export declare function useAppState<Def extends AnyState, const Key extends Extract<keyof StateOf<Def>, string>>(def: Def, keys: readonly Key[], options?: OptionsFor<Def>): [Pick<StateOf<Def>, Key>, UpdateFn<Def>];
|
|
36
|
-
//#endregion
|
|
36
|
+
//#endregion
|
|
37
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k8ordo/state",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Declare state by where it lives — URL search params, history-entry state, localStorage, sessionStorage, a cookie, or memory. One zod schema per boundary place and a typed box for memory, over the Navigation API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cookie",
|
|
@@ -43,29 +43,29 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@arethetypeswrong/cli": "0.18.5",
|
|
46
|
-
"@k8ordo/router": "^1.
|
|
46
|
+
"@k8ordo/router": "^1.1.0",
|
|
47
47
|
"@types/react": "19.3.0",
|
|
48
48
|
"@types/react-dom": "19.3.0",
|
|
49
49
|
"@vitejs/plugin-basic-ssl": "2.3.0",
|
|
50
50
|
"@vitejs/plugin-react": "6.1.2",
|
|
51
|
-
"@vitest/browser-playwright": "5.0.
|
|
51
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
52
52
|
"playwright": "1.63.0",
|
|
53
53
|
"publint": "0.3.25",
|
|
54
|
-
"react": "19.3.
|
|
55
|
-
"react-dom": "19.3.
|
|
54
|
+
"react": "19.3.1",
|
|
55
|
+
"react-dom": "19.3.1",
|
|
56
56
|
"typescript": "7.0.2",
|
|
57
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.
|
|
58
|
-
"vite-plus": "1.
|
|
59
|
-
"vitest": "5.0.
|
|
57
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
58
|
+
"vite-plus": "1.3.0",
|
|
59
|
+
"vitest": "5.0.5",
|
|
60
60
|
"vitest-browser-react": "2.3.0",
|
|
61
|
-
"zod": "4.6.
|
|
61
|
+
"zod": "4.6.6"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@k8ordo/router": "^1.
|
|
64
|
+
"@k8ordo/router": "^1.1.0",
|
|
65
65
|
"@types/react": ">=19.3.0",
|
|
66
66
|
"react": ">=19.3.0",
|
|
67
67
|
"typescript": ">=7.0.0",
|
|
68
|
-
"zod": "^4.
|
|
68
|
+
"zod": "^4.6.6"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"@k8ordo/router": {
|