@verikit/react 0.23.1 → 0.23.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/README.md
ADDED
|
@@ -13,7 +13,7 @@ export interface UseResourceFormOptions<TRecord> {
|
|
|
13
13
|
onSuccess?: (record: TRecord) => void;
|
|
14
14
|
/**
|
|
15
15
|
* Called when the create/update mutation itself fails (e.g. a network error
|
|
16
|
-
* or a permission-denied response)
|
|
16
|
+
* or a permission-denied response) not for client-side field validation
|
|
17
17
|
* failures, which surface via `fieldErrors`/`submitError` instead.
|
|
18
18
|
*/
|
|
19
19
|
onError?: (error: Error) => void;
|
|
@@ -26,13 +26,9 @@ export interface UseResourceFormResult<TRecord = Record<string, unknown>> extend
|
|
|
26
26
|
submitError: Error | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* fields and which resource to submit to, so there's no separate `name`
|
|
33
|
-
* string or raw field map to keep in sync with it. Submitting infers,
|
|
34
|
-
* validates, and sends the request in one step. Creates when no `id` option
|
|
35
|
-
* is given, updates that record's id otherwise.
|
|
29
|
+
* Resource-backed form hook that uses the resource as the source of truth
|
|
30
|
+
* for fields, validation, and create/update mutations. Creates when no `id`
|
|
31
|
+
* is provided; otherwise updates the specified record.
|
|
36
32
|
*/
|
|
37
33
|
export declare function useResourceForm<TRecord = Record<string, unknown>>(resource: UseResourceFormSource, { id, defaultValues, onSuccess, onError, }?: UseResourceFormOptions<TRecord>): UseResourceFormResult<TRecord>;
|
|
38
34
|
//# sourceMappingURL=use-resource-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resource-form.d.ts","sourceRoot":"","sources":["../../src/query/use-resource-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,E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AAiB,CAAC;IAClC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,6DAA6D;AAC7D,MAAM,WAAW,qBAAqB,CACpC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACjC,SAAQ,oBAAoB,CAAC,OAAO,CAAC;IACrC,iEAAiE;IACjE,YAAY,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,QAAQ,EAAE,qBAAqB,EAC/B,EACE,EAAE,EACF,aAAa,EACb,SAAS,EACT,OAAO,GACR,GAAE,sBAAsB,CAAC,OAAO,CAAM,GACtC,qBAAqB,CAAC,OAAO,CAAC,CAsBhC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { useVerikitForm } from "../form/use-verikit-form.js";
|
|
2
2
|
import { useCreateResource, useUpdateResource, } from "./use-resource-mutations.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* fields and which resource to submit to, so there's no separate `name`
|
|
8
|
-
* string or raw field map to keep in sync with it. Submitting infers,
|
|
9
|
-
* validates, and sends the request in one step. Creates when no `id` option
|
|
10
|
-
* is given, updates that record's id otherwise.
|
|
4
|
+
* Resource-backed form hook that uses the resource as the source of truth
|
|
5
|
+
* for fields, validation, and create/update mutations. Creates when no `id`
|
|
6
|
+
* is provided; otherwise updates the specified record.
|
|
11
7
|
*/
|
|
12
8
|
export function useResourceForm(resource, { id, defaultValues, onSuccess, onError, } = {}) {
|
|
13
9
|
const create = useCreateResource(resource.name, { onError });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verikit/react",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.6",
|
|
4
4
|
"description": "React UI bindings for Verikit resource workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
],
|
|
17
17
|
"author": "Chidi E <hi@ceeso.dev>",
|
|
18
18
|
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/verikit-project/verikit",
|
|
22
|
+
"directory": "packages/react"
|
|
23
|
+
},
|
|
19
24
|
"engines": {
|
|
20
25
|
"node": ">=24"
|
|
21
26
|
},
|
|
@@ -52,11 +57,11 @@
|
|
|
52
57
|
"clsx": "^2.1.1",
|
|
53
58
|
"lucide-react": "^1.26.0",
|
|
54
59
|
"tailwind-merge": "^3.6.0",
|
|
55
|
-
"@verikit/
|
|
56
|
-
"@verikit/
|
|
57
|
-
"@verikit/core": "0.23.
|
|
58
|
-
"@verikit/theme": "0.23.
|
|
59
|
-
"@verikit/ui-core": "0.23.
|
|
60
|
+
"@verikit/client": "0.23.6",
|
|
61
|
+
"@verikit/runtime": "0.23.6",
|
|
62
|
+
"@verikit/core": "0.23.6",
|
|
63
|
+
"@verikit/theme": "0.23.6",
|
|
64
|
+
"@verikit/ui-core": "0.23.6"
|
|
60
65
|
},
|
|
61
66
|
"devDependencies": {
|
|
62
67
|
"@base-ui/react": "^1.6.0",
|