@conform-to/react 1.0.3 → 1.0.5
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 +1 -1
- package/hooks.d.ts +1 -1
- package/hooks.js +0 -2
- package/hooks.mjs +0 -2
- package/package.json +4 -6
package/README
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
╚══════╝ ╚═════╝ ╚═╝ ╚══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
Version 1.0.
|
|
11
|
+
Version 1.0.4 / License MIT / Copyright (c) 2024 Edmund Hung
|
|
12
12
|
|
|
13
13
|
A type-safe form validation library utilizing web fundamentals to progressively enhance HTML Forms with full support for server frameworks like Remix and Next.js.
|
|
14
14
|
|
package/hooks.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { type FormMetadata, type FieldMetadata, type Pretty, type FormOptions }
|
|
|
8
8
|
export declare const useSafeLayoutEffect: typeof useEffect;
|
|
9
9
|
export declare function useFormId<Schema extends Record<string, unknown>, FormError>(preferredId?: string): FormId<Schema, FormError>;
|
|
10
10
|
export declare function useNoValidate(defaultNoValidate?: boolean): boolean;
|
|
11
|
-
export declare function useForm<Schema extends Record<string, any>, FormValue = Schema, FormError = string[]>(options: Pretty<Omit<FormOptions<Schema, FormError, FormValue>, 'formId'
|
|
11
|
+
export declare function useForm<Schema extends Record<string, any>, FormValue = Schema, FormError = string[]>(options: Pretty<Omit<FormOptions<Schema, FormError, FormValue>, 'formId'> & {
|
|
12
12
|
/**
|
|
13
13
|
* The form id. If not provided, a random id will be generated.
|
|
14
14
|
*/
|
package/hooks.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
|
|
6
6
|
var react = require('react');
|
|
7
|
-
var reactDom = require('react-dom');
|
|
8
7
|
var context = require('./context.js');
|
|
9
8
|
|
|
10
9
|
var _excluded = ["id"];
|
|
@@ -38,7 +37,6 @@ function useForm(options) {
|
|
|
38
37
|
formConfig = _rollupPluginBabelHelpers.objectWithoutProperties(options, _excluded);
|
|
39
38
|
var formId = useFormId(id);
|
|
40
39
|
var [context$1] = react.useState(() => context.createFormContext(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, formConfig), {}, {
|
|
41
|
-
onSchedule: callback => reactDom.flushSync(callback),
|
|
42
40
|
formId
|
|
43
41
|
})));
|
|
44
42
|
useSafeLayoutEffect(() => {
|
package/hooks.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from './_virtual/_rollupPluginBabelHelpers.mjs';
|
|
2
2
|
import { useState, useEffect, useLayoutEffect, useId } from 'react';
|
|
3
|
-
import { flushSync } from 'react-dom';
|
|
4
3
|
import { createFormContext, useSubjectRef, useFormState, getFormMetadata, useFormContext, getFieldMetadata } from './context.mjs';
|
|
5
4
|
|
|
6
5
|
var _excluded = ["id"];
|
|
@@ -34,7 +33,6 @@ function useForm(options) {
|
|
|
34
33
|
formConfig = _objectWithoutProperties(options, _excluded);
|
|
35
34
|
var formId = useFormId(id);
|
|
36
35
|
var [context] = useState(() => createFormContext(_objectSpread2(_objectSpread2({}, formConfig), {}, {
|
|
37
|
-
onSchedule: callback => flushSync(callback),
|
|
38
36
|
formId
|
|
39
37
|
})));
|
|
40
38
|
useSafeLayoutEffect(() => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Conform view adapter for react",
|
|
4
4
|
"homepage": "https://conform.guide",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.5",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.mjs",
|
|
9
9
|
"types": "index.d.ts",
|
|
@@ -30,16 +30,14 @@
|
|
|
30
30
|
"url": "https://github.com/edmundhung/conform/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@conform-to/dom": "1.0.
|
|
33
|
+
"@conform-to/dom": "1.0.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/react": "^18.2.
|
|
37
|
-
"@types/react-dom": "^18.2.20",
|
|
36
|
+
"@types/react": "^18.2.43",
|
|
38
37
|
"react": "^18.2.0"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
|
-
"react": ">=18"
|
|
42
|
-
"react-dom": ">=18"
|
|
40
|
+
"react": ">=18"
|
|
43
41
|
},
|
|
44
42
|
"keywords": [
|
|
45
43
|
"constraint-validation",
|