@nemme/js-sdk 0.6.2 → 0.6.3

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.
Files changed (46) hide show
  1. package/README.md +46 -13
  2. package/dist/browser.d.ts +1 -1
  3. package/dist/chunks/client-CEykSZ2c.js +389 -0
  4. package/dist/chunks/client-CEykSZ2c.js.map +1 -0
  5. package/dist/chunks/client-DZJN73sh.js +2 -0
  6. package/dist/chunks/client-DZJN73sh.js.map +1 -0
  7. package/dist/chunks/form-manager-CdG9IzjD.js +12 -0
  8. package/dist/chunks/form-manager-CdG9IzjD.js.map +1 -0
  9. package/dist/chunks/form-manager-Dre89wMr.js +6143 -0
  10. package/dist/chunks/form-manager-Dre89wMr.js.map +1 -0
  11. package/dist/chunks/httpClient-D2IO92uv.js +149 -0
  12. package/dist/chunks/httpClient-D2IO92uv.js.map +1 -0
  13. package/dist/chunks/httpClient-hrn9Ffa2.js +2 -0
  14. package/dist/chunks/httpClient-hrn9Ffa2.js.map +1 -0
  15. package/dist/chunks/jsx-runtime-BubrbI3X.js +2 -0
  16. package/dist/chunks/jsx-runtime-BubrbI3X.js.map +1 -0
  17. package/dist/chunks/jsx-runtime-jIxVPx5o.js +32 -0
  18. package/dist/chunks/jsx-runtime-jIxVPx5o.js.map +1 -0
  19. package/dist/client.d.ts +1 -1
  20. package/dist/deliveries/delivery-manager.d.ts +3 -2
  21. package/dist/forms/form-manager.d.ts +1 -10
  22. package/dist/forms-entry.d.ts +3 -0
  23. package/dist/forms.cjs +2 -0
  24. package/dist/forms.cjs.map +1 -0
  25. package/dist/forms.esm.js +6 -0
  26. package/dist/forms.esm.js.map +1 -0
  27. package/dist/index.cjs +1 -11
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.esm.js +6 -6750
  31. package/dist/index.esm.js.map +1 -1
  32. package/dist/nemme-sdk.umd.js +4 -4
  33. package/dist/nemme-sdk.umd.js.map +1 -1
  34. package/dist/react-entry.d.ts +3 -0
  35. package/dist/react.cjs +2 -0
  36. package/dist/react.cjs.map +1 -0
  37. package/dist/react.esm.js +67 -0
  38. package/dist/react.esm.js.map +1 -0
  39. package/dist/style-entry.d.ts +0 -0
  40. package/dist/style.cjs +2 -0
  41. package/dist/style.cjs.map +1 -0
  42. package/dist/style.esm.js +2 -0
  43. package/dist/style.esm.js.map +1 -0
  44. package/dist/types/forms.d.ts +10 -0
  45. package/package.json +32 -7
  46. /package/dist/{assets/js-sdk.css → js-sdk.css} +0 -0
