@tilli-pro/cookieconsent-plugin 0.1.9 → 0.1.10
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/.cache/tsbuildinfo.json +1 -0
- package/dist/_consts.d.ts +7 -0
- package/dist/_consts.d.ts.map +1 -0
- package/dist/_consts.js +6 -0
- package/dist/assets/cookie.d.ts +4 -0
- package/dist/assets/cookie.d.ts.map +1 -0
- package/dist/assets/cookie.js +11 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/assets/index.js +4 -0
- package/dist/assets/logo.d.ts +4 -0
- package/dist/assets/logo.d.ts.map +1 -0
- package/dist/assets/logo.js +21 -0
- package/dist/config/categories/index.d.ts +43 -0
- package/dist/config/categories/index.d.ts.map +1 -0
- package/dist/config/categories/index.js +49 -0
- package/dist/config/categories/labels.d.ts +14 -0
- package/dist/config/categories/labels.d.ts.map +1 -0
- package/dist/config/categories/labels.js +18 -0
- package/dist/config/cookies/_utils.d.ts +25 -0
- package/dist/config/cookies/_utils.d.ts.map +1 -0
- package/dist/config/cookies/_utils.js +30 -0
- package/dist/config/cookies/_utils.server.d.ts +8 -0
- package/dist/config/cookies/_utils.server.d.ts.map +1 -0
- package/dist/config/cookies/_utils.server.js +8 -0
- package/dist/config/cookies/analytics/datadog.d.ts +22 -0
- package/dist/config/cookies/analytics/datadog.d.ts.map +1 -0
- package/dist/config/cookies/analytics/datadog.js +28 -0
- package/dist/config/cookies/common-translations.d.ts +29 -0
- package/dist/config/cookies/common-translations.d.ts.map +1 -0
- package/dist/config/cookies/common-translations.js +27 -0
- package/dist/config/cookies/functional/brf/v2.d.ts +22 -0
- package/dist/config/cookies/functional/brf/v2.d.ts.map +1 -0
- package/dist/config/cookies/functional/brf/v2.js +28 -0
- package/dist/config/cookies/index.d.ts +15 -0
- package/dist/config/cookies/index.d.ts.map +1 -0
- package/dist/config/cookies/index.js +19 -0
- package/dist/config/cookies/necessary/brf/v2-auth.d.ts +27 -0
- package/dist/config/cookies/necessary/brf/v2-auth.d.ts.map +1 -0
- package/dist/config/cookies/necessary/brf/v2-auth.js +39 -0
- package/dist/config/cookies/necessary/next-auth.d.ts +47 -0
- package/dist/config/cookies/necessary/next-auth.d.ts.map +1 -0
- package/dist/config/cookies/necessary/next-auth.js +83 -0
- package/dist/config/cookies/types.d.ts +37 -0
- package/dist/config/cookies/types.d.ts.map +1 -0
- package/dist/config/cookies/types.js +0 -0
- package/dist/config/gui-options/html-components/ManageCookiePrefsButton.d.ts +18 -0
- package/dist/config/gui-options/html-components/ManageCookiePrefsButton.d.ts.map +1 -0
- package/dist/config/gui-options/html-components/ManageCookiePrefsButton.js +116 -0
- package/dist/config/gui-options/html-components/TilliXCallout.d.ts +20 -0
- package/dist/config/gui-options/html-components/TilliXCallout.d.ts.map +1 -0
- package/dist/config/gui-options/html-components/TilliXCallout.js +28 -0
- package/dist/config/gui-options/html-components/assets/CookieIcon.d.ts +3 -0
- package/dist/config/gui-options/html-components/assets/CookieIcon.d.ts.map +1 -0
- package/dist/config/gui-options/html-components/assets/CookieIcon.js +10 -0
- package/dist/config/gui-options/index.d.ts +18 -0
- package/dist/config/gui-options/index.d.ts.map +1 -0
- package/dist/config/gui-options/index.js +16 -0
- package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.d.ts +20 -0
- package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.d.ts.map +1 -0
- package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.js +143 -0
- package/dist/config/gui-options/scripts/forceDisableReactRemoveScroll.d.ts +17 -0
- package/dist/config/gui-options/scripts/forceDisableReactRemoveScroll.d.ts.map +1 -0
- package/dist/config/gui-options/scripts/forceDisableReactRemoveScroll.js +97 -0
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts +5 -0
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts.map +1 -0
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.js +31 -0
- package/dist/config/index.d.ts +227 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +13 -0
- package/dist/config/translations/de/index.d.ts +35 -0
- package/dist/config/translations/de/index.d.ts.map +1 -0
- package/dist/config/translations/de/index.js +85 -0
- package/dist/config/translations/en/index.d.ts +35 -0
- package/dist/config/translations/en/index.d.ts.map +1 -0
- package/dist/config/translations/en/index.js +85 -0
- package/dist/config/translations/es/index.d.ts +35 -0
- package/dist/config/translations/es/index.d.ts.map +1 -0
- package/dist/config/translations/es/index.js +85 -0
- package/dist/config/translations/fr/index.d.ts +35 -0
- package/dist/config/translations/fr/index.d.ts.map +1 -0
- package/dist/config/translations/fr/index.js +85 -0
- package/dist/config/translations/index.d.ts +164 -0
- package/dist/config/translations/index.d.ts.map +1 -0
- package/dist/config/translations/index.js +12 -0
- package/dist/config/translations/it/index.d.ts +35 -0
- package/dist/config/translations/it/index.d.ts.map +1 -0
- package/dist/config/translations/it/index.js +85 -0
- package/dist/config/translations/types.d.ts +3 -0
- package/dist/config/translations/types.d.ts.map +1 -0
- package/dist/config/translations/types.js +0 -0
- package/dist/react-components/CookieConsentInit.client.d.ts +2 -0
- package/dist/react-components/CookieConsentInit.client.d.ts.map +1 -0
- package/dist/react-components/CookieConsentInit.client.js +27 -0
- package/dist/react-components/CookieConsentInit.server.d.ts +8 -0
- package/dist/react-components/CookieConsentInit.server.d.ts.map +1 -0
- package/dist/react-components/CookieConsentInit.server.js +11 -0
- package/dist/react-components/_utils.d.ts +10 -0
- package/dist/react-components/_utils.d.ts.map +1 -0
- package/dist/react-components/_utils.js +31 -0
- package/package.json +1 -1
@@ -0,0 +1,164 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
de: {
|
3
|
+
consentModal: {
|
4
|
+
title: string;
|
5
|
+
description: string;
|
6
|
+
acceptAllBtn: string;
|
7
|
+
acceptNecessaryBtn: string;
|
8
|
+
showPreferencesBtn: string;
|
9
|
+
revisionMessage: string;
|
10
|
+
footer: string;
|
11
|
+
};
|
12
|
+
preferencesModal: {
|
13
|
+
title: string;
|
14
|
+
acceptAllBtn: string;
|
15
|
+
acceptNecessaryBtn: string;
|
16
|
+
savePreferencesBtn: string;
|
17
|
+
closeIconLabel: string;
|
18
|
+
sections: ({
|
19
|
+
title: string;
|
20
|
+
description: string;
|
21
|
+
linkedCategory?: undefined;
|
22
|
+
cookieTable?: undefined;
|
23
|
+
} | {
|
24
|
+
title: string;
|
25
|
+
description: string;
|
26
|
+
linkedCategory: string;
|
27
|
+
cookieTable: {
|
28
|
+
headers: import("../cookies/types").CookieTableHeaders;
|
29
|
+
body: import("../cookies/types").CookieTableItem[];
|
30
|
+
};
|
31
|
+
})[];
|
32
|
+
};
|
33
|
+
};
|
34
|
+
en: {
|
35
|
+
consentModal: {
|
36
|
+
title: string;
|
37
|
+
description: string;
|
38
|
+
acceptAllBtn: string;
|
39
|
+
acceptNecessaryBtn: string;
|
40
|
+
showPreferencesBtn: string;
|
41
|
+
revisionMessage: string;
|
42
|
+
footer: string;
|
43
|
+
};
|
44
|
+
preferencesModal: {
|
45
|
+
title: string;
|
46
|
+
acceptAllBtn: string;
|
47
|
+
acceptNecessaryBtn: string;
|
48
|
+
savePreferencesBtn: string;
|
49
|
+
closeIconLabel: string;
|
50
|
+
sections: ({
|
51
|
+
title: string;
|
52
|
+
description: string;
|
53
|
+
linkedCategory?: undefined;
|
54
|
+
cookieTable?: undefined;
|
55
|
+
} | {
|
56
|
+
title: string;
|
57
|
+
description: string;
|
58
|
+
linkedCategory: string;
|
59
|
+
cookieTable: {
|
60
|
+
headers: import("../cookies/types").CookieTableHeaders;
|
61
|
+
body: import("../cookies/types").CookieTableItem[];
|
62
|
+
};
|
63
|
+
})[];
|
64
|
+
};
|
65
|
+
};
|
66
|
+
es: {
|
67
|
+
consentModal: {
|
68
|
+
title: string;
|
69
|
+
description: string;
|
70
|
+
acceptAllBtn: string;
|
71
|
+
acceptNecessaryBtn: string;
|
72
|
+
showPreferencesBtn: string;
|
73
|
+
revisionMessage: string;
|
74
|
+
footer: string;
|
75
|
+
};
|
76
|
+
preferencesModal: {
|
77
|
+
title: string;
|
78
|
+
acceptAllBtn: string;
|
79
|
+
acceptNecessaryBtn: string;
|
80
|
+
savePreferencesBtn: string;
|
81
|
+
closeIconLabel: string;
|
82
|
+
sections: ({
|
83
|
+
title: string;
|
84
|
+
description: string;
|
85
|
+
linkedCategory?: undefined;
|
86
|
+
cookieTable?: undefined;
|
87
|
+
} | {
|
88
|
+
title: string;
|
89
|
+
description: string;
|
90
|
+
linkedCategory: string;
|
91
|
+
cookieTable: {
|
92
|
+
headers: import("../cookies/types").CookieTableHeaders;
|
93
|
+
body: import("../cookies/types").CookieTableItem[];
|
94
|
+
};
|
95
|
+
})[];
|
96
|
+
};
|
97
|
+
};
|
98
|
+
fr: {
|
99
|
+
consentModal: {
|
100
|
+
title: string;
|
101
|
+
description: string;
|
102
|
+
acceptAllBtn: string;
|
103
|
+
acceptNecessaryBtn: string;
|
104
|
+
showPreferencesBtn: string;
|
105
|
+
revisionMessage: string;
|
106
|
+
footer: string;
|
107
|
+
};
|
108
|
+
preferencesModal: {
|
109
|
+
title: string;
|
110
|
+
acceptAllBtn: string;
|
111
|
+
acceptNecessaryBtn: string;
|
112
|
+
savePreferencesBtn: string;
|
113
|
+
closeIconLabel: string;
|
114
|
+
sections: ({
|
115
|
+
title: string;
|
116
|
+
description: string;
|
117
|
+
linkedCategory?: undefined;
|
118
|
+
cookieTable?: undefined;
|
119
|
+
} | {
|
120
|
+
title: string;
|
121
|
+
description: string;
|
122
|
+
linkedCategory: string;
|
123
|
+
cookieTable: {
|
124
|
+
headers: import("../cookies/types").CookieTableHeaders;
|
125
|
+
body: import("../cookies/types").CookieTableItem[];
|
126
|
+
};
|
127
|
+
})[];
|
128
|
+
};
|
129
|
+
};
|
130
|
+
it: {
|
131
|
+
consentModal: {
|
132
|
+
title: string;
|
133
|
+
description: string;
|
134
|
+
acceptAllBtn: string;
|
135
|
+
acceptNecessaryBtn: string;
|
136
|
+
showPreferencesBtn: string;
|
137
|
+
revisionMessage: string;
|
138
|
+
footer: string;
|
139
|
+
};
|
140
|
+
preferencesModal: {
|
141
|
+
title: string;
|
142
|
+
acceptAllBtn: string;
|
143
|
+
acceptNecessaryBtn: string;
|
144
|
+
savePreferencesBtn: string;
|
145
|
+
closeIconLabel: string;
|
146
|
+
sections: ({
|
147
|
+
title: string;
|
148
|
+
description: string;
|
149
|
+
linkedCategory?: undefined;
|
150
|
+
cookieTable?: undefined;
|
151
|
+
} | {
|
152
|
+
title: string;
|
153
|
+
description: string;
|
154
|
+
linkedCategory: string;
|
155
|
+
cookieTable: {
|
156
|
+
headers: import("../cookies/types").CookieTableHeaders;
|
157
|
+
body: import("../cookies/types").CookieTableItem[];
|
158
|
+
};
|
159
|
+
})[];
|
160
|
+
};
|
161
|
+
};
|
162
|
+
};
|
163
|
+
export default _default;
|
164
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/translations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAM4D"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import type { CookieTableHeaders } from "../../cookies/types";
|
2
|
+
declare const _default: {
|
3
|
+
consentModal: {
|
4
|
+
title: string;
|
5
|
+
description: string;
|
6
|
+
acceptAllBtn: string;
|
7
|
+
acceptNecessaryBtn: string;
|
8
|
+
showPreferencesBtn: string;
|
9
|
+
revisionMessage: string;
|
10
|
+
footer: string;
|
11
|
+
};
|
12
|
+
preferencesModal: {
|
13
|
+
title: string;
|
14
|
+
acceptAllBtn: string;
|
15
|
+
acceptNecessaryBtn: string;
|
16
|
+
savePreferencesBtn: string;
|
17
|
+
closeIconLabel: string;
|
18
|
+
sections: ({
|
19
|
+
title: string;
|
20
|
+
description: string;
|
21
|
+
linkedCategory?: undefined;
|
22
|
+
cookieTable?: undefined;
|
23
|
+
} | {
|
24
|
+
title: string;
|
25
|
+
description: string;
|
26
|
+
linkedCategory: string;
|
27
|
+
cookieTable: {
|
28
|
+
headers: CookieTableHeaders;
|
29
|
+
body: import("../../cookies/types").CookieTableItem[];
|
30
|
+
};
|
31
|
+
})[];
|
32
|
+
};
|
33
|
+
};
|
34
|
+
export default _default;
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/it/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBAsFwB"}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import cookies from "../../cookies";
|
2
|
+
import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
|
3
|
+
import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
|
4
|
+
const __LANGUAGE__ = "it"; // "Italian" ("Italiano")
|
5
|
+
const COOKIE_TABLE_HEADERS = {
|
6
|
+
name: "Nome",
|
7
|
+
service: "Servizio",
|
8
|
+
description: "Descrizione",
|
9
|
+
expiration: "Scadenza",
|
10
|
+
};
|
11
|
+
export default {
|
12
|
+
consentModal: {
|
13
|
+
title: `${CookieIcon()} Informativa sui Cookie`,
|
14
|
+
description: `{{revisionMessage}}Utilizziamo i cookie per migliorare la tua esperienza sul nostro sito web. I cookie strettamente necessari sono essenziali per il funzionamento di questo sito e non possono essere disattivati. Gli altri cookie richiedono il tuo consenso. Cliccando su "Accetta tutto", acconsenti all'uso dei cookie. In alternativa, puoi gestire le tue preferenze sui cookie selezionando il pulsante "Gestisci preferenze" qui sotto. Puoi rivedere e aggiornare le tue preferenze sui cookie in qualsiasi momento tramite l'icona ${CookieIcon(1, 0.5, 0, -0.3333)} nell'angolo in basso a destra. Ti invitiamo a leggere la nostra <a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a> per ulteriori informazioni.`,
|
15
|
+
acceptAllBtn: "Accetta tutto",
|
16
|
+
acceptNecessaryBtn: "Solo strettamente necessari",
|
17
|
+
showPreferencesBtn: "Gestisci preferenze",
|
18
|
+
// closeIconLabel: "Chiudi", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
|
19
|
+
revisionMessage: `La nostra <a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a> è stata recentemente aggiornata. <br><br> `,
|
20
|
+
footer: `
|
21
|
+
<a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a>
|
22
|
+
<a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Termini e Condizioni</a>
|
23
|
+
|
24
|
+
${TilliXCallout(__LANGUAGE__)}
|
25
|
+
`,
|
26
|
+
},
|
27
|
+
preferencesModal: {
|
28
|
+
title: `${TilliXCallout(__LANGUAGE__, 1)} Gestisci preferenze sui cookie`,
|
29
|
+
acceptAllBtn: "Accetta tutto",
|
30
|
+
acceptNecessaryBtn: "Solo strettamente necessari",
|
31
|
+
savePreferencesBtn: "Salva preferenze",
|
32
|
+
closeIconLabel: "Chiudi",
|
33
|
+
sections: [
|
34
|
+
{
|
35
|
+
title: "Uso dei cookie",
|
36
|
+
description: 'Utilizziamo i cookie per garantire la funzionalità di base del sito web e per migliorare la tua esperienza online. Puoi scegliere, per ogni categoria, se acconsentire o meno in qualsiasi momento. Per maggiori dettagli sui cookie e altri dati sensibili, consulta l\'intera <a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a>.',
|
37
|
+
},
|
38
|
+
{
|
39
|
+
title: "Cookie strettamente necessari",
|
40
|
+
description: "Questi cookie sono essenziali per il funzionamento di base del sito web. Consentono funzionalità fondamentali come sicurezza e accessibilità. Senza questi cookie, alcuni servizi e funzionalità potrebbero non funzionare correttamente.",
|
41
|
+
linkedCategory: "necessary",
|
42
|
+
cookieTable: {
|
43
|
+
headers: COOKIE_TABLE_HEADERS,
|
44
|
+
body: [...cookies.necessary.brf(__LANGUAGE__)],
|
45
|
+
},
|
46
|
+
},
|
47
|
+
/** DISABLED– not in use as of 12/17/2024. */
|
48
|
+
// {
|
49
|
+
// title: "Cookie di prestazione",
|
50
|
+
// description:
|
51
|
+
// "Questi cookie ci aiutano a capire come interagisci con il nostro sito web per migliorarne le prestazioni. Tracciano metriche come visualizzazioni di pagina, tempi di caricamento o eventuali errori riscontrati, permettendoci di identificare e risolvere i problemi.",
|
52
|
+
// linkedCategory: "performance",
|
53
|
+
// },
|
54
|
+
{
|
55
|
+
title: "Cookie funzionali",
|
56
|
+
description: "Questi cookie memorizzano le tue preferenze e impostazioni per personalizzare la tua esperienza di navigazione, come ricordare la scelta del tema o della lingua.",
|
57
|
+
linkedCategory: "functional",
|
58
|
+
cookieTable: {
|
59
|
+
headers: COOKIE_TABLE_HEADERS,
|
60
|
+
body: [...cookies.functional.brf(__LANGUAGE__)],
|
61
|
+
},
|
62
|
+
},
|
63
|
+
/** DISABLED– not in use as of 12/17/2024. */
|
64
|
+
// {
|
65
|
+
// title: "Cookie pubblicitari",
|
66
|
+
// description:
|
67
|
+
// "Questi cookie vengono utilizzati per offrire pubblicità pertinenti ai tuoi interessi. Possono tracciare i tuoi comportamenti di navigazione su diversi siti e aiutare gli inserzionisti a servire annunci più personalizzati.",
|
68
|
+
// linkedCategory: "advertising",
|
69
|
+
// },
|
70
|
+
{
|
71
|
+
title: "Cookie di analisi",
|
72
|
+
description: "Questi cookie raccolgono dati anonimi per aiutarci a comprendere come i visitatori interagiscono con il nostro sito web. Le informazioni che forniscono ci aiutano a migliorare l'esperienza dell'utente.",
|
73
|
+
linkedCategory: "analytics",
|
74
|
+
cookieTable: {
|
75
|
+
headers: COOKIE_TABLE_HEADERS,
|
76
|
+
body: [...cookies.analytics.datadog(__LANGUAGE__)],
|
77
|
+
},
|
78
|
+
},
|
79
|
+
{
|
80
|
+
title: "Ulteriori informazioni",
|
81
|
+
description: 'Per qualsiasi domanda relativa alla nostra politica sui cookie e alle tue scelte, ti preghiamo di <a href="mailto:privacy@tilli.pro">contattarci</a>.',
|
82
|
+
},
|
83
|
+
],
|
84
|
+
},
|
85
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/config/translations/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACxD,MAAM,MAAM,MAAM,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAE,CAAC"}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CookieConsentInit.client.d.ts","sourceRoot":"","sources":["../../src/react-components/CookieConsentInit.client.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,iBAAiB,SAsBxC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use client";
|
2
|
+
import { useEffect } from "react";
|
3
|
+
import { run } from "@tilli-pro/cookieconsent";
|
4
|
+
import { COOKIE_CONSENT_ENABLED } from "../_consts";
|
5
|
+
import config from "../config";
|
6
|
+
import { injectReactRemoveScrollToggle } from "../config/gui-options/scripts/forceDisableReactRemoveScroll";
|
7
|
+
import injectManageCookiePrefsButton from "../config/gui-options/scripts/injectManageCookiePrefsButton";
|
8
|
+
export default function CookieConsentInit() {
|
9
|
+
useEffect(() => {
|
10
|
+
if (!COOKIE_CONSENT_ENABLED)
|
11
|
+
return;
|
12
|
+
void (async () => {
|
13
|
+
/** inject the cookie-consent banner (pop-up) */
|
14
|
+
await run(config);
|
15
|
+
/** ...then, inject the floating cookie consent "manage preferences" icon button into the DOM (floats @ the bottom right) */
|
16
|
+
injectManageCookiePrefsButton();
|
17
|
+
/** ...and, force-disable "react-remove-scroll" -- only upon opening up the "manage preferences" dialog
|
18
|
+
*
|
19
|
+
* > this handles the edge case where there's a shadcn (radix-ui) dialog open
|
20
|
+
* underneath the cookie banner's "manage preferences" dialog, which prevents
|
21
|
+
* the user from scrolling within the manage prefs dialog
|
22
|
+
*/
|
23
|
+
injectReactRemoveScrollToggle();
|
24
|
+
})();
|
25
|
+
}, []);
|
26
|
+
return null;
|
27
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import "server-only";
|
2
|
+
import "@tilli-pro/cookieconsent/dist/cookieconsent.css";
|
3
|
+
import "./styles/tenants/freeman.css";
|
4
|
+
import "./styles/tenants/frontier.css";
|
5
|
+
/** we use a server component to handle dynamic injection of the script all together
|
6
|
+
* > basically, there's no need to inject the client-side cookie-consent script if it's not in scope */
|
7
|
+
export default function CookieConsentInit(): import("react").JSX.Element | null;
|
8
|
+
//# sourceMappingURL=CookieConsentInit.server.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CookieConsentInit.server.d.ts","sourceRoot":"","sources":["../../src/react-components/CookieConsentInit.server.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAKrB,OAAO,iDAAiD,CAAC;AACzD,OAAO,8BAA8B,CAAC;AACtC,OAAO,+BAA+B,CAAC;AAEvC;uGACuG;AACvG,MAAM,CAAC,OAAO,UAAU,iBAAiB,uCAExC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import "server-only";
|
2
|
+
import { COOKIE_CONSENT_ENABLED } from "../_consts";
|
3
|
+
import CookieConsentInitClient from "./CookieConsentInit.client";
|
4
|
+
import "@tilli-pro/cookieconsent/dist/cookieconsent.css";
|
5
|
+
import "./styles/tenants/freeman.css";
|
6
|
+
import "./styles/tenants/frontier.css";
|
7
|
+
/** we use a server component to handle dynamic injection of the script all together
|
8
|
+
* > basically, there's no need to inject the client-side cookie-consent script if it's not in scope */
|
9
|
+
export default function CookieConsentInit() {
|
10
|
+
return COOKIE_CONSENT_ENABLED ? <CookieConsentInitClient /> : null;
|
11
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { Theme } from "~/features/v2/components/theme/types";
|
2
|
+
interface CookieConsentThemeParams {
|
3
|
+
theme?: Theme;
|
4
|
+
defaultTo?: Exclude<Theme, "system">;
|
5
|
+
tenantRefId?: string;
|
6
|
+
url?: URL | null;
|
7
|
+
}
|
8
|
+
export declare const cookieConsentTheme: ({ theme, defaultTo, tenantRefId, url, }: CookieConsentThemeParams) => string | undefined;
|
9
|
+
export {};
|
10
|
+
//# sourceMappingURL=_utils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_utils.d.ts","sourceRoot":"","sources":["../../src/react-components/_utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAWlE,UAAU,wBAAwB;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,4CAK5B,wBAAwB,uBAsC1B,CAAC"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { COOKIE_CONSENT_TEST_SEARCH_PARAM_KEY_PREFIX } from "../_consts";
|
2
|
+
const SUPPORTED_TENANT_THEMES = {
|
3
|
+
freeman: ["light"],
|
4
|
+
frontier: ["light"],
|
5
|
+
};
|
6
|
+
export const cookieConsentTheme = ({ theme, defaultTo = "light", tenantRefId, url, }) => {
|
7
|
+
theme ??= defaultTo; // apply default theme (if not provided)
|
8
|
+
/** handle cookie consent __test__ overrides */
|
9
|
+
if (url) {
|
10
|
+
const prefix = COOKIE_CONSENT_TEST_SEARCH_PARAM_KEY_PREFIX;
|
11
|
+
const searchParams = new URLSearchParams(url.search);
|
12
|
+
const cookieConsentTestParams = Object.fromEntries(["lang", "locale", "tenant", "product", "theme"].map((key) => [
|
13
|
+
key,
|
14
|
+
searchParams.get(`${prefix}${key}`),
|
15
|
+
]));
|
16
|
+
if (cookieConsentTestParams.tenant)
|
17
|
+
tenantRefId = cookieConsentTestParams.tenant;
|
18
|
+
if (cookieConsentTestParams.theme)
|
19
|
+
theme = cookieConsentTestParams.theme;
|
20
|
+
}
|
21
|
+
/** handle tenant-specific themes */
|
22
|
+
const tenantThemes = SUPPORTED_TENANT_THEMES[tenantRefId];
|
23
|
+
if (tenantThemes?.includes(theme))
|
24
|
+
return `cc--tenant:${tenantRefId}-${theme}`;
|
25
|
+
/** fallback to first tenant theme */
|
26
|
+
if (tenantThemes)
|
27
|
+
return `cc--tenant:${tenantRefId}-${tenantThemes[0]}`;
|
28
|
+
/** handle dark mode */
|
29
|
+
if (theme === "dark")
|
30
|
+
return "cc--elegant-black dark";
|
31
|
+
};
|