cogsbox-state 0.5.435 → 0.5.437

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.
@@ -10,3 +10,4 @@ export declare function CogsStateClient({ children, sessionId, }: {
10
10
  sessionId?: string;
11
11
  }): import("react/jsx-runtime").JSX.Element;
12
12
  export {};
13
+ //# sourceMappingURL=CogsStateClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CogsStateClient.d.ts","sourceRoot":"","sources":["../src/CogsStateClient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,KAAK,UAAU,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACzC,eAAO,MAAM,MAAM,EAAE,UAEpB,CAAC;AAIF,eAAO,MAAM,aAAa,kBAAgC,CAAC;AAE3D,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAMA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CogsStateClient.jsx","sources":["../src/CogsStateClient.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { createContext, useContext } from \"react\";\r\ntype ConfigType = { sessionId?: string };\r\nexport const config: ConfigType = {\r\n sessionId: undefined,\r\n};\r\n\r\nconst CogsContext = createContext<ConfigType>(config);\r\n\r\nexport const useCogsConfig = () => useContext(CogsContext);\r\n\r\nexport function CogsStateClient({\r\n children,\r\n sessionId,\r\n}: {\r\n children: React.ReactNode;\r\n sessionId?: string;\r\n}) {\r\n return (\r\n <CogsContext.Provider value={{ sessionId }}>\r\n {children}\r\n </CogsContext.Provider>\r\n );\r\n}\r\n"],"names":["config","CogsContext","createContext","useCogsConfig","useContext","CogsStateClient","children","sessionId","jsx"],"mappings":";;;AAIO,MAAMA,IAAqB;AAAA,EAChC,WAAW;AACb,GAEMC,IAAcC,EAA0BF,CAAM,GAEvCG,IAAgB,MAAMC,EAAWH,CAAW;AAElD,SAASI,EAAgB;AAAA,EAC9B,UAAAC;AAAA,EACA,WAAAC;AACF,GAGG;AAEC,SAAA,gBAAAC,EAACP,EAAY,UAAZ,EAAqB,OAAO,EAAE,WAAAM,EAAA,GAC5B,UAAAD,GACH;AAEJ;"}
1
+ {"version":3,"file":"CogsStateClient.jsx","sources":["../src/CogsStateClient.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { createContext, useContext } from \"react\";\r\ntype ConfigType = { sessionId?: string };\r\nexport const config: ConfigType = {\r\n sessionId: undefined,\r\n};\r\n\r\nconst CogsContext = createContext<ConfigType>(config);\r\n\r\nexport const useCogsConfig = () => useContext(CogsContext);\r\n\r\nexport function CogsStateClient({\r\n children,\r\n sessionId,\r\n}: {\r\n children: React.ReactNode;\r\n sessionId?: string;\r\n}) {\r\n return (\r\n <CogsContext.Provider value={{ sessionId }}>\r\n {children}\r\n </CogsContext.Provider>\r\n );\r\n}\r\n"],"names":["config","CogsContext","createContext","useCogsConfig","useContext","CogsStateClient","children","sessionId","jsx"],"mappings":";;;AAIO,MAAMA,IAAqB;AAAA,EAChC,WAAW;AACb,GAEMC,IAAcC,EAA0BF,CAAM,GAEvCG,IAAgB,MAAMC,EAAWH,CAAW;AAElD,SAASI,EAAgB;AAAA,EAC9B,UAAAC;AAAA,EACA,WAAAC;AACF,GAGG;AACD,SACE,gBAAAC,EAACP,EAAY,UAAZ,EAAqB,OAAO,EAAE,WAAAM,EAAA,GAC5B,UAAAD,GACH;AAEJ;"}
@@ -1,14 +1,11 @@
1
1
  import { FormOptsType } from './CogsState';
2
2
  import { default as React } from 'react';
3
- import { getGlobalStore } from './store';
4
3
 
5
- export declare const useStoreSubscription: <T>(fullPath: string, selector: (store: ReturnType<typeof getGlobalStore.getState>, path: string) => T, compare?: (a: T, b: T) => boolean) => T;
6
- export declare const useGetValidationErrors: (validationKey: string, path: string[], validIndices?: number[]) => string[];
7
4
  export type ValidationWrapperProps = {
8
5
  formOpts?: FormOptsType;
9
6
  path: string[];
10
7
  stateKey: string;
11
8
  children: React.ReactNode;
12
- validIndices?: number[];
13
9
  };
