@devgateway/dvz-ui-react 1.9.1 → 1.9.2

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.
Files changed (38) hide show
  1. package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -1
  2. package/dist/cjs/embeddable/chart/Line.js +1 -1
  3. package/dist/cjs/embeddable/data-paragraph/index.js +1 -1
  4. package/dist/cjs/embeddable/filter/index.js +1 -1
  5. package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
  6. package/dist/cjs/embeddable/newsletter/index.js +1 -1
  7. package/dist/cjs/embeddable/sankeychart/index.js +1 -1
  8. package/dist/cjs/embeddable/showcase/index.js +1 -1
  9. package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
  10. package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
  11. package/dist/cjs/index.js +1 -1
  12. package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
  13. package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
  14. package/dist/cjs/tracker/index.js +1 -1
  15. package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
  16. package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
  17. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
  18. package/dist/esm/embeddable/chart/Line.js +209 -207
  19. package/dist/esm/embeddable/data-paragraph/index.js +119 -119
  20. package/dist/esm/embeddable/filter/index.js +113 -113
  21. package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
  22. package/dist/esm/embeddable/newsletter/index.js +19 -19
  23. package/dist/esm/embeddable/sankeychart/index.js +145 -145
  24. package/dist/esm/embeddable/showcase/index.js +27 -27
  25. package/dist/esm/embeddable/tabbedposts/index.js +40 -39
  26. package/dist/esm/embeddable/utils/parseUtils.js +11 -3
  27. package/dist/esm/index.js +74 -73
  28. package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
  29. package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
  30. package/dist/esm/tracker/index.js +9 -8
  31. package/dist/esm/tracker/internalTrafficUtils.js +18 -13
  32. package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
  33. package/dist/types/embeddable/chart/Line.d.ts +2 -0
  34. package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
  35. package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
  36. package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
  37. package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
  38. package/package.json +1 -1
@@ -1,22 +1,23 @@
1
1
  import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
2
  import y, { useState as v, useRef as G, useEffect as I } from "react";
3
- import { Container as f, Accordion as p, Icon as V, Menu as T, Grid as w, Label as M, Button as W } from "semantic-ui-react";
3
+ import { Container as b, Accordion as p, Icon as V, Menu as T, Grid as w, Label as M, Button as W } from "semantic-ui-react";
4
4
  import { PostProvider as q, PostConsumer as N, MediaProvider as P, MediaConsumer as k, PostIcon as L, PostLabel as S } from "@devgateway/wp-react-lib";
5
5
  import { injectIntl as E } from "react-intl";
6
6
  import { connect as z } from "react-redux";
7
7
  import A from "../connected-templates/PostIntro.js";
8
8
  import { useWindowDimensionsAndDevice as O } from "../../lib/hooks/window-dimensions.js";
9
- const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.map((l) => /* @__PURE__ */ e(
9
+ import { parse as U } from "../utils/parseUtils.js";
10
+ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.map((l) => /* @__PURE__ */ e(
10
11
  T.Item,
11
12
  {
12
13
  onClick: () => i(l.slug),
13
- className: l.slug === a ? "active" : "",
14
+ className: l.slug === c ? "active" : "",
14
15
  children: n ? /* @__PURE__ */ e(S, { post: l }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: l.title.rendered } }) })
15
16
  },
16
17
  l.id
