@xylabs/sdk-react 2.8.2 → 2.9.1
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/components/BasePage/BasePage.js +2 -2
- package/dist/components/BasePage/BasePage.js.map +1 -1
- package/dist/components/BasePage/BasePage.stories.js +4 -0
- package/dist/components/BasePage/BasePage.stories.js.map +1 -1
- package/dist/components/BasePage/BasePageProps.d.ts +2 -0
- package/dist/components/dialogs/ErrorDialog.d.ts +1 -1
- package/dist/components/dialogs/ErrorDialog.js.map +1 -1
- package/dist/esm2017/components/BasePage/BasePageProps.d.ts +2 -0
- package/dist/esm2017/components/dialogs/ErrorDialog.d.ts +1 -1
- package/dist/esm2017/index.js +34 -18
- package/dist/esm2017/index.js.map +1 -1
- package/dist/esm2017/lib/Tracking/Snapchat/Snaptr.d.ts +1 -3
- package/dist/esm5/components/BasePage/BasePageProps.d.ts +2 -0
- package/dist/esm5/components/dialogs/ErrorDialog.d.ts +1 -1
- package/dist/esm5/index.js +34 -18
- package/dist/esm5/index.js.map +1 -1
- package/dist/esm5/lib/Tracking/Snapchat/Snaptr.d.ts +1 -3
- package/dist/lib/Tracking/Google/Gtag.js +8 -7
- package/dist/lib/Tracking/Google/Gtag.js.map +1 -1
- package/dist/lib/Tracking/Reddit/Rdt.js +4 -1
- package/dist/lib/Tracking/Reddit/Rdt.js.map +1 -1
- package/dist/lib/Tracking/Snapchat/Snaptr.d.ts +1 -3
- package/dist/lib/Tracking/Snapchat/Snaptr.js +18 -7
- package/dist/lib/Tracking/Snapchat/Snaptr.js.map +1 -1
- package/dist/lib/Tracking/Tiktok/Ttq.js +4 -1
- package/dist/lib/Tracking/Tiktok/Ttq.js.map +1 -1
- package/dist/node/components/BasePage/BasePageProps.d.ts +2 -0
- package/dist/node/components/dialogs/ErrorDialog.d.ts +1 -1
- package/dist/node/index.js +34 -18
- package/dist/node/index.js.map +1 -1
- package/dist/node/lib/Tracking/Snapchat/Snaptr.d.ts +1 -3
- package/dist/node-esm/components/BasePage/BasePageProps.d.ts +2 -0
- package/dist/node-esm/components/dialogs/ErrorDialog.d.ts +1 -1
- package/dist/node-esm/index.js +34 -18
- package/dist/node-esm/index.js.map +1 -1
- package/dist/node-esm/lib/Tracking/Snapchat/Snaptr.d.ts +1 -3
- package/package.json +28 -29
- package/rollup.config.js +1 -1
- package/src/components/BasePage/BasePage.stories.tsx +5 -0
- package/src/components/BasePage/BasePage.tsx +3 -0
- package/src/components/BasePage/BasePageProps.ts +2 -0
- package/src/components/dialogs/ErrorDialog.tsx +0 -1
- package/src/lib/Tracking/Google/Gtag.ts +7 -5
- package/src/lib/Tracking/Reddit/Rdt.ts +4 -1
- package/src/lib/Tracking/Snapchat/Snaptr.ts +8 -9
- package/src/lib/Tracking/Tiktok/Ttq.ts +4 -1
- package/xylabs-sdk-react-v2.8.2.tgz +0 -0
- package/xylabs-sdk-react-v2.7.25.tgz +0 -0
package/package.json
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"url": "https://github.com/xylabs/sdk-react/issues"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@types/
|
|
13
|
-
"@
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"lodash": "^4
|
|
17
|
-
"md5": "^2
|
|
18
|
-
"numeral": "^2
|
|
19
|
-
"query-string": "^7
|
|
20
|
-
"react-helmet": "^6
|
|
21
|
-
"react-icons": "^4
|
|
12
|
+
"@types/react-helmet": "^6",
|
|
13
|
+
"@xylabs/sdk-js": "^2",
|
|
14
|
+
"axios": "^0",
|
|
15
|
+
"bn.js": "^5",
|
|
16
|
+
"lodash": "^4",
|
|
17
|
+
"md5": "^2",
|
|
18
|
+
"numeral": "^2",
|
|
19
|
+
"query-string": "^7",
|
|
20
|
+
"react-helmet": "^6",
|
|
21
|
+
"react-icons": "^4"
|
|
22
22
|
},
|
|
23
23
|
"description": "Common React library for all XY Labs projects that use React",
|
|
24
24
|
"devDependencies": {
|
|
@@ -26,34 +26,34 @@
|
|
|
26
26
|
"@emotion/react": "^11.7.1",
|
|
27
27
|
"@emotion/styled": "^11.6.0",
|
|
28
28
|
"@ethersproject/abstract-signer": "^5.5.0",
|
|
29
|
-
"@ethersproject/providers": "^5.5.
|
|
30
|
-
"@mui/icons-material": "^5.
|
|
31
|
-
"@mui/material": "^5.
|
|
32
|
-
"@mui/styles": "^5.
|
|
29
|
+
"@ethersproject/providers": "^5.5.2",
|
|
30
|
+
"@mui/icons-material": "^5.3.0",
|
|
31
|
+
"@mui/material": "^5.3.0",
|
|
32
|
+
"@mui/styles": "^5.3.0",
|
|
33
33
|
"@rollup/plugin-image": "^2.1.1",
|
|
34
34
|
"@rollup/plugin-json": "^4.1.0",
|
|
35
35
|
"@rollup/plugin-replace": "^3.0.1",
|
|
36
36
|
"@rollup/plugin-strip": "^2.1.0",
|
|
37
37
|
"@rollup/plugin-typescript": "^8.3.0",
|
|
38
|
-
"@storybook/addon-actions": "^6.4.
|
|
39
|
-
"@storybook/addon-docs": "^6.4.
|
|
40
|
-
"@storybook/addon-essentials": "^6.4.
|
|
41
|
-
"@storybook/addon-links": "^6.4.
|
|
42
|
-
"@storybook/components": "^6.4.
|
|
43
|
-
"@storybook/core-events": "^6.4.
|
|
44
|
-
"@storybook/react": "^6.4.
|
|
38
|
+
"@storybook/addon-actions": "^6.4.13",
|
|
39
|
+
"@storybook/addon-docs": "^6.4.13",
|
|
40
|
+
"@storybook/addon-essentials": "^6.4.13",
|
|
41
|
+
"@storybook/addon-links": "^6.4.13",
|
|
42
|
+
"@storybook/components": "^6.4.13",
|
|
43
|
+
"@storybook/core-events": "^6.4.13",
|
|
44
|
+
"@storybook/react": "^6.4.13",
|
|
45
45
|
"@types/bn.js": "^5.1.0",
|
|
46
46
|
"@types/lodash": "^4.14.178",
|
|
47
47
|
"@types/md5": "^2.3.1",
|
|
48
|
-
"@types/node": "^17.0.
|
|
48
|
+
"@types/node": "^17.0.10",
|
|
49
|
+
"@types/numeral": "^2",
|
|
49
50
|
"@types/react": "^17",
|
|
50
51
|
"@xylabs/eslint-config-react": "^2",
|
|
51
|
-
"@xylabs/pixel": "^1.2.
|
|
52
|
-
"@xylabs/rollup-config": "^1.
|
|
52
|
+
"@xylabs/pixel": "^1.2.6",
|
|
53
|
+
"@xylabs/rollup-config": "^1.1.1",
|
|
53
54
|
"@xylabs/ts-scripts": "^1.0.24",
|
|
54
|
-
"@xylabs/tsconfig": "^1.0.
|
|
55
|
+
"@xylabs/tsconfig": "^1.0.9",
|
|
55
56
|
"babel-loader": "^8.2.3",
|
|
56
|
-
"bn.js": "^5.2.0",
|
|
57
57
|
"copyfiles": "^2.4.1",
|
|
58
58
|
"eslint": "^8",
|
|
59
59
|
"eslint-plugin-prettier": "^4.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"react-dom": "^17.0.2",
|
|
65
65
|
"react-router-dom": "^6",
|
|
66
66
|
"rollbar": "^2",
|
|
67
|
-
"rollup": "^2.
|
|
67
|
+
"rollup": "^2.64.0",
|
|
68
68
|
"rollup-plugin-svg": "^2.0.0",
|
|
69
69
|
"ts-node": "^10.4.0",
|
|
70
70
|
"tslib": "^2.3.1",
|
|
@@ -103,7 +103,6 @@
|
|
|
103
103
|
"@mui/styles": "^5",
|
|
104
104
|
"@xylabs/pixel": "^1",
|
|
105
105
|
"@xylabs/sdk-js": "^2",
|
|
106
|
-
"bn.js": "^5",
|
|
107
106
|
"react": "^17",
|
|
108
107
|
"react-dom": "^17",
|
|
109
108
|
"react-router-dom": "^6"
|
|
@@ -131,5 +130,5 @@
|
|
|
131
130
|
},
|
|
132
131
|
"sideEffects": false,
|
|
133
132
|
"types": "dist/index.d.ts",
|
|
134
|
-
"version": "2.
|
|
133
|
+
"version": "2.9.1"
|
|
135
134
|
}
|
package/rollup.config.js
CHANGED
|
@@ -15,8 +15,13 @@ const StorybookEntry = {
|
|
|
15
15
|
|
|
16
16
|
const Template: ComponentStory<typeof BasePage> = (args) => <BasePage {...args}></BasePage>
|
|
17
17
|
|
|
18
|
+
const AppBar = () => <div>AppBar</div>
|
|
19
|
+
const FilterBar = () => <div>FilterBar</div>
|
|
20
|
+
|
|
18
21
|
const Default = Template.bind({})
|
|
19
22
|
Default.args = {
|
|
23
|
+
appBar: <AppBar />,
|
|
24
|
+
filterBar: <FilterBar />,
|
|
20
25
|
title: 'Default',
|
|
21
26
|
}
|
|
22
27
|
|
|
@@ -18,7 +18,9 @@ const BasePage: React.FC<BasePageProps> = ({
|
|
|
18
18
|
appFooter,
|
|
19
19
|
appBar,
|
|
20
20
|
cookieConsent,
|
|
21
|
+
filterBar,
|
|
21
22
|
hideAppBar,
|
|
23
|
+
hideFilterBar,
|
|
22
24
|
noindex = false,
|
|
23
25
|
scrollToTopButton = false,
|
|
24
26
|
title,
|
|
@@ -40,6 +42,7 @@ const BasePage: React.FC<BasePageProps> = ({
|
|
|
40
42
|
<Helmet title={title}>{noindex ? <meta content="noindex" name="robots" /> : null}</Helmet>
|
|
41
43
|
{scrollToTopButton ? <div id={scrollToTopAnchorId} /> : null}
|
|
42
44
|
{hideAppBar ? null : appBar}
|
|
45
|
+
{hideFilterBar ? null : filterBar}
|
|
43
46
|
{beta ? (
|
|
44
47
|
<FlexRow
|
|
45
48
|
margin={1}
|
|
@@ -9,7 +9,9 @@ interface BasePageProps extends BoxProps {
|
|
|
9
9
|
beta?: boolean
|
|
10
10
|
container?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
11
11
|
disableGutters?: boolean
|
|
12
|
+
filterBar?: ReactElement
|
|
12
13
|
hideAppBar?: boolean
|
|
14
|
+
hideFilterBar?: boolean
|
|
13
15
|
hideFooter?: boolean
|
|
14
16
|
noindex?: boolean
|
|
15
17
|
cookieConsent?: ReactNode
|
|
@@ -21,11 +21,13 @@ class Gtag {
|
|
|
21
21
|
this.ga4id = ga4id
|
|
22
22
|
this.awid = awid
|
|
23
23
|
this.domains = domains
|
|
24
|
-
global.dataLayer = global.dataLayer
|
|
25
|
-
this.gtag =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
global.dataLayer = global.dataLayer ?? []
|
|
25
|
+
this.gtag =
|
|
26
|
+
global.gtag ??
|
|
27
|
+
function () {
|
|
28
|
+
// eslint-disable-next-line prefer-rest-params
|
|
29
|
+
global.dataLayer.push(arguments)
|
|
30
|
+
}
|
|
29
31
|
global.gtag = this.gtag
|
|
30
32
|
this.gtag('js', new Date())
|
|
31
33
|
this.gtag('config', ga4id)
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
import { delay } from '@xylabs/sdk-js'
|
|
2
|
+
|
|
1
3
|
import { global } from '../../global'
|
|
2
4
|
|
|
3
5
|
class SnapTr {
|
|
4
|
-
static pixelId?: string
|
|
5
|
-
|
|
6
6
|
public static getSnapTr() {
|
|
7
|
-
|
|
7
|
+
if (global.snaptr) {
|
|
8
|
+
return global.snaptr
|
|
9
|
+
}
|
|
10
|
+
console.warn('Missing snaptr')
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
public static instance: SnapTr
|
|
11
|
-
public static init(pixelId: string) {
|
|
12
|
-
this.pixelId = pixelId
|
|
13
|
-
this.track('PAGE_VIEW')
|
|
14
|
-
}
|
|
15
14
|
|
|
16
|
-
public static track<T>(event: string, data?: T) {
|
|
17
|
-
this.getSnapTr()('init', this.pixelId)
|
|
15
|
+
public static async track<T>(event: string, data?: T) {
|
|
18
16
|
this.getSnapTr()('track', event, data)
|
|
17
|
+
await delay(0)
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
|
|
Binary file
|
|
Binary file
|