@onsvisual/svelte-components 0.1.69 → 0.1.70

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.
@@ -8,6 +8,7 @@ export default class AnalyticsBanner extends SvelteComponentTyped<{
8
8
  analyticsProps?: any;
9
9
  hideBanner?: boolean;
10
10
  usageCookies?: boolean;
11
+ pageViewEnabled?: boolean;
11
12
  }, {
12
13
  [evt: string]: CustomEvent<any>;
13
14
  }, {}> {
@@ -23,6 +24,7 @@ declare const __propDef: {
23
24
  analyticsProps?: object;
24
25
  hideBanner?: boolean;
25
26
  usageCookies?: boolean;
27
+ pageViewEnabled?: boolean;
26
28
  };
27
29
  events: {
28
30
  [evt: string]: CustomEvent<any>;
@@ -34,6 +34,11 @@
34
34
  * @type {"wide"|"wider"}
35
35
  */
36
36
  export let width = "wide";
37
+ /**
38
+ * Enable automatic pageView event on route changes
39
+ * @type {boolean}
40
+ */
41
+ export let pageViewEnabled = true;
37
42
 
38
43
  let live; // Don't run analytics unless page is live on ONS site (re-set in the onMount function)
39
44
  let showBanner = false;
@@ -119,7 +124,7 @@
119
124
  }
120
125
  }
121
126
  }
122
- $: onPageChange($page);
127
+ $: if (pageViewEnabled) onPageChange($page);
123
128
 
124
129
  onMount(() => {
125
130
  live = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.69",
3
+ "version": "0.1.70",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",