17
- )) : null, Y = ({
18
+ )) : null, J = ({
18
19
  posts: t,
19
- activeItem: a,
20
+ activeItem: c,
20
21
  setActive: i,
21
22
  showIcons: n,
22
23
  showLabels: l
@@ -27,7 +28,7 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
27
28
  return (d = r._embedded) != null && d["wp:featuredmedia"] && r._embedded["wp:featuredmedia"][0].source_url, /* @__PURE__ */ e(
28
29
  w.Column,
29
30
  {
30
- className: (r.slug === a ? "active" : "") + (n ? " has-icon" : ""),
31
+ className: (r.slug === c ? "active" : "") + (n ? " has-icon" : ""),
31
32
  children: /* @__PURE__ */ g(
32
33
  W,
33
34
  {
@@ -54,12 +55,12 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
54
55
  r.id
55
56
  );
56
57
  }) : null;
57
- }, $ = ({ posts: t, activeItem: a }) => (I(() => {
58
+ }, $ = ({ posts: t, activeItem: c }) => (I(() => {
58
59
  const i = document.querySelector(".ui.container.content-tab");
59
60
  i && (i.scrollTop = 0);
60
- }, [a]), t ? t.map((i) => {
61
+ }, [c]), t ? t.map((i) => {
61
62
  let n = {};
62
- return i.slug !== a ? n = {
63
+ return i.slug !== c ? n = {
63
64
  position: "absolute",
64
65
  left: "-3000px",
65
66
  width: "auto",
@@ -70,10 +71,10 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
70
71
  visibility: "visible",
71
72
  position: "relative",
72
73
  width: "auto"
73
- }, /* @__PURE__ */ e(A, { as: f, fluid: !0, post: i, style: n }, i.slug);
74
- }) : null), J = ({ posts: t, activeItem: a, setActive: i }) => {
74
+ }, /* @__PURE__ */ e(A, { as: b, fluid: !0, post: i, style: n }, i.slug);
75
+ }) : null), K = ({ posts: t, activeItem: c, setActive: i }) => {
75
76
  const [n, l] = v(
76
- t.findIndex((s) => s.slug === a)
77
+ t.findIndex((s) => s.slug === c)
77
78
  ), [o, r] = v(null), d = G(null);
78
79
  I(() => {
79
80
  if (o) {
@@ -85,12 +86,12 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
85
86
  }
86
87
  }, [o]);
87
88
  const m = (s, u) => {
88
- const { index: c } = u, h = n === c ? -1 : c;
89
- l(h), i(t[c].slug), h !== -1 && r(s.currentTarget);
89
+ const { index: a } = u, h = n === a ? -1 : a;
90
+ l(h), i(t[a].slug), h !== -1 && r(s.currentTarget);
90
91
  };
91
92
  return /* @__PURE__ */ e(p, { fluid: !0, styled: !0, children: t.map((s, u) => {
92
93
  var h;
93
- const c = (h = s.meta_fields) != null && h.icon ? s.meta_fields.icon[0] : null;
94
+ const a = (h = s.meta_fields) != null && h.icon ? s.meta_fields.icon[0] : null;
94
95
  return /* @__PURE__ */ g(y.Fragment, { children: [
95
96
  /* @__PURE__ */ e(
96
97
  p.Title,
@@ -109,12 +110,12 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
109
110
  },
110
111
  children: [
111
112
  /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center" }, children: [
112
- c && /* @__PURE__ */ e(P, { id: c, children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(L, { className: "icon" }) }) }),
113
+ a && /* @__PURE__ */ e(P, { id: a, children: /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(L, { className: "icon" }) }) }),
113
114
  /* @__PURE__ */ e(
114
115
  "span",
115
116
  {
116
117
  dangerouslySetInnerHTML: { __html: s.title.rendered },
117
- style: { marginLeft: c ? "10px" : "0" }
118
+ style: { marginLeft: a ? "10px" : "0" }
118
119
  }
119
120
  )
120
121
  ] }),
@@ -129,12 +130,12 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
129
130
  {
130
131
  className: "accordion-post-content",
131
132
  active: n === u,
132
- children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(A, { post: s, as: f, fluid: !0 }) })
133
+ children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(A, { post: s, as: b, fluid: !0 }) })
133
134
  }
134
135
  )
135
136
  ] }, s.id);
136
137
  }) });