14
- export declare function ValidationWrapper({ formOpts, path, stateKey, children, validIndices, }: ValidationWrapperProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ValidationWrapper({ formOpts, path, stateKey, children, }: ValidationWrapperProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=Functions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Functions.d.ts","sourceRoot":"","sources":["../src/Functions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,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;AACF,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,GACT,EAAE,sBAAsB,2CA6BxB"}
@@ -1,53 +1,22 @@
1
- import { jsx as m, Fragment as S } from "react/jsx-runtime";
2
- import d, { useState as v, useRef as f, useEffect as b } from "react";
3
- import { getGlobalStore as l } from "./store.js";
4
- const E = (t, e, r = (n, o) => JSON.stringify(n) === JSON.stringify(o)) => {
5
- const [n, o] = v(
6
- () => e(l.getState(), t)
7
- ), a = f(n), s = f(t);
8
- return b(() => {
9
- s.current = t, o(e(l.getState(), t));
10
- const g = (c) => {
11
- const i = e(c, s.current);
12
- r(a.current, i) || (a.current = i, o(i));
13
- }, u = l.subscribe(g);
14
- return () => {
15
- u();
16
- };
17
- }, [t]), n;
18
- }, V = (t, e, r) => {
19
- const n = t + "." + (e.length > 0 ? [e.join(".")] : []) + (r && r.length > 0 ? "." + r : "");
20
- return E(
21
- n,
22
- (a, s) => a.getValidationErrors(s) || []
23
- );
24
- };
25
- function y({
26
- formOpts: t,
27
- path: e,
28
- stateKey: r,
29
- children: n,
30
- validIndices: o
1
+ import { jsx as e, Fragment as c } from "react/jsx-runtime";
2
+ import r from "react";
3
+ import { getGlobalStore as S } from "./store.js";
4
+ function h({
5
+ formOpts: a,
6
+ path: t,
7
+ stateKey: o,
8
+ children: i
31
9
  }) {
32
- const { getInitialOptions: a } = l.getState(), s = a(r), g = s?.validation?.key ?? r, u = V(
33
- g,
34
- e,
35
- o
36
- ), c = [];
37
- if (u) {
38
- const i = u.join(", ");
39
- c.includes(i) || c.push(i);
40
- }
41
- return /* @__PURE__ */ m(S, { children: s?.formElements?.validation && !t?.validation?.disable ? s.formElements.validation({
42
- children: /* @__PURE__ */ m(d.Fragment, { children: n }, e.toString()),
43
- active: u.length > 0,
44
- message: t?.validation?.hideMessage ? "" : t?.validation?.message ? t?.validation?.message : c.map((i) => i).join(", "),
45
- path: e
46
- }) : /* @__PURE__ */ m(d.Fragment, { children: n }, e.toString()) });
10
+ const { getInitialOptions: d, getShadowMetadata: l } = S.getState(), n = d(o), s = l(o, t)?.validation, m = s?.status || "PRISTINE", g = s?.message;
11
+ return /* @__PURE__ */ e(c, { children: n?.formElements?.validation && !a?.validation?.disable ? n.formElements.validation({
12
+ children: /* @__PURE__ */ e(r.Fragment, { children: i }, t.toString()),
13
+ status: m,
14
+ // Pass status instead of active
15
+ message: a?.validation?.hideMessage ? "" : a?.validation?.message || g || "",
16
+ path: t
17
+ }) : /* @__PURE__ */ e(r.Fragment, { children: i }, t.toString()) });
47
18
  }
48
19
  export {
49
- y as ValidationWrapper,
50
- V as useGetValidationErrors,
51
- E as useStoreSubscription
20
+ h as ValidationWrapper
52
21
  };
53
22
  //# sourceMappingURL=Functions.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"Functions.jsx","sources":["../src/Functions.tsx"],"sourcesContent":["import { type FormOptsType } from './CogsState';\r\n\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport React from 'react';\r\nimport { getGlobalStore } from './store';\r\n\r\nexport const useStoreSubscription = <T,>(\r\n fullPath: string,\r\n selector: (\r\n store: ReturnType<typeof getGlobalStore.getState>,\r\n path: string\r\n ) => T,\r\n compare: (a: T, b: T) => boolean = (a, b) =>\r\n JSON.stringify(a) === JSON.stringify(b)\r\n) => {\r\n const [value, setValue] = useState<T>(() =>\r\n selector(getGlobalStore.getState(), fullPath)\r\n );\r\n const previousValueRef = useRef<T>(value);\r\n const fullPathRef = useRef(fullPath);\r\n useEffect(() => {\r\n fullPathRef.current = fullPath; // Ensure latest fullPath is always used\r\n\r\n setValue(selector(getGlobalStore.getState(), fullPath));\r\n\r\n const callback = (store: any) => {\r\n const newValue = selector(store, fullPathRef.current);\r\n\r\n if (!compare(previousValueRef.current, newValue)) {\r\n previousValueRef.current = newValue;\r\n setValue(newValue);\r\n }\r\n };\r\n const unsubscribe = getGlobalStore.subscribe(callback);\r\n return () => {\r\n unsubscribe();\r\n };\r\n }, [fullPath]);\r\n return value;\r\n};\r\nexport const useGetValidationErrors = (\r\n validationKey: string,\r\n path: string[],\r\n validIndices?: number[]\r\n) => {\r\n const fullPath =\r\n validationKey +\r\n '.' +\r\n (path.length > 0 ? [path.join('.')] : []) +\r\n (validIndices && validIndices.length > 0 ? '.' + validIndices : '');\r\n\r\n const returnresult = useStoreSubscription(\r\n fullPath,\r\n (store, path) => store.getValidationErrors(path) || []\r\n );\r\n\r\n return returnresult;\r\n};\r\n\r\n// Find FormControlComponent in your Functions.ts or equivalent file\r\n\r\n// export const FormControlComponent = <TStateObject,>({\r\n// setState, // This is the real effectiveSetState from the hook\r\n// path,\r\n// child,\r\n// formOpts,\r\n// stateKey,\r\n// rebuildStateShape,\r\n// }: FormControlComponentProps<TStateObject>) => {\r\n// const { registerFormRef, getFormRef } = formRefStore.getState();\r\n// const {\r\n// getValidationErrors,\r\n// addValidationError,\r\n// getInitialOptions,\r\n// removeValidationError,\r\n// } = getGlobalStore.getState();\r\n// const stateKeyPathKey = [stateKey, ...path].join('.');\r\n// const [, forceUpdate] = useState<any>();\r\n// getGlobalStore.getState().subscribeToPath(stateKeyPathKey, () => {\r\n// forceUpdate({});\r\n// });\r\n\r\n// const refKey = stateKey + '.' + path.join('.');\r\n// const localFormRef = useRef<HTMLInputElement>(null);\r\n// const existingRef = getFormRef(refKey);\r\n// if (!existingRef) {\r\n// registerFormRef(refKey, localFormRef);\r\n// }\r\n// const formRef = existingRef || localFormRef;\r\n\r\n// // --- START CHANGES ---\r\n\r\n// const globalStateValue = getGlobalStore\r\n// .getState()\r\n// .getShadowValue(stateKeyPathKey);\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// // Effect to sync local state if global state changes externally\r\n// useEffect(() => {\r\n// // Only update local if not actively debouncing a local change\r\n// if (!isCurrentlyDebouncing.current && globalStateValue !== localValue) {\r\n// setLocalValue(globalStateValue);\r\n// }\r\n// }, [globalStateValue]); // Removed localValue dependency\r\n\r\n// // Effect for cleanup\r\n// useEffect(() => {\r\n// return () => {\r\n// if (debounceTimeoutRef.current) {\r\n// clearTimeout(debounceTimeoutRef.current);\r\n// debounceTimeoutRef.current = null; // Explicitly nullify\r\n// isCurrentlyDebouncing.current = false;\r\n// }\r\n// };\r\n// }, []);\r\n\r\n// const debouncedUpdater = (payload: UpdateArg<TStateObject>) => {\r\n// setLocalValue(payload); // Update local state immediately\r\n// isCurrentlyDebouncing.current = true;\r\n\r\n// if (payload === '') {\r\n// if (debounceTimeoutRef.current) {\r\n// clearTimeout(debounceTimeoutRef.current); // Clear pending timer\r\n// debounceTimeoutRef.current = null;\r\n// }\r\n\r\n// setState(payload, path, { updateType: 'update' });\r\n// isCurrentlyDebouncing.current = false; // No longer debouncing\r\n// return; // Don't proceed to set another timeout\r\n// }\r\n\r\n// // If not empty, proceed with normal debouncing\r\n// if (debounceTimeoutRef.current) {\r\n// clearTimeout(debounceTimeoutRef.current);\r\n// }\r\n\r\n// debounceTimeoutRef.current = setTimeout(\r\n// () => {\r\n// isCurrentlyDebouncing.current = false;\r\n// console.log('debouncedUpdater', payload);\r\n// setState(payload, path, { updateType: 'update' });\r\n// },\r\n// formOpts?.debounceTime ??\r\n// (typeof globalStateValue == 'boolean' ? 20 : 200)\r\n// );\r\n// };\r\n\r\n// const initialOptions = getInitialOptions(stateKey);\r\n\r\n// const validationKey = initialOptions?.validation?.key;\r\n// const validateOnBlur = initialOptions?.validation?.onBlur === true;\r\n\r\n// const handleBlur = async () => {\r\n// // --- Ensure latest value is flushed if debouncing ---\r\n// if (debounceTimeoutRef.current) {\r\n// clearTimeout(debounceTimeoutRef.current); // Clear pending timer\r\n// debounceTimeoutRef.current = null;\r\n// isCurrentlyDebouncing.current = false;\r\n// // Ensure the absolute latest local value is committed on blur\r\n// setState(localValue, path, { updateType: 'update' });\r\n// }\r\n// // --- End modification ---\r\n\r\n// if (!initialOptions?.validation?.zodSchema || !validateOnBlur) return;\r\n// removeValidationError(validationKey + '.' + path.join('.'));\r\n// try {\r\n// // Use the potentially just flushed value\r\n// if (!validationKey) return;\r\n// const fieldValue = getGlobalStore\r\n// .getState()\r\n// .getShadowValue(stateKeyPathKey);\r\n// await validateZodPathFunc(\r\n// validationKey,\r\n// initialOptions.validation.zodSchema,\r\n// path,\r\n// fieldValue\r\n// );\r\n// // forceUpdate might be needed if validation state update doesn't trigger render\r\n// // Consider using useGetValidationErrors hook result directly for validation display\r\n// } catch (error) {\r\n// console.error('Validation error on blur:', error);\r\n// }\r\n// };\r\n\r\n// const childElement = child({\r\n// state: setter,\r\n// // --- START CHANGES ---\r\n// get: () => localValue, // Get should return the immediate local value\r\n// set: debouncedUpdater, // Use the new debounced updater\r\n// // --- END CHANGES ---\r\n\r\n// path: path,\r\n// validationErrors: () =>\r\n// getValidationErrors(validationKey + '.' + path.join('.')),\r\n// addValidationError: (message?: string) => {\r\n// removeValidationError(validationKey + '.' + path.join('.'));\r\n// addValidationError(validationKey + '.' + path.join('.'), message ?? '');\r\n// },\r\n// inputProps: {\r\n// // --- START CHANGES ---\r\n// value: localValue ?? '', // Input value is always the local state\r\n// onChange: (e: any) => debouncedUpdater(e.target.value), // Use debounced updater\r\n// // --- END CHANGES ---\r\n// onBlur: handleBlur,\r\n// ref: formRef,\r\n// },\r\n// });\r\n\r\n// return (\r\n// <>\r\n// <ValidationWrapper {...{ formOpts, path, stateKey }}>\r\n// {childElement}\r\n// </ValidationWrapper>\r\n// </>\r\n// );\r\n// };\r\nexport type ValidationWrapperProps = {\r\n formOpts?: FormOptsType;\r\n path: string[];\r\n stateKey: string;\r\n children: React.ReactNode;\r\n validIndices?: number[];\r\n};\r\nexport function ValidationWrapper({\r\n formOpts,\r\n path,\r\n\r\n stateKey,\r\n children,\r\n validIndices,\r\n}: ValidationWrapperProps) {\r\n const { getInitialOptions } = getGlobalStore.getState();\r\n const thisStateOpts = getInitialOptions(stateKey!);\r\n const validationKey = thisStateOpts?.validation?.key ?? stateKey!;\r\n const validationErrors = useGetValidationErrors(\r\n validationKey,\r\n path,\r\n validIndices\r\n );\r\n // console.log(\r\n // \"validationErrors ValidationWrapper\",\r\n // stateKey,\r\n // validationKey,\r\n // path,\r\n // validationErrors\r\n // );\r\n const thesMessages: string[] = [];\r\n\r\n if (validationErrors) {\r\n const newMessage = validationErrors!.join(', ');\r\n if (!thesMessages.includes(newMessage)) {\r\n thesMessages.push(newMessage);\r\n }\r\n }\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 active: validationErrors.length > 0 ? true : false,\r\n message: formOpts?.validation?.hideMessage\r\n ? ''\r\n : formOpts?.validation?.message\r\n ? formOpts?.validation?.message\r\n : thesMessages.map((m) => m).join(', '),\r\n path: path,\r\n })\r\n ) : (\r\n <React.Fragment key={path.toString()}>{children}</React.Fragment>\r\n )}\r\n </>\r\n );\r\n}\r\n"],"names":["useStoreSubscription","fullPath","selector","compare","a","b","value","setValue","useState","getGlobalStore","previousValueRef","useRef","fullPathRef","useEffect","callback","store","newValue","unsubscribe","useGetValidationErrors","validationKey","path","validIndices","ValidationWrapper","formOpts","stateKey","children","getInitialOptions","thisStateOpts","validationErrors","thesMessages","newMessage","jsx","Fragment","React","m"],"mappings":";;;AAMO,MAAMA,IAAuB,CAClCC,GACAC,GAIAC,IAAmC,CAACC,GAAGC,MACrC,KAAK,UAAUD,CAAC,MAAM,KAAK,UAAUC,CAAC,MACrC;AACG,QAAA,CAACC,GAAOC,CAAQ,IAAIC;AAAA,IAAY,MACpCN,EAASO,EAAe,SAAA,GAAYR,CAAQ;AAAA,EAC9C,GACMS,IAAmBC,EAAUL,CAAK,GAClCM,IAAcD,EAAOV,CAAQ;AACnC,SAAAY,EAAU,MAAM;AACd,IAAAD,EAAY,UAAUX,GAEtBM,EAASL,EAASO,EAAe,SAAS,GAAGR,CAAQ,CAAC;AAEhD,UAAAa,IAAW,CAACC,MAAe;AAC/B,YAAMC,IAAWd,EAASa,GAAOH,EAAY,OAAO;AAEpD,MAAKT,EAAQO,EAAiB,SAASM,CAAQ,MAC7CN,EAAiB,UAAUM,GAC3BT,EAASS,CAAQ;AAAA,IAErB,GACMC,IAAcR,EAAe,UAAUK,CAAQ;AACrD,WAAO,MAAM;AACC,MAAAG,EAAA;AAAA,IACd;AAAA,EAAA,GACC,CAAChB,CAAQ,CAAC,GACNK;AACT,GACaY,IAAyB,CACpCC,GACAC,GACAC,MACG;AACH,QAAMpB,IACJkB,IACA,OACCC,EAAK,SAAS,IAAI,CAACA,EAAK,KAAK,GAAG,CAAC,IAAI,CACrC,MAAAC,KAAgBA,EAAa,SAAS,IAAI,MAAMA,IAAe;AAO3D,SALcrB;AAAA,IACnBC;AAAA,IACA,CAACc,GAAOK,MAASL,EAAM,oBAAoBK,CAAI,KAAK,CAAA;AAAA,EACtD;AAGF;AAwKO,SAASE,EAAkB;AAAA,EAChC,UAAAC;AAAA,EACA,MAAAH;AAAA,EAEA,UAAAI;AAAA,EACA,UAAAC;AAAA,EACA,cAAAJ;AACF,GAA2B;AACzB,QAAM,EAAE,mBAAAK,EAAA,IAAsBjB,EAAe,SAAS,GAChDkB,IAAgBD,EAAkBF,CAAS,GAC3CL,IAAgBQ,GAAe,YAAY,OAAOH,GAClDI,IAAmBV;AAAA,IACvBC;AAAA,IACAC;AAAA,IACAC;AAAA,EACF,GAQMQ,IAAyB,CAAC;AAEhC,MAAID,GAAkB;AACd,UAAAE,IAAaF,EAAkB,KAAK,IAAI;AAC9C,IAAKC,EAAa,SAASC,CAAU,KACnCD,EAAa,KAAKC,CAAU;AAAA,EAC9B;AAIA,SAAA,gBAAAC,EAAAC,GAAA,EACG,UAAeL,GAAA,cAAc,cAC9B,CAACJ,GAAU,YAAY,UACrBI,EAAc,aAAc,WAAY;AAAA,IACtC,4BACGM,EAAM,UAAN,EAAsC,UAAAR,KAAlBL,EAAK,UAAsB;AAAA,IAElD,QAAQQ,EAAiB,SAAS;AAAA,IAClC,SAASL,GAAU,YAAY,cAC3B,KACAA,GAAU,YAAY,UACpBA,GAAU,YAAY,UACtBM,EAAa,IAAI,CAACK,MAAMA,CAAC,EAAE,KAAK,IAAI;AAAA,IAC1C,MAAAd;AAAA,EAAA,CACD,IAED,gBAAAW,EAACE,EAAM,UAAN,EAAsC,UAAAR,EAAlB,GAAAL,EAAK,SAAsB,CAAA,GAEpD;AAEJ;"}
1
+ {"version":3,"file":"Functions.jsx","sources":["../src/Functions.tsx"],"sourcesContent":["import { type FormOptsType } from './CogsState';\r\n\r\nimport React from 'react';\r\nimport { getGlobalStore } from './store';\r\n\r\nexport type ValidationWrapperProps = {\r\n formOpts?: FormOptsType;\r\n path: string[];\r\n stateKey: string;\r\n children: React.ReactNode;\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 } = getGlobalStore.getState();\r\n const thisStateOpts = getInitialOptions(stateKey!);\r\n\r\n // GET VALIDATION FROM SHADOW METADATA\r\n const shadowMeta = getShadowMetadata(stateKey!, path);\r\n const validationState = shadowMeta?.validation;\r\n const status = validationState?.status || 'PRISTINE';\r\n\r\n const message = validationState?.message;\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, // Pass status instead of active\r\n message: formOpts?.validation?.hideMessage\r\n ? ''\r\n : formOpts?.validation?.message || message || '',\r\n path: path,\r\n })\r\n ) : (\r\n <React.Fragment key={path.toString()}>{children}</React.Fragment>\r\n )}\r\n </>\r\n );\r\n}\r\n"],"names":["ValidationWrapper","formOpts","path","stateKey","children","getInitialOptions","getShadowMetadata","getGlobalStore","thisStateOpts","validationState","status","message","jsx","Fragment","React"],"mappings":";;;AAWO,SAASA,EAAkB;AAAA,EAChC,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AACF,GAA2B;AACzB,QAAM,EAAE,mBAAAC,GAAmB,mBAAAC,MAAsBC,EAAe,SAAA,GAC1DC,IAAgBH,EAAkBF,CAAS,GAI3CM,IADaH,EAAkBH,GAAWD,CAAI,GAChB,YAC9BQ,IAASD,GAAiB,UAAU,YAEpCE,IAAUF,GAAiB;AACjC,SACE,gBAAAG,EAAAC,GAAA,EACG,UAAAL,GAAe,cAAc,cAC9B,CAACP,GAAU,YAAY,UACrBO,EAAc,aAAc,WAAY;AAAA,IACtC,4BACGM,EAAM,UAAN,EAAsC,UAAAV,KAAlBF,EAAK,UAAsB;AAAA,IAElD,QAAAQ;AAAA;AAAA,IACA,SAAST,GAAU,YAAY,cAC3B,KACAA,GAAU,YAAY,WAAWU,KAAW;AAAA,IAChD,MAAAT;AAAA,EAAA,CACD,IAED,gBAAAU,EAACE,EAAM,UAAN,EAAsC,UAAAV,EAAA,GAAlBF,EAAK,SAAA,CAAsB,GAEpD;AAEJ;"}
@@ -4,3 +4,4 @@ import { TRPCLink } from '@trpc/client';
4
4
  export declare const useCogsTrpcValidationLink: <TRouter extends AnyRouter>(passedOpts?: {
5
5
  log?: boolean;
6
6
  }) => () => TRPCLink<TRouter>;
7
+ //# sourceMappingURL=TRPCValidationLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TRPCValidationLink.d.ts","sourceRoot":"","sources":["../src/TRPCValidationLink.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK7C,eAAO,MAAM,yBAAyB,GACpC,OAAO,SAAS,SAAS,EACzB,aAAa;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,WAGgC,QAAQ,CAAC,OAAO,CAuDhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TRPCValidationLink.js","sources":["../src/TRPCValidationLink.ts"],"sourcesContent":["import { observable } from \"@trpc/server/observable\";\r\nimport type { AnyRouter } from \"@trpc/server\";\r\nimport type { TRPCLink } from \"@trpc/client\";\r\nimport type { Operation } from \"@trpc/client\";\r\nimport type { TRPCClientError } from \"@trpc/client\";\r\nimport { getGlobalStore } from \"./store\";\r\nimport type { Observer } from \"@trpc/server/observable\";\r\nexport const useCogsTrpcValidationLink = <\r\n TRouter extends AnyRouter,\r\n>(passedOpts?: {\r\n log?: boolean;\r\n}) => {\r\n const addValidationError = getGlobalStore.getState().addValidationError;\r\n\r\n const TrpcValidationLink = (): TRPCLink<TRouter> => {\r\n return (opts) => {\r\n return ({ next, op }: { next: any; op: Operation }) => {\r\n return observable(\r\n (observer: Observer<any, TRPCClientError<TRouter>>) => {\r\n const unsubscribe = next(op).subscribe({\r\n next(value: unknown) {\r\n observer.next(value);\r\n },\r\n error(err: TRPCClientError<TRouter>) {\r\n try {\r\n const errorObject = JSON.parse(err.message);\r\n if (passedOpts?.log) {\r\n console.log(\"errorObject\", errorObject);\r\n }\r\n if (Array.isArray(errorObject)) {\r\n errorObject.forEach(\r\n (error: { path: string[]; message: string }) => {\r\n const fullpath = `${op.path}.${error.path.join(\".\")}`;\r\n // In your TRPC link\r\n if (passedOpts?.log) {\r\n console.log(\"fullpath 1\", fullpath);\r\n }\r\n addValidationError(fullpath, error.message);\r\n }\r\n );\r\n } else if (\r\n typeof errorObject === \"object\" &&\r\n errorObject !== null\r\n ) {\r\n Object.entries(errorObject).forEach(([key, value]) => {\r\n const fullpath = `${op.path}.${key}`;\r\n if (passedOpts?.log) {\r\n console.log(\"fullpath 2\", fullpath);\r\n }\r\n addValidationError(fullpath, value as string);\r\n });\r\n }\r\n } catch (e) {\r\n // Silently handle parse errors\r\n }\r\n\r\n observer.error(err);\r\n },\r\n complete() {\r\n observer.complete();\r\n },\r\n });\r\n return unsubscribe;\r\n }\r\n );\r\n };\r\n };\r\n };\r\n return TrpcValidationLink;\r\n};\r\n"],"names":["useCogsTrpcValidationLink","passedOpts","addValidationError","getGlobalStore","opts","next","op","observable","observer","value","err","errorObject","error","fullpath","key"],"mappings":";;AAOa,MAAAA,IAA4B,CAEvCC,MAEI;AACE,QAAAC,IAAqBC,EAAe,SAAA,EAAW;AAwD9C,SAtDoB,MAClB,CAACC,MACC,CAAC,EAAE,MAAAC,GAAM,IAAAC,QACPC;AAAA,IACL,CAACC,MACqBH,EAAKC,CAAE,EAAE,UAAU;AAAA,MACrC,KAAKG,GAAgB;AACnB,QAAAD,EAAS,KAAKC,CAAK;AAAA,MACrB;AAAA,MACA,MAAMC,GAA+B;AAC/B,YAAA;AACF,gBAAMC,IAAc,KAAK,MAAMD,EAAI,OAAO;AAC1C,UAAIT,GAAY,OACN,QAAA,IAAI,eAAeU,CAAW,GAEpC,MAAM,QAAQA,CAAW,IACfA,EAAA;AAAA,YACV,CAACC,MAA+C;AACxC,oBAAAC,IAAW,GAAGP,EAAG,IAAI,IAAIM,EAAM,KAAK,KAAK,GAAG,CAAC;AAEnD,cAAIX,GAAY,OACN,QAAA,IAAI,cAAcY,CAAQ,GAEjBX,EAAAW,GAAUD,EAAM,OAAO;AAAA,YAAA;AAAA,UAE9C,IAEA,OAAOD,KAAgB,YACvBA,MAAgB,QAET,OAAA,QAAQA,CAAW,EAAE,QAAQ,CAAC,CAACG,GAAKL,CAAK,MAAM;AACpD,kBAAMI,IAAW,GAAGP,EAAG,IAAI,IAAIQ,CAAG;AAClC,YAAIb,GAAY,OACN,QAAA,IAAI,cAAcY,CAAQ,GAEpCX,EAAmBW,GAAUJ,CAAe;AAAA,UAAA,CAC7C;AAAA,gBAEO;AAAA,QAAA;AAIZ,QAAAD,EAAS,MAAME,CAAG;AAAA,MACpB;AAAA,MACA,WAAW;AACT,QAAAF,EAAS,SAAS;AAAA,MAAA;AAAA,IACpB,CACD;AAAA,EAGL;AAKR;"}
1
+ {"version":3,"file":"TRPCValidationLink.js","sources":["../src/TRPCValidationLink.ts"],"sourcesContent":["import { observable } from '@trpc/server/observable';\r\nimport type { AnyRouter } from '@trpc/server';\r\nimport type { TRPCLink } from '@trpc/client';\r\nimport type { Operation } from '@trpc/client';\r\nimport type { TRPCClientError } from '@trpc/client';\r\nimport { getGlobalStore } from './store';\r\nimport type { Observer } from '@trpc/server/observable';\r\nexport const useCogsTrpcValidationLink = <\r\n TRouter extends AnyRouter,\r\n>(passedOpts?: {\r\n log?: boolean;\r\n}) => {\r\n const addValidationError = getGlobalStore.getState().addValidationError;\r\n\r\n const TrpcValidationLink = (): TRPCLink<TRouter> => {\r\n return (opts) => {\r\n return ({ next, op }: { next: any; op: Operation }) => {\r\n return observable(\r\n (observer: Observer<any, TRPCClientError<TRouter>>) => {\r\n const unsubscribe = next(op).subscribe({\r\n next(value: unknown) {\r\n observer.next(value);\r\n },\r\n error(err: TRPCClientError<TRouter>) {\r\n try {\r\n const errorObject = JSON.parse(err.message);\r\n if (passedOpts?.log) {\r\n console.log('errorObject', errorObject);\r\n }\r\n if (Array.isArray(errorObject)) {\r\n errorObject.forEach(\r\n (error: { path: string[]; message: string }) => {\r\n const fullpath = `${op.path}.${error.path.join('.')}`;\r\n // In your TRPC link\r\n if (passedOpts?.log) {\r\n console.log('fullpath 1', fullpath);\r\n }\r\n addValidationError(fullpath, error.message);\r\n }\r\n );\r\n } else if (\r\n typeof errorObject === 'object' &&\r\n errorObject !== null\r\n ) {\r\n Object.entries(errorObject).forEach(([key, value]) => {\r\n const fullpath = `${op.path}.${key}`;\r\n if (passedOpts?.log) {\r\n console.log('fullpath 2', fullpath);\r\n }\r\n addValidationError(fullpath, value as string);\r\n });\r\n }\r\n } catch (e) {\r\n // Silently handle parse errors\r\n }\r\n\r\n observer.error(err);\r\n },\r\n complete() {\r\n observer.complete();\r\n },\r\n });\r\n return unsubscribe;\r\n }\r\n );\r\n };\r\n };\r\n };\r\n return TrpcValidationLink;\r\n};\r\n"],"names":["useCogsTrpcValidationLink","passedOpts","addValidationError","getGlobalStore","opts","next","op","observable","observer","value","err","errorObject","error","fullpath","key"],"mappings":";;AAOO,MAAMA,IAA4B,CAEvCC,MAEI;AACJ,QAAMC,IAAqBC,EAAe,SAAA,EAAW;AAwDrD,SAtD2B,MAClB,CAACC,MACC,CAAC,EAAE,MAAAC,GAAM,IAAAC,QACPC;AAAA,IACL,CAACC,MACqBH,EAAKC,CAAE,EAAE,UAAU;AAAA,MACrC,KAAKG,GAAgB;AACnB,QAAAD,EAAS,KAAKC,CAAK;AAAA,MACrB;AAAA,MACA,MAAMC,GAA+B;AACnC,YAAI;AACF,gBAAMC,IAAc,KAAK,MAAMD,EAAI,OAAO;AAC1C,UAAIT,GAAY,OACd,QAAQ,IAAI,eAAeU,CAAW,GAEpC,MAAM,QAAQA,CAAW,IAC3BA,EAAY;AAAA,YACV,CAACC,MAA+C;AAC9C,oBAAMC,IAAW,GAAGP,EAAG,IAAI,IAAIM,EAAM,KAAK,KAAK,GAAG,CAAC;AAEnD,cAAIX,GAAY,OACd,QAAQ,IAAI,cAAcY,CAAQ,GAEpCX,EAAmBW,GAAUD,EAAM,OAAO;AAAA,YAC5C;AAAA,UAAA,IAGF,OAAOD,KAAgB,YACvBA,MAAgB,QAEhB,OAAO,QAAQA,CAAW,EAAE,QAAQ,CAAC,CAACG,GAAKL,CAAK,MAAM;AACpD,kBAAMI,IAAW,GAAGP,EAAG,IAAI,IAAIQ,CAAG;AAClC,YAAIb,GAAY,OACd,QAAQ,IAAI,cAAcY,CAAQ,GAEpCX,EAAmBW,GAAUJ,CAAe;AAAA,UAC9C,CAAC;AAAA,QAEL,QAAY;AAAA,QAEZ;AAEA,QAAAD,EAAS,MAAME,CAAG;AAAA,MACpB;AAAA,MACA,WAAW;AACT,QAAAF,EAAS,SAAA;AAAA,MACX;AAAA,IAAA,CACD;AAAA,EAEH;AAMV;"}
package/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export * from './CogsState.js';
2
2
  export * from './CogsStateClient.js';
3
3
  export * from './utility.js';
4
4
  export * from './TRPCValidationLink.js';
5
+ export * from './store.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,30 +1,34 @@
1
- import { $cogsSignal as r, addStateOptions as o, createCogsState as n, notifyComponent as s, useCogsStateFn as a } from "./CogsState.jsx";
2
- import { CogsStateClient as g, config as f, useCogsConfig as c } from "./CogsStateClient.jsx";
3
- import { debounce as d, deepMerge as u, deleteNestedProperty as y, getArrayLengthDifferences as C, getArrayLengthDifferencesArray as l, getDifferences as m, getDifferencesArray as S, getNestedValue as A, isArray as D, isDeepEqual as x, isFunction as F, isObject as L, transformStateFunc as N, updateNestedProperty as b } from "./utility.js";
4
- import { useCogsTrpcValidationLink as O } from "./TRPCValidationLink.js";
1
+ import { $cogsSignal as r, addStateOptions as o, createCogsState as n, createCogsStateFromSync as s, notifyComponent as a, useCogsStateFn as f } from "./CogsState.jsx";
2
+ import { CogsStateClient as i, config as c, useCogsConfig as p } from "./CogsStateClient.jsx";
3
+ import { debounce as S, deepMerge as m, deleteNestedProperty as u, getArrayLengthDifferences as y, getArrayLengthDifferencesArray as C, getDifferences as l, getDifferencesArray as x, getNestedValue as A, isArray as D, isDeepEqual as F, isFunction as b, isObject as L, transformStateFunc as N, updateNestedProperty as h } from "./utility.js";
4
+ import { useCogsTrpcValidationLink as P } from "./TRPCValidationLink.js";
5
+ import { formRefStore as j, getGlobalStore as k } from "./store.js";
5
6
  export {
6
7
  r as $cogsSignal,
7
- g as CogsStateClient,
8
+ i as CogsStateClient,
8
9
  o as addStateOptions,
9
- f as config,
10
+ c as config,
10
11
  n as createCogsState,
11
- d as debounce,
12
- u as deepMerge,
13
- y as deleteNestedProperty,
14
- C as getArrayLengthDifferences,
15
- l as getArrayLengthDifferencesArray,
16
- m as getDifferences,
17
- S as getDifferencesArray,
12
+ s as createCogsStateFromSync,
13
+ S as debounce,
14
+ m as deepMerge,
15
+ u as deleteNestedProperty,
16
+ j as formRefStore,
17
+ y as getArrayLengthDifferences,
18
+ C as getArrayLengthDifferencesArray,
19
+ l as getDifferences,
20
+ x as getDifferencesArray,
21
+ k as getGlobalStore,
18
22
  A as getNestedValue,
19
23
  D as isArray,
20
- x as isDeepEqual,
21
- F as isFunction,
24
+ F as isDeepEqual,
25
+ b as isFunction,
22
26
  L as isObject,
23
- s as notifyComponent,
27
+ a as notifyComponent,
24
28
  N as transformStateFunc,
25
- b as updateNestedProperty,
26
- c as useCogsConfig,
27
- a as useCogsStateFn,
28
- O as useCogsTrpcValidationLink
29
+ h as updateNestedProperty,
30
+ p as useCogsConfig,
31
+ f as useCogsStateFn,
32
+ P as useCogsTrpcValidationLink
29
33
  };
30
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
package/dist/store.d.ts CHANGED
@@ -45,6 +45,7 @@ export type ShadowMetadata = {
45
45
  syncInfo?: {
46
46
  status: string;
47
47
  };
48
+ validation?: ValidationState;
48
49
  lastUpdated?: number;
49
50
  value?: any;
50
51
  classSignals?: Array<{
@@ -82,6 +83,13 @@ export type ShadowMetadata = {
82
83
  flushTimer: NodeJS.Timeout | null;
83
84
  }>;
84
85
  } & ComponentsType;
86
+ export type ValidationStatus = 'PRISTINE' | 'DIRTY' | 'VALID_LIVE' | 'INVALID_LIVE' | 'VALIDATION_FAILED' | 'VALID_PENDING_SYNC' | 'SYNCING' | 'SYNCED' | 'SYNC_FAILED';
87
+ export type ValidationState = {
88
+ status: ValidationStatus;
89
+ message?: string;
90
+ lastValidated?: number;
91
+ validatedValue?: any;
92
+ };
85
93
  export type CogsEvent = {
86
94
  type: 'INSERT';
87
95
  path: string;
@@ -104,6 +112,9 @@ export type CogsEvent = {
104
112
  path: string;
105
113
  };
106
114
  export type CogsGlobalState = {
115
+ registerComponent: (stateKey: string, componentId: string, registration: any) => void;
116
+ unregisterComponent: (stateKey: string, componentId: string) => void;
117
+ addPathComponent: (stateKey: string, dependencyPath: string[], fullComponentId: string) => void;
107
118
  shadowStateStore: Map<string, ShadowMetadata>;
108
119
  markAsDirty: (key: string, path: string[], options: {
109
120
  bubble: boolean;
@@ -155,3 +166,4 @@ export type CogsGlobalState = {
155
166
  };
156
167
  export declare const getGlobalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CogsGlobalState>>;
157
168
  export {};
169
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EAEd,QAAQ,EACR,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAKF,KAAK,UAAU,GAAG,GAAG,CAAC;AAEtB,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACjE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC7D,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC,qBAAqB,EAAE,CACrB,QAAQ,EAAE,MAAM,KACb,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CA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