@@ -0,0 +1,3 @@
1
+ export { NemmeProvider } from './react/NemmeProvider';
2
+ export { useNemmeContext } from './react/useNemmeContext';
3
+ export { useNemme } from './react/useNemme';
package/dist/react.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./chunks/jsx-runtime-BubrbI3X.js"),r=require("react"),w=require("./chunks/client-DZJN73sh.js"),d=r.createContext(void 0),y=({clientKey:e,config:n,children:s})=>{const[l,i]=r.useState(null),[o,u]=r.useState(!1),[C,a]=r.useState(null);r.useEffect(()=>{let c=null,m=!1;const x=async()=>{try{const t=new w.NemmeClient(e);if(await t.init(n),m){t.destroy();return}c=t,i(t),u(t.initialized),a(t.lastInitError?t.lastInitError.message:null)}catch(t){m||(a(t instanceof Error?t.message:"Failed to initialize Nemme client"),u(!1))}},v=setTimeout(()=>{i(null),u(!1),a(null)},0);return x(),()=>{clearTimeout(v),m=!0,c&&c.destroy()}},[e,n]);const N={client:l,isInitialized:o,error:C};return z.jsxRuntimeExports.jsx(d.Provider,{value:N,children:s})},f=()=>{const e=r.useContext(d);if(e===void 0)throw new Error("useNemmeContext must be used within a NemmeProvider");return e},E=()=>{const{client:e,isInitialized:n,error:s}=f(),l=r.useCallback(async o=>{if(!e||!n){console.warn("Nemme client not initialized");return}return e.track(o)},[e,n]),i=r.useCallback(async()=>{if(!e||!n){console.warn("Nemme client not initialized");return}return e.flush()},[e,n]);return{track:l,flush:i,isInitialized:n,error:s,client:e}};exports.NemmeProvider=y;exports.useNemme=E;exports.useNemmeContext=f;
2
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.cjs","sources":["../src/react/context.ts","../src/react/NemmeProvider.tsx","../src/react/useNemmeContext.ts","../src/react/useNemme.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { NemmeClient } from '../client';\n\nexport interface NemmeContextType {\n client: NemmeClient | null;\n isInitialized: boolean;\n error: string | null;\n}\n\nexport const NemmeContext = createContext<NemmeContextType | undefined>(undefined);\n","import * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { ClientConfigType, NemmeClient } from '../client';\nimport { NemmeContext, NemmeContextType } from './context';\n\ninterface NemmeProviderProps {\n clientKey: string;\n config: ClientConfigType;\n children: React.ReactNode;\n}\n\nexport const NemmeProvider: React.FC<NemmeProviderProps> = ({ clientKey, config, children }) => {\n const [client, setClient] = useState<NemmeClient | null>(null);\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let currentClient: NemmeClient | null = null;\n let isCancelled = false;\n\n const initializeClient = async () => {\n try {\n const nemmeClient = new NemmeClient(clientKey);\n await nemmeClient.init(config);\n\n // Check if effect was cancelled during async operation\n if (isCancelled) {\n nemmeClient.destroy();\n return;\n }\n\n currentClient = nemmeClient;\n setClient(nemmeClient);\n setIsInitialized(nemmeClient.initialized);\n setError(nemmeClient.lastInitError ? nemmeClient.lastInitError.message : null);\n } catch (err) {\n if (!isCancelled) {\n setError(err instanceof Error ? err.message : 'Failed to initialize Nemme client');\n setIsInitialized(false);\n }\n }\n };\n\n // Reset state when starting new initialization (deferred to avoid sync setState in effect)\n const resetId = setTimeout(() => {\n setClient(null);\n setIsInitialized(false);\n setError(null);\n }, 0);\n\n initializeClient();\n\n return () => {\n clearTimeout(resetId);\n isCancelled = true;\n if (currentClient) {\n currentClient.destroy();\n }\n };\n }, [clientKey, config]);\n\n const value: NemmeContextType = {\n client,\n isInitialized,\n error\n };\n\n return <NemmeContext.Provider value={value}>{children}</NemmeContext.Provider>;\n};\n","import { useContext } from 'react';\nimport { NemmeContext } from './context';\n\nexport const useNemmeContext = () => {\n const context = useContext(NemmeContext);\n if (context === undefined) {\n throw new Error('useNemmeContext must be used within a NemmeProvider');\n }\n return context;\n};\n","import { useCallback } from 'react';\nimport { useNemmeContext } from './useNemmeContext';\nimport { TrackEventOptions } from '../client';\n\nexport const useNemme = () => {\n const { client, isInitialized, error } = useNemmeContext();\n\n const track = useCallback(\n async <T extends TrackEventOptions>(options: T) => {\n if (!client || !isInitialized) {\n console.warn('Nemme client not initialized');\n return;\n }\n return client.track(options);\n },\n [client, isInitialized]\n );\n\n const flush = useCallback(async () => {\n if (!client || !isInitialized) {\n console.warn('Nemme client not initialized');\n return;\n }\n return client.flush();\n }, [client, isInitialized]);\n\n return {\n track,\n flush,\n isInitialized,\n error,\n client\n };\n};\n"],"names":["NemmeContext","createContext","NemmeProvider","clientKey","config","children","client","setClient","useState","isInitialized","setIsInitialized","error","setError","useEffect","currentClient","isCancelled","initializeClient","nemmeClient","NemmeClient","err","resetId","value","jsx","useNemmeContext","context","useContext","useNemme","track","useCallback","options","flush"],"mappings":"gMASaA,EAAeC,EAAAA,cAA4C,MAAS,ECEpEC,EAA8C,CAAC,CAAE,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,KAAe,CAC9F,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAA6B,IAAI,EACvD,CAACC,EAAeC,CAAgB,EAAIF,EAAAA,SAAS,EAAK,EAClD,CAACG,EAAOC,CAAQ,EAAIJ,EAAAA,SAAwB,IAAI,EAEtDK,EAAAA,UAAU,IAAM,CACd,IAAIC,EAAoC,KACpCC,EAAc,GAElB,MAAMC,EAAmB,SAAY,CACnC,GAAI,CACF,MAAMC,EAAc,IAAIC,EAAAA,YAAYf,CAAS,EAI7C,GAHA,MAAMc,EAAY,K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AChB,EAAG,CAACA,EAAQG,CAAa,CAAC,EAE1B,MAAO,CACL,MAAAkB,EACA,MAAAG,EACA,cAAArB,EACA,MAAAE,EACA,OAAAL,CAAA,CAEJ"}
@@ -0,0 +1,67 @@
1
+ import { j as w } from "./chunks/jsx-runtime-jIxVPx5o.js";
2
+ import { createContext as E, useState as u, useEffect as I, useContext as v, useCallback as d } from "react";
3
+ import { N as h } from "./chunks/client-CEykSZ2c.js";
4
+ const f = E(void 0), P = ({ clientKey: e, config: n, children: i }) => {
5
+ const [s, r] = u(null), [o, l] = u(!1), [C, a] = u(null);
6
+ I(() => {
7
+ let c = null, m = !1;
8
+ const x = async () => {
9
+ try {
10
+ const t = new h(e);
11
+ if (await t.init(n), m) {
12
+ t.destroy();
13
+ return;
14
+ }
15
+ c = t, r(t), l(t.initialized), a(t.lastInitError ? t.lastInitError.message : null);
16
+ } catch (t) {
17
+ m || (a(t instanceof Error ? t.message : "Failed to initialize Nemme client"), l(!1));
18
+ }
19
+ }, z = setTimeout(() => {
20
+ r(null), l(!1), a(null);
21
+ }, 0);
22
+ return x(), () => {
23
+ clearTimeout(z), m = !0, c && c.destroy();
24
+ };
25
+ }, [e, n]);
26
+ const N = {
27
+ client: s,
28
+ isInitialized: o,
29
+ error: C
30
+ };
31
+ return /* @__PURE__ */ w.jsx(f.Provider, { value: N, children: i });
32
+ }, p = () => {
33
+ const e = v(f);
34
+ if (e === void 0)
35
+ throw new Error("useNemmeContext must be used within a NemmeProvider");
36
+ return e;
37
+ }, b = () => {
38
+ const { client: e, isInitialized: n, error: i } = p(), s = d(
39
+ async (o) => {
40
+ if (!e || !n) {
41
+ console.warn("Nemme client not initialized");
42
+ return;
43
+ }
44
+ return e.track(o);
45
+ },
46
+ [e, n]
47
+ ), r = d(async () => {
48
+ if (!e || !n) {
49
+ console.warn("Nemme client not initialized");
50
+ return;
51
+ }
52
+ return e.flush();
53
+ }, [e, n]);
54
+ return {
55
+ track: s,
56
+ flush: r,
57
+ isInitialized: n,
58
+ error: i,
59
+ client: e
60
+ };
61
+ };
62
+ export {
63
+ P as NemmeProvider,
64
+ b as useNemme,
65
+ p as useNemmeContext
66
+ };
67
+ //# sourceMappingURL=react.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.esm.js","sources":["../src/react/context.ts","../src/react/NemmeProvider.tsx","../src/react/useNemmeContext.ts","../src/react/useNemme.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { NemmeClient } from '../client';\n\nexport interface NemmeContextType {\n client: NemmeClient | null;\n isInitialized: boolean;\n error: string | null;\n}\n\nexport const NemmeContext = createContext<NemmeContextType | undefined>(undefined);\n","import * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport { ClientConfigType, NemmeClient } from '../client';\nimport { NemmeContext, NemmeContextType } from './context';\n\ninterface NemmeProviderProps {\n clientKey: string;\n config: ClientConfigType;\n children: React.ReactNode;\n}\n\nexport const NemmeProvider: React.FC<NemmeProviderProps> = ({ clientKey, config, children }) => {\n const [client, setClient] = useState<NemmeClient | null>(null);\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let currentClient: NemmeClient | null = null;\n let isCancelled = false;\n\n const initializeClient = async () => {\n try {\n const nemmeClient = new NemmeClient(clientKey);\n await nemmeClient.init(config);\n\n // Check if effect was cancelled during async operation\n if (isCancelled) {\n nemmeClient.destroy();\n return;\n }\n\n currentClient = nemmeClient;\n setClient(nemmeClient);\n setIsInitialized(nemmeClient.initialized);\n setError(nemmeClient.lastInitError ? nemmeClient.lastInitError.message : null);\n } catch (err) {\n if (!isCancelled) {\n setError(err instanceof Error ? err.message : 'Failed to initialize Nemme client');\n setIsInitialized(false);\n }\n }\n };\n\n // Reset state when starting new initialization (deferred to avoid sync setState in effect)\n const resetId = setTimeout(() => {\n setClient(null);\n setIsInitialized(false);\n setError(null);\n }, 0);\n\n initializeClient();\n\n return () => {\n clearTimeout(resetId);\n isCancelled = true;\n if (currentClient) {\n currentClient.destroy();\n }\n };\n }, [clientKey, config]);\n\n const value: NemmeContextType = {\n client,\n isInitialized,\n error\n };\n\n return <NemmeContext.Provider value={value}>{children}</NemmeContext.Provider>;\n};\n","import { useContext } from 'react';\nimport { NemmeContext } from './context';\n\nexport const useNemmeContext = () => {\n const context = useContext(NemmeContext);\n if (context === undefined) {\n throw new Error('useNemmeContext must be used within a NemmeProvider');\n }\n return context;\n};\n","import { useCallback } from 'react';\nimport { useNemmeContext } from './useNemmeContext';\nimport { TrackEventOptions } from '../client';\n\nexport const useNemme = () => {\n const { client, isInitialized, error } = useNemmeContext();\n\n const track = useCallback(\n async <T extends TrackEventOptions>(options: T) => {\n if (!client || !isInitialized) {\n console.warn('Nemme client not initialized');\n return;\n }\n return client.track(options);\n },\n [client, isInitialized]\n );\n\n const flush = useCallback(async () => {\n if (!client || !isInitialized) {\n console.warn('Nemme client not initialized');\n return;\n }\n return client.flush();\n }, [client, isInitialized]);\n\n return {\n track,\n flush,\n isInitialized,\n error,\n client\n };\n};\n"],"names":["NemmeContext","createContext","NemmeProvider","clientKey","config","children","client","setClient","useState","isInitialized","setIsInitialized","error","setError","useEffect","currentClient","isCancelled","initializeClient","nemmeClient","NemmeClient","err","resetId","value","jsx","useNemmeContext","context","useContext","useNemme","track","useCallback","options","flush"],"mappings":";;;AASO,MAAMA,IAAeC,EAA4C,MAAS,GCEpEC,IAA8C,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,UAAAC,QAAe;AAC9F,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAA6B,IAAI,GACvD,CAACC,GAAeC,CAAgB,IAAIF,EAAS,EAAK,GAClD,CAACG,GAAOC,CAAQ,IAAIJ,EAAwB,IAAI;AAEtD,EAAAK,EAAU,MAAM;AACd,QAAIC,IAAoC,MACpCC,IAAc;AAElB,UAAMC,IAAmB,YAAY;AACnC,UAAI;AACF,cAAMC,IAAc,IAAIC,EAAYf,CAAS;AAI7C,YAHA,MAAMc,EAAY,KAAKb,CAAM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AACtB,KAAU,CAACG,GAAe;AAC7B,cAAQ,KAAK,8BAA8B;AAC3C;AAAA,IACF;AACA,WAAOH,EAAO,MAAA;AAAA,EAChB,GAAG,CAACA,GAAQG,CAAa,CAAC;AAE1B,SAAO;AAAA,IACL,OAAAkB;AAAA,IACA,OAAAG;AAAA,IACA,eAAArB;AAAA,IACA,OAAAE;AAAA,IACA,QAAAL;AAAA,EAAA;AAEJ;"}
File without changes
package/dist/style.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=style.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=style.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export type FormErrorType = 'FETCH_ERROR' | 'SUBMISSION_ERROR';
2
+ export declare class FormError extends Error {
3
+ errorType: string;
4
+ constructor(errorType: FormErrorType, message?: string);
5
+ }
6
+ export type FormConfig = {
7
+ zIndex?: number;
8
+ theme?: 'light' | 'dark';
9
+ onFormError?: (error: FormError) => void;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nemme/js-sdk",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.esm.js",
@@ -21,7 +21,20 @@
21
21
  "require": "./dist/index.cjs",
22
22
  "default": "./dist/index.esm.js"
23
23
  },
24
- "./style.css": "./dist/assets/js-sdk.css",
24
+ "./react": {
25
+ "types": "./dist/react-entry.d.ts",
26
+ "import": "./dist/react.esm.js",
27
+ "require": "./dist/react.cjs",
28
+ "default": "./dist/react.esm.js"
29
+ },
30
+ "./forms": {
31
+ "types": "./dist/forms-entry.d.ts",
32
+ "import": "./dist/forms.esm.js",
33
+ "require": "./dist/forms.cjs",
34
+ "default": "./dist/forms.esm.js"
35
+ },
36
+ "./style.css": "./dist/js-sdk.css",
37
+ "./dist/js-sdk.css": "./dist/js-sdk.css",
25
38
  "./dist/assets/js-sdk.css": "./dist/assets/js-sdk.css"
26
39
  },
27
40
  "scripts": {
@@ -30,9 +43,9 @@
30
43
  "debug": "vitest --test-timeout=0 --no-file-parallelism",
31
44
  "cov": "vitest run --coverage",
32
45
  "type-check": "tsc --noEmit",
33
- "build": "tsc && vite build",
34
- "build:dev": "tsc && vite build --mode development",
35
- "build:test": "tsc && vite build --mode test",
46
+ "build": "tsc && vite build && vite build -c vite.umd.config.ts",
47
+ "build:dev": "tsc && vite build --mode development && vite build -c vite.umd.config.ts --mode development",
48
+ "build:test": "tsc && vite build --mode test && vite build -c vite.umd.config.ts --mode test",
36
49
  "dev": "vite",
37
50
  "preview": "vite preview",
38
51
  "sb": "storybook dev -p 6006 --no-open",
@@ -45,12 +58,22 @@
45
58
  "author": "Nemme AS",
46
59
  "license": "MIT",
47
60
  "description": "Nemme JS SDK",
61
+ "peerDependencies": {
62
+ "react": "^19.0.0",
63
+ "react-dom": "^19.0.0"
64
+ },
65
+ "peerDependenciesMeta": {
66
+ "react": {
67
+ "optional": true
68
+ },
69
+ "react-dom": {
70
+ "optional": true
71
+ }
72
+ },
48
73
  "dependencies": {
49
74
  "@phosphor-icons/react": "^2.1.10",
50
75
  "date-fns": "^4.1.0",
51
76
  "i18next-browser-languagedetector": "^8.2.1",
52
- "react": "^18.0.0 || ^19.0.0",
53
- "react-dom": "^18.0.0 || ^19.0.0",
54
77
  "react-i18next": "^16.5.4"
55
78
  },
56
79
  "devDependencies": {
@@ -74,6 +97,8 @@
74
97
  "@vitejs/plugin-react": "^5.1.4",
75
98
  "@vitest/browser": "^4.0.18",
76
99
  "@vitest/coverage-v8": "^4.0.18",
100
+ "react": "^19.2.4",
101
+ "react-dom": "^19.2.4",
77
102
  "eslint": "^9.39.0",
78
103
  "eslint-config-prettier": "^10.1.5",
79
104
  "eslint-plugin-prettier": "^5.4.1",
File without changes