aesirx-analytics 2.2.12 → 2.2.14

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/index.d.ts CHANGED
@@ -41,4 +41,15 @@ declare const AnalyticsContext: React.Context<AnalyticsContextType>;
41
41
  */
42
42
  declare const getFingerprint: () => string;
43
43
 
44
- export { AnalyticsContext, AnalyticsNext, AnalyticsReact, getFingerprint, trackEvent };
44
+ interface Props {
45
+ show: boolean;
46
+ handleClose: () => void;
47
+ }
48
+ declare global {
49
+ interface Window {
50
+ funcAfterPaymentConsent: any;
51
+ }
52
+ }
53
+ declare const PaymentConsent: ({ show, handleClose }: Props) => React.JSX.Element;
54
+
55
+ export { AnalyticsContext, AnalyticsNext, AnalyticsReact, PaymentConsent, getFingerprint, trackEvent };
package/dist/index.js CHANGED
@@ -8,8 +8,11 @@ import {
8
8
  import {
9
9
  AnalyticsContext,
10
10
  AnalyticsContextProvider_default,
11
- getConsentTemplate
12
- } from "./chunk-R4T7FUMB.js";
11
+ bg_default,
12
+ getConsentTemplate,
13
+ privacy_default,
14
+ useTranslation
15
+ } from "./chunk-N4WREXIA.js";
13
16
 
14
17
  // src/AnalyticsNext/index.tsx
15
18
  import React2, { useEffect as useEffect2, useState as useState2 } from "react";
@@ -72,8 +75,8 @@ var handle_default = AnalyticsHandle;
72
75
 
73
76
  // src/AnalyticsNext/index.tsx
74
77
  import dynamic from "next/dynamic";
75
- var ConsentComponent = dynamic(() => import("./Consent-QTHZTQUK.js"), { ssr: false });
76
- var ConsentComponentCustom = dynamic(() => import("./ConsentCustom-HQ6RMLQ6.js"), { ssr: false });
78
+ var ConsentComponent = dynamic(() => import("./Consent-VTHZ6KB6.js"), { ssr: false });
79
+ var ConsentComponentCustom = dynamic(() => import("./ConsentCustom-VIQCBSAX.js"), { ssr: false });
77
80
  var AnalyticsNext = ({
78
81
  router,
79
82
  attributes,
@@ -164,8 +167,8 @@ var AnalyticsHandle2 = ({ location, history, children }) => {
164
167
  var handle_default2 = AnalyticsHandle2;
165
168
 
166
169
  // src/AnalyticsReact/index.tsx
167
- var ConsentComponent2 = React4.lazy(() => import("./Consent-QTHZTQUK.js"));
168
- var ConsentComponentCustom2 = React4.lazy(() => import("./ConsentCustom-HQ6RMLQ6.js"));
170
+ var ConsentComponent2 = React4.lazy(() => import("./Consent-VTHZ6KB6.js"));
171
+ var ConsentComponentCustom2 = React4.lazy(() => import("./ConsentCustom-VIQCBSAX.js"));
169
172
  var AnalyticsReact = ({ location, history, oldLayout = false, children }) => {
170
173
  const [layout, setLayout] = useState3(process.env.REACT_APP_CONSENT_LAYOUT ?? "simple-web-2");
171
174
  const [gtagId, setGtagId] = useState3(process.env.REACT_APP_ANALYTICS_GTAG_ID);
@@ -204,10 +207,97 @@ var AnalyticsReact = ({ location, history, oldLayout = false, children }) => {
204
207
  ))));
205
208
  };
206
209
  var AnalyticsReact_default = AnalyticsReact;
