@jitsu/jitsu-react 1.10.4 → 1.11.0-beta.0

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.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
2
  import { createContext } from "react";
3
- var JitsuContext = createContext(null);
3
+ const JitsuContext = createContext(null);
4
4
  export default JitsuContext;
5
5
  //# sourceMappingURL=JitsuContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JitsuContext.js","sourceRoot":"","sources":["../src/JitsuContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,IAAM,YAAY,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAE/D,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"JitsuContext.js","sourceRoot":"","sources":["../src/JitsuContext.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,MAAM,YAAY,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAE/D,eAAe,YAAY,CAAC"}
@@ -3,14 +3,14 @@ import * as React from "react";
3
3
  import { useMemo } from "react";
4
4
  import JitsuContext from "./JitsuContext";
5
5
  import { emptyAnalytics, jitsuAnalytics } from "@jitsu/js";
6
- var JitsuProvider = function (props) {
7
- var instance = useMemo(function () {
6
+ const JitsuProvider = props => {
7
+ const instance = useMemo(() => {
8
8
  if (props.options.disabled) {
9
9
  return { analytics: emptyAnalytics };
10
10
  }
11
11
  else if (!props.options.host) {
12
- var msg = "<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized";
13
- console.error("%c".concat(msg), "color: red; font-weight: bold;");
12
+ const msg = "<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized";
13
+ console.error(`%c${msg}`, "color: red; font-weight: bold;");
14
14
  return { analytics: emptyAnalytics };
15
15
  }
16
16
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"JitsuProvider.js","sourceRoot":"","sources":["../src/JitsuProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAqB,OAAO,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,YAA+B,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3D,IAAM,aAAa,GAAmE,UAAA,KAAK;IACzF,IAAM,QAAQ,GAAkB,OAAO,CAAC;QACtC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;aAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAM,GAAG,GAAG,6EAA6E,CAAC;YAC1F,OAAO,CAAC,KAAK,CAAC,YAAK,GAAG,CAAE,EAAE,gCAAgC,CAAC,CAAC;YAC5D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACtD,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,OAAO,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,IAAG,KAAK,CAAC,QAAQ,CAAyB,CAAC;AAC1F,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"JitsuProvider.js","sourceRoot":"","sources":["../src/JitsuProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAqB,OAAO,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,YAA+B,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3D,MAAM,aAAa,GAAmE,KAAK,CAAC,EAAE;IAC5F,MAAM,QAAQ,GAAkB,OAAO,CAAC,GAAG,EAAE;QAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;aAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC/B,MAAM,GAAG,GAAG,6EAA6E,CAAC;YAC1F,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC;YAC5D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACtD,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,OAAO,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,IAAG,KAAK,CAAC,QAAQ,CAAyB,CAAC;AAC1F,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -46,9 +46,6 @@ var JitsuProvider = function JitsuProvider(props) {
46
46
  }, props.children);
47
47
  };
48
48
 
49
- /**
50
- * See for details http://jitsu.com/docs/sending-data/js-sdk/react
51
- */
52
49
  function useJitsu(opts) {
53
50
  var jitsuInstance = React.useContext(JitsuContext);
54
51
  if (opts != null && opts.disabled) {
@@ -70,7 +67,6 @@ function useJitsu(opts) {
70
67
  }
71
68
  } else if (opts != null && opts.host || opts != null && opts.echoEvents) {
72
69
  throw new Error("Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react");
73
- //Jitsu analytics is initialized inside provider
74
70
  } else if (jitsuInstance.analytics) {
75
71
  return jitsuInstance;
76
72
  } else {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nexport type JitsuInstance = { analytics: AnalyticsInterface };\n\nconst JitsuContext = createContext<JitsuInstance | null>(null);\n\nexport default JitsuContext;\n","\"use client\";\n\nimport * as React from \"react\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport JitsuContext, { JitsuInstance } from \"./JitsuContext\";\nimport { emptyAnalytics, jitsuAnalytics } from \"@jitsu/js\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n const instance: JitsuInstance = useMemo(() => {\n if (props.options.disabled) {\n return { analytics: emptyAnalytics };\n } else if (!props.options.host) {\n const msg = \"<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n } else {\n return { analytics: jitsuAnalytics(props.options) };\n }\n }, [props.options.disabled, props.options.host]);\n return <JitsuContext.Provider value={instance}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions, emptyAnalytics } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n echoEvents?: boolean;\n })\n | { disabled: true; host?: undefined };\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n let jitsuInstance = useContext(JitsuContext);\n if (opts?.disabled) {\n return { analytics: emptyAnalytics };\n }\n if (!jitsuInstance) {\n if (opts?.host || opts?.echoEvents) {\n return { analytics: jitsuAnalytics(opts) };\n } else {\n const msg =\n \"Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n }\n } else if (opts?.host || opts?.echoEvents) {\n throw new Error(\n \"Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\"\n );\n //Jitsu analytics is initialized inside provider\n } else if (jitsuInstance.analytics) {\n return jitsuInstance;\n } else {\n throw new Error(`<JitsuProvider /> is not initialized with undefined analytics instance`);\n }\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","instance","useMemo","options","disabled","analytics","emptyAnalytics","host","msg","console","error","jitsuAnalytics","React","createElement","Provider","value","children","useJitsu","opts","jitsuInstance","useContext","echoEvents","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,YAAY,GAAGC,mBAAa,CAAuB,IAAI;;ACC7D,IAAMC,aAAa,GAAmE,SAAhFA,aAAaA,CAAmEC,KAAK,EAAG;AAC5F,EAAA,IAAMC,QAAQ,GAAkBC,aAAO,CAAC,YAAK;AAC3C,IAAA,IAAIF,KAAK,CAACG,OAAO,CAACC,QAAQ,EAAE;MAC1B,OAAO;AAAEC,QAAAA,SAAS,EAAEC,iBAAAA;OAAgB,CAAA;KACrC,MAAM,IAAI,C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AAgC,CAAC,CAAA;MAC3D,OAAO;AAAEH,QAAAA,SAAS,EAAEC,iBAAAA;OAAgB,CAAA;AACtC,KAAA;AACF,GAAC,MAAM,IAAIY,IAAI,IAAA,IAAA,IAAJA,IAAI,CAAEX,IAAI,IAAIW,IAAI,IAAA,IAAA,IAAJA,IAAI,CAAEG,UAAU,EAAE;AACzC,IAAA,MAAM,IAAIC,KAAK,CACb,2IAA2I,CAC5I,CAAA;AACD;AACF,GAAC,MAAM,IAAIH,aAAa,CAACd,SAAS,EAAE;AAClC,IAAA,OAAOc,aAAa,CAAA;AACtB,GAAC,MAAM;IACL,MAAM,IAAIG,KAAK,CAAA,wEAAyE,CAAC,CAAA;AAC3F,GAAA;AACF;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nexport type JitsuInstance = { analytics: AnalyticsInterface };\n\nconst JitsuContext = createContext<JitsuInstance | null>(null);\n\nexport default JitsuContext;\n","\"use client\";\n\nimport * as React from \"react\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport JitsuContext, { JitsuInstance } from \"./JitsuContext\";\nimport { emptyAnalytics, jitsuAnalytics } from \"@jitsu/js\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n const instance: JitsuInstance = useMemo(() => {\n if (props.options.disabled) {\n return { analytics: emptyAnalytics };\n } else if (!props.options.host) {\n const msg = \"<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n } else {\n return { analytics: jitsuAnalytics(props.options) };\n }\n }, [props.options.disabled, props.options.host]);\n return <JitsuContext.Provider value={instance}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions, emptyAnalytics } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n echoEvents?: boolean;\n })\n | { disabled: true; host?: undefined };\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n let jitsuInstance = useContext(JitsuContext);\n if (opts?.disabled) {\n return { analytics: emptyAnalytics };\n }\n if (!jitsuInstance) {\n if (opts?.host || opts?.echoEvents) {\n return { analytics: jitsuAnalytics(opts) };\n } else {\n const msg =\n \"Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n }\n } else if (opts?.host || opts?.echoEvents) {\n throw new Error(\n \"Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\"\n );\n //Jitsu analytics is initialized inside provider\n } else if (jitsuInstance.analytics) {\n return jitsuInstance;\n } else {\n throw new Error(`<JitsuProvider /> is not initialized with undefined analytics instance`);\n }\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","instance","useMemo","options","disabled","analytics","emptyAnalytics","host","msg","console","error","jitsuAnalytics","React","createElement","Provider","value","children","useJitsu","opts","jitsuInstance","useContext","echoEvents","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,YAAY,GAAGC,mBAAa,CAAuB,IAAI;;ACC7D,IAAMC,aAAa,GAAmE,S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I,CAAEG,UAAU,EAAE;MAClC,OAAO;QAAEhB,SAAS,EAAEM,iBAAc,CAACO,IAAI,CAAA;OAAG,CAAA;AAC5C,KAAC,MAAM;MACL,IAAMV,GAAG,GACP,iJAAiJ,CAAA;AACnJC,MAAAA,OAAO,CAACC,KAAK,CAAA,IAAA,GAAMF,GAAG,EAAI,gCAAgC,CAAC,CAAA;MAC3D,OAAO;AAAEH,QAAAA,SAAS,EAAEC,iBAAAA;OAAgB,CAAA;AACtC,KAAA;AACF,GAAC,MAAM,IAAIY,IAAI,IAAA,IAAA,IAAJA,IAAI,CAAEX,IAAI,IAAIW,IAAI,IAAA,IAAA,IAAJA,IAAI,CAAEG,UAAU,EAAE;AACzC,IAAA,MAAM,IAAIC,KAAK,CACb,2IAA2I,CAC5I,CAAA;AAEH,GAAC,MAAM,IAAIH,aAAa,CAACd,SAAS,EAAE;AAClC,IAAA,OAAOc,aAAa,CAAA;AACtB,GAAC,MAAM;IACL,MAAM,IAAIG,KAAK,CAAA,wEAAyE,CAAC,CAAA;AAC3F,GAAA;AACF;;;;;;"}
@@ -27,9 +27,6 @@ var JitsuProvider = function JitsuProvider(props) {
27
27
  }, props.children);
28
28
  };
29
29
 
30
- /**
31
- * See for details http://jitsu.com/docs/sending-data/js-sdk/react
32
- */
33
30
  function useJitsu(opts) {
34
31
  var jitsuInstance = useContext(JitsuContext);
35
32
  if (opts != null && opts.disabled) {
@@ -51,7 +48,6 @@ function useJitsu(opts) {
51
48
  }
52
49
  } else if (opts != null && opts.host || opts != null && opts.echoEvents) {
53
50
  throw new Error("Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react");
54
- //Jitsu analytics is initialized inside provider
55
51
  } else if (jitsuInstance.analytics) {
56
52
  return jitsuInstance;
57
53
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nexport type JitsuInstance = { analytics: AnalyticsInterface };\n\nconst JitsuContext = createContext<JitsuInstance | null>(null);\n\nexport default JitsuContext;\n","\"use client\";\n\nimport * as React from \"react\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport JitsuContext, { JitsuInstance } from \"./JitsuContext\";\nimport { emptyAnalytics, jitsuAnalytics } from \"@jitsu/js\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n const instance: JitsuInstance = useMemo(() => {\n if (props.options.disabled) {\n return { analytics: emptyAnalytics };\n } else if (!props.options.host) {\n const msg = \"<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n } else {\n return { analytics: jitsuAnalytics(props.options) };\n }\n }, [props.options.disabled, props.options.host]);\n return <JitsuContext.Provider value={instance}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions, emptyAnalytics } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n echoEvents?: boolean;\n })\n | { disabled: true; host?: undefined };\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n let jitsuInstance = useContext(JitsuContext);\n if (opts?.disabled) {\n return { analytics: emptyAnalytics };\n }\n if (!jitsuInstance) {\n if (opts?.host || opts?.echoEvents) {\n return { analytics: jitsuAnalytics(opts) };\n } else {\n const msg =\n \"Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n }\n } else if (opts?.host || opts?.echoEvents) {\n throw new Error(\n \"Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\"\n );\n //Jitsu analytics is initialized inside provider\n } else if (jitsuInstance.analytics) {\n return jitsuInstance;\n } else {\n throw new Error(`<JitsuProvider /> is not initialized with undefined analytics instance`);\n }\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","instance","useMemo","options","disabled","analytics","emptyAnalytics","host","msg","console","error","jitsuAnalytics","React","createElement","Provider","value","children","useJitsu","opts","jitsuInstance","useContext","echoEvents","Error"],"mappings":";;;;AAOA,IAAMA,YAAY,GAAGC,aAAa,CAAuB,IAAI;;ACC7D,IAAMC,aAAa,GAAmE,SAAhFA,aAAaA,CAAmEC,KAAK,EAAG;AAC5F,EAAA,IAAMC,QAAQ,GAAkBC,OAAO,CAAC,YAAK;AAC3C,IAAA,IAAIF,KAAK,CAACG,OAAO,CAACC,QAAQ,EAAE;MAC1B,OAAO;AAAEC,QAAAA,SAAS,EAAEC,cAAAA;OAAgB,CAAA;KACrC,MAAM,IAAI,CAACN,KAAK,CAACG,OAAO,CAACI,IAAI,EAAE;MAC9B,IAAMC,GAAG,GAAG,6EAA6E,CAAA;AACzFC,MAAAA,OAAO,CAACC,KAAK,CAAA,IAAA,GAAMF,GAAG,EAAI,gCAAgC,CAAC,CAAA;MAC3D,OAAO;AAAEH,QAAAA,SAAS,EAAEC,cAAAA;OAAgB,CAAA;AACtC,KAAC,MAAM;MACL,OAAO;AAAED,QAAAA,SAAS,EAAEM,cAAc,CAACX,KAAK,CAACG,OAAO,CAAA;OAAG,CAAA;AACrD,KAAA;A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a,CAAA;AACtB,GAAC,MAAM;IACL,MAAM,IAAIG,KAAK,CAAA,wEAAyE,CAAC,CAAA;AAC3F,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.modern.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nexport type JitsuInstance = { analytics: AnalyticsInterface };\n\nconst JitsuContext = createContext<JitsuInstance | null>(null);\n\nexport default JitsuContext;\n","\"use client\";\n\nimport * as React from \"react\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport JitsuContext, { JitsuInstance } from \"./JitsuContext\";\nimport { emptyAnalytics, jitsuAnalytics } from \"@jitsu/js\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n const instance: JitsuInstance = useMemo(() => {\n if (props.options.disabled) {\n return { analytics: emptyAnalytics };\n } else if (!props.options.host) {\n const msg = \"<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n } else {\n return { analytics: jitsuAnalytics(props.options) };\n }\n }, [props.options.disabled, props.options.host]);\n return <JitsuContext.Provider value={instance}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions, emptyAnalytics } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n echoEvents?: boolean;\n })\n | { disabled: true; host?: undefined };\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n let jitsuInstance = useContext(JitsuContext);\n if (opts?.disabled) {\n return { analytics: emptyAnalytics };\n }\n if (!jitsuInstance) {\n if (opts?.host || opts?.echoEvents) {\n return { analytics: jitsuAnalytics(opts) };\n } else {\n const msg =\n \"Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\";\n console.error(`%c${msg}`, \"color: red; font-weight: bold;\");\n return { analytics: emptyAnalytics };\n }\n } else if (opts?.host || opts?.echoEvents) {\n throw new Error(\n \"Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\"\n );\n //Jitsu analytics is initialized inside provider\n } else if (jitsuInstance.analytics) {\n return jitsuInstance;\n } else {\n throw new Error(`<JitsuProvider /> is not initialized with undefined analytics instance`);\n }\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","instance","useMemo","options","disabled","analytics","emptyAnalytics","host","msg","console","error","jitsuAnalytics","React","createElement","Provider","value","children","useJitsu","opts","jitsuInstance","useContext","echoEvents","Error"],"mappings":";;;;AAOA,IAAMA,YAAY,GAAGC,aAAa,CAAuB,IAAI;;ACC7D,IAAMC,aAAa,GAAmE,SAAhFA,aAAaA,CAAmEC,KAAK,EAAG;AAC5F,EAAA,IAAMC,QAAQ,GAAkBC,OAAO,CAAC,YAAK;AAC3C,IAAA,IAAIF,KAAK,CAACG,OAAO,CAACC,QAAQ,EAAE;MAC1B,OAAO;AAAEC,QAAAA,SAAS,EAAEC,cAAAA;OAAgB,CAAA;KACrC,MAAM,IAAI,CAACN,KAAK,CAACG,OAAO,CAACI,IAAI,EAAE;MAC9B,IAAMC,GAAG,GAAG,6EAA6E,CAAA;AACzFC,MAAAA,OAAO,CAACC,KAAK,CAAA,IAAA,GAAMF,GAAG,EAAI,gC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IAAI,IAAA,IAAA,IAAJA,IAAI,CAAEG,UAAU,EAAE;AACzC,IAAA,MAAM,IAAIC,KAAK,CACb,2IAA2I,CAC5I,CAAA;AAEH,GAAC,MAAM,IAAIH,aAAa,CAACd,SAAS,EAAE;AAClC,IAAA,OAAOc,aAAa,CAAA;AACtB,GAAC,MAAM;IACL,MAAM,IAAIG,KAAK,CAAA,wEAAyE,CAAC,CAAA;AAC3F,GAAA;AACF;;;;"}
@@ -12,9 +12,6 @@ export type ExtendedJitsuOptions = (Omit<JitsuOptions, "host"> & {
12
12
  disabled: true;
13
13
  host?: undefined;
14
14
  };
15
- /**
16
- * See for details http://jitsu.com/docs/sending-data/js-sdk/react
17
- */
18
15
  declare function useJitsu(opts?: ExtendedJitsuOptions): {
19
16
  analytics: AnalyticsInterface;
20
17
  };
package/dist/useJitsu.js CHANGED
@@ -2,33 +2,29 @@
2
2
  import { useContext } from "react";
3
3
  import JitsuContext from "./JitsuContext";
4
4
  import { jitsuAnalytics, emptyAnalytics } from "@jitsu/js";
5
- /**
6
- * See for details http://jitsu.com/docs/sending-data/js-sdk/react
7
- */
8
5
  function useJitsu(opts) {
9
- var jitsuInstance = useContext(JitsuContext);
10
- if (opts === null || opts === void 0 ? void 0 : opts.disabled) {
6
+ let jitsuInstance = useContext(JitsuContext);
7
+ if (opts?.disabled) {
11
8
  return { analytics: emptyAnalytics };
12
9
  }
13
10
  if (!jitsuInstance) {
14
- if ((opts === null || opts === void 0 ? void 0 : opts.host) || (opts === null || opts === void 0 ? void 0 : opts.echoEvents)) {
11
+ if (opts?.host || opts?.echoEvents) {
15
12
  return { analytics: jitsuAnalytics(opts) };
16
13
  }
17
14
  else {
18
- var msg = "Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react";
19
- console.error("%c".concat(msg), "color: red; font-weight: bold;");
15
+ const msg = "Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react";
16
+ console.error(`%c${msg}`, "color: red; font-weight: bold;");
20
17
  return { analytics: emptyAnalytics };
21
18
  }
22
19
  }
23
- else if ((opts === null || opts === void 0 ? void 0 : opts.host) || (opts === null || opts === void 0 ? void 0 : opts.echoEvents)) {
20
+ else if (opts?.host || opts?.echoEvents) {
24
21
  throw new Error("Jitsu client already set up with <JitsuProvider /> and cannot be overridden. Read more in http://jitsu.com/docs/sending-data/js-sdk/react");
25
- //Jitsu analytics is initialized inside provider
26
22
  }
27
23
  else if (jitsuInstance.analytics) {
28
24
  return jitsuInstance;
29
25
  }
30
26
  else {
31
- throw new Error("<JitsuProvider /> is not initialized with undefined analytics instance");
27
+ throw new Error(`<JitsuProvider /> is not initialized with undefined analytics instance`);
32
28
  }
33
29
  }
34
30
  export default useJitsu;
@@ -1 +1 @@
1
- {"version":3,"file":"useJitsu.js","sourceRoot":"","sources":["../src/useJitsu.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAsB,cAAc,EAAgB,cAAc,EAAE,MAAM,WAAW,CAAC;AAc7F;;GAEG;AACH,SAAS,QAAQ,CAAC,IAA2B;IAC3C,IAAI,aAAa,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,EAAE,CAAC;QACnB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IACvC,CAAC;IACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA,EAAE,CAAC;YACnC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,CAAC;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AM,GAAG,GACP,iJAAiJ,CAAC;YACpJ,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC;YAC5D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;QACvC,CAAC;IACH,CAAC;SAAM,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,UAAU,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,2IAA2I,CAC5I,CAAC;IAEJ,CAAC;SAAM,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QACnC,OAAO,aAAa,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC;AAED,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/jitsu-react",
3
- "version": "1.10.4",
3
+ "version": "1.11.0-beta.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -10,8 +10,16 @@
10
10
  "engines": {
11
11
  "node": ">=10"
12
12
  },
13
+ "scripts": {
14
+ "build": "tsc -p . && microbundle build --jsx React.createElement --no-compress --format es,cjs",
15
+ "//build-deps": "Required by turbo ^build-deps - builds dist/ for workspace packages that import this",
16
+ "build-deps": "pnpm run build",
17
+ "//typecheck": "Not a bug below, we need to build it for typecheck pipeline",
18
+ "typecheck": "tsc -p . && microbundle build --jsx React.createElement --no-compress --format es,cjs",
19
+ "clean": "rm -rf dist"
20
+ },
13
21
  "dependencies": {
14
- "@jitsu/js": "1.10.4"
22
+ "@jitsu/js": "workspace:*"
15
23
  },
16
24
  "peerDependencies": {
17
25
  "react": "15.x || 16.x || 17.x || 18.x || 19.x",
@@ -24,22 +32,17 @@
24
32
  }
25
33
  },
26
34
  "devDependencies": {
35
+ "@jitsu/common-config": "workspace:*",
27
36
  "ts-toolbelt": "^9.6.0",
28
37
  "@testing-library/jest-dom": "^6.1.3",
29
38
  "@testing-library/react": "^13.4.0",
30
39
  "@testing-library/user-event": "^14.4.3",
31
40
  "@types/jest": "^29.2.3",
32
- "@types/node": "^18.15.3",
41
+ "@types/node": "catalog:",
33
42
  "microbundle": "^0.15.1",
34
- "typescript": "^5.6.3",
35
- "@babel/plugin-transform-regenerator": "^7.22.10"
43
+ "typescript": "catalog:"
36
44
  },
37
45
  "files": [
38
46
  "dist"
39
- ],
40
- "scripts": {
41
- "build": "pnpm compile && microbundle build --jsx React.createElement --no-compress --format es,cjs",
42
- "compile": "tsc -p .",
43
- "clean": "rm -rf dist"
44
- }
45
- }
47
+ ]
48
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Jitsu Labs, Inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.