137
- }, K = ({ posts: t, showLabels: a, height: i }) => {
138
+ }, Q = ({ posts: t, showLabels: c, height: i }) => {
138
139
  const [n, l] = v(t ? t[0].slug : null);
139
140
  return I(() => {
140
141
  setTimeout(() => {
@@ -145,19 +146,19 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
145
146
  }, 0);
146
147
  }, [t]), /* @__PURE__ */ g(y.Fragment, { children: [
147
148
  t.map((o) => /* @__PURE__ */ e("anchor", { id: o.slug }, o.slug)),
148
- /* @__PURE__ */ e(T, { className: "tabbed posts", text: !0, children: /* @__PURE__ */ e(U, { showLabels: a, posts: t, setActive: l, activeItem: n }) }),
149
- /* @__PURE__ */ e(f, { className: "content-tab", style: { height: `${i}px` }, children: /* @__PURE__ */ e($, { posts: t, activeItem: n }) })
149
+ /* @__PURE__ */ e(T, { className: "tabbed posts", text: !0, children: /* @__PURE__ */ e(Y, { showLabels: c, posts: t, setActive: l, activeItem: n }) }),
150
+ /* @__PURE__ */ e(b, { className: "content-tab", style: { height: `${i}px` }, children: /* @__PURE__ */ e($, { posts: t, activeItem: n }) })
150
151
  ] });
151
- }, Q = ({ posts: t, showLabels: a, showIcons: i, height: n }) => {
152
+ }, X = ({ posts: t, showLabels: c, showIcons: i, height: n }) => {
152
153
  const [l, o] = v(t ? t[0].slug : null);
153
154
  return /* @__PURE__ */ e(y.Fragment, { children: /* @__PURE__ */ g(w, { stackable: !0, className: "tabbed posts", columns: t.length, style: { height: n + "px" }, children: [
154
- /* @__PURE__ */ e(Y, { showIcons: i, showLabels: a, posts: t, activeItem: l, setActive: o }),
155
- /* @__PURE__ */ e(w.Row, { style: { height: `${n}px` }, children: /* @__PURE__ */ e(w.Column, { width: 16, className: "content", children: /* @__PURE__ */ e(f, { className: "content-tab", style: { height: `${n}px` }, children: /* @__PURE__ */ e($, { className: "content-tab", posts: t, activeItem: l }) }) }) })
155
+ /* @__PURE__ */ e(J, { showIcons: i, showLabels: c, posts: t, activeItem: l, setActive: o }),
156
+ /* @__PURE__ */ e(w.Row, { style: { height: `${n}px` }, children: /* @__PURE__ */ e(w.Column, { width: 16, className: "content", children: /* @__PURE__ */ e(b, { className: "content-tab", style: { height: `${n}px` }, children: /* @__PURE__ */ e($, { className: "content-tab", posts: t, activeItem: l }) }) }) })
156
157
  ] }) });
157
- }, X = (t) => {
158
+ }, Z = (t) => {
158
159
  var _;
159
160
  let {
160
- "data-type": a,
161
+ "data-type": c,
161
162
  "data-taxonomy": i,
162
163
  "data-categories": n,
163
164
  "data-items": l,
@@ -167,26 +168,26 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
167
168
  "data-show-labels": m,
168
169
  "data-height": s,
169
170
  "data-preview-mode": u = "Desktop",
170
- pageModuleProps: c,
171
+ pageModuleProps: a,
171
172
  parent: h,
172
- editing: b,
173
+ editing: f,
173
174
  unique: D
174
175
  } = t;
175
- c != null && c.previewMode && (c != null && c.editing) && (u = c.previewMode, b = c.editing);
176
- const R = t.intl.locale, x = d === "true", C = x ? s : void 0, { width: j } = O(), H = j <= 1024, B = u !== "Desktop" && b, F = H && !b;
177
- return /* @__PURE__ */ e(f, { className: `viz tabbed posts ${b ? "editing" : ""} ${x ? "scrollable" : ""}`, fluid: !0, children: /* @__PURE__ */ e(
176
+ a != null && a.previewMode && (a != null && a.editing) && (u = a.previewMode, f = a.editing);
177
+ const R = t.intl.locale, x = d === "true", C = x ? s : void 0, { width: j } = O(), H = j <= 1024, B = u !== "Desktop" && f, F = H && !f;
178
+ return /* @__PURE__ */ e(b, { className: `viz tabbed posts ${f ? "editing" : ""} ${x ? "scrollable" : ""}`, fluid: !0, children: /* @__PURE__ */ e(
178
179
  q,
179
180
  {
180
181
  locale: R,
181
- type: a,
182
+ type: c,
182
183
  taxonomy: i,
183
- categories: n,
184
+ categories: U(n, f),
184
185
  store: `tabbedposts_${h}_${D}`,
185
186
  page: 1,
186
187
  perPage: l,
187
- children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(N, { children: F || B ? /* @__PURE__ */ e(J, { posts: l, activeItem: (_ = l[0]) == null ? void 0 : _.slug, setActive: () => {
188
- } }) : o === "light" ? /* @__PURE__ */ e(K, { height: C, showLabels: m === "true" }) : /* @__PURE__ */ e(
189
- Q,
188
+ children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(N, { children: F || B ? /* @__PURE__ */ e(K, { posts: l, activeItem: (_ = l[0]) == null ? void 0 : _.slug, setActive: () => {
189
+ } }) : o === "light" ? /* @__PURE__ */ e(Q, { height: C, showLabels: m === "true" }) : /* @__PURE__ */ e(
190
+ X,
190
191
  {
191
192
  height: C,
192
193
  showLabels: m === "true",
@@ -195,13 +196,13 @@ const U = ({ posts: t, activeItem: a, setActive: i, showLabels: n }) => t ? t.ma
195
196
  ) }) })
196
197
  }
197
198
  ) });
198
- }, Z = (t, a) => {
199
+ }, ee = (t, c) => {
199
200
  const i = t.getIn([
200
201
  "data",
201
202
  "pageModuleProps"
202
203
  ]), n = {};
203
204
  return i && (n.pageModuleProps = i), n;
204
- }, ee = {}, se = z(Z, ee)(E(X));
205
+ }, te = {}, ue = z(ee, te)(E(Z));
205
206
  export {
206
- se as default
207
+ ue as default
207
208
  };
@@ -1,13 +1,21 @@
1
- const n = (r, e) => e ? r : decodeURIComponent(r.replace(/%(?![0-9a-fA-F][0-9a-fA-F]+)/g, "%25")), t = (r, e) => {
1
+ const n = (r, e) => {
2
+ if (e)
3
+ return r;
4
+ try {
5
+ return decodeURIComponent(r.replace(/%(?![0-9a-fA-F][0-9a-fA-F]+)/g, "%25"));
6
+ } catch {
7
+ console.error("error decoding value:" + r);
8
+ }
9
+ }, t = (r, e) => {
2
10
  try {
3
11
  return JSON.parse(n(r, e));
4
12
  } catch {
5
13
  console.error("error parsing value:" + r);
6
14
  }
7
15
  return null;
8
- }, s = (r, e) => JSON.stringify(r) === JSON.stringify(e);
16
+ }, c = (r, e) => JSON.stringify(r) === JSON.stringify(e);
9
17
  export {
10
- s as compareJsonProps,
18
+ c as compareJsonProps,
11
19
  n as decode,
12
20
  t as parse
13
21
  };
package/dist/esm/index.js CHANGED
@@ -6,8 +6,8 @@ import { default as S } from "./layout/containers/PreviewPageContainer.js";
6
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 H } from "./layout/containers/SlugPostContainer.js";
9
- import { CustomizerWrapper as k } from "./layout/Customizer.js";
10
- import { default as E } from "./layout/Layout.js";
9
+ import { CustomizerWrapper as R } from "./layout/Customizer.js";
10
+ import { default as w } 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";
@@ -19,107 +19,108 @@ 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 re } from "./layout/FloatingMenuHeader.js";
23
- import { withTracker as te } from "./tracker/withGoogleAnalytics.js";
24
- import { clearInternalTrafficCookie as fe, isInternalTrafficEnabled as se, setInternalTrafficCookie as pe } from "./tracker/internalTrafficUtils.js";
25
- import { default as ne } from "./tracker/InternalTrafficToggle.js";
26
- import { default as le } from "./tracker/InternalTrafficWatermark.js";
27
- import { useInternalTrafficBypass as de } from "./tracker/useInternalTrafficBypass.js";
28
- import { store as ce } from "./redux/store.js";
29
- import { useAppDispatch as Ce, useAppSelector as ge } from "./redux/hooks.js";
30
- import { UPDATE as Ie, initialState as Se, intlReducer as he, updateIntl as ve } from "./lib/react-intl-redux/index.js";
31
- import { combineReducers as Ae } from "./lib/redux-immutable/index.js";
32
- import * as e from "./translations/en.json.js";
33
- import * as r from "./translations/fr.json.js";
22
+ import { default as er } from "./layout/FloatingMenuHeader.js";
23
+ import { withTracker as tr } from "./tracker/withGoogleAnalytics.js";
24
+ import { clearInternalTrafficCookie as fr, getInternalTrafficExpiry as sr, isInternalTrafficEnabled as pr, setInternalTrafficCookie as nr } from "./tracker/internalTrafficUtils.js";
25
+ import { default as ir } from "./tracker/InternalTrafficToggle.js";
26
+ import { default as xr } from "./tracker/InternalTrafficWatermark.js";
27
+ import { useInternalTrafficBypass as ur } from "./tracker/useInternalTrafficBypass.js";
28
+ import { store as Tr } from "./redux/store.js";
29
+ import { useAppDispatch as gr, useAppSelector as Pr } from "./redux/hooks.js";
30
+ import { UPDATE as Sr, initialState as hr, intlReducer as vr, updateIntl as yr } from "./lib/react-intl-redux/index.js";
31
+ import { combineReducers as Dr } from "./lib/redux-immutable/index.js";
32
+ import * as r from "./translations/en.json.js";
33
+ import * as e from "./translations/fr.json.js";
34
34
  import * as o from "./translations/af.json.js";
35
35
  import * as t from "./translations/am.json.js";
36
- import { COUNTRY_OPTIONS as He } from "./countries.js";
37
- import { decodeHtmlEntitiesToHtml as ke, decodeHtmlEntitiesToText as we, stringToArray as Ee, toBoolean as Fe, toNumber as Le, uriStringToArray as Me } from "./utils/data.js";
38
- import { Media as Oe, MediaContextProvider as be, mediaStyle as Be } from "./utils/AppMedia.js";
39
- import { getUnhandledProps as We, htmlImageProps as ze, htmlInputAttrs as Ke, htmlInputEvents as Je, htmlInputProps as Ve, partitionHTMLProps as Ye, useKeyOnly as _e, useValueAndKey as je } from "./utils/semanticUtils.js";
40
- import { default as Ge, useDataContext as Qe } from "./embeddable/data/DataConsumer.js";
41
- import { default as Ze } from "./embeddable/data/DataProvider.js";
42
- import { CategoriesContext as er, DataContext as rr, PostsContext as or } from "./embeddable/data/DataContext.js";
36
+ import { COUNTRY_OPTIONS as Er } from "./countries.js";
37
+ import { decodeHtmlEntitiesToHtml as kr, decodeHtmlEntitiesToText as wr, stringToArray as Fr, toBoolean as Lr, toNumber as Mr, uriStringToArray as Nr } from "./utils/data.js";
38
+ import { Media as br, MediaContextProvider as Br, mediaStyle as Ur } from "./utils/AppMedia.js";
39
+ import { getUnhandledProps as zr, htmlImageProps as Kr, htmlInputAttrs as Jr, htmlInputEvents as Vr, htmlInputProps as Yr, partitionHTMLProps as _r, useKeyOnly as jr, useValueAndKey as qr } from "./utils/semanticUtils.js";
40
+ import { default as Qr, useDataContext as Xr } from "./embeddable/data/DataConsumer.js";
41
+ import { default as $r } from "./embeddable/data/DataProvider.js";
42
+ import { CategoriesContext as ee, DataContext as oe, PostsContext as te } from "./embeddable/data/DataContext.js";
43
43
  import "react/jsx-runtime";
44
44
  import "react";
45
45
  import "./embeddable/data/CategoriesProvider.js";
46
- import { compareJsonProps as ar, decode as fr, parse as sr } from "./embeddable/utils/parseUtils.js";
46
+ import { compareJsonProps as fe, decode as se, parse as pe } from "./embeddable/utils/parseUtils.js";
47
47
  import * as p from "./embeddable/reducers/data.js";
48
- import { default as mr } from "./lib/react-intl-redux/providers/Provider.js";
49
- import { default as ir } from "./lib/react-intl-redux/providers/IntlProvider.js";
48
+ import { default as me } from "./lib/react-intl-redux/providers/Provider.js";
49
+ import { default as le } from "./lib/react-intl-redux/providers/IntlProvider.js";
50
50
  export {
51
- He as COUNTRY_OPTIONS,
52
- er as CategoriesContext,
51
+ Er as COUNTRY_OPTIONS,
52
+ ee as CategoriesContext,
53
53
  X as ClassicHeader,
54
54
  c as Config,
55
55
  z as CustomSemanticSearch,
56
- k as CustomizerWrapper,
57
- Ge as DataConsumer,
58
- rr as DataContext,
59
- Ze as DataProvider,
56
+ R as CustomizerWrapper,
57
+ Qr as DataConsumer,
58
+ oe as DataContext,
59
+ $r as DataProvider,
60
60
  N as Favicon,
61
61
  $ as FlexWrapDetector,
62
- re as FloatingMenuHeader,
62
+ er as FloatingMenuHeader,
63
63
  G as Footer,
64
64
  J as Header,
65
- ne as InternalTrafficToggle,
66
- le as InternalTrafficWatermark,
67
- ir as IntlProvider,
65
+ ir as InternalTrafficToggle,
66
+ xr as InternalTrafficWatermark,
67
+ le as IntlProvider,
68
68
  j as LangSwitcher,
69
69
  U as Loading,
70
- Oe as Media,
71
- be as MediaContextProvider,
72
- or as PostsContext,
70
+ br as Media,
71
+ Br as MediaContextProvider,
72
+ te as PostsContext,
73
73
  L as PreviewComponent,
74
74
  S as PreviewPageContainer,
75
75
  v as PreviewTypeContainer,
76
- mr as Provider,
76
+ me as Provider,
77
77
  C as ResponsiveContainer,
78
- E as RootLayout,
78
+ w as RootLayout,
79
79
  b as SSRFavicon,
80
80
  P as ScrollToTop,
81
81
  Y as SearchControl,
82
82
  A as SlugContainer,
83
83
  H as SlugPostContainer,
84
- Ie as UPDATE,
84
+ Sr as UPDATE,
85
85
  o as afrikaansTranslations,
86
86
  t as amharicTranslations,
87
- fe as clearInternalTrafficCookie,
88
- Ae as combineReducers,
89
- ar as compareJsonProps,
87
+ fr as clearInternalTrafficCookie,
88
+ Dr as combineReducers,
89
+ fe as compareJsonProps,
90
90
  i as components,
91
91
  l as customizer,
92
- fr as decode,
93
- ke as decodeHtmlEntitiesToHtml,
94
- we as decodeHtmlEntitiesToText,
95
- e as englishTranslations,
96
- r as frenchTranslations,
92
+ se as decode,
93
+ kr as decodeHtmlEntitiesToHtml,
94
+ wr as decodeHtmlEntitiesToText,
95
+ r as englishTranslations,
96
+ e as frenchTranslations,
97
97
  x as getComponentByNameIgnoreCase,
98
- We as getUnhandledProps,
99
- ze as htmlImageProps,
100
- Ke as htmlInputAttrs,
101
- Je as htmlInputEvents,
102
- Ve as htmlInputProps,
103
- Se as initialState,
104
- he as intlReducer,
105
- se as isInternalTrafficEnabled,
106
- Be as mediaStyle,
107
- sr as parse,
108
- Ye as partitionHTMLProps,
98
+ sr as getInternalTrafficExpiry,
99
+ zr as getUnhandledProps,
100
+ Kr as htmlImageProps,
101
+ Jr as htmlInputAttrs,
102
+ Vr as htmlInputEvents,
103
+ Yr as htmlInputProps,
104
+ hr as initialState,
105
+ vr as intlReducer,
106
+ pr as isInternalTrafficEnabled,
107
+ Ur as mediaStyle,
108
+ pe as parse,
109
+ _r as partitionHTMLProps,
109
110
  p as reducer,
110
111
  d as reducers,
111
- pe as setInternalTrafficCookie,
112
- ce as store,
113
- Ee as stringToArray,
114
- Fe as toBoolean,
115
- Le as toNumber,
116
- ve as updateIntl,
117
- Me as uriStringToArray,
118
- Ce as useAppDispatch,
119
- ge as useAppSelector,
120
- Qe as useDataContext,
121
- de as useInternalTrafficBypass,
122
- _e as useKeyOnly,
123
- je as useValueAndKey,
124
- te as withTracker
112
+ nr as setInternalTrafficCookie,
113
+ Tr as store,
114
+ Fr as stringToArray,
115
+ Lr as toBoolean,
116
+ Mr as toNumber,
117
+ yr as updateIntl,
118
+ Nr as uriStringToArray,
119
+ gr as useAppDispatch,
120
+ Pr as useAppSelector,
121
+ Xr as useDataContext,
122
+ ur as useInternalTrafficBypass,
123
+ jr as useKeyOnly,
124
+ qr as useValueAndKey,
125
+ tr as withTracker
125
126
  };
@@ -1,24 +1,34 @@
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
- ) })
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { Container as s, Segment as i, Header as l, Message as a, Button as c } from "semantic-ui-react";
3
+ import { useInternalTrafficBypass as d } from "./useInternalTrafficBypass.js";
4
+ const g = () => {
5
+ const { isEnabled: e, expiresAt: t, toggle: o } = d();
6
+ return /* @__PURE__ */ n(s, { as: "div", children: [
7
+ /* @__PURE__ */ r(i, { textAlign: "center", basic: !0, vertical: !0, children: /* @__PURE__ */ r(l, { as: "h1", content: "Google Analytics Bypass" }) }),
8
+ /* @__PURE__ */ n(i, { vertical: !0, children: [
9
+ /* @__PURE__ */ n(a, { color: e ? "green" : "blue", children: [
10
+ /* @__PURE__ */ r(a.Header, { children: e ? "Internal traffic bypass is ON" : "Internal traffic bypass is OFF" }),
11
+ /* @__PURE__ */ r("p", { children: e ? "Your visits are excluded from GA4. Disable to resume normal tracking." : "Your visits are being tracked in GA4. Enable to exclude internal traffic." }),
12
+ e && t && /* @__PURE__ */ n("p", { style: { marginTop: "0.5em", fontSize: "0.9em", opacity: 0.8 }, children: [
13
+ "Cookie expires: ",
14
+ t.toLocaleDateString(void 0, {
15
+ year: "numeric",
16
+ month: "long",
17
+ day: "numeric"
18
+ })
19
+ ] })
20
+ ] }),
21
+ /* @__PURE__ */ r(
22
+ c,
23
+ {
24
+ color: e ? "red" : "green",
25
+ onClick: o,
26
+ content: e ? "Disable bypass" : "Enable bypass"
27
+ }
28
+ )
29
+ ] })
20
30
  ] });
21
31
  };
