@ereo/forms 0.1.33 → 0.2.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/dist/action-react.test.d.ts +2 -0
- package/dist/action-react.test.d.ts.map +1 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.react.test.d.ts +2 -0
- package/dist/components.react.test.d.ts.map +1 -0
- package/dist/hooks.react.test.d.ts +2 -0
- package/dist/hooks.react.test.d.ts.map +1 -0
- package/dist/index.js +184 -120
- package/dist/store.d.ts +1 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/test-setup-dom.d.ts +2 -0
- package/dist/test-setup-dom.d.ts.map +1 -0
- package/dist/validation-engine.d.ts +1 -0
- package/dist/validation-engine.d.ts.map +1 -1
- package/dist/validators.d.ts +1 -1
- package/dist/validators.d.ts.map +1 -1
- package/dist/wizard-react.test.d.ts +2 -0
- package/dist/wizard-react.test.d.ts.map +1 -0
- package/dist/wizard.d.ts.map +1 -1
- package/package.json +29 -28
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-react.test.d.ts","sourceRoot":"","sources":["../src/action-react.test.tsx"],"names":[],"mappings":""}
|
package/dist/action.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO;IAC3D,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACtC,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,C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AS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtD,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GACxB,YAAY,CAuId;AAID,MAAM,WAAW,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO;IACxD,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,kBAAkB,GAAG,qBAAqB,CAAC;CACtD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,EAChD,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAC,GACrC;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CACtC,CA+DA;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAuCvE"}
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAEV,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,OAA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":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.react.test.d.ts","sourceRoot":"","sources":["../src/hooks.react.test.tsx"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/store.ts
|
|
2
|
-
import { signal as signal2, batch } from "@ereo/state";
|
|
2
|
+
import { signal as signal2, batch as batch2 } from "@ereo/state";
|
|
3
3
|
|
|
4
4
|
// src/utils.ts
|
|
5
5
|
function parsePath(path) {
|
|
@@ -118,7 +118,7 @@ function deepClone(obj) {
|
|
|
118
118
|
return result;
|
|
119
119
|
}
|
|
120
120
|
function deepEqual(a, b) {
|
|
121
|
-
if (a
|
|
121
|
+
if (Object.is(a, b))
|
|
122
122
|
return true;
|
|
123
123
|
if (a === null || b === null)
|
|
124
124
|
return false;
|
|
@@ -284,7 +284,7 @@ function createValuesProxy(store, basePath = "", proxyCache) {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
// src/validation-engine.ts
|
|
287
|
-
import { signal } from "@ereo/state";
|
|
287
|
+
import { signal, batch } from "@ereo/state";
|
|
288
288
|
|
|
289
289
|
// src/schema.ts
|
|
290
290
|
function isStandardSchema(value) {
|
|
@@ -750,6 +750,8 @@ class ValidationEngine {
|
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
const fieldPaths = Array.from(this._fieldValidations.keys());
|
|
753
|
+
const fieldSyncErrors = {};
|
|
754
|
+
const fieldAsyncErrors = {};
|
|
753
755
|
await Promise.all(fieldPaths.map(async (path) => {
|
|
754
756
|
if (controller.signal.aborted)
|
|
755
757
|
return;
|
|
@@ -758,32 +760,42 @@ class ValidationEngine {
|
|
|
758
760
|
return;
|
|
759
761
|
const value = this._store.getValue(path);
|
|
760
762
|
const context = this._createContext(controller.signal);
|
|
761
|
-
const errors = [];
|
|
762
763
|
const syncValidators = validation.validators.filter((v) => !v._isAsync);
|
|
763
764
|
const asyncValidators = validation.validators.filter((v) => v._isAsync);
|
|
765
|
+
const syncErrors = [];
|
|
766
|
+
const asyncErrors = [];
|
|
764
767
|
for (const validator of syncValidators) {
|
|
765
768
|
if (controller.signal.aborted)
|
|
766
769
|
break;
|
|
767
770
|
const result = await validator(value, context);
|
|
768
771
|
if (result)
|
|
769
|
-
|
|
772
|
+
syncErrors.push(result);
|
|
770
773
|
}
|
|
771
|
-
if (
|
|
774
|
+
if (syncErrors.length === 0 && !controller.signal.aborted) {
|
|
772
775
|
for (const validator of asyncValidators) {
|
|
773
776
|
if (controller.signal.aborted)
|
|
774
777
|
break;
|
|
775
778
|
const result = await validator(value, context);
|
|
776
779
|
if (result)
|
|
777
|
-
|
|
780
|
+
asyncErrors.push(result);
|
|
778
781
|
}
|
|
779
782
|
}
|
|
780
|
-
if (
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
783
|
+
if (!controller.signal.aborted) {
|
|
784
|
+
const allFieldErrors = [...syncErrors, ...asyncErrors];
|
|
785
|
+
if (allFieldErrors.length > 0) {
|
|
786
|
+
if (allErrors[path]) {
|
|
787
|
+
allErrors[path] = [...allErrors[path], ...allFieldErrors];
|
|
788
|
+
} else {
|
|
789
|
+
allErrors[path] = allFieldErrors;
|
|
790
|
+
}
|
|
791
|
+
hasErrors = true;
|
|
792
|
+
}
|
|
793
|
+
if (syncErrors.length > 0) {
|
|
794
|
+
fieldSyncErrors[path] = syncErrors;
|
|
795
|
+
}
|
|
796
|
+
if (asyncErrors.length > 0) {
|
|
797
|
+
fieldAsyncErrors[path] = asyncErrors;
|
|
785
798
|
}
|
|
786
|
-
hasErrors = true;
|
|
787
799
|
}
|
|
788
800
|
}));
|
|
789
801
|
if (controller.signal.aborted)
|
|
@@ -791,40 +803,44 @@ class ValidationEngine {
|
|
|
791
803
|
if (this._validateAllController === controller) {
|
|
792
804
|
this._validateAllController = null;
|
|
793
805
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
806
|
+
batch(() => {
|
|
807
|
+
this._store.clearErrors();
|
|
808
|
+
if (schema) {
|
|
809
|
+
const schemaErrors2 = schemaResult?.errors ?? {};
|
|
810
|
+
for (const [path, errors] of Object.entries(schemaErrors2)) {
|
|
811
|
+
this._store.setErrorsWithSource(path, errors, "schema");
|
|
812
|
+
}
|
|
799
813
|
}
|
|
800
|
-
}
|
|
801
|
-
for (const [path, errors] of Object.entries(allErrors)) {
|
|
802
814
|
const schemaErrors = schemaResult?.errors ?? {};
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
if (
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
this._store.setErrors(path, errors);
|
|
815
|
+
for (const path of fieldPaths) {
|
|
816
|
+
const syncErrs = fieldSyncErrors[path];
|
|
817
|
+
const asyncErrs = fieldAsyncErrors[path];
|
|
818
|
+
if (!syncErrs && !asyncErrs)
|
|
819
|
+
continue;
|
|
820
|
+
if (schemaErrors[path]) {
|
|
821
|
+
const schemaSet = new Set(schemaErrors[path]);
|
|
822
|
+
if (syncErrs) {
|
|
823
|
+
const unique = syncErrs.filter((e) => !schemaSet.has(e));
|
|
824
|
+
if (unique.length > 0) {
|
|
825
|
+
this._store.setErrorsWithSource(path, unique, "sync");
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
if (asyncErrs) {
|
|
829
|
+
const unique = asyncErrs.filter((e) => !schemaSet.has(e));
|
|
830
|
+
if (unique.length > 0) {
|
|
831
|
+
this._store.setErrorsWithSource(path, unique, "async");
|
|
832
|
+
}
|
|
822
833
|
}
|
|
823
834
|
} else {
|
|
824
|
-
|
|
835
|
+
if (syncErrs && syncErrs.length > 0) {
|
|
836
|
+
this._store.setErrorsWithSource(path, syncErrs, "sync");
|
|
837
|
+
}
|
|
838
|
+
if (asyncErrs && asyncErrs.length > 0) {
|
|
839
|
+
this._store.setErrorsWithSource(path, asyncErrs, "async");
|
|
840
|
+
}
|
|
825
841
|
}
|
|
826
842
|
}
|
|
827
|
-
}
|
|
843
|
+
});
|
|
828
844
|
return { success: !hasErrors, errors: hasErrors ? allErrors : undefined };
|
|
829
845
|
}
|
|
830
846
|
async _validateSchema(schema) {
|
|
@@ -914,7 +930,29 @@ class ValidationEngine {
|
|
|
914
930
|
set.delete(path);
|
|
915
931
|
}
|
|
916
932
|
}
|
|
933
|
+
abortAll() {
|
|
934
|
+
for (const controller of this._abortControllers.values()) {
|
|
935
|
+
controller.abort();
|
|
936
|
+
}
|
|
937
|
+
this._abortControllers.clear();
|
|
938
|
+
for (const timer of this._debounceTimers.values()) {
|
|
939
|
+
clearTimeout(timer);
|
|
940
|
+
}
|
|
941
|
+
this._debounceTimers.clear();
|
|
942
|
+
if (this._validateAllController) {
|
|
943
|
+
this._validateAllController.abort();
|
|
944
|
+
this._validateAllController = null;
|
|
945
|
+
}
|
|
946
|
+
for (const path of this._validatingFields) {
|
|
947
|
+
const sig = this._validatingSignals.get(path);
|
|
948
|
+
if (sig)
|
|
949
|
+
sig.set(false);
|
|
950
|
+
}
|
|
951
|
+
this._validatingFields.clear();
|
|
952
|
+
this._validatingDependents.clear();
|
|
953
|
+
}
|
|
917
954
|
dispose() {
|
|
955
|
+
this.abortAll();
|
|
918
956
|
for (const timer of this._debounceTimers.values()) {
|
|
919
957
|
clearTimeout(timer);
|
|
920
958
|
}
|
|
@@ -923,6 +961,7 @@ class ValidationEngine {
|
|
|
923
961
|
controller.abort();
|
|
924
962
|
}
|
|
925
963
|
this._abortControllers.clear();
|
|
964
|
+
this._fieldValidations.clear();
|
|
926
965
|
this._validatingFields.clear();
|
|
927
966
|
this._validatingSignals.clear();
|
|
928
967
|
this._fieldGenerations.clear();
|
|
@@ -1041,9 +1080,9 @@ function focusFirstError(form) {
|
|
|
1041
1080
|
if (typeof document === "undefined")
|
|
1042
1081
|
return;
|
|
1043
1082
|
const scrollBehavior = prefersReducedMotion() ? "auto" : "smooth";
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1046
|
-
for (const [path, el] of
|
|
1083
|
+
const fieldRefs = form.getFieldRefs?.() ?? form._fieldRefs;
|
|
1084
|
+
if (fieldRefs) {
|
|
1085
|
+
for (const [path, el] of fieldRefs) {
|
|
1047
1086
|
if (!el)
|
|
1048
1087
|
continue;
|
|
1049
1088
|
const errors = form.getErrors(path).get();
|
|
@@ -1074,7 +1113,7 @@ function focusField(name) {
|
|
|
1074
1113
|
function trapFocus(container) {
|
|
1075
1114
|
if (typeof document === "undefined")
|
|
1076
1115
|
return () => {};
|
|
1077
|
-
const focusableSelector = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1116
|
+
const focusableSelector = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]:not([contenteditable="false"])';
|
|
1078
1117
|
const handleKeydown = (e) => {
|
|
1079
1118
|
if (e.key !== "Tab")
|
|
1080
1119
|
return;
|
|
@@ -1266,10 +1305,10 @@ class FormStore {
|
|
|
1266
1305
|
return this.getSignal(path).get();
|
|
1267
1306
|
}
|
|
1268
1307
|
setValue(path, value) {
|
|
1269
|
-
|
|
1308
|
+
batch2(() => {
|
|
1270
1309
|
const sig = this.getSignal(path);
|
|
1271
1310
|
const oldValue = sig.get();
|
|
1272
|
-
if (oldValue
|
|
1311
|
+
if (Object.is(oldValue, value))
|
|
1273
1312
|
return;
|
|
1274
1313
|
sig.set(value);
|
|
1275
1314
|
if (value !== null && typeof value === "object") {
|
|
@@ -1289,7 +1328,7 @@ class FormStore {
|
|
|
1289
1328
|
});
|
|
1290
1329
|
}
|
|
1291
1330
|
setValues(partial) {
|
|
1292
|
-
|
|
1331
|
+
batch2(() => {
|
|
1293
1332
|
const paths = flattenToPaths(partial);
|
|
1294
1333
|
for (const [path, value] of paths) {
|
|
1295
1334
|
if (typeof value !== "object" || value === null) {
|
|
@@ -1403,39 +1442,45 @@ class FormStore {
|
|
|
1403
1442
|
return result;
|
|
1404
1443
|
}
|
|
1405
1444
|
setErrors(path, errors) {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
if (mapSig) {
|
|
1409
|
-
const current = mapSig.get();
|
|
1410
|
-
mapSig.set({ ...current, manual: errors });
|
|
1411
|
-
}
|
|
1412
|
-
this._updateIsValid();
|
|
1413
|
-
this._notifySubscribers();
|
|
1414
|
-
}
|
|
1415
|
-
clearErrors(path) {
|
|
1416
|
-
if (path) {
|
|
1417
|
-
const sig = this._errorSignals.get(path);
|
|
1418
|
-
if (sig)
|
|
1419
|
-
sig.set([]);
|
|
1445
|
+
batch2(() => {
|
|
1446
|
+
this.getErrors(path).set(errors);
|
|
1420
1447
|
const mapSig = this._errorMapSignals.get(path);
|
|
1421
|
-
if (mapSig)
|
|
1422
|
-
mapSig.
|
|
1423
|
-
|
|
1424
|
-
for (const sig of this._errorSignals.values()) {
|
|
1425
|
-
sig.set([]);
|
|
1448
|
+
if (mapSig) {
|
|
1449
|
+
const current = mapSig.get();
|
|
1450
|
+
mapSig.set({ ...current, manual: errors });
|
|
1426
1451
|
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1452
|
+
this._updateIsValid();
|
|
1453
|
+
this._notifySubscribers();
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
clearErrors(path) {
|
|
1457
|
+
batch2(() => {
|
|
1458
|
+
if (path) {
|
|
1459
|
+
const sig = this._errorSignals.get(path);
|
|
1460
|
+
if (sig)
|
|
1461
|
+
sig.set([]);
|
|
1462
|
+
const mapSig = this._errorMapSignals.get(path);
|
|
1463
|
+
if (mapSig)
|
|
1464
|
+
mapSig.set(this._emptyErrorMap());
|
|
1465
|
+
} else {
|
|
1466
|
+
for (const sig of this._errorSignals.values()) {
|
|
1467
|
+
sig.set([]);
|
|
1468
|
+
}
|
|
1469
|
+
for (const sig of this._errorMapSignals.values()) {
|
|
1470
|
+
sig.set(this._emptyErrorMap());
|
|
1471
|
+
}
|
|
1472
|
+
this._formErrors.set([]);
|
|
1429
1473
|
}
|
|
1430
|
-
this.
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
this._notifySubscribers();
|
|
1474
|
+
this._updateIsValid();
|
|
1475
|
+
this._notifySubscribers();
|
|
1476
|
+
});
|
|
1434
1477
|
}
|
|
1435
1478
|
setFormErrors(errors) {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1479
|
+
batch2(() => {
|
|
1480
|
+
this._formErrors.set(errors);
|
|
1481
|
+
this._updateIsValid();
|
|
1482
|
+
this._notifySubscribers();
|
|
1483
|
+
});
|
|
1439
1484
|
}
|
|
1440
1485
|
_emptyErrorMap() {
|
|
1441
1486
|
return { sync: [], async: [], schema: [], server: [], manual: [] };
|
|
@@ -1449,22 +1494,26 @@ class FormStore {
|
|
|
1449
1494
|
return sig;
|
|
1450
1495
|
}
|
|
1451
1496
|
setErrorsWithSource(path, errors, source) {
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1497
|
+
batch2(() => {
|
|
1498
|
+
const mapSig = this.getErrorMap(path);
|
|
1499
|
+
const current = mapSig.get();
|
|
1500
|
+
const updated = { ...current, [source]: errors };
|
|
1501
|
+
mapSig.set(updated);
|
|
1502
|
+
this._rebuildFlatErrors(path, updated);
|
|
1503
|
+
});
|
|
1457
1504
|
}
|
|
1458
1505
|
clearErrorsBySource(path, source) {
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1506
|
+
batch2(() => {
|
|
1507
|
+
const mapSig = this._errorMapSignals.get(path);
|
|
1508
|
+
if (!mapSig)
|
|
1509
|
+
return;
|
|
1510
|
+
const current = mapSig.get();
|
|
1511
|
+
if (current[source].length === 0)
|
|
1512
|
+
return;
|
|
1513
|
+
const updated = { ...current, [source]: [] };
|
|
1514
|
+
mapSig.set(updated);
|
|
1515
|
+
this._rebuildFlatErrors(path, updated);
|
|
1516
|
+
});
|
|
1468
1517
|
}
|
|
1469
1518
|
_rebuildFlatErrors(path, errorMap) {
|
|
1470
1519
|
const flat = [];
|
|
@@ -1589,7 +1638,7 @@ class FormStore {
|
|
|
1589
1638
|
const generation = ++this._submitGeneration;
|
|
1590
1639
|
const abortController = new AbortController;
|
|
1591
1640
|
this._submitAbort = abortController;
|
|
1592
|
-
|
|
1641
|
+
batch2(() => {
|
|
1593
1642
|
this.isSubmitting.set(true);
|
|
1594
1643
|
this.submitState.set("submitting");
|
|
1595
1644
|
for (const path of this._fieldOptions.keys()) {
|
|
@@ -1602,7 +1651,7 @@ class FormStore {
|
|
|
1602
1651
|
if (generation !== this._submitGeneration)
|
|
1603
1652
|
return;
|
|
1604
1653
|
if (!validationResult.success) {
|
|
1605
|
-
|
|
1654
|
+
batch2(() => {
|
|
1606
1655
|
if (validationResult.errors) {
|
|
1607
1656
|
for (const [path, errors] of Object.entries(validationResult.errors)) {
|
|
1608
1657
|
this.setErrors(path, errors);
|
|
@@ -1625,7 +1674,7 @@ class FormStore {
|
|
|
1625
1674
|
});
|
|
1626
1675
|
if (generation !== this._submitGeneration)
|
|
1627
1676
|
return;
|
|
1628
|
-
|
|
1677
|
+
batch2(() => {
|
|
1629
1678
|
this.isSubmitting.set(false);
|
|
1630
1679
|
this.submitState.set("success");
|
|
1631
1680
|
this.submitCount.update((c) => c + 1);
|
|
@@ -1635,7 +1684,7 @@ class FormStore {
|
|
|
1635
1684
|
}
|
|
1636
1685
|
} catch (error) {
|
|
1637
1686
|
if (generation === this._submitGeneration && !abortController.signal.aborted) {
|
|
1638
|
-
|
|
1687
|
+
batch2(() => {
|
|
1639
1688
|
this.isSubmitting.set(false);
|
|
1640
1689
|
this.submitState.set("error");
|
|
1641
1690
|
});
|
|
@@ -1648,7 +1697,7 @@ class FormStore {
|
|
|
1648
1697
|
return result.success;
|
|
1649
1698
|
}
|
|
1650
1699
|
resetField(path) {
|
|
1651
|
-
|
|
1700
|
+
batch2(() => {
|
|
1652
1701
|
const baseline = getPath(this._baseline, path);
|
|
1653
1702
|
this.setValue(path, baseline);
|
|
1654
1703
|
this.clearErrors(path);
|
|
@@ -1677,7 +1726,8 @@ class FormStore {
|
|
|
1677
1726
|
this.resetTo(deepClone(this.config.defaultValues));
|
|
1678
1727
|
}
|
|
1679
1728
|
resetTo(values) {
|
|
1680
|
-
|
|
1729
|
+
this._validationEngine.abortAll();
|
|
1730
|
+
batch2(() => {
|
|
1681
1731
|
this._baseline = deepClone(values);
|
|
1682
1732
|
const newPaths = flattenToPaths(values);
|
|
1683
1733
|
const newPathSet = new Set(newPaths.keys());
|
|
@@ -1708,7 +1758,7 @@ class FormStore {
|
|
|
1708
1758
|
});
|
|
1709
1759
|
}
|
|
1710
1760
|
setBaseline(values) {
|
|
1711
|
-
|
|
1761
|
+
batch2(() => {
|
|
1712
1762
|
this._baseline = deepClone(values);
|
|
1713
1763
|
for (const path of this._signals.keys()) {
|
|
1714
1764
|
const current = this.getValue(path);
|
|
@@ -1764,6 +1814,9 @@ class FormStore {
|
|
|
1764
1814
|
getFieldRef(path) {
|
|
1765
1815
|
return this._fieldRefs.get(path) ?? null;
|
|
1766
1816
|
}
|
|
1817
|
+
getFieldRefs() {
|
|
1818
|
+
return this._fieldRefs;
|
|
1819
|
+
}
|
|
1767
1820
|
setFieldRef(path, el) {
|
|
1768
1821
|
this._fieldRefs.set(path, el);
|
|
1769
1822
|
}
|
|
@@ -1782,7 +1835,10 @@ class FormStore {
|
|
|
1782
1835
|
this._watchers.clear();
|
|
1783
1836
|
this._fieldRefs.clear();
|
|
1784
1837
|
this._fieldOptions.clear();
|
|
1838
|
+
this._errorSignals.clear();
|
|
1785
1839
|
this._errorMapSignals.clear();
|
|
1840
|
+
this._touchedSet.clear();
|
|
1841
|
+
this._dirtySet.clear();
|
|
1786
1842
|
if (this._submitAbort) {
|
|
1787
1843
|
this._submitAbort.abort();
|
|
1788
1844
|
this._submitAbort = null;
|
|
@@ -1841,13 +1897,21 @@ class FormStore {
|
|
|
1841
1897
|
const set = this._watchers.get(path);
|
|
1842
1898
|
if (set) {
|
|
1843
1899
|
for (const cb of [...set]) {
|
|
1844
|
-
|
|
1900
|
+
try {
|
|
1901
|
+
cb(value, path);
|
|
1902
|
+
} catch (e) {
|
|
1903
|
+
console.error("FormStore watcher error:", e);
|
|
1904
|
+
}
|
|
1845
1905
|
}
|
|
1846
1906
|
}
|
|
1847
1907
|
}
|
|
1848
1908
|
_notifySubscribers() {
|
|
1849
1909
|
for (const cb of [...this._subscribers]) {
|
|
1850
|
-
|
|
1910
|
+
try {
|
|
1911
|
+
cb();
|
|
1912
|
+
} catch (e) {
|
|
1913
|
+
console.error("FormStore subscriber error:", e);
|
|
1914
|
+
}
|
|
1851
1915
|
}
|
|
1852
1916
|
}
|
|
1853
1917
|
}
|
|
@@ -2112,6 +2176,8 @@ function inferInputType(name, explicitType) {
|
|
|
2112
2176
|
return "tel";
|
|
2113
2177
|
if (lastSegment.includes("url") || lastSegment.includes("website"))
|
|
2114
2178
|
return "url";
|
|
2179
|
+
if (lastSegment.includes("datetime"))
|
|
2180
|
+
return "datetime-local";
|
|
2115
2181
|
if (lastSegment.includes("date"))
|
|
2116
2182
|
return "date";
|
|
2117
2183
|
if (lastSegment.includes("time"))
|
|
@@ -2338,13 +2404,8 @@ function positive(msg = "Must be a positive number") {
|
|
|
2338
2404
|
return Number(value) > 0 ? undefined : msg;
|
|
2339
2405
|
};
|
|
2340
2406
|
}
|
|
2341
|
-
function custom(fn,
|
|
2342
|
-
return (value) =>
|
|
2343
|
-
const result = fn(value);
|
|
2344
|
-
if (result !== undefined)
|
|
2345
|
-
return result;
|
|
2346
|
-
return;
|
|
2347
|
-
};
|
|
2407
|
+
function custom(fn, _msg) {
|
|
2408
|
+
return (value) => fn(value);
|
|
2348
2409
|
}
|
|
2349
2410
|
function async(fn, opts) {
|
|
2350
2411
|
const validator = (value) => fn(value);
|
|
@@ -2463,7 +2524,7 @@ var v = {
|
|
|
2463
2524
|
};
|
|
2464
2525
|
// src/action.ts
|
|
2465
2526
|
import { createElement as createElement3, useCallback as useCallback2, useRef as useRef2, useEffect as useEffect2, useState } from "react";
|
|
2466
|
-
import { batch as
|
|
2527
|
+
import { batch as batch3 } from "@ereo/state";
|
|
2467
2528
|
function createFormAction(opts) {
|
|
2468
2529
|
return async (request) => {
|
|
2469
2530
|
try {
|
|
@@ -2564,7 +2625,7 @@ function ActionForm(props) {
|
|
|
2564
2625
|
return;
|
|
2565
2626
|
}
|
|
2566
2627
|
const values = form.getValues();
|
|
2567
|
-
|
|
2628
|
+
batch3(() => {
|
|
2568
2629
|
form.isSubmitting.set(true);
|
|
2569
2630
|
form.submitState.set("submitting");
|
|
2570
2631
|
});
|
|
@@ -2586,7 +2647,7 @@ function ActionForm(props) {
|
|
|
2586
2647
|
if (generation !== generationRef.current)
|
|
2587
2648
|
return;
|
|
2588
2649
|
if (result.success) {
|
|
2589
|
-
|
|
2650
|
+
batch3(() => {
|
|
2590
2651
|
form.isSubmitting.set(false);
|
|
2591
2652
|
form.submitState.set("success");
|
|
2592
2653
|
form.submitCount.update((c) => c + 1);
|
|
@@ -2594,19 +2655,21 @@ function ActionForm(props) {
|
|
|
2594
2655
|
announceSubmitStatus("success");
|
|
2595
2656
|
onSuccess?.(result.data);
|
|
2596
2657
|
} else {
|
|
2597
|
-
|
|
2658
|
+
batch3(() => {
|
|
2598
2659
|
form.isSubmitting.set(false);
|
|
2599
2660
|
form.submitState.set("error");
|
|
2600
2661
|
});
|
|
2601
2662
|
announceSubmitStatus("error");
|
|
2602
2663
|
if (result.errors) {
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2664
|
+
batch3(() => {
|
|
2665
|
+
for (const [path, errors] of Object.entries(result.errors)) {
|
|
2666
|
+
if (path) {
|
|
2667
|
+
form.setErrorsWithSource(path, errors, "server");
|
|
2668
|
+
} else {
|
|
2669
|
+
form.setFormErrors(errors);
|
|
2670
|
+
}
|
|
2608
2671
|
}
|
|
2609
|
-
}
|
|
2672
|
+
});
|
|
2610
2673
|
focusFirstError(form);
|
|
2611
2674
|
announceErrors(result.errors);
|
|
2612
2675
|
onError?.(result.errors);
|
|
@@ -2615,7 +2678,7 @@ function ActionForm(props) {
|
|
|
2615
2678
|
} catch (error) {
|
|
2616
2679
|
if (generation !== generationRef.current || controller.signal.aborted)
|
|
2617
2680
|
return;
|
|
2618
|
-
|
|
2681
|
+
batch3(() => {
|
|
2619
2682
|
form.isSubmitting.set(false);
|
|
2620
2683
|
form.submitState.set("error");
|
|
2621
2684
|
});
|
|
@@ -2738,7 +2801,7 @@ import {
|
|
|
2738
2801
|
useEffect as useEffect3,
|
|
2739
2802
|
useMemo as useMemo3
|
|
2740
2803
|
} from "react";
|
|
2741
|
-
import { signal as signal3, batch as
|
|
2804
|
+
import { signal as signal3, batch as batch4 } from "@ereo/state";
|
|
2742
2805
|
import { useSignal as useSignal2 } from "@ereo/state";
|
|
2743
2806
|
function createWizard(config) {
|
|
2744
2807
|
const form = new FormStore(config.form);
|
|
@@ -2823,7 +2886,7 @@ function createWizard(config) {
|
|
|
2823
2886
|
return false;
|
|
2824
2887
|
const step = currentStep.get();
|
|
2825
2888
|
const stepConfig = steps[step];
|
|
2826
|
-
|
|
2889
|
+
batch4(() => {
|
|
2827
2890
|
const completed = new Set(completedSteps.get());
|
|
2828
2891
|
if (stepConfig)
|
|
2829
2892
|
completed.add(stepConfig.id);
|
|
@@ -2880,7 +2943,7 @@ function createWizard(config) {
|
|
|
2880
2943
|
clearTimeout(persistTimer);
|
|
2881
2944
|
persistTimer = null;
|
|
2882
2945
|
}
|
|
2883
|
-
|
|
2946
|
+
batch4(() => {
|
|
2884
2947
|
form.reset();
|
|
2885
2948
|
currentStep.set(0);
|
|
2886
2949
|
completedSteps.set(new Set);
|
|
@@ -2900,6 +2963,7 @@ function createWizard(config) {
|
|
|
2900
2963
|
clearTimeout(persistTimer);
|
|
2901
2964
|
persistTimer = null;
|
|
2902
2965
|
}
|
|
2966
|
+
form.dispose();
|
|
2903
2967
|
}
|
|
2904
2968
|
return {
|
|
2905
2969
|
form,
|
package/dist/store.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare class FormStore<T extends Record<string, any> = Record<string, an
|
|
|
82
82
|
toJSON(): T;
|
|
83
83
|
toFormData(): FormData;
|
|
84
84
|
getFieldRef(path: string): HTMLElement | null;
|
|
85
|
+
getFieldRefs(): Map<string, HTMLElement | null>;
|
|
85
86
|
setFieldRef(path: string, el: HTMLElement | null): void;
|
|
86
87
|
getFieldOptions(path: string): FieldOptions<any> | undefined;
|
|
87
88
|
getBaseline(): T;
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,iBAAiB,EAEjB,aAAa,EACb,aAAa,EACb,WAAW,EAEX,WAAW,EACZ,MAAM,SAAS,CAAC;AAMjB,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACxE,YAAW,kBAAkB,CAAC,CAAC,CAAC;IAEhC,QAAQ,C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B;CAS3B;AAID,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3D,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GACpB,SAAS,CAAC,CAAC,CAAC,CAEd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup-dom.d.ts","sourceRoot":"","sources":["../src/test-setup-dom.ts"],"names":[],"mappings":""}
|
|
@@ -29,6 +29,7 @@ export declare class ValidationEngine<T extends Record<string, any>> {
|
|
|
29
29
|
private _triggerDependents;
|
|
30
30
|
getDependents(sourcePath: string): Set<string> | undefined;
|
|
31
31
|
unregisterField(path: string): void;
|
|
32
|
+
abortAll(): void;
|
|
32
33
|
dispose(): void;
|
|
33
34
|
private _createContext;
|
|
34
35
|
private _getDebounceMs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-engine.d.ts","sourceRoot":"","sources":["../src/validation-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"validation-engine.d.ts","sourceRoot":"","sources":["../src/validation-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AASzC,qBAAa,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACzD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,iBAAiB,CAAsC;IAC/D,OAAO,CAAC,iBAAiB,CAAsC;IAC/D,OAAO,CAAC,eAAe,CAAoD;IAC3E,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,kBAAkB,CAAsC;IAChE,OAAO,CAAC,iBAAiB,CAA6B;IACtD,O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validators.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function pattern(regex: RegExp, msg?: string): ValidatorFunction<
|
|
|
12
12
|
export declare function number(msg?: string): ValidatorFunction;
|
|
13
13
|
export declare function integer(msg?: string): ValidatorFunction;
|
|
14
14
|
export declare function positive(msg?: string): ValidatorFunction<number>;
|
|
15
|
-
export declare function custom<T = unknown>(fn: (value: T) => string | undefined,
|
|
15
|
+
export declare function custom<T = unknown>(fn: (value: T) => string | undefined, _msg?: string): ValidatorFunction<T>;
|
|
16
16
|
export declare function async<T = unknown>(fn: (value: T) => Promise<string | undefined>, opts?: {
|
|
17
17
|
debounce?: number;
|
|
18
18
|
message?: string;
|
package/dist/validators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,wBAAgB,QAAQ,CAAC,GAAG,SAA2B,GAAG,iBAAiB,CAQ1E;AAED,wBAAgB,KAAK,CAAC,GAAG,SAA0B,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAM9E;AAED,wBAAgB,GAAG,CAAC,GAAG,SAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAUlE;AAED,wBAAgB,IAAI,CAAC,GAAG,SAAiB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAMpE;AAED,wBAAgB,KAAK,CAAC,GAAG,SAAyB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAS7E;AAID,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAO5E;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAO5E;AAED,wBAAgB,GAAG,CAAC,CAAC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AM,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAOxE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAO3E;AAID,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAS1E;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CASzE;AAID,wBAAgB,OAAO,CAAC,CAAC,GAAG,OAAO,EACjC,GAAG,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAC/B,iBAAiB,CAAC,CAAC,CAAC,CAwBtB;AAED,wBAAgB,IAAI,CAAC,CAAC,GAAG,OAAO,EAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,EAC/C,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GACzB,iBAAiB,CAAC,CAAC,CAAC,CAatB;AAID,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuBb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard-react.test.d.ts","sourceRoot":"","sources":["../src/wizard-react.test.tsx"],"names":[],"mappings":""}
|
package/dist/wizard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAU,MAAM,EAAS,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,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CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,SAAkB,EAClB,SAAkB,EAClB,WAAsB,GACvB,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CAkC7C"}
|
package/package.json
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ereo/forms",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.2.0",
|
|
5
4
|
"author": "Ereo Team",
|
|
6
|
-
"homepage": "https://ereo.dev",
|
|
7
5
|
"repository": {
|
|
8
6
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
7
|
+
"url": "https://github.com/ereoJS/ereoJS.git",
|
|
10
8
|
"directory": "packages/forms"
|
|
11
9
|
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/ereojs/ereo/issues"
|
|
14
|
-
},
|
|
15
|
-
"type": "module",
|
|
16
10
|
"main": "./dist/index.js",
|
|
17
|
-
"
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@ereo/state": "^0.2.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@happy-dom/global-registrator": "20.5.0",
|
|
16
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
17
|
+
"@testing-library/react": "16.3.2",
|
|
18
|
+
"@types/bun": "^1.1.0",
|
|
19
|
+
"@types/react": "^18.2.0",
|
|
20
|
+
"@types/react-dom": "^18.2.0",
|
|
21
|
+
"happy-dom": "20.5.0",
|
|
22
|
+
"typescript": "^5.4.0"
|
|
23
|
+
},
|
|
18
24
|
"exports": {
|
|
19
25
|
".": {
|
|
20
26
|
"types": "./dist/index.d.ts",
|
|
21
27
|
"import": "./dist/index.js"
|
|
22
28
|
}
|
|
23
29
|
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/ereoJS/ereoJS/issues"
|
|
32
|
+
},
|
|
24
33
|
"files": [
|
|
25
34
|
"dist"
|
|
26
35
|
],
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
30
|
-
"dev": "bun build ./src/index.ts --outdir ./dist --target browser --watch",
|
|
31
|
-
"test": "bun test",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@ereo/state": "^0.1.33"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"react": "^18.2.0"
|
|
39
|
-
},
|
|
36
|
+
"homepage": "https://ereojs.github.io/ereoJS",
|
|
37
|
+
"license": "MIT",
|
|
40
38
|
"peerDependenciesMeta": {
|
|
41
39
|
"@ereo/client": {
|
|
42
40
|
"optional": true
|
|
@@ -51,10 +49,13 @@
|
|
|
51
49
|
"optional": true
|
|
52
50
|
}
|
|
53
51
|
},
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target browser --external @ereo/state --external @ereo/client --external @ereo/data --external react --external react-dom && bun run build:types",
|
|
54
|
+
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
55
|
+
"dev": "bun build ./src/index.ts --outdir ./dist --target browser --watch",
|
|
56
|
+
"test": "bun test",
|
|
57
|
+
"typecheck": "tsc --noEmit"
|
|
58
|
+
},
|
|
59
|
+
"type": "module",
|
|
60
|
+
"types": "./dist/index.d.ts"
|
|
60
61
|
}
|