@reykjavik/webtools 0.1.4 → 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 CHANGED
@@ -3,9 +3,8 @@
3
3
  ## Upcoming...
4
4
 
5
5
  - ... <!-- Add new lines here. -->
6
- - feat: Relax the Next.js peerDependency version to include v11
7
6
 
8
- ## 0.1.0 – 0.1.4
7
+ ## 0.1.0 – 0.1.6
9
8
 
10
9
  _2023-03-24_
11
10
 
@@ -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
- }, [consented]);
71
- if (!consented) {
72
- return null;
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
@@ -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
- }, [consented]);
100
- if (!consented) {
101
- return null;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reykjavik/webtools",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Misc. JS/TS helpers used by Reykjavík City's web dev teams.",
5
5
  "main": "index.js",
6
6
  "repository": "ssh://git@github.com:reykjavikcity/webtools.git",
@@ -14,9 +14,9 @@
14
14
  "@reykjavik/hanna-utils": "^0.2.3"
15
15
  },
16
16
  "peerDependencies": {
17
- "next": ">11",
18
- "react": ">16.8.0",
19
- "react-dom": ">16.8.0"
17
+ "next": ">=11",
18
+ "react": ">=16.8.0",
19
+ "react-dom": ">=16.8.0"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=16"