22
32
  export {
23
- p as default
33
+ g as default
24
34
  };
@@ -1,60 +1,50 @@
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
- };
1
+ import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
+ import { useState as t, useRef as f, useEffect as g } from "react";
3
+ import { Popup as E, Label as I, Icon as L } from "semantic-ui-react";
4
+ import { useNavigate as M } from "react-router";
5
+ import { isInternalTrafficEnabled as m } from "./internalTrafficUtils.js";
6
+ const A = () => {
7
+ const p = M(), [w, a] = t(!1), [v, b] = t(!1), [n, l] = t({ x: 0, y: 0 }), [o, c] = t(!1), r = f({ x: 0, y: 0 }), s = f(!1);
8
+ g(() => {
9
+ b(!0), a(m()), l({ x: window.innerWidth - 200, y: window.innerHeight - 40 });
10
+ const e = () => a(m());
16
11
  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"
12
+ }, []), g(() => {
13
+ if (!o) return;
14
+ const e = (d) => {
15
+ s.current = !0, l({ x: d.clientX - r.current.x, y: d.clientY - r.current.y });
16
+ }, u = () => c(!1);
17
+ return window.addEventListener("mousemove", e), window.addEventListener("mouseup", u), () => {
18
+ window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", u);
19
+ };
20
+ }, [o]);
21
+ const x = (e) => {
22
+ s.current = !1, r.current = { x: e.clientX - n.x, y: e.clientY - n.y }, c(!0);
23
+ }, y = () => {
24
+ s.current || p("/__ga/internal");
40
25
  };
41
- return /* @__PURE__ */ s(
26
+ return !v || !w ? null : /* @__PURE__ */ i(
42
27
  "div",
43
28
  {
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,
29
+ style: {
30
+ position: "fixed",
31
+ left: n.x,
32
+ top: n.y,
33
+ zIndex: 999999,
34
+ cursor: o ? "grabbing" : "grab",
35
+ userSelect: "none"
36
+ },
37
+ onMouseDown: x,
38
+ onClick: y,
39
+ role: "button",
40
+ "aria-label": "GA bypass enabled — click to manage",
41
+ children: /* @__PURE__ */ i(
42
+ E,
53
43
  {
54
- content: "Drag to move",
44
+ content: "Click to manage bypass settings",
55
45
  position: "left center",
56
- trigger: /* @__PURE__ */ w(M, { color: "yellow", image: !0, children: [
57
- /* @__PURE__ */ s(v, { name: "spinner", loading: !0, color: "red" }),
46
+ trigger: /* @__PURE__ */ h(I, { color: "yellow", image: !0, children: [
47
+ /* @__PURE__ */ i(L, { name: "spinner", loading: !0, color: "red" }),
58
48
  "GA Bypass Enabled"
59
49
  ] })
60
50
  }
@@ -63,5 +53,5 @@ const S = () => {
63
53
  );
64
54
  };
65
55
  export {
66
- S as default
56
+ A as default
67
57
  };
@@ -1,14 +1,15 @@
1
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";
2
+ import { clearInternalTrafficCookie as t, getInternalTrafficExpiry as n, isInternalTrafficEnabled as o, setInternalTrafficCookie as i } from "./internalTrafficUtils.js";
3
+ import { default as c } from "./InternalTrafficToggle.js";
4
+ import { default as p } from "./InternalTrafficWatermark.js";
5
+ import { useInternalTrafficBypass as I } from "./useInternalTrafficBypass.js";
6
6
  export {
7
- i as InternalTrafficToggle,
8
- T as InternalTrafficWatermark,
7
+ c as InternalTrafficToggle,
8
+ p as InternalTrafficWatermark,
9
9
  t as clearInternalTrafficCookie,
10
+ n as getInternalTrafficExpiry,
10
11
  o as isInternalTrafficEnabled,
11
- n as setInternalTrafficCookie,
12
- m as useInternalTrafficBypass,
12
+ i as setInternalTrafficCookie,
13
+ I as useInternalTrafficBypass,
13
14
  e as withTracker
14
15
  };