cogsbox-state 0.5.465 → 0.5.466
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 +3 -3
- package/dist/CogsState.d.ts +1 -0
- package/dist/CogsState.d.ts.map +1 -1
- package/dist/CogsState.jsx +1011 -1270
- package/dist/CogsState.jsx.map +1 -1
- package/dist/Components.d.ts +39 -0
- package/dist/Components.d.ts.map +1 -0
- package/dist/Components.jsx +281 -0
- package/dist/Components.jsx.map +1 -0
- package/dist/index.js +11 -12
- package/dist/store.d.ts +2 -5
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +261 -219
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +151 -707
- package/src/Components.tsx +541 -0
- package/src/store.ts +178 -141
- package/dist/Functions.d.ts +0 -11
- package/dist/Functions.d.ts.map +0 -1
- package/dist/Functions.jsx +0 -29
- package/dist/Functions.jsx.map +0 -1
- package/src/Functions.tsx +0 -66
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FormElementParams, FormOptsType } from './CogsState';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
4
|
+
export type ValidationWrapperProps = {
|
|
5
|
+
formOpts?: FormOptsType;
|
|
6
|
+
path: string[];
|
|
7
|
+
stateKey: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function ValidationWrapper({ formOpts, path, stateKey, children, }: ValidationWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const MemoizedCogsItemWrapper: React.MemoExoticComponent<typeof ListItemWrapper>;
|
|
12
|
+
export declare function ListItemWrapper({ stateKey, itemComponentId, itemPath, localIndex, arraySetter, rebuildStateShape, renderFn, }: {
|
|
13
|
+
stateKey: string;
|
|
14
|
+
itemComponentId: string;
|
|
15
|
+
itemPath: string[];
|
|
16
|
+
localIndex: number;
|
|
17
|
+
arraySetter: any;
|
|
18
|
+
rebuildStateShape: (options: {
|
|
19
|
+
currentState: any;
|
|
20
|
+
path: string[];
|
|
21
|
+
componentId: string;
|
|
22
|
+
meta?: any;
|
|
23
|
+
}) => any;
|
|
24
|
+
renderFn: (setter: any, index: number, arraySetter: any) => React.ReactNode;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function FormElementWrapper({ stateKey, path, rebuildStateShape, renderFn, formOpts, setState, }: {
|
|
27
|
+
stateKey: string;
|
|
28
|
+
path: string[];
|
|
29
|
+
rebuildStateShape: (options: {
|
|
30
|
+
path: string[];
|
|
31
|
+
componentId: string;
|
|
32
|
+
meta?: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
renderFn: (params: FormElementParams<any>) => React.ReactNode;
|
|
35
|
+
formOpts?: FormOptsType;
|
|
36
|
+
setState: any;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function useRegisterComponent(stateKey: string, componentId: string, forceUpdate: (o: object) => void): void;
|
|
39
|
+
//# sourceMappingURL=Components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Components.d.ts","sourceRoot":"","sources":["../src/Components.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,KAQN,MAAM,OAAO,CAAC;AAkBf,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,sBAAsB,2CAgDxB;AACD,eAAO,MAAM,uBAAuB,mDAWnC,CAAC;AACF,wBAAgB,eAAe,CAAC,EAC9B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
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { jsx as O, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import x, { memo as k, useState as A, useRef as C, useCallback as J, useEffect as j, useLayoutEffect as U } from "react";
|
|
3
|
+
import { getGlobalStore as p, formRefStore as _ } from "./store.js";
|
|
4
|
+
import { useInView as Q } from "react-intersection-observer";
|
|
5
|
+
import { v4 as X } from "uuid";
|
|
6
|
+
import { isDeepEqual as Y } from "./utility.js";
|
|
7
|
+
const {
|
|
8
|
+
getInitialOptions: Z,
|
|
9
|
+
getShadowMetadata: H,
|
|
10
|
+
setShadowMetadata: h,
|
|
11
|
+
getShadowValue: R,
|
|
12
|
+
registerComponent: K,
|
|
13
|
+
unregisterComponent: ee,
|
|
14
|
+
notifyPathSubscribers: te,
|
|
15
|
+
subscribeToPath: re
|
|
16
|
+
} = p.getState();
|
|
17
|
+
function ne({
|
|
18
|
+
formOpts: e,
|
|
19
|
+
path: t,
|
|
20
|
+
stateKey: n,
|
|
21
|
+
children: o
|
|
22
|
+
}) {
|
|
23
|
+
const { getInitialOptions: f, getShadowMetadata: s, getShadowValue: l } = p.getState(), g = f(n), d = s(n, t)?.validation, a = d?.status || "NOT_VALIDATED", S = (d?.errors || []).map((c) => ({
|
|
24
|
+
...c,
|
|
25
|
+
path: t
|
|
26
|
+
})), u = S.filter((c) => c.severity === "error").map((c) => c.message), i = S.filter((c) => c.severity === "warning").map((c) => c.message), E = u[0] || i[0];
|
|
27
|
+
return /* @__PURE__ */ O($, { children: g?.formElements?.validation && !e?.validation?.disable ? g.formElements.validation({
|
|
28
|
+
children: /* @__PURE__ */ O(x.Fragment, { children: o }, t.toString()),
|
|
29
|
+
status: a,
|
|
30
|
+
// Now passes the new ValidationStatus type
|
|
31
|
+
message: e?.validation?.hideMessage ? "" : e?.validation?.message || E || "",
|
|
32
|
+
hasErrors: u.length > 0,
|
|
33
|
+
hasWarnings: i.length > 0,
|
|
34
|
+
allErrors: S,
|
|
35
|
+
path: t,
|
|
36
|
+
getData: () => l(n, t)
|
|
37
|
+
}) : /* @__PURE__ */ O(x.Fragment, { children: o }, t.toString()) });
|
|
38
|
+
}
|
|
39
|
+
const ge = k(
|
|
40
|
+
oe,
|
|
41
|
+
(e, t) => e.itemPath.join(".") === t.itemPath.join(".") && e.stateKey === t.stateKey && e.itemComponentId === t.itemComponentId && e.localIndex === t.localIndex
|
|
42
|
+
);
|
|
43
|
+
function oe({
|
|
44
|
+
stateKey: e,
|
|
45
|
+
itemComponentId: t,
|
|
46
|
+
itemPath: n,
|
|
47
|
+
localIndex: o,
|
|
48
|
+
arraySetter: f,
|
|
49
|
+
rebuildStateShape: s,
|
|
50
|
+
renderFn: l
|
|
51
|
+
}) {
|
|
52
|
+
const [, g] = A({}), { ref: M, inView: d } = Q(), a = C(null), S = ae(a), u = C(!1), i = [e, ...n].join(".");
|
|
53
|
+
B(e, t, g);
|
|
54
|
+
const E = J(
|
|
55
|
+
(r) => {
|
|
56
|
+
a.current = r, M(r);
|
|
57
|
+
},
|
|
58
|
+
[M]
|
|
59
|
+
);
|
|
60
|
+
j(() => {
|
|
61
|
+
const r = re(i, (m) => {
|
|
62
|
+
g({});
|
|
63
|
+
});
|
|
64
|
+
return () => r();
|
|
65
|
+
}, [i]), j(() => {
|
|
66
|
+
if (!d || !S || u.current)
|
|
67
|
+
return;
|
|
68
|
+
const r = a.current;
|
|
69
|
+
if (r && r.offsetHeight > 0) {
|
|
70
|
+
u.current = !0;
|
|
71
|
+
const m = r.offsetHeight;
|
|
72
|
+
h(e, n, {
|
|
73
|
+
virtualizer: {
|
|
74
|
+
itemHeight: m,
|
|
75
|
+
domRef: r
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
const v = n.slice(0, -1), T = [e, ...v].join(".");
|
|
79
|
+
te(T, {
|
|
80
|
+
type: "ITEMHEIGHT",
|
|
81
|
+
itemKey: n.join("."),
|
|
82
|
+
ref: a.current
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, [d, S, e, n]);
|
|
86
|
+
const c = R(e, n);
|
|
87
|
+
if (c === void 0)
|
|
88
|
+
return null;
|
|
89
|
+
const z = s({
|
|
90
|
+
currentState: c,
|
|
91
|
+
path: n,
|
|
92
|
+
componentId: t
|
|
93
|
+
}), y = l(z, o, f);
|
|
94
|
+
return /* @__PURE__ */ O("div", { ref: E, children: y });
|
|
95
|
+
}
|
|
96
|
+
function me({
|
|
97
|
+
stateKey: e,
|
|
98
|
+
path: t,
|
|
99
|
+
rebuildStateShape: n,
|
|
100
|
+
renderFn: o,
|
|
101
|
+
formOpts: f,
|
|
102
|
+
setState: s
|
|
103
|
+
}) {
|
|
104
|
+
const [l] = A(() => X()), [, g] = A({}), M = [e, ...t].join(".");
|
|
105
|
+
B(e, l, g);
|
|
106
|
+
const d = R(e, t), [a, S] = A(d), u = C(!1), i = C(null);
|
|
107
|
+
j(() => {
|
|
108
|
+
!u.current && !Y(d, a) && S(d);
|
|
109
|
+
}, [d]), j(() => {
|
|
110
|
+
const r = p.getState().subscribeToPath(M, (m) => {
|
|
111
|
+
!u.current && a !== m && g({});
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
r(), i.current && (clearTimeout(i.current), u.current = !1);
|
|
115
|
+
};
|
|
116
|
+
}, []);
|
|
117
|
+
const E = J(
|
|
118
|
+
(r) => {
|
|
119
|
+
typeof d === "number" && typeof r == "string" && (r = r === "" ? 0 : Number(r)), S(r), u.current = !0, i.current && clearTimeout(i.current);
|
|
120
|
+
const v = f?.debounceTime ?? 200;
|
|
121
|
+
i.current = setTimeout(() => {
|
|
122
|
+
if (u.current = !1, s(r, t, { updateType: "update" }), !p.getState().getShadowMetadata(e, [])?.features?.validationEnabled) return;
|
|
123
|
+
const I = Z(e)?.validation, N = I?.zodSchemaV4 || I?.zodSchemaV3;
|
|
124
|
+
if (N) {
|
|
125
|
+
const V = R(e, []), w = N.safeParse(V), L = H(e, t) || {};
|
|
126
|
+
if (w.success)
|
|
127
|
+
h(e, t, {
|
|
128
|
+
...L,
|
|
129
|
+
validation: {
|
|
130
|
+
status: "VALID",
|
|
131
|
+
errors: [],
|
|
132
|
+
lastValidated: Date.now(),
|
|
133
|
+
validatedValue: r
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
else {
|
|
137
|
+
const W = ("issues" in w.error ? w.error.issues : w.error.errors).filter(
|
|
138
|
+
(b) => JSON.stringify(b.path) === JSON.stringify(t)
|
|
139
|
+
);
|
|
140
|
+
W.length > 0 ? h(e, t, {
|
|
141
|
+
...L,
|
|
142
|
+
validation: {
|
|
143
|
+
status: "INVALID",
|
|
144
|
+
errors: [
|
|
145
|
+
{
|
|
146
|
+
source: "client",
|
|
147
|
+
message: W[0]?.message,
|
|
148
|
+
severity: "warning"
|
|
149
|
+
// Gentle error during typing
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
lastValidated: Date.now(),
|
|
153
|
+
validatedValue: r
|
|
154
|
+
}
|
|
155
|
+
}) : h(e, t, {
|
|
156
|
+
...L,
|
|
157
|
+
validation: {
|
|
158
|
+
status: "VALID",
|
|
159
|
+
errors: [],
|
|
160
|
+
lastValidated: Date.now(),
|
|
161
|
+
validatedValue: r
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}, v), g({});
|
|
167
|
+
},
|
|
168
|
+
[s, t, f?.debounceTime, e]
|
|
169
|
+
), c = J(async () => {
|
|
170
|
+
if (console.log("handleBlur triggered"), i.current && (clearTimeout(i.current), i.current = null, u.current = !1, s(a, t, { updateType: "update" })), !H(e, [])?.features?.validationEnabled) return;
|
|
171
|
+
const { getInitialOptions: m } = p.getState(), v = m(e)?.validation, T = v?.zodSchemaV4 || v?.zodSchemaV3;
|
|
172
|
+
if (!T) return;
|
|
173
|
+
const I = H(e, t);
|
|
174
|
+
h(e, t, {
|
|
175
|
+
...I,
|
|
176
|
+
validation: {
|
|
177
|
+
status: "VALIDATING",
|
|
178
|
+
errors: [],
|
|
179
|
+
lastValidated: Date.now(),
|
|
180
|
+
validatedValue: a
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const N = R(e, []), V = T.safeParse(N);
|
|
184
|
+
if (V.success)
|
|
185
|
+
h(e, t, {
|
|
186
|
+
...I,
|
|
187
|
+
validation: {
|
|
188
|
+
status: "VALID",
|
|
189
|
+
errors: [],
|
|
190
|
+
lastValidated: Date.now(),
|
|
191
|
+
validatedValue: a
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
else {
|
|
195
|
+
const L = ("issues" in V.error ? V.error.issues : V.error.errors).filter((D) => {
|
|
196
|
+
if (t.some((b) => b.startsWith("id:"))) {
|
|
197
|
+
const b = t[0].startsWith("id:") ? [] : t.slice(0, -1), F = p.getState().getShadowMetadata(e, b);
|
|
198
|
+
if (F?.arrayKeys) {
|
|
199
|
+
const G = [e, ...t.slice(0, -1)].join("."), P = F.arrayKeys.indexOf(G), q = [...b, P, ...t.slice(-1)];
|
|
200
|
+
return JSON.stringify(D.path) === JSON.stringify(q);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return JSON.stringify(D.path) === JSON.stringify(t);
|
|
204
|
+
});
|
|
205
|
+
h(e, t, {
|
|
206
|
+
...I,
|
|
207
|
+
validation: {
|
|
208
|
+
status: "INVALID",
|
|
209
|
+
errors: L.map((D) => ({
|
|
210
|
+
source: "client",
|
|
211
|
+
message: D.message,
|
|
212
|
+
severity: "error"
|
|
213
|
+
// Hard error on blur
|
|
214
|
+
})),
|
|
215
|
+
lastValidated: Date.now(),
|
|
216
|
+
validatedValue: a
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
g({});
|
|
221
|
+
}, [e, t, a, s]), z = n({
|
|
222
|
+
path: t,
|
|
223
|
+
componentId: l
|
|
224
|
+
}), y = new Proxy(z, {
|
|
225
|
+
get(r, m) {
|
|
226
|
+
return m === "inputProps" ? {
|
|
227
|
+
value: a ?? "",
|
|
228
|
+
onChange: (v) => {
|
|
229
|
+
E(v.target.value);
|
|
230
|
+
},
|
|
231
|
+
// 5. Wire the new onBlur handler to the input props.
|
|
232
|
+
onBlur: c,
|
|
233
|
+
ref: _.getState().getFormRef(e + "." + t.join("."))
|
|
234
|
+
} : r[m];
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
return /* @__PURE__ */ O(ne, { formOpts: f, path: t, stateKey: e, children: o(y) });
|
|
238
|
+
}
|
|
239
|
+
function B(e, t, n) {
|
|
240
|
+
const o = `${e}////${t}`;
|
|
241
|
+
U(() => (K(e, o, {
|
|
242
|
+
forceUpdate: () => n({}),
|
|
243
|
+
paths: /* @__PURE__ */ new Set(),
|
|
244
|
+
reactiveType: ["component"]
|
|
245
|
+
}), () => {
|
|
246
|
+
ee(e, o);
|
|
247
|
+
}), [e, o]);
|
|
248
|
+
}
|
|
249
|
+
const ae = (e) => {
|
|
250
|
+
const [t, n] = A(!1);
|
|
251
|
+
return U(() => {
|
|
252
|
+
if (!e.current) {
|
|
253
|
+
n(!0);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const o = Array.from(e.current.querySelectorAll("img"));
|
|
257
|
+
if (o.length === 0) {
|
|
258
|
+
n(!0);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
let f = 0;
|
|
262
|
+
const s = () => {
|
|
263
|
+
f++, f === o.length && n(!0);
|
|
264
|
+
};
|
|
265
|
+
return o.forEach((l) => {
|
|
266
|
+
l.complete ? s() : (l.addEventListener("load", s), l.addEventListener("error", s));
|
|
267
|
+
}), () => {
|
|
268
|
+
o.forEach((l) => {
|
|
269
|
+
l.removeEventListener("load", s), l.removeEventListener("error", s);
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
}, [e.current]), t;
|
|
273
|
+
};
|
|
274
|
+
export {
|
|
275
|
+
me as FormElementWrapper,
|
|
276
|
+
oe as ListItemWrapper,
|
|
277
|
+
ge as MemoizedCogsItemWrapper,
|
|
278
|
+
ne as ValidationWrapper,
|
|
279
|
+
B as useRegisterComponent
|
|
280
|
+
};
|
|
281
|
+
//# sourceMappingURL=Components.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Components.jsx","sources":["../src/Components.tsx"],"sourcesContent":["import { FormElementParams, type FormOptsType } from './CogsState';\r\nimport React, {\r\n memo,\r\n RefObject,\r\n useCallback,\r\n useEffect,\r\n useLayoutEffect,\r\n useRef,\r\n useState,\r\n} from 'react';\r\nimport { formRefStore, getGlobalStore, ValidationError } from './store';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { isDeepEqual } from './utility';\r\nconst {\r\n getInitialOptions,\r\n\r\n getShadowMetadata,\r\n setShadowMetadata,\r\n getShadowValue,\r\n\r\n registerComponent,\r\n unregisterComponent,\r\n\r\n notifyPathSubscribers,\r\n subscribeToPath,\r\n} = getGlobalStore.getState();\r\nexport type ValidationWrapperProps = {\r\n formOpts?: FormOptsType;\r\n path: string[];\r\n stateKey: string;\r\n children: React.ReactNode;\r\n};\r\n\r\nexport function ValidationWrapper({\r\n formOpts,\r\n path,\r\n stateKey,\r\n children,\r\n}: ValidationWrapperProps) {\r\n const { getInitialOptions, getShadowMetadata, getShadowValue } =\r\n getGlobalStore.getState();\r\n const thisStateOpts = getInitialOptions(stateKey!);\r\n\r\n const shadowMeta = getShadowMetadata(stateKey!, path);\r\n const validationState = shadowMeta?.validation;\r\n\r\n const status = validationState?.status || 'NOT_VALIDATED';\r\n\r\n const errors = (validationState?.errors || []).map((err) => ({\r\n ...err,\r\n path: path,\r\n })) as ValidationError[];\r\n const errorMessages = errors\r\n .filter((err) => err.severity === 'error')\r\n .map((err) => err.message);\r\n const warningMessages = errors\r\n .filter((err) => err.severity === 'warning')\r\n .map((err) => err.message);\r\n\r\n // Use first error, or first warning if no errors\r\n const message = errorMessages[0] || warningMessages[0];\r\n\r\n return (\r\n <>\r\n {thisStateOpts?.formElements?.validation &&\r\n !formOpts?.validation?.disable ? (\r\n thisStateOpts.formElements!.validation!({\r\n children: (\r\n <React.Fragment key={path.toString()}>{children}</React.Fragment>\r\n ),\r\n status, // Now passes the new ValidationStatus type\r\n message: formOpts?.validation?.hideMessage\r\n ? ''\r\n : formOpts?.validation?.message || message || '',\r\n\r\n hasErrors: errorMessages.length > 0,\r\n hasWarnings: warningMessages.length > 0,\r\n allErrors: errors,\r\n path: path,\r\n getData: () => getShadowValue(stateKey!, path),\r\n })\r\n ) : (\r\n <React.Fragment key={path.toString()}>{children}</React.Fragment>\r\n )}\r\n </>\r\n );\r\n}\r\nexport const MemoizedCogsItemWrapper = memo(\r\n ListItemWrapper,\r\n (prevProps, nextProps) => {\r\n // Re-render if any of these change:\r\n return (\r\n prevProps.itemPath.join('.') === nextProps.itemPath.join('.') &&\r\n prevProps.stateKey === nextProps.stateKey &&\r\n prevProps.itemComponentId === nextProps.itemComponentId &&\r\n prevProps.localIndex === nextProps.localIndex\r\n );\r\n }\r\n);\r\nexport function ListItemWrapper({\r\n stateKey,\r\n itemComponentId,\r\n itemPath,\r\n localIndex,\r\n arraySetter,\r\n rebuildStateShape,\r\n renderFn,\r\n}: {\r\n stateKey: string;\r\n itemComponentId: string;\r\n itemPath: string[];\r\n localIndex: number;\r\n arraySetter: any;\r\n\r\n rebuildStateShape: (options: {\r\n currentState: any;\r\n path: string[];\r\n componentId: string;\r\n meta?: any;\r\n }) => any;\r\n renderFn: (\r\n setter: any,\r\n index: number,\r\n\r\n arraySetter: any\r\n ) => React.ReactNode;\r\n}) {\r\n const [, forceUpdate] = useState({});\r\n const { ref: inViewRef, inView } = useInView();\r\n const elementRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const imagesLoaded = useImageLoaded(elementRef);\r\n const hasReportedInitialHeight = useRef(false);\r\n const fullKey = [stateKey, ...itemPath].join('.');\r\n useRegisterComponent(stateKey, itemComponentId, forceUpdate);\r\n\r\n const setRefs = useCallback(\r\n (element: HTMLDivElement | null) => {\r\n elementRef.current = element;\r\n inViewRef(element); // This is the ref from useInView\r\n },\r\n [inViewRef]\r\n );\r\n\r\n useEffect(() => {\r\n const unsubscribe = subscribeToPath(fullKey, (e) => {\r\n forceUpdate({});\r\n });\r\n return () => unsubscribe();\r\n }, [fullKey]);\r\n useEffect(() => {\r\n if (!inView || !imagesLoaded || hasReportedInitialHeight.current) {\r\n return;\r\n }\r\n\r\n const element = elementRef.current;\r\n if (element && element.offsetHeight > 0) {\r\n hasReportedInitialHeight.current = true;\r\n const newHeight = element.offsetHeight;\r\n\r\n setShadowMetadata(stateKey, itemPath, {\r\n virtualizer: {\r\n itemHeight: newHeight,\r\n domRef: element,\r\n },\r\n });\r\n\r\n const arrayPath = itemPath.slice(0, -1);\r\n const arrayPathKey = [stateKey, ...arrayPath].join('.');\r\n notifyPathSubscribers(arrayPathKey, {\r\n type: 'ITEMHEIGHT',\r\n itemKey: itemPath.join('.'),\r\n\r\n ref: elementRef.current,\r\n });\r\n }\r\n }, [inView, imagesLoaded, stateKey, itemPath]);\r\n\r\n const itemValue = getShadowValue(stateKey, itemPath);\r\n\r\n if (itemValue === undefined) {\r\n return null;\r\n }\r\n\r\n const itemSetter = rebuildStateShape({\r\n currentState: itemValue,\r\n path: itemPath,\r\n componentId: itemComponentId,\r\n });\r\n const children = renderFn(itemSetter, localIndex, arraySetter);\r\n\r\n return <div ref={setRefs}>{children}</div>;\r\n}\r\n\r\nexport function FormElementWrapper({\r\n stateKey,\r\n path,\r\n rebuildStateShape,\r\n renderFn,\r\n formOpts,\r\n setState,\r\n}: {\r\n stateKey: string;\r\n path: string[];\r\n rebuildStateShape: (options: {\r\n path: string[];\r\n componentId: string;\r\n meta?: any;\r\n }) => any;\r\n renderFn: (params: FormElementParams<any>) => React.ReactNode;\r\n formOpts?: FormOptsType;\r\n setState: any;\r\n}) {\r\n const [componentId] = useState(() => uuidv4());\r\n const [, forceUpdate] = useState({});\r\n\r\n const stateKeyPathKey = [stateKey, ...path].join('.');\r\n useRegisterComponent(stateKey, componentId, forceUpdate);\r\n const globalStateValue = getShadowValue(stateKey, path);\r\n const [localValue, setLocalValue] = useState<any>(globalStateValue);\r\n const isCurrentlyDebouncing = useRef(false);\r\n const debounceTimeoutRef = useRef<NodeJS.Timeout | null>(null);\r\n\r\n useEffect(() => {\r\n if (\r\n !isCurrentlyDebouncing.current &&\r\n !isDeepEqual(globalStateValue, localValue)\r\n ) {\r\n setLocalValue(globalStateValue);\r\n }\r\n }, [globalStateValue]);\r\n\r\n useEffect(() => {\r\n const unsubscribe = getGlobalStore\r\n .getState()\r\n .subscribeToPath(stateKeyPathKey, (newValue) => {\r\n if (!isCurrentlyDebouncing.current && localValue !== newValue) {\r\n forceUpdate({});\r\n }\r\n });\r\n return () => {\r\n unsubscribe();\r\n if (debounceTimeoutRef.current) {\r\n clearTimeout(debounceTimeoutRef.current);\r\n isCurrentlyDebouncing.current = false;\r\n }\r\n };\r\n }, []);\r\n\r\n const debouncedUpdate = useCallback(\r\n (newValue: any) => {\r\n const currentType = typeof globalStateValue;\r\n if (currentType === 'number' && typeof newValue === 'string') {\r\n newValue = newValue === '' ? 0 : Number(newValue);\r\n }\r\n setLocalValue(newValue);\r\n isCurrentlyDebouncing.current = true;\r\n\r\n if (debounceTimeoutRef.current) {\r\n clearTimeout(debounceTimeoutRef.current);\r\n }\r\n\r\n const debounceTime = formOpts?.debounceTime ?? 200;\r\n\r\n debounceTimeoutRef.current = setTimeout(() => {\r\n isCurrentlyDebouncing.current = false;\r\n setState(newValue, path, { updateType: 'update' });\r\n\r\n // NEW: Check if validation is enabled via features\r\n const rootMeta = getGlobalStore\r\n .getState()\r\n .getShadowMetadata(stateKey, []);\r\n if (!rootMeta?.features?.validationEnabled) return;\r\n\r\n const validationOptions = getInitialOptions(stateKey)?.validation;\r\n const zodSchema =\r\n validationOptions?.zodSchemaV4 || validationOptions?.zodSchemaV3;\r\n\r\n if (zodSchema) {\r\n const fullState = getShadowValue(stateKey, []);\r\n const result = zodSchema.safeParse(fullState);\r\n const currentMeta = getShadowMetadata(stateKey, path) || {};\r\n\r\n if (!result.success) {\r\n const errors =\r\n 'issues' in result.error\r\n ? result.error.issues\r\n : (result.error as any).errors;\r\n\r\n const pathErrors = errors.filter(\r\n (error: any) =>\r\n JSON.stringify(error.path) === JSON.stringify(path)\r\n );\r\n\r\n if (pathErrors.length > 0) {\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'INVALID',\r\n errors: [\r\n {\r\n source: 'client',\r\n message: pathErrors[0]?.message,\r\n severity: 'warning', // Gentle error during typing\r\n },\r\n ],\r\n lastValidated: Date.now(),\r\n validatedValue: newValue,\r\n },\r\n });\r\n } else {\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'VALID',\r\n errors: [],\r\n lastValidated: Date.now(),\r\n validatedValue: newValue,\r\n },\r\n });\r\n }\r\n } else {\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'VALID',\r\n errors: [],\r\n lastValidated: Date.now(),\r\n validatedValue: newValue,\r\n },\r\n });\r\n }\r\n }\r\n }, debounceTime);\r\n forceUpdate({});\r\n },\r\n [setState, path, formOpts?.debounceTime, stateKey]\r\n );\r\n\r\n const handleBlur = useCallback(async () => {\r\n console.log('handleBlur triggered');\r\n\r\n // Commit any pending changes\r\n if (debounceTimeoutRef.current) {\r\n clearTimeout(debounceTimeoutRef.current);\r\n debounceTimeoutRef.current = null;\r\n isCurrentlyDebouncing.current = false;\r\n setState(localValue, path, { updateType: 'update' });\r\n }\r\n const rootMeta = getShadowMetadata(stateKey, []);\r\n if (!rootMeta?.features?.validationEnabled) return;\r\n const { getInitialOptions } = getGlobalStore.getState();\r\n const validationOptions = getInitialOptions(stateKey)?.validation;\r\n const zodSchema =\r\n validationOptions?.zodSchemaV4 || validationOptions?.zodSchemaV3;\r\n\r\n if (!zodSchema) return;\r\n\r\n // Get the full path including stateKey\r\n\r\n // Update validation state to \"validating\"\r\n const currentMeta = getShadowMetadata(stateKey, path);\r\n\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'VALIDATING',\r\n errors: [],\r\n lastValidated: Date.now(),\r\n validatedValue: localValue,\r\n },\r\n });\r\n\r\n // Validate full state\r\n const fullState = getShadowValue(stateKey, []);\r\n const result = zodSchema.safeParse(fullState);\r\n\r\n if (!result.success) {\r\n const errors =\r\n 'issues' in result.error\r\n ? result.error.issues\r\n : (result.error as any).errors;\r\n\r\n // Find errors for this specific path\r\n const pathErrors = errors.filter((error: any) => {\r\n // For array paths, we need to translate indices to ULIDs\r\n if (path.some((p) => p.startsWith('id:'))) {\r\n // This is an array item path like [\"id:xyz\", \"name\"]\r\n const parentPath = path[0]!.startsWith('id:')\r\n ? []\r\n : path.slice(0, -1);\r\n\r\n const arrayMeta = getGlobalStore\r\n .getState()\r\n .getShadowMetadata(stateKey, parentPath);\r\n\r\n if (arrayMeta?.arrayKeys) {\r\n const itemKey = [stateKey, ...path.slice(0, -1)].join('.');\r\n const itemIndex = arrayMeta.arrayKeys.indexOf(itemKey);\r\n\r\n // Compare with Zod path\r\n const zodPath = [...parentPath, itemIndex, ...path.slice(-1)];\r\n const match =\r\n JSON.stringify(error.path) === JSON.stringify(zodPath);\r\n\r\n return match;\r\n }\r\n }\r\n\r\n const directMatch = JSON.stringify(error.path) === JSON.stringify(path);\r\n\r\n return directMatch;\r\n });\r\n\r\n // Update shadow metadata with validation result\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'INVALID',\r\n errors: pathErrors.map((err: any) => ({\r\n source: 'client' as const,\r\n message: err.message,\r\n severity: 'error' as const, // Hard error on blur\r\n })),\r\n lastValidated: Date.now(),\r\n validatedValue: localValue,\r\n },\r\n });\r\n } else {\r\n // Validation passed\r\n setShadowMetadata(stateKey, path, {\r\n ...currentMeta,\r\n validation: {\r\n status: 'VALID',\r\n errors: [],\r\n lastValidated: Date.now(),\r\n validatedValue: localValue,\r\n },\r\n });\r\n }\r\n forceUpdate({});\r\n }, [stateKey, path, localValue, setState]);\r\n\r\n const baseState = rebuildStateShape({\r\n path: path,\r\n componentId: componentId,\r\n });\r\n\r\n const stateWithInputProps = new Proxy(baseState, {\r\n get(target, prop) {\r\n if (prop === 'inputProps') {\r\n return {\r\n value: localValue ?? '',\r\n onChange: (e: any) => {\r\n debouncedUpdate(e.target.value);\r\n },\r\n // 5. Wire the new onBlur handler to the input props.\r\n onBlur: handleBlur,\r\n ref: formRefStore\r\n .getState()\r\n .getFormRef(stateKey + '.' + path.join('.')),\r\n };\r\n }\r\n\r\n return target[prop];\r\n },\r\n });\r\n\r\n return (\r\n <ValidationWrapper formOpts={formOpts} path={path} stateKey={stateKey}>\r\n {renderFn(stateWithInputProps)}\r\n </ValidationWrapper>\r\n );\r\n}\r\nexport function useRegisterComponent(\r\n stateKey: string,\r\n componentId: string,\r\n forceUpdate: (o: object) => void\r\n) {\r\n const fullComponentId = `${stateKey}////${componentId}`;\r\n\r\n useLayoutEffect(() => {\r\n // Call the safe, centralized function to register\r\n registerComponent(stateKey, fullComponentId, {\r\n forceUpdate: () => forceUpdate({}),\r\n paths: new Set(),\r\n reactiveType: ['component'],\r\n });\r\n\r\n // The cleanup now calls the safe, centralized unregister function\r\n return () => {\r\n unregisterComponent(stateKey, fullComponentId);\r\n };\r\n }, [stateKey, fullComponentId]); // Dependencies are stable and correct\r\n}\r\n\r\nconst useImageLoaded = (ref: RefObject<HTMLElement>): boolean => {\r\n const [loaded, setLoaded] = useState(false);\r\n\r\n useLayoutEffect(() => {\r\n if (!ref.current) {\r\n setLoaded(true);\r\n return;\r\n }\r\n\r\n const images = Array.from(ref.current.querySelectorAll('img'));\r\n\r\n // If there are no images, we are \"loaded\" immediately.\r\n if (images.length === 0) {\r\n setLoaded(true);\r\n return;\r\n }\r\n\r\n let loadedCount = 0;\r\n const handleImageLoad = () => {\r\n loadedCount++;\r\n if (loadedCount === images.length) {\r\n setLoaded(true);\r\n }\r\n };\r\n\r\n images.forEach((image) => {\r\n if (image.complete) {\r\n handleImageLoad();\r\n } else {\r\n image.addEventListener('load', handleImageLoad);\r\n image.addEventListener('error', handleImageLoad);\r\n }\r\n });\r\n\r\n return () => {\r\n images.forEach((image) => {\r\n image.removeEventListener('load', handleImageLoad);\r\n image.removeEventListener('error', handleImageLoad);\r\n });\r\n };\r\n }, [ref.current]);\r\n\r\n return loaded;\r\n};\r\n"],"names":["getInitialOptions","getShadowMetadata","setShadowMetadata","getShadowValue","registerComponent","unregisterComponent","notifyPathSubscribers","subscribeToPath","getGlobalStore","ValidationWrapper","formOpts","path","stateKey","children","thisStateOpts","validationState","status","errors","err","errorMessages","warningMessages","message","jsx","Fragment","React","MemoizedCogsItemWrapper","memo","ListItemWrapper","prevProps","nextProps","itemComponentId","itemPath","localIndex","arraySetter","rebuildStateShape","renderFn","forceUpdate","useState","inViewRef","inView","useInView","elementRef","useRef","imagesLoaded","useImageLoaded","hasReportedInitialHeight","fullKey","useRegisterComponent","setRefs","useCallback","element","useEffect","unsubscribe","e","newHeight","arrayPath","arrayPathKey","itemValue","itemSetter","FormElementWrapper","setState","componentId","uuidv4","stateKeyPathKey","globalStateValue","localValue","setLocalValue","isCurrentlyDebouncing","debounceTimeoutRef","isDeepEqual","newValue","debouncedUpdate","debounceTime","validationOptions","zodSchema","fullState","result","currentMeta","pathErrors","error","handleBlur","p","parentPath","arrayMeta","itemKey","itemIndex","zodPath","baseState","stateWithInputProps","target","prop","formRefStore","fullComponentId","useLayoutEffect","ref","loaded","setLoaded","images","loadedCount","handleImageLoad","image"],"mappings":";;;;;;AAcA,MAAM;AAAA,EACJ,mBAAAA;AAAA,EAEA,mBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,gBAAAC;AAAA,EAEA,mBAAAC;AAAA,EACA,qBAAAC;AAAA,EAEA,uBAAAC;AAAA,EACA,iBAAAC;AACF,IAAIC,EAAe,SAAA;AAQZ,SAASC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AAAA,IACjC,2BAAW,IAAA;AAAA,IACX,cAAc,CAAC,WAAW;AAAA,EAAA,CAC3B,GAGM,MAAM;AACX,IAAA/B,GAAoBO,GAAUgF,CAAe;AAAA,EAC/C,IACC,CAAChF,GAAUgF,CAAe,CAAC;AAChC;AAEA,MAAMhD,KAAiB,CAACkD,MAAyC;AAC/D,QAAM,CAACC,GAAQC,CAAS,IAAI3D,EAAS,EAAK;AAE1C,SAAAwD,EAAgB,MAAM;AACpB,QAAI,CAACC,EAAI,SAAS;AAChB,MAAAE,EAAU,EAAI;AACd;AAAA,IACF;AAEA,UAAMC,IAAS,MAAM,KAAKH,EAAI,QAAQ,iBAAiB,KAAK,CAAC;AAG7D,QAAIG,EAAO,WAAW,GAAG;AACvB,MAAAD,EAAU,EAAI;AACd;AAAA,IACF;AAEA,QAAIE,IAAc;AAClB,UAAMC,IAAkB,MAAM;AAC5B,MAAAD,KACIA,MAAgBD,EAAO,UACzBD,EAAU,EAAI;AAAA,IAElB;AAEA,WAAAC,EAAO,QAAQ,CAACG,MAAU;AACxB,MAAIA,EAAM,WACRD,EAAA,KAEAC,EAAM,iBAAiB,QAAQD,CAAe,GAC9CC,EAAM,iBAAiB,SAASD,CAAe;AAAA,IAEnD,CAAC,GAEM,MAAM;AACX,MAAAF,EAAO,QAAQ,CAACG,MAAU;AACxB,QAAAA,EAAM,oBAAoB,QAAQD,CAAe,GACjDC,EAAM,oBAAoB,SAASD,CAAe;AAAA,MACpD,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAACL,EAAI,OAAO,CAAC,GAETC;AACT;"}
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { $cogsSignal as r, addStateOptions as o, createCogsState as a, createCogsStateFromSync as s, useCogsStateFn as n } from "./CogsState.jsx";
|
|
2
2
|
import { CogsStateClient as g, config as i, useCogsConfig as c } from "./CogsStateClient.jsx";
|
|
3
|
-
import { debounce as p, deepMerge as S, deleteNestedProperty as u, getArrayLengthDifferences as l, getArrayLengthDifferencesArray as m, getDifferences as y, getDifferencesArray as
|
|
4
|
-
import { useCogsTrpcValidationLink as
|
|
5
|
-
import {
|
|
3
|
+
import { debounce as p, deepMerge as S, deleteNestedProperty as u, getArrayLengthDifferences as l, getArrayLengthDifferencesArray as m, getDifferences as y, getDifferencesArray as C, isArray as x, isDeepEqual as A, isFunction as D, isObject as b, transformStateFunc as F, updateNestedProperty as h } from "./utility.js";
|
|
4
|
+
import { useCogsTrpcValidationLink as N } from "./TRPCValidationLink.js";
|
|
5
|
+
import { buildShadowNode as P, formRefStore as j, getGlobalStore as k } from "./store.js";
|
|
6
6
|
export {
|
|
7
7
|
r as $cogsSignal,
|
|
8
8
|
g as CogsStateClient,
|
|
9
|
-
T as METADATA_KEYS,
|
|
10
9
|
o as addStateOptions,
|
|
11
|
-
|
|
10
|
+
P as buildShadowNode,
|
|
12
11
|
i as config,
|
|
13
12
|
a as createCogsState,
|
|
14
13
|
s as createCogsStateFromSync,
|
|
15
14
|
p as debounce,
|
|
16
15
|
S as deepMerge,
|
|
17
16
|
u as deleteNestedProperty,
|
|
18
|
-
|
|
17
|
+
j as formRefStore,
|
|
19
18
|
l as getArrayLengthDifferences,
|
|
20
19
|
m as getArrayLengthDifferencesArray,
|
|
21
20
|
y as getDifferences,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
C as getDifferencesArray,
|
|
22
|
+
k as getGlobalStore,
|
|
23
|
+
x as isArray,
|
|
24
|
+
A as isDeepEqual,
|
|
25
|
+
D as isFunction,
|
|
27
26
|
b as isObject,
|
|
28
27
|
F as transformStateFunc,
|
|
29
28
|
h as updateNestedProperty,
|
|
30
29
|
c as useCogsConfig,
|
|
31
30
|
n as useCogsStateFn,
|
|
32
|
-
|
|
31
|
+
N as useCogsTrpcValidationLink
|
|
33
32
|
};
|
|
34
33
|
//# sourceMappingURL=index.js.map
|
package/dist/store.d.ts
CHANGED
|
@@ -108,6 +108,8 @@ export type CogsGlobalState = {
|
|
|
108
108
|
setShadowMetadata: (key: string, path: string[], metadata: any) => void;
|
|
109
109
|
getShadowValue: (key: string, path: string[], validArrayIds?: string[], log?: boolean) => any;
|
|
110
110
|
updateShadowAtPath: (key: string, path: string[], newValue: any) => void;
|
|
111
|
+
insertManyShadowArrayElements: (key: string, arrayPath: string[], newItems: any[], index?: number) => void;
|
|
112
|
+
addItemsToArrayNode: (key: string, arrayPath: string[], newItems: any, newKeys: string[]) => void;
|
|
111
113
|
insertShadowArrayElement: (key: string, arrayPath: string[], newItem: any, index?: number) => void;
|
|
112
114
|
removeShadowArrayElement: (key: string, itemPath: string[]) => void;
|
|
113
115
|
registerComponent: (stateKey: string, componentId: string, registration: any) => void;
|
|
@@ -147,11 +149,6 @@ export type CogsGlobalState = {
|
|
|
147
149
|
setSyncInfo: (key: string, syncInfo: SyncInfo) => void;
|
|
148
150
|
getSyncInfo: (key: string) => SyncInfo | null;
|
|
149
151
|
};
|
|
150
|
-
export declare const METADATA_KEYS: Set<string>;
|
|
151
|
-
/**
|
|
152
|
-
* The single source of truth for converting a regular JS value/object
|
|
153
|
-
* into the shadow state tree format with the new `_meta` structure.
|
|
154
|
-
*/
|
|
155
152
|
export declare function buildShadowNode(value: any): ShadowNode;
|
|
156
153
|
export declare const getGlobalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CogsGlobalState>>;
|
|
157
154
|
export {};
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,QAAQ,E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