@devgateway/dvz-ui-react 1.8.7 → 1.8.8
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/conf/index.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 -0
- package/dist/cjs/tracker/index.js +1 -1
- package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
- package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -0
- package/dist/esm/conf/index.js +1 -2
- package/dist/esm/index.js +76 -73
- package/dist/esm/tracker/InternalTrafficToggle.js +21 -73
- package/dist/esm/tracker/InternalTrafficWatermark.js +67 -0
- package/dist/esm/tracker/index.js +11 -8
- package/dist/esm/tracker/internalTrafficUtils.js +9 -10
- package/dist/esm/tracker/useInternalTrafficBypass.js +34 -0
- package/dist/types/conf/index.d.ts +0 -1
- package/dist/types/tracker/InternalTrafficToggle.d.ts +0 -1
- package/dist/types/tracker/InternalTrafficWatermark.d.ts +13 -0
- package/dist/types/tracker/index.d.ts +2 -0
- package/dist/types/tracker/internalTrafficUtils.d.ts +0 -7
- package/dist/types/tracker/useInternalTrafficBypass.d.ts +13 -0
- package/package.json +1 -1
package/dist/cjs/conf/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _={REACT_APP_WP_API:process.env.VITE_REACT_APP_WP_API??"/wp/wp-json",REACT_APP_API_ROOT:process.env.VITE_REACT_APP_API_ROOT??null,GA_CODE:process.env.VITE_REACT_APP_GA_CODE??"",DEFAULT_LOCALE:process.env.VITE_REACT_APP_DEFAULT_LOCALE??"en"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _={REACT_APP_WP_API:process.env.VITE_REACT_APP_WP_API??"/wp/wp-json",REACT_APP_API_ROOT:process.env.VITE_REACT_APP_API_ROOT??null,GA_CODE:process.env.VITE_REACT_APP_GA_CODE??"",DEFAULT_LOCALE:process.env.VITE_REACT_APP_DEFAULT_LOCALE??"en"};exports.Config=_;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./embeddable/index.js"),c=require("./conf/index.js"),l=require("./layout/ResponsiveContainer.js"),d=require("./layout/ScrollTop.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./embeddable/index.js"),c=require("./conf/index.js"),l=require("./layout/ResponsiveContainer.js"),d=require("./layout/ScrollTop.js"),f=require("./layout/containers/PreviewPageContainer.js"),p=require("./layout/containers/PreviewTypeContainer.js"),m=require("./layout/containers/SlugContainer.js"),q=require("./layout/containers/SlugPostContainer.js"),C=require("./layout/Customizer.js"),T=require("./layout/Layout.js"),g=require("./layout/PreviewComponent.js"),P=require("./layout/Favicon.js"),S=require("./layout/SSRFavicon.js"),I=require("./layout/Loading.js"),h=require("./layout/CustomSemanticSearch.js"),y=require("./layout/Header.js"),v=require("./layout/SearchControl.js"),x=require("./layout/LangSwitcher.js"),A=require("./layout/Footer.js"),H=require("./layout/ClassicHeader.js"),D=require("./layout/FlexWrapDetector.js"),w=require("./layout/FloatingMenuHeader.js"),R=require("./tracker/withGoogleAnalytics.js"),o=require("./tracker/internalTrafficUtils.js"),k=require("./tracker/InternalTrafficToggle.js"),E=require("./tracker/InternalTrafficWatermark.js"),F=require("./tracker/useInternalTrafficBypass.js"),M=require("./redux/store.js"),u=require("./redux/hooks.js"),n=require("./lib/react-intl-redux/index.js"),O=require("./lib/redux-immutable/index.js"),U=require("./translations/en.json.js"),b=require("./translations/fr.json.js"),L=require("./translations/af.json.js"),N=require("./translations/am.json.js"),B=require("./countries.js"),r=require("./utils/data.js"),a=require("./utils/AppMedia.js"),e=require("./utils/semanticUtils.js"),W=require("./embeddable/data/DataConsumer.js"),z=require("./embeddable/data/DataProvider.js"),i=require("./embeddable/data/DataContext.js");require("react/jsx-runtime");require("react");require("./embeddable/data/CategoriesProvider.js");const s=require("./embeddable/utils/parseUtils.js"),K=require("./embeddable/reducers/data.js"),$=require("./lib/react-intl-redux/providers/Provider.js"),J=require("./lib/react-intl-redux/providers/IntlProvider.js");exports.components=t.components;exports.customizer=t.customizer;exports.getComponentByNameIgnoreCase=t.getComponentByNameIgnoreCase;exports.reducers=t.reducers;exports.Config=c.Config;exports.ResponsiveContainer=l.default;exports.ScrollToTop=d.default;exports.PreviewPageContainer=f.default;exports.PreviewTypeContainer=p.default;exports.SlugContainer=m.default;exports.SlugPostContainer=q.default;exports.CustomizerWrapper=C.CustomizerWrapper;exports.RootLayout=T.default;exports.PreviewComponent=g.default;exports.Favicon=P.default;exports.SSRFavicon=S.default;exports.Loading=I.default;exports.CustomSemanticSearch=h.default;exports.Header=y.default;exports.SearchControl=v.default;exports.LangSwitcher=x.default;exports.Footer=A.default;exports.ClassicHeader=H.default;exports.FlexWrapDetector=D.default;exports.FloatingMenuHeader=w.default;exports.withTracker=R.withTracker;exports.clearInternalTrafficCookie=o.clearInternalTrafficCookie;exports.isInternalTrafficEnabled=o.isInternalTrafficEnabled;exports.setInternalTrafficCookie=o.setInternalTrafficCookie;exports.InternalTrafficToggle=k.default;exports.InternalTrafficWatermark=E.default;exports.useInternalTrafficBypass=F.useInternalTrafficBypass;exports.store=M.store;exports.useAppDispatch=u.useAppDispatch;exports.useAppSelector=u.useAppSelector;exports.UPDATE=n.UPDATE;exports.initialState=n.initialState;exports.intlReducer=n.intlReducer;exports.updateIntl=n.updateIntl;exports.combineReducers=O.combineReducers;exports.englishTranslations=U;exports.frenchTranslations=b;exports.afrikaansTranslations=L;exports.amharicTranslations=N;exports.COUNTRY_OPTIONS=B.COUNTRY_OPTIONS;exports.decodeHtmlEntitiesToHtml=r.decodeHtmlEntitiesToHtml;exports.decodeHtmlEntitiesToText=r.decodeHtmlEntitiesToText;exports.stringToArray=r.stringToArray;exports.toBoolean=r.toBoolean;exports.toNumber=r.toNumber;exports.uriStringToArray=r.uriStringToArray;exports.Media=a.Media;exports.MediaContextProvider=a.MediaContextProvider;exports.mediaStyle=a.mediaStyle;exports.getUnhandledProps=e.getUnhandledProps;exports.htmlImageProps=e.htmlImageProps;exports.htmlInputAttrs=e.htmlInputAttrs;exports.htmlInputEvents=e.htmlInputEvents;exports.htmlInputProps=e.htmlInputProps;exports.partitionHTMLProps=e.partitionHTMLProps;exports.useKeyOnly=e.useKeyOnly;exports.useValueAndKey=e.useValueAndKey;exports.DataConsumer=W.default;exports.DataProvider=z.default;exports.CategoriesContext=i.CategoriesContext;exports.DataContext=i.DataContext;exports.PostsContext=i.PostsContext;exports.compareJsonProps=s.compareJsonProps;exports.decode=s.decode;exports.parse=s.parse;exports.reducer=K;exports.Provider=$.default;exports.IntlProvider=J.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),r=require("semantic-ui-react"),o=require("./useInternalTrafficBypass.js"),u=({redirectTo:n="/"})=>{const{status:e,message:c}=o.useInternalTrafficBypass(n),t=e==="success"?"Success":e==="error"?"Error":"Processing",i=e==="success"?"green":e==="error"?"red":"blue",a=e==="success"?"check circle":e==="error"?"warning sign":"spinner";return s.jsxs(r.Container,{as:"div",children:[s.jsxs(r.Segment,{textAlign:"center",basic:!0,vertical:!0,children:[s.jsx(r.Header,{as:"h1",content:t}),e==="success"&&s.jsx(r.Message,{size:"small",content:"Redirecting to home page in 3 seconds..."})]}),s.jsx(r.Segment,{vertical:!0,children:s.jsx(r.Message,{size:"large",icon:a,color:i,content:c})})]})};exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),t=require("react"),i=require("semantic-ui-react"),d=require("./internalTrafficUtils.js"),M=()=>{const[f,r]=t.useState(!1),[g,x]=t.useState(!1),[n,a]=t.useState({x:-20,y:-20}),[o,l]=t.useState(!1),[u,p]=t.useState({x:0,y:0});t.useEffect(()=>{if(typeof document>"u")return;x(!0),r(d.isInternalTrafficEnabled()),typeof window<"u"&&a({x:window.innerWidth-200,y:window.innerHeight-40});const e=()=>{r(d.isInternalTrafficEnabled())};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]);const y=e=>{l(!0),p({x:e.clientX-n.x,y:e.clientY-n.y})},b=e=>{o&&a({x:e.clientX-u.x,y:e.clientY-u.y})},c=()=>{l(!1)};if(!g||!f)return null;const w={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,zIndex:999999,willChange:o?"transform":"auto",cursor:o?"grabbing":"grab"};return s.jsx("div",{style:w,onMouseDown:y,onMouseMove:b,onMouseUp:c,onMouseLeave:c,role:"status","aria-label":"GA bypass enabled. Drag to move this notification.",children:s.jsx(i.Popup,{content:"Drag to move",position:"left center",trigger:s.jsxs(i.Label,{color:"yellow",image:!0,children:[s.jsx(i.Icon,{name:"spinner",loading:!0,color:"red"}),"GA Bypass Enabled"]})})})};exports.default=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./withGoogleAnalytics.js"),e=require("./internalTrafficUtils.js"),a=require("./InternalTrafficToggle.js");exports.withTracker=r.withTracker;exports.clearInternalTrafficCookie=e.clearInternalTrafficCookie;exports.isInternalTrafficEnabled=e.isInternalTrafficEnabled;exports.setInternalTrafficCookie=e.setInternalTrafficCookie;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./withGoogleAnalytics.js"),e=require("./internalTrafficUtils.js"),a=require("./InternalTrafficToggle.js"),n=require("./InternalTrafficWatermark.js"),t=require("./useInternalTrafficBypass.js");exports.withTracker=r.withTracker;exports.clearInternalTrafficCookie=e.clearInternalTrafficCookie;exports.isInternalTrafficEnabled=e.isInternalTrafficEnabled;exports.setInternalTrafficCookie=e.setInternalTrafficCookie;exports.InternalTrafficToggle=a.default;exports.InternalTrafficWatermark=n.default;exports.useInternalTrafficBypass=t.useInternalTrafficBypass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="_ga_internal_traffic",c=365*24*60*60,i=e=>{if(typeof document>"u")return;const o=e?"1":"0",n="/";document.cookie=`${t}=${o}; max-age=${c}; path=${n}; SameSite=Lax`,console.log(`Internal traffic cookie ${e?"enabled":"disabled"}`)},r=()=>{if(typeof document>"u")return!1;const e=document.cookie.split(";");for(const o of e){const[n,a]=o.trim().split("=");if(n===t)return a==="1"}return!1},f=()=>{typeof document>"u"||(document.cookie=`${t}=; max-age=0; path=/; SameSite=Lax`,console.log("Internal traffic cookie cleared"))};exports.clearInternalTrafficCookie=f;exports.isInternalTrafficEnabled=r;exports.setInternalTrafficCookie=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),l=require("react-router"),m=require("./internalTrafficUtils.js"),d=e=>e instanceof Error?`Error: ${e.message}`:"Error: Unknown error",k=(e="/")=>{const i=l.useNavigate(),[n]=l.useSearchParams(),[u,r]=c.useState("validating"),[g,s]=c.useState("Processing...");return c.useEffect(()=>{const t=n.get("enable");if(!n.get("k")){r("error"),s("Missing token parameter. Use ?k=your_token"),console.error("Missing token parameter");return}if(!t){r("error"),s("Missing enable parameter. Use ?enable=0 or ?enable=1"),console.error("Missing enable parameter");return}if(t!=="0"&&t!=="1"){r("error"),s("Invalid enable parameter. Use ?enable=0 or ?enable=1"),console.error("Invalid enable parameter:",t);return}const o=t==="1",f=o?"✓ Internal traffic enabled. GA4 events will be tagged as internal.":"✓ Internal traffic disabled. GA4 events will be tagged as external.",b=`Internal traffic ${o?"enabled":"disabled"} successfully`;try{m.setInternalTrafficCookie(o),r("success"),s(f),console.log(b);const a=setTimeout(()=>{i(e)},3e3);return()=>clearTimeout(a)}catch(a){r("error"),s(d(a)),console.error("Error setting internal traffic cookie:",a)}},[n,i,e]),{status:u,message:g}};exports.useInternalTrafficBypass=k;
|
package/dist/esm/conf/index.js
CHANGED
|
@@ -2,8 +2,7 @@ const _ = {
|
|
|
2
2
|
REACT_APP_WP_API: process.env.VITE_REACT_APP_WP_API ?? "/wp/wp-json",
|
|
3
3
|
REACT_APP_API_ROOT: process.env.VITE_REACT_APP_API_ROOT ?? null,
|
|
4
4
|
GA_CODE: process.env.VITE_REACT_APP_GA_CODE ?? "",
|
|
5
|
-
DEFAULT_LOCALE: process.env.VITE_REACT_APP_DEFAULT_LOCALE ?? "en"
|
|
6
|
-
INTERNAL_GA_TOKEN: process.env.VITE_INTERNAL_GA_TOKEN ?? ""
|
|
5
|
+
DEFAULT_LOCALE: process.env.VITE_REACT_APP_DEFAULT_LOCALE ?? "en"
|
|
7
6
|
};
|
|
8
7
|
export {
|
|
9
8
|
_ as Config
|
package/dist/esm/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { components as i, customizer as l, getComponentByNameIgnoreCase as d, re
|
|
|
2
2
|
import { Config as c } from "./conf/index.js";
|
|
3
3
|
import { default as C } from "./layout/ResponsiveContainer.js";
|
|
4
4
|
import { default as P } from "./layout/ScrollTop.js";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
5
|
+
import { default as S } from "./layout/containers/PreviewPageContainer.js";
|
|
6
|
+
import { default as v } from "./layout/containers/PreviewTypeContainer.js";
|
|
7
7
|
import { default as A } from "./layout/containers/SlugContainer.js";
|
|
8
8
|
import { default as D } from "./layout/containers/SlugPostContainer.js";
|
|
9
9
|
import { CustomizerWrapper as k } from "./layout/Customizer.js";
|
|
@@ -11,66 +11,69 @@ import { default as E } from "./layout/Layout.js";
|
|
|
11
11
|
import { default as L } from "./layout/PreviewComponent.js";
|
|
12
12
|
import { default as N } from "./layout/Favicon.js";
|
|
13
13
|
import { default as b } from "./layout/SSRFavicon.js";
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
14
|
+
import { default as U } from "./layout/Loading.js";
|
|
15
|
+
import { default as z } from "./layout/CustomSemanticSearch.js";
|
|
16
16
|
import { default as J } from "./layout/Header.js";
|
|
17
17
|
import { default as Y } from "./layout/SearchControl.js";
|
|
18
18
|
import { default as j } from "./layout/LangSwitcher.js";
|
|
19
19
|
import { default as G } from "./layout/Footer.js";
|
|
20
20
|
import { default as X } from "./layout/ClassicHeader.js";
|
|
21
21
|
import { default as $ } from "./layout/FlexWrapDetector.js";
|
|
22
|
-
import { default as
|
|
23
|
-
import { withTracker as
|
|
24
|
-
import { clearInternalTrafficCookie as
|
|
25
|
-
import { default as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import
|
|
31
|
-
import
|
|
22
|
+
import { default as er } from "./layout/FloatingMenuHeader.js";
|
|
23
|
+
import { withTracker as tr } from "./tracker/withGoogleAnalytics.js";
|
|
24
|
+
import { clearInternalTrafficCookie as fr, isInternalTrafficEnabled as sr, setInternalTrafficCookie as pr } from "./tracker/internalTrafficUtils.js";
|
|
25
|
+
import { default as nr } from "./tracker/InternalTrafficToggle.js";
|
|
26
|
+
import { default as lr } from "./tracker/InternalTrafficWatermark.js";
|
|
27
|
+
import { useInternalTrafficBypass as xr } from "./tracker/useInternalTrafficBypass.js";
|
|
28
|
+
import { store as cr } from "./redux/store.js";
|
|
29
|
+
import { useAppDispatch as Cr, useAppSelector as gr } from "./redux/hooks.js";
|
|
30
|
+
import { UPDATE as Ir, initialState as Sr, intlReducer as hr, updateIntl as vr } from "./lib/react-intl-redux/index.js";
|
|
31
|
+
import { combineReducers as Ar } from "./lib/redux-immutable/index.js";
|
|
32
|
+
import * as r from "./translations/en.json.js";
|
|
33
|
+
import * as e from "./translations/fr.json.js";
|
|
32
34
|
import * as o from "./translations/af.json.js";
|
|
33
35
|
import * as t from "./translations/am.json.js";
|
|
34
|
-
import { COUNTRY_OPTIONS as
|
|
35
|
-
import { decodeHtmlEntitiesToHtml as
|
|
36
|
-
import { Media as
|
|
37
|
-
import { getUnhandledProps as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { CategoriesContext as
|
|
36
|
+
import { COUNTRY_OPTIONS as Dr } from "./countries.js";
|
|
37
|
+
import { decodeHtmlEntitiesToHtml as kr, decodeHtmlEntitiesToText as wr, stringToArray as Er, toBoolean as Fr, toNumber as Lr, uriStringToArray as Mr } from "./utils/data.js";
|
|
38
|
+
import { Media as Or, MediaContextProvider as br, mediaStyle as Br } from "./utils/AppMedia.js";
|
|
39
|
+
import { getUnhandledProps as Wr, htmlImageProps as zr, htmlInputAttrs as Kr, htmlInputEvents as Jr, htmlInputProps as Vr, partitionHTMLProps as Yr, useKeyOnly as _r, useValueAndKey as jr } from "./utils/semanticUtils.js";
|
|
40
|
+
import { default as Gr } from "./embeddable/data/DataConsumer.js";
|
|
41
|
+
import { default as Xr } from "./embeddable/data/DataProvider.js";
|
|
42
|
+
import { CategoriesContext as $r, DataContext as re, PostsContext as ee } from "./embeddable/data/DataContext.js";
|
|
41
43
|
import "react/jsx-runtime";
|
|
42
44
|
import "react";
|
|
43
45
|
import "./embeddable/data/CategoriesProvider.js";
|
|
44
|
-
import { compareJsonProps as
|
|
46
|
+
import { compareJsonProps as te, decode as ae, parse as fe } from "./embeddable/utils/parseUtils.js";
|
|
45
47
|
import * as p from "./embeddable/reducers/data.js";
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
+
import { default as pe } from "./lib/react-intl-redux/providers/Provider.js";
|
|
49
|
+
import { default as ne } from "./lib/react-intl-redux/providers/IntlProvider.js";
|
|
48
50
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
Dr as COUNTRY_OPTIONS,
|
|
52
|
+
$r as CategoriesContext,
|
|
51
53
|
X as ClassicHeader,
|
|
52
54
|
c as Config,
|
|
53
|
-
|
|
55
|
+
z as CustomSemanticSearch,
|
|
54
56
|
k as CustomizerWrapper,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
Gr as DataConsumer,
|
|
58
|
+
re as DataContext,
|
|
59
|
+
Xr as DataProvider,
|
|
58
60
|
N as Favicon,
|
|
59
61
|
$ as FlexWrapDetector,
|
|
60
|
-
|
|
62
|
+
er as FloatingMenuHeader,
|
|
61
63
|
G as Footer,
|
|
62
64
|
J as Header,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
nr as InternalTrafficToggle,
|
|
66
|
+
lr as InternalTrafficWatermark,
|
|
67
|
+
ne as IntlProvider,
|
|
65
68
|
j as LangSwitcher,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
U as Loading,
|
|
70
|
+
Or as Media,
|
|
71
|
+
br as MediaContextProvider,
|
|
72
|
+
ee as PostsContext,
|
|
70
73
|
L as PreviewComponent,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
S as PreviewPageContainer,
|
|
75
|
+
v as PreviewTypeContainer,
|
|
76
|
+
pe as Provider,
|
|
74
77
|
C as ResponsiveContainer,
|
|
75
78
|
E as RootLayout,
|
|
76
79
|
b as SSRFavicon,
|
|
@@ -78,44 +81,44 @@ export {
|
|
|
78
81
|
Y as SearchControl,
|
|
79
82
|
A as SlugContainer,
|
|
80
83
|
D as SlugPostContainer,
|
|
81
|
-
|
|
84
|
+
Ir as UPDATE,
|
|
82
85
|
o as afrikaansTranslations,
|
|
83
86
|
t as amharicTranslations,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
fr as clearInternalTrafficCookie,
|
|
88
|
+
Ar as combineReducers,
|
|
89
|
+
te as compareJsonProps,
|
|
87
90
|
i as components,
|
|
88
91
|
l as customizer,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
ae as decode,
|
|
93
|
+
kr as decodeHtmlEntitiesToHtml,
|
|
94
|
+
wr as decodeHtmlEntitiesToText,
|
|
95
|
+
r as englishTranslations,
|
|
96
|
+
e as frenchTranslations,
|
|
94
97
|
d as getComponentByNameIgnoreCase,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
Wr as getUnhandledProps,
|
|
99
|
+
zr as htmlImageProps,
|
|
100
|
+
Kr as htmlInputAttrs,
|
|
101
|
+
Jr as htmlInputEvents,
|
|
102
|
+
Vr as htmlInputProps,
|
|
103
|
+
Sr as initialState,
|
|
104
|
+
hr as intlReducer,
|
|
105
|
+
sr as isInternalTrafficEnabled,
|
|
106
|
+
Br as mediaStyle,
|
|
107
|
+
fe as parse,
|
|
108
|
+
Yr as partitionHTMLProps,
|
|
106
109
|
p as reducer,
|
|
107
110
|
x as reducers,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
pr as setInternalTrafficCookie,
|
|
112
|
+
cr as store,
|
|
113
|
+
Er as stringToArray,
|
|
114
|
+
Fr as toBoolean,
|
|
115
|
+
Lr as toNumber,
|
|
116
|
+
vr as updateIntl,
|
|
117
|
+
Mr as uriStringToArray,
|
|
118
|
+
Cr as useAppDispatch,
|
|
119
|
+
gr as useAppSelector,
|
|
120
|
+
xr as useInternalTrafficBypass,
|
|
121
|
+
_r as useKeyOnly,
|
|
122
|
+
jr as useValueAndKey,
|
|
123
|
+
tr as withTracker
|
|
121
124
|
};
|
|
@@ -1,76 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
), console.log(`Internal traffic ${r ? "enabled" : "disabled"} successfully`), setTimeout(() => {
|
|
22
|
-
f(c);
|
|
23
|
-
}, 3e3);
|
|
24
|
-
} catch (r) {
|
|
25
|
-
s("error"), t(`Error: ${r instanceof Error ? r.message : "Unknown error"}`), console.error("Error setting internal traffic cookie:", r);
|
|
26
|
-
}
|
|
27
|
-
}, [a, l, f, c]);
|
|
28
|
-
const m = {
|
|
29
|
-
display: "flex",
|
|
30
|
-
justifyContent: "center",
|
|
31
|
-
alignItems: "center",
|
|
32
|
-
minHeight: "100vh",
|
|
33
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
|
|
34
|
-
}, i = {
|
|
35
|
-
textAlign: "center",
|
|
36
|
-
padding: "2rem",
|
|
37
|
-
borderRadius: "8px",
|
|
38
|
-
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
39
|
-
maxWidth: "500px"
|
|
40
|
-
}, b = e === "success" ? {
|
|
41
|
-
...i,
|
|
42
|
-
backgroundColor: "#f0f9ff",
|
|
43
|
-
borderLeft: "4px solid #10b981"
|
|
44
|
-
} : e === "error" ? {
|
|
45
|
-
...i,
|
|
46
|
-
backgroundColor: "#fef2f2",
|
|
47
|
-
borderLeft: "4px solid #ef4444"
|
|
48
|
-
} : {
|
|
49
|
-
...i,
|
|
50
|
-
backgroundColor: "#f3f4f6",
|
|
51
|
-
borderLeft: "4px solid #3b82f6"
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */ o("div", { style: m, children: /* @__PURE__ */ p("div", { style: b, children: [
|
|
54
|
-
/* @__PURE__ */ o("h1", { style: {
|
|
55
|
-
fontSize: "1.5rem",
|
|
56
|
-
fontWeight: "600",
|
|
57
|
-
margin: "0 0 1rem 0",
|
|
58
|
-
color: e === "success" ? "#059669" : e === "error" ? "#dc2626" : "#1f2937"
|
|
59
|
-
}, children: e === "success" ? "Success" : e === "error" ? "Error" : "Processing" }),
|
|
60
|
-
/* @__PURE__ */ o("p", { style: {
|
|
61
|
-
fontSize: "1rem",
|
|
62
|
-
margin: "1rem 0",
|
|
63
|
-
color: e === "success" ? "#047857" : e === "error" ? "#991b1b" : "#374151",
|
|
64
|
-
lineHeight: "1.5"
|
|
65
|
-
}, children: g }),
|
|
66
|
-
e === "success" && /* @__PURE__ */ o("p", { style: {
|
|
67
|
-
fontSize: "0.875rem",
|
|
68
|
-
color: "#6b7280",
|
|
69
|
-
marginTop: "1.5rem",
|
|
70
|
-
fontStyle: "italic"
|
|
71
|
-
}, children: "Redirecting to home page in 3 seconds..." })
|
|
72
|
-
] }) });
|
|
1
|
+
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Container as a, Segment as n, Header as i, Message as c } from "semantic-ui-react";
|
|
3
|
+
import { useInternalTrafficBypass as g } from "./useInternalTrafficBypass.js";
|
|
4
|
+
const p = ({ redirectTo: o = "/" }) => {
|
|
5
|
+
const { status: e, message: t } = g(o);
|
|
6
|
+
return /* @__PURE__ */ r(a, { as: "div", children: [
|
|
7
|
+
/* @__PURE__ */ r(n, { textAlign: "center", basic: !0, vertical: !0, children: [
|
|
8
|
+
/* @__PURE__ */ s(i, { as: "h1", content: e === "success" ? "Success" : e === "error" ? "Error" : "Processing" }),
|
|
9
|
+
e === "success" && /* @__PURE__ */ s(c, { size: "small", content: "Redirecting to home page in 3 seconds..." })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ s(n, { vertical: !0, children: /* @__PURE__ */ s(
|
|
12
|
+
c,
|
|
13
|
+
{
|
|
14
|
+
size: "large",
|
|
15
|
+
icon: e === "success" ? "check circle" : e === "error" ? "warning sign" : "spinner",
|
|
16
|
+
color: e === "success" ? "green" : e === "error" ? "red" : "blue",
|
|
17
|
+
content: t
|
|
18
|
+
}
|
|
19
|
+
) })
|
|
20
|
+
] });
|
|
73
21
|
};
|
|
74
22
|
export {
|
|
75
|
-
|
|
23
|
+
p as default
|
|
76
24
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as s, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as n, useEffect as b } from "react";
|
|
3
|
+
import { Popup as h, Label as M, Icon as v } from "semantic-ui-react";
|
|
4
|
+
import { isInternalTrafficEnabled as f } from "./internalTrafficUtils.js";
|
|
5
|
+
const S = () => {
|
|
6
|
+
const [c, r] = n(!1), [u, g] = n(!1), [t, i] = n({ x: -20, y: -20 }), [o, a] = n(!1), [l, p] = n({ x: 0, y: 0 });
|
|
7
|
+
b(() => {
|
|
8
|
+
if (typeof document > "u") return;
|
|
9
|
+
g(!0), r(f()), typeof window < "u" && i({
|
|
10
|
+
x: window.innerWidth - 200,
|
|
11
|
+
y: window.innerHeight - 40
|
|
12
|
+
});
|
|
13
|
+
const e = () => {
|
|
14
|
+
r(f());
|
|
15
|
+
};
|
|
16
|
+
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
17
|
+
}, []);
|
|
18
|
+
const m = (e) => {
|
|
19
|
+
a(!0), p({
|
|
20
|
+
x: e.clientX - t.x,
|
|
21
|
+
y: e.clientY - t.y
|
|
22
|
+
});
|
|
23
|
+
}, x = (e) => {
|
|
24
|
+
o && i({
|
|
25
|
+
x: e.clientX - l.x,
|
|
26
|
+
y: e.clientY - l.y
|
|
27
|
+
});
|
|
28
|
+
}, d = () => {
|
|
29
|
+
a(!1);
|
|
30
|
+
};
|
|
31
|
+
if (!u || !c)
|
|
32
|
+
return null;
|
|
33
|
+
const y = {
|
|
34
|
+
position: "fixed",
|
|
35
|
+
left: `${t.x}px`,
|
|
36
|
+
top: `${t.y}px`,
|
|
37
|
+
zIndex: 999999,
|
|
38
|
+
willChange: o ? "transform" : "auto",
|
|
39
|
+
cursor: o ? "grabbing" : "grab"
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ s(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
style: y,
|
|
45
|
+
onMouseDown: m,
|
|
46
|
+
onMouseMove: x,
|
|
47
|
+
onMouseUp: d,
|
|
48
|
+
onMouseLeave: d,
|
|
49
|
+
role: "status",
|
|
50
|
+
"aria-label": "GA bypass enabled. Drag to move this notification.",
|
|
51
|
+
children: /* @__PURE__ */ s(
|
|
52
|
+
h,
|
|
53
|
+
{
|
|
54
|
+
content: "Drag to move",
|
|
55
|
+
position: "left center",
|
|
56
|
+
trigger: /* @__PURE__ */ w(M, { color: "yellow", image: !0, children: [
|
|
57
|
+
/* @__PURE__ */ s(v, { name: "spinner", loading: !0, color: "red" }),
|
|
58
|
+
"GA Bypass Enabled"
|
|
59
|
+
] })
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
S as default
|
|
67
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { withTracker as
|
|
2
|
-
import { clearInternalTrafficCookie as
|
|
3
|
-
import { default as
|
|
1
|
+
import { withTracker as e } from "./withGoogleAnalytics.js";
|
|
2
|
+
import { clearInternalTrafficCookie as t, isInternalTrafficEnabled as o, setInternalTrafficCookie as n } from "./internalTrafficUtils.js";
|
|
3
|
+
import { default as i } from "./InternalTrafficToggle.js";
|
|
4
|
+
import { default as T } from "./InternalTrafficWatermark.js";
|
|
5
|
+
import { useInternalTrafficBypass as m } from "./useInternalTrafficBypass.js";
|
|
4
6
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t as
|
|
7
|
+
i as InternalTrafficToggle,
|
|
8
|
+
T as InternalTrafficWatermark,
|
|
9
|
+
t as clearInternalTrafficCookie,
|
|
10
|
+
o as isInternalTrafficEnabled,
|
|
8
11
|
n as setInternalTrafficCookie,
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
m as useInternalTrafficBypass,
|
|
13
|
+
e as withTracker
|
|
11
14
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = "_ga_internal_traffic";
|
|
2
2
|
const c = (e) => {
|
|
3
3
|
if (typeof document > "u") return;
|
|
4
|
-
const
|
|
5
|
-
document.cookie = `${
|
|
4
|
+
const o = e ? "1" : "0", n = "/";
|
|
5
|
+
document.cookie = `${t}=${o}; max-age=31536000; path=${n}; SameSite=Lax`, console.log(`Internal traffic cookie ${e ? "enabled" : "disabled"}`);
|
|
6
6
|
}, i = () => {
|
|
7
7
|
if (typeof document > "u") return !1;
|
|
8
8
|
const e = document.cookie.split(";");
|
|
9
|
-
for (const
|
|
10
|
-
const [n, a] =
|
|
11
|
-
if (n ===
|
|
9
|
+
for (const o of e) {
|
|
10
|
+
const [n, a] = o.trim().split("=");
|
|
11
|
+
if (n === t)
|
|
12
12
|
return a === "1";
|
|
13
13
|
}
|
|
14
14
|
return !1;
|
|
15
15
|
}, r = () => {
|
|
16
|
-
typeof document > "u" || (document.cookie = `${
|
|
17
|
-
}
|
|
16
|
+
typeof document > "u" || (document.cookie = `${t}=; max-age=0; path=/; SameSite=Lax`, console.log("Internal traffic cookie cleared"));
|
|
17
|
+
};
|
|
18
18
|
export {
|
|
19
19
|
r as clearInternalTrafficCookie,
|
|
20
20
|
i as isInternalTrafficEnabled,
|
|
21
|
-
c as setInternalTrafficCookie
|
|
22
|
-
f as validateToken
|
|
21
|
+
c as setInternalTrafficCookie
|
|
23
22
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useState as c, useEffect as b } from "react";
|
|
2
|
+
import { useNavigate as m, useSearchParams as p } from "react-router";
|
|
3
|
+
import { setInternalTrafficCookie as d } from "./internalTrafficUtils.js";
|
|
4
|
+
const k = (e) => e instanceof Error ? `Error: ${e.message}` : "Error: Unknown error", T = (e = "/") => {
|
|
5
|
+
const l = m(), [n] = p(), [i, r] = c("validating"), [g, s] = c("Processing...");
|
|
6
|
+
return b(() => {
|
|
7
|
+
const t = n.get("enable");
|
|
8
|
+
if (!n.get("k")) {
|
|
9
|
+
r("error"), s("Missing token parameter. Use ?k=your_token"), console.error("Missing token parameter");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!t) {
|
|
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 };
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
T as useInternalTrafficBypass
|
|
34
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
declare const InternalTrafficWatermark: React.FC;
|
|
13
|
+
export default InternalTrafficWatermark;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './withGoogleAnalytics';
|
|
2
2
|
export * from './internalTrafficUtils';
|
|
3
3
|
export { default as InternalTrafficToggle } from './InternalTrafficToggle';
|
|
4
|
+
export { default as InternalTrafficWatermark } from './InternalTrafficWatermark';
|
|
5
|
+
export { useInternalTrafficBypass } from './useInternalTrafficBypass';
|
|
@@ -15,10 +15,3 @@ export declare const isInternalTrafficEnabled: () => boolean;
|
|
|
15
15
|
* Clear the internal traffic cookie
|
|
16
16
|
*/
|
|
17
17
|
export declare const clearInternalTrafficCookie: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* Validate the token against the expected value
|
|
20
|
-
* @param providedToken - The token from query params
|
|
21
|
-
* @param expectedToken - The expected token from environment
|
|
22
|
-
* @returns true if tokens match, false otherwise
|
|
23
|
-
*/
|
|
24
|
-
export declare const validateToken: (providedToken: string | null, expectedToken: string) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface BypassStatus {
|
|
2
|
+
status: 'validating' | 'success' | 'error';
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
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;
|
|
13
|
+
export {};
|