@jitsu/jitsu-react 0.0.0-alpha.96 → 0.0.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.
- package/dist/JitsuContext.d.ts +1 -1
- package/dist/JitsuProvider.d.ts +2 -2
- package/dist/index.js +45 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +48 -14
- package/dist/index.modern.js.map +1 -1
- package/dist/useJitsu.d.ts +21 -15
- package/package.json +7 -10
- package/dist/client.d.ts +0 -4
- package/dist/index.es.js +0 -47
- package/dist/index.es.js.map +0 -1
package/dist/JitsuContext.d.ts
CHANGED
package/dist/JitsuProvider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { ExtendedJitsuOptions } from "./useJitsu";
|
|
4
4
|
declare const JitsuProvider: React.FC<PropsWithChildren<{
|
|
5
|
-
options:
|
|
5
|
+
options: ExtendedJitsuOptions;
|
|
6
6
|
}>>;
|
|
7
7
|
export default JitsuProvider;
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,77 @@
|
|
|
1
1
|
var React = require('react');
|
|
2
|
+
var src = require('@jitsu/js/compiled/src');
|
|
2
3
|
var js = require('@jitsu/js');
|
|
3
4
|
|
|
4
5
|
var JitsuContext = React.createContext(null);
|
|
5
6
|
|
|
6
7
|
var JitsuProvider = function JitsuProvider(props) {
|
|
7
|
-
|
|
8
|
+
if (props.options.disabled) {
|
|
9
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
10
|
+
}
|
|
11
|
+
if (!props.options.host) {
|
|
12
|
+
var msg = "<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized";
|
|
13
|
+
console.error("%c" + msg, "color: red; font-size: 16px; font-weight: bold;");
|
|
14
|
+
console.error(msg);
|
|
15
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
16
|
+
}
|
|
17
|
+
var analytics = src.jitsuAnalytics(props.options);
|
|
8
18
|
return React.createElement(JitsuContext.Provider, {
|
|
9
|
-
value:
|
|
19
|
+
value: analytics
|
|
10
20
|
}, props.children);
|
|
11
21
|
};
|
|
12
22
|
|
|
23
|
+
var emptyAnalytics = {
|
|
24
|
+
analytics: {
|
|
25
|
+
track: function track() {
|
|
26
|
+
return Promise.resolve();
|
|
27
|
+
},
|
|
28
|
+
page: function page() {
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
},
|
|
31
|
+
user: function user() {
|
|
32
|
+
return {};
|
|
33
|
+
},
|
|
34
|
+
identify: function identify() {
|
|
35
|
+
return Promise.resolve({});
|
|
36
|
+
},
|
|
37
|
+
reset: function reset() {
|
|
38
|
+
return Promise.resolve({});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
13
42
|
function useJitsu(opts) {
|
|
14
|
-
var _opts$
|
|
43
|
+
var _opts$before;
|
|
44
|
+
if (opts !== null && opts !== void 0 && opts.disabled) {
|
|
45
|
+
return emptyAnalytics;
|
|
46
|
+
}
|
|
15
47
|
var cl = React.useContext(JitsuContext);
|
|
16
48
|
if (!cl) {
|
|
17
|
-
if (opts !== null && opts !== void 0 && opts.host) {
|
|
49
|
+
if (opts !== null && opts !== void 0 && opts.host || opts !== null && opts !== void 0 && opts.echoEvents) {
|
|
18
50
|
cl = js.jitsuAnalytics(opts);
|
|
19
51
|
} else {
|
|
20
|
-
|
|
52
|
+
var msg = "Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react";
|
|
53
|
+
console.error("%c" + msg, "color: red; font-size: 16px; font-weight: bold;");
|
|
54
|
+
return emptyAnalytics;
|
|
21
55
|
}
|
|
22
|
-
} else if (opts !== null && opts !== void 0 && opts.host) {
|
|
56
|
+
} else if (opts !== null && opts !== void 0 && opts.host || opts !== null && opts !== void 0 && opts.echoEvents) {
|
|
23
57
|
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");
|
|
24
58
|
}
|
|
25
59
|
var client = cl;
|
|
26
|
-
var reactLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter
|
|
27
|
-
var before = opts !== null && opts !== void 0 && opts.
|
|
28
|
-
var nextjsLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter
|
|
60
|
+
var reactLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter : null;
|
|
61
|
+
var before = opts !== null && opts !== void 0 && opts.before ? opts.before.effect : null;
|
|
62
|
+
var nextjsLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter : null;
|
|
29
63
|
React.useEffect(function () {
|
|
30
64
|
if (before) {
|
|
31
65
|
before(client);
|
|
32
66
|
}
|
|
33
|
-
}, (opts === null || opts === void 0 ? void 0 : (_opts$
|
|
67
|
+
}, (opts === null || opts === void 0 ? void 0 : (_opts$before = opts.before) === null || _opts$before === void 0 ? void 0 : _opts$before.deps) || []);
|
|
34
68
|
React.useEffect(function () {
|
|
35
69
|
if (reactLocationHook) {
|
|
36
70
|
client.page();
|
|
37
71
|
} else if (nextjsLocationHook) {
|
|
38
72
|
client.page();
|
|
39
73
|
}
|
|
40
|
-
}, [reactLocationHook, nextjsLocationHook]);
|
|
74
|
+
}, [reactLocationHook, nextjsLocationHook === null || nextjsLocationHook === void 0 ? void 0 : nextjsLocationHook.asPath]);
|
|
41
75
|
return {
|
|
42
76
|
analytics: client
|
|
43
77
|
};
|
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":["import { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nconst JitsuContext = createContext<AnalyticsInterface | null>(null);\n\nexport default JitsuContext;\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport { jitsuAnalytics } from \"@jitsu/js/compiled/src\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n if (props.options.disabled) {\n return <React.Fragment>{props.children}</React.Fragment>;\n }\n 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-size: 16px; font-weight: bold;\");\n console.error(msg);\n return <React.Fragment>{props.children}</React.Fragment>;\n }\n const analytics = jitsuAnalytics(props.options);\n return <JitsuContext.Provider value={analytics}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","import { useContext, useEffect } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport type { useLocation } from \"react-router-dom\";\nimport type { useRouter } from \"next/router\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type RouterOptions =\n | { reactRouter: ReturnType<typeof useLocation>; nextjsRouter?: never }\n | { reactRouter?: never; nextjsRouter: ReturnType<typeof useRouter> };\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n autoPageTracking?: RouterOptions;\n echoEvents?: boolean;\n before?: BeforeEffect;\n })\n | { disabled: true };\n\n\nconst emptyAnalytics = {\n analytics: {\n track: () => Promise.resolve(),\n page: () => Promise.resolve(),\n user: () => ({}),\n identify: () => Promise.resolve({}),\n reset: () => Promise.resolve({}),\n },\n};\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n if (opts?.disabled) {\n return emptyAnalytics;\n }\n let cl = useContext(JitsuContext);\n if (!cl) {\n if (opts?.host || opts?.echoEvents) {\n cl = 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-size: 16px; font-weight: bold;\");\n return 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 }\n const client = cl;\n\n const reactLocationHook: ReturnType<typeof useLocation> | null =\n opts?.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter : null;\n const before = opts?.before ? opts.before.effect : null;\n const nextjsLocationHook =\n opts?.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter : null;\n useEffect(() => {\n if (before) {\n before(client);\n }\n }, opts?.before?.deps || []);\n\n useEffect(() => {\n if (reactLocationHook) {\n client.page();\n } else if (nextjsLocationHook) {\n client.page();\n }\n }, [reactLocationHook, nextjsLocationHook?.asPath]);\n\n return { analytics: client };\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","options","disabled","React","children","host","msg","console","error","analytics","jitsuAnalytics","Provider","value","emptyAnalytics","track","Promise","resolve","page","user","identify","reset","useJitsu","opts","cl","useContext","echoEvents","Error","client","reactLocationHook","autoPageTracking","reactRouter","before","effect","nextjsLocationHook","next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,EAAE;KACd,MAAM,IAAIgB,kBAAkB,EAAE;MAC7BN,MAAM,CAACV,IAAI,EAAE;;GAEhB,EAAE,CAACW,iBAAiB,EAAEK,kBAAkB,aAAlBA,kBAAkB,uBAAlBA,kBAAkB,CAAEI,MAAM,CAAC,CAAC;EAEnD,OAAO;IAAE5B,SAAS,EAAEkB;GAAQ;AAC9B;;;;;;"}
|
package/dist/index.modern.js
CHANGED
|
@@ -1,43 +1,77 @@
|
|
|
1
|
-
import { createContext, createElement, useContext, useEffect } from 'react';
|
|
2
|
-
import { jitsuAnalytics } from '@jitsu/js';
|
|
1
|
+
import { createContext, createElement, Fragment, useContext, useEffect } from 'react';
|
|
2
|
+
import { jitsuAnalytics } from '@jitsu/js/compiled/src';
|
|
3
|
+
import { jitsuAnalytics as jitsuAnalytics$1 } from '@jitsu/js';
|
|
3
4
|
|
|
4
5
|
var JitsuContext = createContext(null);
|
|
5
6
|
|
|
6
7
|
var JitsuProvider = function JitsuProvider(props) {
|
|
7
|
-
|
|
8
|
+
if (props.options.disabled) {
|
|
9
|
+
return createElement(Fragment, null, props.children);
|
|
10
|
+
}
|
|
11
|
+
if (!props.options.host) {
|
|
12
|
+
var msg = "<JitsuProvider />. Jitsu host is not defined. Jitsu will not be initialized";
|
|
13
|
+
console.error("%c" + msg, "color: red; font-size: 16px; font-weight: bold;");
|
|
14
|
+
console.error(msg);
|
|
15
|
+
return createElement(Fragment, null, props.children);
|
|
16
|
+
}
|
|
17
|
+
var analytics = jitsuAnalytics(props.options);
|
|
8
18
|
return createElement(JitsuContext.Provider, {
|
|
9
|
-
value:
|
|
19
|
+
value: analytics
|
|
10
20
|
}, props.children);
|
|
11
21
|
};
|
|
12
22
|
|
|
23
|
+
var emptyAnalytics = {
|
|
24
|
+
analytics: {
|
|
25
|
+
track: function track() {
|
|
26
|
+
return Promise.resolve();
|
|
27
|
+
},
|
|
28
|
+
page: function page() {
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
},
|
|
31
|
+
user: function user() {
|
|
32
|
+
return {};
|
|
33
|
+
},
|
|
34
|
+
identify: function identify() {
|
|
35
|
+
return Promise.resolve({});
|
|
36
|
+
},
|
|
37
|
+
reset: function reset() {
|
|
38
|
+
return Promise.resolve({});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
13
42
|
function useJitsu(opts) {
|
|
14
|
-
var _opts$
|
|
43
|
+
var _opts$before;
|
|
44
|
+
if (opts !== null && opts !== void 0 && opts.disabled) {
|
|
45
|
+
return emptyAnalytics;
|
|
46
|
+
}
|
|
15
47
|
var cl = useContext(JitsuContext);
|
|
16
48
|
if (!cl) {
|
|
17
|
-
if (opts !== null && opts !== void 0 && opts.host) {
|
|
18
|
-
cl = jitsuAnalytics(opts);
|
|
49
|
+
if (opts !== null && opts !== void 0 && opts.host || opts !== null && opts !== void 0 && opts.echoEvents) {
|
|
50
|
+
cl = jitsuAnalytics$1(opts);
|
|
19
51
|
} else {
|
|
20
|
-
|
|
52
|
+
var msg = "Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react";
|
|
53
|
+
console.error("%c" + msg, "color: red; font-size: 16px; font-weight: bold;");
|
|
54
|
+
return emptyAnalytics;
|
|
21
55
|
}
|
|
22
|
-
} else if (opts !== null && opts !== void 0 && opts.host) {
|
|
56
|
+
} else if (opts !== null && opts !== void 0 && opts.host || opts !== null && opts !== void 0 && opts.echoEvents) {
|
|
23
57
|
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");
|
|
24
58
|
}
|
|
25
59
|
var client = cl;
|
|
26
|
-
var reactLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter
|
|
27
|
-
var before = opts !== null && opts !== void 0 && opts.
|
|
28
|
-
var nextjsLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter
|
|
60
|
+
var reactLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter : null;
|
|
61
|
+
var before = opts !== null && opts !== void 0 && opts.before ? opts.before.effect : null;
|
|
62
|
+
var nextjsLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter : null;
|
|
29
63
|
useEffect(function () {
|
|
30
64
|
if (before) {
|
|
31
65
|
before(client);
|
|
32
66
|
}
|
|
33
|
-
}, (opts === null || opts === void 0 ? void 0 : (_opts$
|
|
67
|
+
}, (opts === null || opts === void 0 ? void 0 : (_opts$before = opts.before) === null || _opts$before === void 0 ? void 0 : _opts$before.deps) || []);
|
|
34
68
|
useEffect(function () {
|
|
35
69
|
if (reactLocationHook) {
|
|
36
70
|
client.page();
|
|
37
71
|
} else if (nextjsLocationHook) {
|
|
38
72
|
client.page();
|
|
39
73
|
}
|
|
40
|
-
}, [reactLocationHook, nextjsLocationHook]);
|
|
74
|
+
}, [reactLocationHook, nextjsLocationHook === null || nextjsLocationHook === void 0 ? void 0 : nextjsLocationHook.asPath]);
|
|
41
75
|
return {
|
|
42
76
|
analytics: client
|
|
43
77
|
};
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport { AnalyticsInterface } from \"@jitsu/js\";\n\nconst JitsuContext = createContext<AnalyticsInterface | null>(null);\n\nexport default JitsuContext;\n","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport { jitsuAnalytics } from \"@jitsu/js/compiled/src\";\nimport { ExtendedJitsuOptions } from \"./useJitsu\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: ExtendedJitsuOptions }>> = props => {\n if (props.options.disabled) {\n return <React.Fragment>{props.children}</React.Fragment>;\n }\n 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-size: 16px; font-weight: bold;\");\n console.error(msg);\n return <React.Fragment>{props.children}</React.Fragment>;\n }\n const analytics = jitsuAnalytics(props.options);\n return <JitsuContext.Provider value={analytics}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","import { useContext, useEffect } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport type { useLocation } from \"react-router-dom\";\nimport type { useRouter } from \"next/router\";\n\nimport { AnalyticsInterface, jitsuAnalytics, JitsuOptions } from \"@jitsu/js\";\n\nexport interface BeforeEffect {\n effect: (analytics: AnalyticsInterface) => any;\n deps: any[];\n}\n\nexport type RouterOptions =\n | { reactRouter: ReturnType<typeof useLocation>; nextjsRouter?: never }\n | { reactRouter?: never; nextjsRouter: ReturnType<typeof useRouter> };\n\nexport type ExtendedJitsuOptions =\n | (Omit<JitsuOptions, \"host\"> & { host: string } & {\n disabled?: false | undefined;\n autoPageTracking?: RouterOptions;\n echoEvents?: boolean;\n before?: BeforeEffect;\n })\n | { disabled: true };\n\n\nconst emptyAnalytics = {\n analytics: {\n track: () => Promise.resolve(),\n page: () => Promise.resolve(),\n user: () => ({}),\n identify: () => Promise.resolve({}),\n reset: () => Promise.resolve({}),\n },\n};\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n if (opts?.disabled) {\n return emptyAnalytics;\n }\n let cl = useContext(JitsuContext);\n if (!cl) {\n if (opts?.host || opts?.echoEvents) {\n cl = 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-size: 16px; font-weight: bold;\");\n return 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 }\n const client = cl;\n\n const reactLocationHook: ReturnType<typeof useLocation> | null =\n opts?.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter : null;\n const before = opts?.before ? opts.before.effect : null;\n const nextjsLocationHook =\n opts?.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter : null;\n useEffect(() => {\n if (before) {\n before(client);\n }\n }, opts?.before?.deps || []);\n\n useEffect(() => {\n if (reactLocationHook) {\n client.page();\n } else if (nextjsLocationHook) {\n client.page();\n }\n }, [reactLocationHook, nextjsLocationHook?.asPath]);\n\n return { analytics: client };\n}\n\nexport default useJitsu;\nexport { AnalyticsInterface, JitsuOptions };\n"],"names":["JitsuContext","createContext","JitsuProvider","props","options","disabled","React","children","host","msg","console","error","analytics","jitsuAnalytics","Provider","value","emptyAnalytics","track","Promise","resolve","page","user","identify","reset","useJitsu","opts","cl","useContext","echoEvents","Error","client","reactLocationHook","autoPageTracking","reactRouter","before","effect","nextjsLocationHook","nextjsRouter","useEffect","deps","asPath"],"mappings":";;;;AAGA,IAAMA,YAAY,GAAGC,aAAa,CAA4B,IAAI,CAAC;;ACGnE,IAAMC,aAAa,GAAmE,SAAhFA,aAAa,CAAmEC,KAAK;EACzF,IAAIA,KAAK,CAACC,OAAO,CAACC,QAAQ,EAAE;IAC1B,OAAOC,cAACA,QAAc,QAAEH,KAAK,CAACI,QAAQ,CAAkB;;EAE1D,IAAI,CAACJ,KAAK,CAACC,OA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
-
import { AnalyticsInterface } from "@jitsu/types/analytics";
|
|
2
1
|
import type { useLocation } from "react-router-dom";
|
|
3
2
|
import type { useRouter } from "next/router";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { AnalyticsInterface, JitsuOptions } from "@jitsu/js";
|
|
4
|
+
export interface BeforeEffect {
|
|
5
|
+
effect: (analytics: AnalyticsInterface) => any;
|
|
6
|
+
deps: any[];
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
declare type
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
export declare type RouterOptions = {
|
|
9
|
+
reactRouter: ReturnType<typeof useLocation>;
|
|
10
|
+
nextjsRouter?: never;
|
|
11
|
+
} | {
|
|
12
|
+
reactRouter?: never;
|
|
13
|
+
nextjsRouter: ReturnType<typeof useRouter>;
|
|
14
|
+
};
|
|
15
|
+
export declare type ExtendedJitsuOptions = (Omit<JitsuOptions, "host"> & {
|
|
16
|
+
host: string;
|
|
17
|
+
} & {
|
|
18
|
+
disabled?: false | undefined;
|
|
19
|
+
autoPageTracking?: RouterOptions;
|
|
20
|
+
echoEvents?: boolean;
|
|
21
|
+
before?: BeforeEffect;
|
|
22
|
+
}) | {
|
|
23
|
+
disabled: true;
|
|
19
24
|
};
|
|
20
25
|
/**
|
|
21
26
|
* See for details http://jitsu.com/docs/sending-data/js-sdk/react
|
|
@@ -24,3 +29,4 @@ declare function useJitsu(opts?: ExtendedJitsuOptions): {
|
|
|
24
29
|
analytics: AnalyticsInterface;
|
|
25
30
|
};
|
|
26
31
|
export default useJitsu;
|
|
32
|
+
export { AnalyticsInterface, JitsuOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitsu/jitsu-react",
|
|
3
|
-
"version": "0.0.0
|
|
3
|
+
"version": "0.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"node": ">=10"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@jitsu/js": "0.0.0
|
|
14
|
+
"@jitsu/js": "0.0.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "15.x || 16.x || 17.x || 18.x",
|
|
18
|
+
"@types/react": "15.x || 16.x || 17.x || 18.x",
|
|
18
19
|
"react-router-dom": "5.x || 6.x",
|
|
19
20
|
"next": "12.x || 13.x"
|
|
20
21
|
},
|
|
@@ -28,25 +29,21 @@
|
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"ts-toolbelt": "^9.6.0",
|
|
32
|
+
"@jitsu/js": "0.0.0",
|
|
31
33
|
"@testing-library/jest-dom": "^5.16.5",
|
|
32
34
|
"@testing-library/react": "^13.4.0",
|
|
33
35
|
"@testing-library/user-event": "^14.4.3",
|
|
34
36
|
"@types/jest": "^29.2.3",
|
|
35
37
|
"@types/node": "^18.11.9",
|
|
36
|
-
"@types/react": "^18.0.25",
|
|
37
|
-
"next": "13.0.6",
|
|
38
|
-
"@types/react-router-dom": "^5.3.3",
|
|
39
38
|
"microbundle-crl": "^0.13.11",
|
|
40
|
-
"
|
|
41
|
-
"typescript": "^4.9.3",
|
|
42
|
-
"@jitsu/js": "0.0.0-alpha.96",
|
|
43
|
-
"@jitsu/types": "0.0.0-alpha.96"
|
|
39
|
+
"typescript": "^4.9.3"
|
|
44
40
|
},
|
|
45
41
|
"files": [
|
|
46
42
|
"dist"
|
|
47
43
|
],
|
|
48
44
|
"scripts": {
|
|
49
45
|
"build": "microbundle-crl --no-compress --format es,cjs",
|
|
50
|
-
"compile": "tsc -p ."
|
|
46
|
+
"compile": "tsc -p .",
|
|
47
|
+
"clean": "rm -rf dist"
|
|
51
48
|
}
|
|
52
49
|
}
|
package/dist/client.d.ts
DELETED
package/dist/index.es.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createContext, createElement, useContext, useEffect } from 'react';
|
|
2
|
-
import { jitsuAnalytics } from '@jitsu/js';
|
|
3
|
-
|
|
4
|
-
var JitsuContext = createContext(null);
|
|
5
|
-
|
|
6
|
-
var JitsuProvider = function JitsuProvider(props) {
|
|
7
|
-
var client = jitsuAnalytics(props.options);
|
|
8
|
-
return createElement(JitsuContext.Provider, {
|
|
9
|
-
value: client
|
|
10
|
-
}, props.children);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
function useJitsu(opts) {
|
|
14
|
-
var _opts$autoPageTrackin;
|
|
15
|
-
var cl = useContext(JitsuContext);
|
|
16
|
-
if (!cl) {
|
|
17
|
-
if (opts !== null && opts !== void 0 && opts.host) {
|
|
18
|
-
cl = jitsuAnalytics(opts);
|
|
19
|
-
} else {
|
|
20
|
-
throw new Error("Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react");
|
|
21
|
-
}
|
|
22
|
-
} else if (opts !== null && opts !== void 0 && opts.host) {
|
|
23
|
-
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");
|
|
24
|
-
}
|
|
25
|
-
var client = cl;
|
|
26
|
-
var reactLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter() : null;
|
|
27
|
-
var before = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.before ? opts.autoPageTracking.before : null;
|
|
28
|
-
var nextjsLocationHook = opts !== null && opts !== void 0 && opts.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter() : null;
|
|
29
|
-
useEffect(function () {
|
|
30
|
-
if (before) {
|
|
31
|
-
before(client);
|
|
32
|
-
}
|
|
33
|
-
}, (opts === null || opts === void 0 ? void 0 : (_opts$autoPageTrackin = opts.autoPageTracking) === null || _opts$autoPageTrackin === void 0 ? void 0 : _opts$autoPageTrackin.beforeDeps) || []);
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
if (reactLocationHook) {
|
|
36
|
-
client.page();
|
|
37
|
-
} else if (nextjsLocationHook) {
|
|
38
|
-
client.page();
|
|
39
|
-
}
|
|
40
|
-
}, [reactLocationHook, nextjsLocationHook]);
|
|
41
|
-
return {
|
|
42
|
-
analytics: client
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { JitsuContext, JitsuProvider, useJitsu };
|
|
47
|
-
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/JitsuContext.tsx","../src/JitsuProvider.tsx","../src/useJitsu.ts"],"sourcesContent":["import { createContext } from 'react'\nimport { AnalyticsInterface } from \"@jitsu/types/analytics\";\n\n\nconst JitsuContext = createContext<AnalyticsInterface | null>(null)\n\nexport default JitsuContext","import * as React from \"react\";\nimport { PropsWithChildren } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport { jitsuAnalytics, JitsuOptions } from \"@jitsu/js\";\n\nconst JitsuProvider: React.FC<PropsWithChildren<{ options: JitsuOptions }>> = function (props) {\n const client = jitsuAnalytics(props.options);\n return <JitsuContext.Provider value={client}>{props.children}</JitsuContext.Provider>;\n};\n\nexport default JitsuProvider;\n","import { useContext, useEffect } from \"react\";\nimport JitsuContext from \"./JitsuContext\";\nimport { AnalyticsInterface } from \"@jitsu/types/analytics\";\nimport type { useLocation } from \"react-router-dom\";\nimport type { useRouter } from \"next/router\";\n\nimport { Union } from \"ts-toolbelt\";\nimport { jitsuAnalytics, JitsuOptions } from \"@jitsu/js\";\n\ninterface ReactRouterOptions {\n reactRouter: typeof useLocation;\n}\n\ninterface NextJsRouterOptions {\n nextjsRouter: typeof useRouter;\n}\n\ninterface AutoPageTrackingBefore {\n before: (analytics: AnalyticsInterface) => any;\n beforeDeps: any[];\n}\ntype RouterOptions = Union.Strict<ReactRouterOptions | NextJsRouterOptions>;\n\ntype ExtendedJitsuOptions = JitsuOptions & {\n autoPageTracking?: Union.Strict<(RouterOptions & AutoPageTrackingBefore) | RouterOptions>;\n};\n\n/**\n * See for details http://jitsu.com/docs/sending-data/js-sdk/react\n */\nfunction useJitsu(opts?: ExtendedJitsuOptions): { analytics: AnalyticsInterface } {\n let cl = useContext(JitsuContext);\n if (!cl) {\n if (opts?.host) {\n cl = jitsuAnalytics(opts);\n } else {\n throw new Error(\n \"Before calling useJitsu() hook, please wrap your component into <JitsuProvider />. Read more in http://jitsu.com/docs/sending-data/js-sdk/react\"\n );\n }\n } else if (opts?.host) {\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 }\n const client = cl;\n\n const reactLocationHook =\n opts?.autoPageTracking && opts.autoPageTracking.reactRouter ? opts.autoPageTracking.reactRouter() : null;\n const before = opts?.autoPageTracking && opts.autoPageTracking.before ? opts.autoPageTracking.before : null;\n const nextjsLocationHook =\n opts?.autoPageTracking && opts.autoPageTracking.nextjsRouter ? opts.autoPageTracking.nextjsRouter() : null;\n useEffect(() => {\n if (before) {\n before(client);\n }\n }, opts?.autoPageTracking?.beforeDeps || []);\n\n useEffect(() => {\n if (reactLocationHook) {\n client.page();\n } else if (nextjsLocationHook) {\n client.page();\n }\n }, [reactLocationHook, nextjsLocationHook]);\n\n return { analytics: client };\n}\n\nexport default useJitsu;\n"],"names":["JitsuContext","createContext","JitsuProvider","props","client","jitsuAnalytics","options","React","Provider","value","children","useJitsu","opts","cl","useContext","host","Error","reactLocationHook","autoPageTracking","reactRouter","before","nextjsLocationHook","nextjsRouter","useEffect","beforeDeps","page","analytics"],"mappings":";;;AAIA,IAAMA,YAAY,GAAGC,aAAa,CAA4B,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