@reykjavik/webtools 0.1.5 → 0.1.6
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/CHANGELOG.md +1 -2
- package/esm/next/SiteImprove.js +12 -11
- package/next/SiteImprove.js +12 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/esm/next/SiteImprove.js
CHANGED
|
@@ -59,6 +59,14 @@ export const SiteImprove = (props) => {
|
|
|
59
59
|
(analytics === undefined && props.hasConstented);
|
|
60
60
|
useEffect(() => {
|
|
61
61
|
if (consented) {
|
|
62
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
63
|
+
console.info('Mock loading SiteImprove in development mode.', props.scriptUrl || props.accountId);
|
|
64
|
+
if (!window._sz) {
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
window._sz = window._sz || [];
|
|
67
|
+
}, 300);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
62
70
|
const routerEvents = Router.events;
|
|
63
71
|
routerEvents.on('routeChangeStart', captureRefUrl);
|
|
64
72
|
routerEvents.on('routeChangeComplete', sendRoutingEvent);
|
|
@@ -67,17 +75,10 @@ export const SiteImprove = (props) => {
|
|
|
67
75
|
routerEvents.off('routeChangeComplete', sendRoutingEvent);
|
|
68
76
|
};
|
|
69
77
|
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
75
|
-
console.info('Mock loading SiteImprove in development mode.');
|
|
76
|
-
if (!window._sz) {
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
window._sz = window._sz || [];
|
|
79
|
-
}, 300);
|
|
80
|
-
}
|
|
78
|
+
},
|
|
79
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
80
|
+
[consented]);
|
|
81
|
+
if (!consented || process.env.NODE_ENV !== 'production') {
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
83
84
|
const scriptUrl = props.scriptUrl != null
|
package/next/SiteImprove.js
CHANGED
|
@@ -88,6 +88,14 @@ const SiteImprove = (props) => {
|
|
|
88
88
|
(analytics === undefined && props.hasConstented);
|
|
89
89
|
(0, react_1.useEffect)(() => {
|
|
90
90
|
if (consented) {
|
|
91
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
92
|
+
console.info('Mock loading SiteImprove in development mode.', props.scriptUrl || props.accountId);
|
|
93
|
+
if (!window._sz) {
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
window._sz = window._sz || [];
|
|
96
|
+
}, 300);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
91
99
|
const routerEvents = router_1.Router.events;
|
|
92
100
|
routerEvents.on('routeChangeStart', captureRefUrl);
|
|
93
101
|
routerEvents.on('routeChangeComplete', sendRoutingEvent);
|
|
@@ -96,17 +104,10 @@ const SiteImprove = (props) => {
|
|
|
96
104
|
routerEvents.off('routeChangeComplete', sendRoutingEvent);
|
|
97
105
|
};
|
|
98
106
|
}
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
104
|
-
console.info('Mock loading SiteImprove in development mode.');
|
|
105
|
-
if (!window._sz) {
|
|
106
|
-
setTimeout(() => {
|
|
107
|
-
window._sz = window._sz || [];
|
|
108
|
-
}, 300);
|
|
109
|
-
}
|
|
107
|
+
},
|
|
108
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
|
+
[consented]);
|
|
110
|
+
if (!consented || process.env.NODE_ENV !== 'production') {
|
|
110
111
|
return null;
|
|
111
112
|
}
|
|
112
113
|
const scriptUrl = props.scriptUrl != null
|
package/package.json
CHANGED