210
+
211
+ // src/Components/PaymentConsent.tsx
212
+ import React5, { useEffect as useEffect5 } from "react";
213
+ import { Button } from "react-bootstrap";
214
+ var PaymentConsent = ({ show = false, handleClose }) => {
215
+ const { t } = useTranslation();
216
+ const handleConsent = () => {
217
+ sessionStorage.setItem("aesirx-analytics-payment", "true");
218
+ window?.funcAfterPaymentConsent && window.funcAfterPaymentConsent();
219
+ handleClose();
220
+ };
221
+ useEffect5(() => {
222
+ if (sessionStorage.getItem("aesirx-analytics-payment") === "true") {
223
+ window.funcAfterPaymentConsent && window.funcAfterPaymentConsent();
224
+ }
225
+ }, []);
226
+ return /* @__PURE__ */ React5.createElement("div", { className: "aesirxconsent" }, /* @__PURE__ */ React5.createElement(
227
+ "div",
228
+ {
229
+ tabIndex: -1,
230
+ className: `toast-container position-fixed m-md-3 ${show ? "top-50 start-50 translate-middle" : "bottom-0 end-0 opacity-0"}`
231
+ },
232
+ /* @__PURE__ */ React5.createElement("div", { className: `toast payment-consent ${show ? "show" : ""} custom` }, /* @__PURE__ */ React5.createElement("div", { className: "toast-body p-0 shadow mx-3 mx-md-0" }, /* @__PURE__ */ React5.createElement("div", { className: "bg-white" }, /* @__PURE__ */ React5.createElement(
233
+ "div",
234
+ {
235
+ className: `d-flex rounded-top align-items-center justify-content-between p-2 p-lg-3 fw-medium flex-wrap py-2 py-lg-3 px-4 header-consent-bg`,
236
+ style: {
237
+ borderBottom: "1px solid #DEDEDE"
238
+ }
239
+ },
240
+ /* @__PURE__ */ React5.createElement("div", { className: "text-primary text-nowrap" }, t("txt_tracking_data_privacy")),
241
+ /* @__PURE__ */ React5.createElement("div", { className: "d-flex align-items-center fs-14 text-primary" }, /* @__PURE__ */ React5.createElement(
242
+ "a",
243
+ {
244
+ href: "https://shield.aesirx.io/",
245
+ rel: "noreferrer",
246
+ target: "_blank",
247
+ className: "minimize-shield-wrapper position-relative text-decoration-none"
248
+ },
249
+ /* @__PURE__ */ React5.createElement(
250
+ "img",
251
+ {
252
+ className: "cover-img position-absolute h-100 w-100 object-fit-cover z-1",
253
+ src: bg_default
254
+ }
255
+ ),
256
+ /* @__PURE__ */ React5.createElement("div", { className: "minimize-shield position-relative z-2 py-2" }, /* @__PURE__ */ React5.createElement("img", { src: privacy_default, alt: "Shield of Privacy" }), t("txt_shield_of_privacy"))
257
+ ))
258
+ ), /* @__PURE__ */ React5.createElement("div", { className: "p-4 pt-3 pb-0 bg-white" }, /* @__PURE__ */ React5.createElement("p", { className: "fw-semibold lh-160 text-primary mb-2" }, t("txt_payment_notice")), /* @__PURE__ */ React5.createElement("div", { className: "text-primary lh-160" }, t("txt_payment_1"), /* @__PURE__ */ React5.createElement("br", null), /* @__PURE__ */ React5.createElement("br", null), /* @__PURE__ */ React5.createElement(
259
+ "div",
260
+ {
261
+ dangerouslySetInnerHTML: {
262
+ __html: t("txt_payment_2", {
263
+ interpolation: { escapeValue: false }
264
+ })
265
+ }
266
+ }
267
+ ), /* @__PURE__ */ React5.createElement("br", null), t("txt_payment_3"), /* @__PURE__ */ React5.createElement("br", null), /* @__PURE__ */ React5.createElement("br", null), /* @__PURE__ */ React5.createElement(
268
+ "div",
269
+ {
270
+ dangerouslySetInnerHTML: {
271
+ __html: t("txt_payment_4", {
272
+ interpolation: { escapeValue: false }
273
+ })
274
+ }
275
+ }
276
+ ))), /* @__PURE__ */ React5.createElement("div", { className: "rounded-bottom position-relative overflow-hidden text-white bg-white" }, /* @__PURE__ */ React5.createElement("div", { className: "position-relative pt-2 pt-lg-3 p-3" }, /* @__PURE__ */ React5.createElement("div", { className: "d-flex align-items-center justify-content-between flex-wrap" }, /* @__PURE__ */ React5.createElement(
277
+ Button,
278
+ {
279
+ onClick: handleClose,
280
+ variant: "outline-success",
281
+ className: "border-2 fs-7 fw-bold text-primary rounded-pill py-13px px-5rem"
282
+ },
283
+ t("txt_reject_consent")
284
+ ), /* @__PURE__ */ React5.createElement(
285
+ Button,
286
+ {
287
+ onClick: handleConsent,
288
+ variant: "outline-success",
289
+ className: "border-2 fs-7 fw-bold text-primary rounded-pill py-13px px-5rem"
290
+ },
291
+ t("txt_yes_i_consent")
292
+ )))))))
293
+ ));
294
+ };
295
+ var PaymentConsent_default = PaymentConsent;
207
296
  export {
208
297
  AnalyticsContext,
209
298
  AnalyticsNext_default as AnalyticsNext,
210
299
  AnalyticsReact_default as AnalyticsReact,
300
+ PaymentConsent_default as PaymentConsent,
211
301
  fingerprint_default as getFingerprint,
212
302
  trackEvent
213
303
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aesirx-analytics",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "AesirX",
6
6
  "repository": "https://gitlab.redweb.dk/aesirx/analytics",
@@ -14,7 +14,7 @@
14
14
  "@concordium/web-sdk": "^7.0.4-rc.3",
15
15
  "@web3modal/ethereum": "^2.7.0",
16
16
  "@web3modal/react": "^2.7.0",
17
- "aesirx-sso": "^1.4.12",
17
+ "aesirx-sso": "^1.4.13",
18
18
  "axios": "^1.6.0",
19
19
  "bootstrap": "^5.3.2",
20
20
  "bowser": "^2.11.0",
@@ -66,7 +66,7 @@
66
66
  "@babel/preset-env": "^7.24.5",
67
67
  "@babel/preset-typescript": "^7.23.0",
68
68
  "@jest/globals": "^29.7.0",
69
- "@types/jest": "^29.5.0",
69
+ "@types/jest": "^29.5.12",
70
70
  "@types/murmurhash-js": "^1.0.3",
71
71
  "@types/node": "^20.8.0",
72
72
  "@types/react": "^18.3.1",
@@ -80,7 +80,7 @@
80
80
  "esbuild-scss-modules-plugin": "^1.1.1",
81
81
  "eslint": "^8.48.0",
82
82
  "eslint-plugin-react": "^7.33.2",
83
- "jest": "^29.4.3",
83
+ "jest": "^29.7.0",
84
84
  "jest-environment-jsdom": "^29.4.3",
85
85
  "node-fetch": "^3.3.1",
86
86
  "prettier": "^3.0.3",