cogsbox-state 0.5.28 → 0.5.29

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.
@@ -5,7 +5,7 @@ type ConfigType = {
5
5
  };
6
6
  export declare const config: ConfigType;
7
7
  export declare const useCogsConfig: () => ConfigType;
8
- export default function CogsStateClient({ children, sessionId, }: {
8
+ export declare function CogsStateClient({ children, sessionId, }: {
9
9
  children: React.ReactNode;
10
10
  sessionId?: string;
11
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,18 @@
1
1
  "use client";
2
- import "react/jsx-runtime";
3
- import { createContext as o, useContext as t } from "react";
4
- const e = {
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { createContext as s, useContext as i } from "react";
4
+ const r = {
5
5
  sessionId: void 0
6
- }, s = o(e), c = () => t(s);
6
+ }, o = s(r), u = () => i(o);
7
+ function f({
8
+ children: t,
9
+ sessionId: e
10
+ }) {
11
+ return /* @__PURE__ */ n(o.Provider, { value: { sessionId: e }, children: t });
12
+ }
7
13
  export {
8
- e as config,
9
- c as useCogsConfig
14
+ f as CogsStateClient,
15
+ r as config,
16
+ u as useCogsConfig
10
17
  };
11
18
  //# sourceMappingURL=CogsStateClient.jsx.map
@@ -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 default 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"],"mappings":";;;AAIO,MAAMA,IAAqB;AAAA,EAC9B,WAAW;AACf,GAEMC,IAAcC,EAA0BF,CAAM,GAEvCG,IAAgB,MAAMC,EAAWH,CAAW;"}
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;"}
package/dist/index.js CHANGED
@@ -1,29 +1,30 @@
1
1
  import { $cogsSignal as r, $cogsSignalStore as o, addStateOptions as n, createCogsState as s, notifyComponent as a, useCogsStateFn as i } from "./CogsState.jsx";
2
- import { config as f, useCogsConfig as c } from "./CogsStateClient.jsx";
3
- import { debounce as d, deleteNestedProperty as u, getArrayLengthDifferences as y, getArrayLengthDifferencesArray as S, getDifferences as l, getDifferencesArray as m, getNestedValue as C, isArray as A, isDeepEqual as D, isFunction as x, isObject as F, transformStateFunc as L, updateNestedProperty as N } from "./utility.js";
4
- import { useCogsTrpcValidationLink as h } from "./TRPCValidationLink.js";
2
+ import { CogsStateClient as f, config as c, useCogsConfig as p } from "./CogsStateClient.jsx";
3
+ import { debounce as u, deleteNestedProperty as y, getArrayLengthDifferences as C, getArrayLengthDifferencesArray as S, getDifferences as l, getDifferencesArray as m, 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";
5
5
  export {
6
6
  r as $cogsSignal,
7
7
  o as $cogsSignalStore,
8
+ f as CogsStateClient,
8
9
  n as addStateOptions,
9
- f as config,
10
+ c as config,
10
11
  s as createCogsState,
11
- d as debounce,
12
- u as deleteNestedProperty,
13
- y as getArrayLengthDifferences,
12
+ u as debounce,
13
+ y as deleteNestedProperty,
14
+ C as getArrayLengthDifferences,
14
15
  S as getArrayLengthDifferencesArray,
15
16
  l as getDifferences,
16
17
  m as getDifferencesArray,
17
- C as getNestedValue,
18
- A as isArray,
19
- D as isDeepEqual,
20
- x as isFunction,
21
- F as isObject,
18
+ A as getNestedValue,
19
+ D as isArray,
20
+ x as isDeepEqual,
21
+ F as isFunction,
22
+ L as isObject,
22
23
  a as notifyComponent,
23
- L as transformStateFunc,
24
- N as updateNestedProperty,
25
- c as useCogsConfig,
24
+ N as transformStateFunc,
25
+ b as updateNestedProperty,
26
+ p as useCogsConfig,
26
27
  i as useCogsStateFn,
27
- h as useCogsTrpcValidationLink
28
+ O as useCogsTrpcValidationLink
28
29
  };
29
30
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cogsbox-state",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "React state management library with form controls and server sync",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",