@reformer/core 8.0.0 → 9.0.0-beta.2
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 +52 -57
- package/dist/behaviors-Br4Im38V.js +263 -0
- package/dist/behaviors.js +146 -146
- package/dist/core/factories/node-factory.d.ts +5 -4
- package/dist/core/model/behaviors.d.ts +15 -0
- package/dist/core/model/types.d.ts +41 -12
- package/dist/core/model/validate-model.d.ts +8 -4
- package/dist/core/nodes/field-node.d.ts +2 -2
- package/dist/core/nodes/group-node.d.ts +39 -3
- package/dist/core/nodes/model-array-node.d.ts +13 -1
- package/dist/core/types/deep-schema.d.ts +39 -5
- package/dist/core/types/form-proxy.d.ts +27 -2
- package/dist/core/types/index.d.ts +4 -10
- package/dist/core/types/schema-node.d.ts +79 -0
- package/dist/core/types/validation-schema.d.ts +37 -16
- package/dist/core/utils/create-form.d.ts +4 -3
- package/dist/core/utils/derived-registry.d.ts +29 -0
- package/dist/core/utils/error-handler.d.ts +4 -1
- package/dist/core/utils/form-submitter.d.ts +8 -4
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/core/utils/safe-effect.d.ts +27 -7
- package/dist/core/utils/type-guards.d.ts +3 -3
- package/dist/core/validation/validators/date-utils.d.ts +5 -1
- package/dist/core/validation/validators/integer.d.ts +1 -1
- package/dist/core/validation/validators/is-number.d.ts +1 -1
- package/dist/core/validation/validators/max.d.ts +1 -1
- package/dist/core/validation/validators/min.d.ts +1 -1
- package/dist/core/validation/validators/multiple-of.d.ts +1 -1
- package/dist/core/validation/validators/non-negative.d.ts +1 -1
- package/dist/core/validation/validators/non-zero.d.ts +1 -1
- package/dist/core/validation/validators/required.d.ts +2 -1
- package/dist/{date-utils-xUWFslTj.js → date-utils-dTT_x_Be.js} +12 -10
- package/dist/hooks/types.d.ts +31 -1
- package/dist/hooks/useArrayLength.d.ts +1 -2
- package/dist/hooks/useFormControl.d.ts +2 -2
- package/dist/hooks/useSignalSubscription.d.ts +8 -1
- package/dist/index.js +625 -617
- package/dist/signals.d.ts +13 -0
- package/dist/signals.js +9 -0
- package/dist/validators/future-date.js +1 -1
- package/dist/validators/is-date.js +1 -1
- package/dist/validators/max-age.js +1 -1
- package/dist/validators/max-date.js +1 -1
- package/dist/validators/min-age.js +1 -1
- package/dist/validators/min-date.js +1 -1
- package/dist/validators/multiple-of.js +11 -7
- package/dist/validators/past-date.js +1 -1
- package/dist/validators/pattern.js +7 -6
- package/dist/validators/required.js +5 -9
- package/llms.txt +715 -175
- package/package.json +6 -2
- package/dist/behaviors-O9a1Djj9.js +0 -147
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reformer/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.2",
|
|
4
4
|
"description": "Reactive form state management library for React with signals-based architecture",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./signals": {
|
|
15
|
+
"types": "./dist/signals.d.ts",
|
|
16
|
+
"import": "./dist/signals.js"
|
|
17
|
+
},
|
|
14
18
|
"./behaviors": {
|
|
15
19
|
"types": "./dist/behaviors.d.ts",
|
|
16
20
|
"import": "./dist/behaviors.js"
|
|
@@ -125,11 +129,11 @@
|
|
|
125
129
|
"llms.txt"
|
|
126
130
|
],
|
|
127
131
|
"peerDependencies": {
|
|
128
|
-
"@preact/signals-core": "^1.8.0",
|
|
129
132
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
130
133
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
131
134
|
},
|
|
132
135
|
"dependencies": {
|
|
136
|
+
"@preact/signals-core": "^1.8.0",
|
|
133
137
|
"use-sync-external-store": "^1.2.0"
|
|
134
138
|
},
|
|
135
139
|
"devDependencies": {
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { effect as u } from "@preact/signals-core";
|
|
2
|
-
const o = /* @__PURE__ */ new WeakSet();
|
|
3
|
-
function h(e) {
|
|
4
|
-
o.add(e);
|
|
5
|
-
}
|
|
6
|
-
function p(e) {
|
|
7
|
-
return o.has(e);
|
|
8
|
-
}
|
|
9
|
-
const d = /* @__PURE__ */ new WeakMap();
|
|
10
|
-
function y(e, n) {
|
|
11
|
-
d.set(e, n);
|
|
12
|
-
}
|
|
13
|
-
function v(e) {
|
|
14
|
-
return d.get(e);
|
|
15
|
-
}
|
|
16
|
-
function b(e) {
|
|
17
|
-
return (...n) => {
|
|
18
|
-
queueMicrotask(() => e(...n));
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function s(e) {
|
|
22
|
-
queueMicrotask(e);
|
|
23
|
-
}
|
|
24
|
-
function w(e, n) {
|
|
25
|
-
return () => {
|
|
26
|
-
n(() => {
|
|
27
|
-
queueMicrotask(e);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function W(e, n, r, a) {
|
|
32
|
-
return u(() => {
|
|
33
|
-
const t = e.map((f) => f.value);
|
|
34
|
-
if (a?.when && !a.when(...t)) return;
|
|
35
|
-
const l = r(...t);
|
|
36
|
-
n.peek() !== l && (n.value = l);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function x(e, n, r) {
|
|
40
|
-
return u(() => {
|
|
41
|
-
const a = e.value;
|
|
42
|
-
if (r?.when && !r.when()) return;
|
|
43
|
-
const t = r?.transform ? r.transform(a) : a;
|
|
44
|
-
n.peek() !== t && (n.value = t);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function F(e, n, r) {
|
|
48
|
-
let a = !0;
|
|
49
|
-
return u(() => {
|
|
50
|
-
const t = e.value;
|
|
51
|
-
a && (a = !1, !r?.immediate) || n(t);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function k(e, n, r) {
|
|
55
|
-
return u(() => {
|
|
56
|
-
const a = n(), t = v(e);
|
|
57
|
-
t && s(() => {
|
|
58
|
-
a ? t.enable() : (t.disable(), r?.resetOnDisable && t.reset());
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function g(e, n, r) {
|
|
63
|
-
return k(e, () => !n(), r);
|
|
64
|
-
}
|
|
65
|
-
function D(e, n) {
|
|
66
|
-
let r = !1;
|
|
67
|
-
return u(() => {
|
|
68
|
-
const a = e.value;
|
|
69
|
-
r || s(() => {
|
|
70
|
-
const t = n(a);
|
|
71
|
-
if (e.peek() !== t) {
|
|
72
|
-
r = !0;
|
|
73
|
-
try {
|
|
74
|
-
e.value = t;
|
|
75
|
-
} finally {
|
|
76
|
-
r = !1;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function M(e, n, r) {
|
|
83
|
-
const a = r?.resetValue ?? null;
|
|
84
|
-
return u(() => {
|
|
85
|
-
const t = n();
|
|
86
|
-
s(() => {
|
|
87
|
-
t && e.peek() !== a && (e.value = a);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function q(e, n, r) {
|
|
92
|
-
const a = r?.transform;
|
|
93
|
-
let t = !1;
|
|
94
|
-
const l = u(() => {
|
|
95
|
-
const i = e.value;
|
|
96
|
-
t || s(() => {
|
|
97
|
-
t = !0;
|
|
98
|
-
try {
|
|
99
|
-
const c = a ? a(i) : i;
|
|
100
|
-
n.peek() !== c && (n.value = c);
|
|
101
|
-
} finally {
|
|
102
|
-
t = !1;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}), f = u(() => {
|
|
106
|
-
const i = n.value;
|
|
107
|
-
t || s(() => {
|
|
108
|
-
t = !0;
|
|
109
|
-
try {
|
|
110
|
-
e.peek() !== i && (e.value = i);
|
|
111
|
-
} finally {
|
|
112
|
-
t = !1;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
return () => {
|
|
117
|
-
l(), f();
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function S(e, n) {
|
|
121
|
-
let r = !0;
|
|
122
|
-
return u(() => {
|
|
123
|
-
if (e.forEach((a) => a.value), r) {
|
|
124
|
-
r = !1;
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
s(() => n());
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
export {
|
|
131
|
-
M as a,
|
|
132
|
-
S as b,
|
|
133
|
-
x as c,
|
|
134
|
-
y as d,
|
|
135
|
-
k as e,
|
|
136
|
-
b as f,
|
|
137
|
-
v as g,
|
|
138
|
-
w as h,
|
|
139
|
-
p as i,
|
|
140
|
-
W as j,
|
|
141
|
-
g as k,
|
|
142
|
-
h as m,
|
|
143
|
-
s as r,
|
|
144
|
-
q as s,
|
|
145
|
-
D as t,
|
|
146
|
-
F as w
|
|
147
|
-
};
|