@devgateway/dvz-ui-react 1.9.1 → 1.9.3
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/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
- package/dist/cjs/embeddable/newsletter/index.js +1 -1
- package/dist/cjs/embeddable/sankeychart/index.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
- package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
- package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
- package/dist/cjs/tracker/index.js +1 -1
- package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
- package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
- package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
- package/dist/esm/embeddable/chart/Line.js +209 -207
- package/dist/esm/embeddable/data-paragraph/index.js +119 -119
- package/dist/esm/embeddable/filter/index.js +113 -113
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
- package/dist/esm/embeddable/newsletter/index.js +35 -38
- package/dist/esm/embeddable/sankeychart/index.js +145 -145
- package/dist/esm/embeddable/showcase/index.js +27 -27
- package/dist/esm/embeddable/tabbedposts/index.js +40 -39
- package/dist/esm/embeddable/utils/parseUtils.js +11 -3
- package/dist/esm/index.js +74 -73
- package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
- package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
- package/dist/esm/tracker/index.js +9 -8
- package/dist/esm/tracker/internalTrafficUtils.js +18 -13
- package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
- package/dist/types/embeddable/chart/Line.d.ts +2 -0
- package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
- package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
- package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
- package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
- package/package.json +1 -1
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const o = "_ga_internal_traffic", n = "_ga_internal_traffic_expires";
|
|
2
|
+
const r = (e) => {
|
|
3
3
|
if (typeof document > "u") return;
|
|
4
|
-
const
|
|
5
|
-
document.cookie = `${
|
|
4
|
+
const t = e ? "1" : "0";
|
|
5
|
+
document.cookie = `${o}=${t}; max-age=31536000; path=/; SameSite=Lax`, e ? localStorage.setItem(n, String(Date.now() + 31536e6)) : localStorage.removeItem(n);
|
|
6
6
|
}, i = () => {
|
|
7
7
|
if (typeof document > "u") return !1;
|
|
8
|
-
const e
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (n === t)
|
|
12
|
-
return a === "1";
|
|
8
|
+
for (const e of document.cookie.split(";")) {
|
|
9
|
+
const [t, a] = e.trim().split("=");
|
|
10
|
+
if (t === o) return a === "1";
|
|
13
11
|
}
|
|
14
12
|
return !1;
|
|
15
|
-
},
|
|
16
|
-
typeof
|
|
13
|
+
}, c = () => {
|
|
14
|
+
if (typeof localStorage > "u") return null;
|
|
15
|
+
const e = localStorage.getItem(n);
|
|
16
|
+
if (!e) return null;
|
|
17
|
+
const t = parseInt(e, 10);
|
|
18
|
+
return isNaN(t) ? null : new Date(t);
|
|
19
|
+
}, f = () => {
|
|
20
|
+
typeof document > "u" || (document.cookie = `${o}=; max-age=0; path=/; SameSite=Lax`, localStorage.removeItem(n));
|
|
17
21
|
};
|
|
18
22
|
export {
|
|
19
|
-
|
|
23
|
+
f as clearInternalTrafficCookie,
|
|
24
|
+
c as getInternalTrafficExpiry,
|
|
20
25
|
i as isInternalTrafficEnabled,
|
|
21
|
-
|
|
26
|
+
r as setInternalTrafficCookie
|
|
22
27
|
};
|
|
@@ -1,34 +1,16 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
r("error"), s("Missing enable parameter. Use ?enable=0 or ?enable=1"), console.error("Missing enable parameter");
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (t !== "0" && t !== "1") {
|
|
17
|
-
r("error"), s("Invalid enable parameter. Use ?enable=0 or ?enable=1"), console.error("Invalid enable parameter:", t);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const o = t === "1", u = o ? "✓ Internal traffic enabled. GA4 events will be tagged as internal." : "✓ Internal traffic disabled. GA4 events will be tagged as external.", f = `Internal traffic ${o ? "enabled" : "disabled"} successfully`;
|
|
21
|
-
try {
|
|
22
|
-
d(o), r("success"), s(u), console.log(f);
|
|
23
|
-
const a = setTimeout(() => {
|
|
24
|
-
l(e);
|
|
25
|
-
}, 3e3);
|
|
26
|
-
return () => clearTimeout(a);
|
|
27
|
-
} catch (a) {
|
|
28
|
-
r("error"), s(k(a)), console.error("Error setting internal traffic cookie:", a);
|
|
29
|
-
}
|
|
30
|
-
}, [n, l, e]), { status: i, message: g };
|
|
1
|
+
import { useState as n } from "react";
|
|
2
|
+
import { isInternalTrafficEnabled as l, getInternalTrafficExpiry as o, setInternalTrafficCookie as f } from "./internalTrafficUtils.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const [t, r] = n(
|
|
5
|
+
() => typeof document < "u" ? l() : !1
|
|
6
|
+
), [s, a] = n(
|
|
7
|
+
() => typeof localStorage < "u" ? o() : null
|
|
8
|
+
);
|
|
9
|
+
return { isEnabled: t, expiresAt: s, toggle: () => {
|
|
10
|
+
const e = !t;
|
|
11
|
+
f(e), r(e), a(e ? o() : null);
|
|
12
|
+
} };
|
|
31
13
|
};
|
|
32
14
|
export {
|
|
33
|
-
|
|
15
|
+
d as useInternalTrafficBypass
|
|
34
16
|
};
|
|
@@ -59,6 +59,7 @@ declare const _default: React.FC<import('react-intl').WithIntlProps<{
|
|
|
59
59
|
lineXAxisTickMode: any;
|
|
60
60
|
lineXAxisTickCount: any;
|
|
61
61
|
lineXAxisTickEvery: any;
|
|
62
|
+
chartHeight: any;
|
|
62
63
|
}>> & {
|
|
63
64
|
WrappedComponent: React.ComponentType<{
|
|
64
65
|
editing: any;
|
|
@@ -120,6 +121,7 @@ declare const _default: React.FC<import('react-intl').WithIntlProps<{
|
|
|
120
121
|
lineXAxisTickMode: any;
|
|
121
122
|
lineXAxisTickCount: any;
|
|
122
123
|
lineXAxisTickEvery: any;
|
|
124
|
+
chartHeight: any;
|
|
123
125
|
}>;
|
|
124
126
|
};
|
|
125
127
|
export default _default;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
redirectTo?: string;
|
|
4
|
-
}
|
|
5
|
-
declare const InternalTrafficToggle: React.FC<InternalTrafficToggleProps>;
|
|
2
|
+
declare const InternalTrafficToggle: React.FC;
|
|
6
3
|
export default InternalTrafficToggle;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* InternalTrafficWatermark
|
|
4
|
-
*
|
|
5
|
-
* Displays a watermark badge indicating that internal traffic bypassing
|
|
6
|
-
* is enabled. This ensures staff members know they are not contributing
|
|
7
|
-
* to Google Analytics statistics when browsing with this setting enabled.
|
|
8
|
-
*
|
|
9
|
-
* The watermark is only rendered when the _ga_internal_traffic cookie is
|
|
10
|
-
* set to '1', and it updates reactively if the cookie state changes.
|
|
11
|
-
*/
|
|
12
2
|
declare const InternalTrafficWatermark: React.FC;
|
|
13
3
|
export default InternalTrafficWatermark;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for managing internal traffic detection via first-party cookies
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Set a first-party cookie to mark this session as internal traffic
|
|
6
|
-
* @param enable - Whether to enable (true) or disable (false) internal traffic tracking
|
|
7
|
-
*/
|
|
8
1
|
export declare const setInternalTrafficCookie: (enable: boolean) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Check if internal traffic cookie is enabled
|
|
11
|
-
* @returns true if the internal traffic cookie is set to '1', false otherwise
|
|
12
|
-
*/
|
|
13
2
|
export declare const isInternalTrafficEnabled: () => boolean;
|
|
14
|
-
|
|
15
|
-
* Clear the internal traffic cookie
|
|
16
|
-
*/
|
|
3
|
+
export declare const getInternalTrafficExpiry: () => Date | null;
|
|
17
4
|
export declare const clearInternalTrafficCookie: () => void;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
interface BypassStatus {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
isEnabled: boolean;
|
|
3
|
+
expiresAt: Date | null;
|
|
4
|
+
toggle: () => void;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
* Custom hook to handle internal traffic GA bypass logic
|
|
7
|
-
* Processes URL query parameters and manages cookie state
|
|
8
|
-
*
|
|
9
|
-
* @param redirectTo - URL to redirect to after successful toggle (default: '/')
|
|
10
|
-
* @returns Object containing status, message, and validation state
|
|
11
|
-
*/
|
|
12
|
-
export declare const useInternalTrafficBypass: (redirectTo?: string) => BypassStatus;
|
|
6
|
+
export declare const useInternalTrafficBypass: () => BypassStatus;
|
|
13
7
|
export {};
|