@tilli-pro/cookieconsent-plugin 0.1.0

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 (39) hide show
  1. package/eslint.config.js +13 -0
  2. package/package.json +38 -0
  3. package/src/_consts.ts +8 -0
  4. package/src/assets/cookie.ts +11 -0
  5. package/src/assets/index.ts +5 -0
  6. package/src/assets/logo.ts +21 -0
  7. package/src/config/categories/index.ts +53 -0
  8. package/src/config/categories/labels.ts +20 -0
  9. package/src/config/cookies/_utils.server.ts +24 -0
  10. package/src/config/cookies/_utils.ts +53 -0
  11. package/src/config/cookies/analytics/datadog.ts +38 -0
  12. package/src/config/cookies/common-translations.ts +31 -0
  13. package/src/config/cookies/functional/brf/v2.ts +34 -0
  14. package/src/config/cookies/index.ts +22 -0
  15. package/src/config/cookies/necessary/brf/v2-auth.ts +51 -0
  16. package/src/config/cookies/necessary/next-auth.ts +106 -0
  17. package/src/config/cookies/types.ts +45 -0
  18. package/src/config/gui-options/html-components/ManageCookiePrefsButton.ts +121 -0
  19. package/src/config/gui-options/html-components/TilliXCallout.ts +34 -0
  20. package/src/config/gui-options/html-components/assets/CookieIcon.ts +15 -0
  21. package/src/config/gui-options/index.ts +19 -0
  22. package/src/config/gui-options/scripts/cookiePrefsButtonDragObserver.ts +180 -0
  23. package/src/config/gui-options/scripts/forceDisableReactRemoveScroll.ts +152 -0
  24. package/src/config/gui-options/scripts/injectManageCookiePrefsButton.ts +50 -0
  25. package/src/config/index.ts +15 -0
  26. package/src/config/translations/de/index.ts +103 -0
  27. package/src/config/translations/en/index.ts +103 -0
  28. package/src/config/translations/es/index.ts +103 -0
  29. package/src/config/translations/fr/index.ts +103 -0
  30. package/src/config/translations/index.ts +15 -0
  31. package/src/config/translations/it/index.ts +103 -0
  32. package/src/config/translations/types.ts +2 -0
  33. package/src/react-components/CookieConsentInit.client.tsx +34 -0
  34. package/src/react-components/CookieConsentInit.server.tsx +14 -0
  35. package/src/react-components/_types.ts +7 -0
  36. package/src/react-components/_utils.ts +62 -0
  37. package/src/react-components/styles/tenants/freeman.css +63 -0
  38. package/src/react-components/styles/tenants/frontier.css +71 -0
  39. package/tsconfig.json +15 -0
@@ -0,0 +1,103 @@
1
+ import type { Translation } from "@tilli-pro/cookieconsent";
2
+
3
+ import type { CookieTableHeaders } from "../../cookies/types";
4
+ import cookies from "../../cookies";
5
+ import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
6
+ import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
7
+
8
+ const __LANGUAGE__ = "de"; // "German" ("Deutsch")
9
+
10
+ const COOKIE_TABLE_HEADERS: CookieTableHeaders = {
11
+ name: "Name",
12
+ service: "Dienst",
13
+ description: "Beschreibung",
14
+ expiration: "Ablauf",
15
+ };
16
+
17
+ export default {
18
+ consentModal: {
19
+ title: `${CookieIcon()} Cookie-Hinweis`,
20
+ description: `{{revisionMessage}}Wir verwenden Cookies, um Ihre Erfahrung auf unserer Website zu verbessern. Unbedingt erforderliche Cookies sind für die Funktionalität dieser Website unerlässlich und können nicht deaktiviert werden. Andere Cookies erfordern Ihre Zustimmung. Durch Klicken auf "Alle akzeptieren" stimmen Sie der Verwendung von Cookies zu. Alternativ können Sie Ihre Cookie-Einstellungen verwalten, indem Sie unten auf die Schaltfläche "Einstellungen verwalten" klicken. Sie können Ihre Cookie-Einstellungen jederzeit über das Symbol ${CookieIcon(1, 0.5, 0, -0.3333)} in der unteren rechten Ecke überprüfen und aktualisieren. Weitere Informationen finden Sie in unserer <a href="https://tilli.pro/privacy-policy" target="_blank">Datenschutzerklärung</a>.`,
21
+ acceptAllBtn: "Alle akzeptieren",
22
+ acceptNecessaryBtn: "Nur unbedingt erforderliche",
23
+ showPreferencesBtn: "Einstellungen verwalten",
24
+ // closeIconLabel: "Schließen", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
25
+ revisionMessage: `Unsere <a href="https://tilli.pro/privacy-policy" target="_blank">Datenschutzerklärung</a> wurde kürzlich aktualisiert. <br><br> `,
26
+ footer: `
27
+ <a href="https://tilli.pro/privacy-policy" target="_blank">Datenschutzerklärung</a>
28
+ <a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Allgemeine Geschäftsbedingungen</a>
29
+
30
+ ${TilliXCallout(__LANGUAGE__)}
31
+ `,
32
+ },
33
+
34
+ preferencesModal: {
35
+ title: `${TilliXCallout(__LANGUAGE__, 1)} Cookie-Einstellungen verwalten`,
36
+ acceptAllBtn: "Alle akzeptieren",
37
+ acceptNecessaryBtn: "Nur unbedingt erforderliche",
38
+ savePreferencesBtn: "Einstellungen speichern",
39
+ closeIconLabel: "Schließen",
40
+ sections: [
41
+ {
42
+ title: "Verwendung von Cookies",
43
+ description:
44
+ 'Wir verwenden Cookies, um die grundlegende Funktionalität der Website zu gewährleisten und Ihre Online-Erfahrung zu verbessern. Sie können für jede Kategorie auswählen, ob Sie zustimmen oder ablehnen möchten. Weitere Informationen zu Cookies und anderen sensiblen Daten finden Sie in der vollständigen <a href="https://tilli.pro/privacy-policy" target="_blank">Datenschutzerklärung</a>.',
45
+ },
46
+
47
+ {
48
+ title: "Unbedingt erforderliche Cookies",
49
+ description:
50
+ "Diese Cookies sind für die grundlegende Funktionalität der Website unerlässlich. Sie ermöglichen Kernfunktionen wie Sicherheit und Barrierefreiheit. Ohne diese Cookies können bestimmte Dienste und Funktionen nicht ordnungsgemäß funktionieren.",
51
+ linkedCategory: "necessary",
52
+ cookieTable: {
53
+ headers: COOKIE_TABLE_HEADERS,
54
+ body: [...cookies.necessary.brf(__LANGUAGE__)],
55
+ },
56
+ },
57
+
58
+ /** DISABLED– not in use as of 12/17/2024. */
59
+ // {
60
+ // title: "Leistungs-Cookies",
61
+ // description:
62
+ // "Diese Cookies helfen uns zu verstehen, wie Sie mit unserer Website interagieren, um deren Leistung zu verbessern. Sie verfolgen Metriken wie Seitenaufrufe, Ladezeiten oder auftretende Fehler und helfen uns, Probleme zu erkennen und zu beheben.",
63
+ // linkedCategory: "performance",
64
+ // },
65
+
66
+ {
67
+ title: "Funktionale Cookies",
68
+ description:
69
+ "Diese Cookies speichern Ihre Präferenzen und Einstellungen, um Ihre Browsing-Erfahrung zu personalisieren, z. B. durch das Speichern Ihrer Themen- oder Spracheinstellungen.",
70
+ linkedCategory: "functional",
71
+ cookieTable: {
72
+ headers: COOKIE_TABLE_HEADERS,
73
+ body: [...cookies.functional.brf(__LANGUAGE__)],
74
+ },
75
+ },
76
+
77
+ /** DISABLED– not in use as of 12/17/2024. */
78
+ // {
79
+ // title: "Werbe-Cookies",
80
+ // description:
81
+ // "Diese Cookies werden verwendet, um Werbung bereitzustellen, die für Ihre Interessen relevant ist. Sie können Ihr Surfverhalten auf verschiedenen Websites verfolgen und Werbetreibenden helfen, personalisierte Anzeigen anzuzeigen.",
82
+ // linkedCategory: "advertising",
83
+ // },
84
+
85
+ {
86
+ title: "Analyse-Cookies",
87
+ description:
88
+ "Diese Cookies sammeln anonymisierte Daten, um uns zu helfen, zu verstehen, wie Besucher mit unserer Website interagieren. Die von ihnen bereitgestellten Erkenntnisse helfen uns, die Benutzererfahrung zu verbessern.",
89
+ linkedCategory: "analytics",
90
+ cookieTable: {
91
+ headers: COOKIE_TABLE_HEADERS,
92
+ body: [...cookies.analytics.datadog(__LANGUAGE__)],
93
+ },
94
+ },
95
+
96
+ {
97
+ title: "Weitere Informationen",
98
+ description:
99
+ 'Bei Fragen zu unserer Cookie-Richtlinie und Ihren Auswahlmöglichkeiten kontaktieren Sie uns bitte unter <a href="mailto:privacy@tilli.pro">privacy@tilli.pro</a>.',
100
+ },
101
+ ],
102
+ },
103
+ } satisfies Translation;
@@ -0,0 +1,103 @@
1
+ import type { Translation } from "@tilli-pro/cookieconsent";
2
+
3
+ import type { CookieTableHeaders } from "../../cookies/types";
4
+ import cookies from "../../cookies";
5
+ import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
6
+ import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
7
+
8
+ const __LANGUAGE__ = "en"; // "English" ("English")
9
+
10
+ const COOKIE_TABLE_HEADERS: CookieTableHeaders = {
11
+ name: "Name",
12
+ service: "Service",
13
+ description: "Description",
14
+ expiration: "Expiration",
15
+ };
16
+
17
+ export default {
18
+ consentModal: {
19
+ title: `${CookieIcon()} Cookie Notice`,
20
+ description: `{{revisionMessage}}We use cookies to improve your experience on our website. Strictly necessary cookies are essential for this site's functionality and cannot be turned off. Other cookies require your consent. By clicking "Accept all," you consent to our use of cookies. Alternatively, you can manage your cookie preferences by selecting the "Manage preferences" button below. You can review and update your cookie preferences anytime via the ${CookieIcon(1, 0.5, 0, -0.3333)} icon in the bottom-right corner. Please read our <a href="https://tilli.pro/privacy-policy" target="_blank">Privacy Policy</a> for more information.`,
21
+ acceptAllBtn: "Accept all",
22
+ acceptNecessaryBtn: "Strictly necessary only",
23
+ showPreferencesBtn: "Manage preferences",
24
+ // closeIconLabel: "Close", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
25
+ revisionMessage: `Our <a href="https://tilli.pro/privacy-policy" target="_blank">Privacy Policy</a> was recently updated. <br><br> `,
26
+ footer: `
27
+ <a href="https://tilli.pro/privacy-policy" target="_blank">Privacy Policy</a>
28
+ <a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Terms & Conditions</a>
29
+
30
+ ${TilliXCallout(__LANGUAGE__)}
31
+ `,
32
+ },
33
+
34
+ preferencesModal: {
35
+ title: `${TilliXCallout(__LANGUAGE__, 1)} Manage cookie preferences`,
36
+ acceptAllBtn: "Accept all",
37
+ acceptNecessaryBtn: "Strictly necessary only",
38
+ savePreferencesBtn: "Save preferences",
39
+ closeIconLabel: "Close",
40
+ sections: [
41
+ {
42
+ title: "Cookie Usage",
43
+ description:
44
+ 'We use cookies to ensure basic website functionality and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="https://tilli.pro/privacy-policy" target="_blank">Privacy Policy</a>.',
45
+ },
46
+
47
+ {
48
+ title: "Strictly necessary cookies",
49
+ description:
50
+ "These cookies are essential for the basic functioning of the website. They enable core functionalities such as security and accessibility. Without these cookies, certain services and functionality may not work properly.",
51
+ linkedCategory: "necessary",
52
+ cookieTable: {
53
+ headers: COOKIE_TABLE_HEADERS,
54
+ body: [...cookies.necessary.brf(__LANGUAGE__)],
55
+ },
56
+ },
57
+
58
+ /** DISABLED– not in use as of 12/17/2024. */
59
+ // {
60
+ // title: "Performance cookies",
61
+ // description:
62
+ // "These cookies help us understand how you interact with our website to enhance its performance. They track metrics such as page views, loading times or any errors encountered, allowing us to identify and resolve the issues.",
63
+ // linkedCategory: "performance",
64
+ // },
65
+
66
+ {
67
+ title: "Functional cookies",
68
+ description:
69
+ "These cookies remember your preferences and settings to personalize your browsing experience, such as remembering your theme or language choices.",
70
+ linkedCategory: "functional",
71
+ cookieTable: {
72
+ headers: COOKIE_TABLE_HEADERS,
73
+ body: [...cookies.functional.brf(__LANGUAGE__)],
74
+ },
75
+ },
76
+
77
+ /** DISABLED– not in use as of 12/17/2024. */
78
+ // {
79
+ // title: "Advertising cookies",
80
+ // description:
81
+ // "These cookies are used to deliver advertisements that are relevant to your interests. They may track your browsing behaviours across different sites and help advertisers serve more personalized ads.",
82
+ // linkedCategory: "advertising",
83
+ // },
84
+
85
+ {
86
+ title: "Analytics cookies",
87
+ description:
88
+ "These cookies collect anonymized data to help us understand how visitors interact with our website. The insights they provide help us improve the user experience.",
89
+ linkedCategory: "analytics",
90
+ cookieTable: {
91
+ headers: COOKIE_TABLE_HEADERS,
92
+ body: [...cookies.analytics.datadog(__LANGUAGE__)],
93
+ },
94
+ },
95
+
96
+ {
97
+ title: "More information",
98
+ description:
99
+ 'For any queries in relation to our policy on cookies and your choices, please <a href="mailto:privacy@tilli.pro">contact us</a>.',
100
+ },
101
+ ],
102
+ },
103
+ } satisfies Translation;
@@ -0,0 +1,103 @@
1
+ import type { Translation } from "@tilli-pro/cookieconsent";
2
+
3
+ import type { CookieTableHeaders } from "../../cookies/types";
4
+ import cookies from "../../cookies";
5
+ import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
6
+ import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
7
+
8
+ const __LANGUAGE__ = "es"; // "Spanish" ("Español")
9
+
10
+ const COOKIE_TABLE_HEADERS: CookieTableHeaders = {
11
+ name: "Nombre",
12
+ service: "Servicio",
13
+ description: "Descripción",
14
+ expiration: "Vencimiento",
15
+ };
16
+
17
+ export default {
18
+ consentModal: {
19
+ title: `${CookieIcon()} Aviso de Cookies`,
20
+ description: `{{revisionMessage}}Utilizamos cookies para mejorar tu experiencia en nuestro sitio web. Las cookies estrictamente necesarias son esenciales para el funcionamiento de este sitio y no se pueden desactivar. Otras cookies requieren tu consentimiento. Al hacer clic en "Aceptar todas", consientes el uso de nuestras cookies. Alternativamente, puedes gestionar tus preferencias de cookies seleccionando el botón "Gestionar preferencias" a continuación. Puedes revisar y actualizar tus preferencias de cookies en cualquier momento mediante el icono ${CookieIcon(1, 0.5, 0, -0.3333)} en la esquina inferior derecha. Por favor, lee nuestra <a href="https://tilli.pro/privacy-policy" target="_blank">Política de Privacidad</a> para más información.`,
21
+ acceptAllBtn: "Aceptar todas",
22
+ acceptNecessaryBtn: "Solo estrictamente necesarias",
23
+ showPreferencesBtn: "Gestionar preferencias",
24
+ // closeIconLabel: "Cerrar", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
25
+ revisionMessage: `Nuestra <a href="https://tilli.pro/privacy-policy" target="_blank">Política de Privacidad</a> se actualizó recientemente. <br><br> `,
26
+ footer: `
27
+ <a href="https://tilli.pro/privacy-policy" target="_blank">Política de Privacidad</a>
28
+ <a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Términos y Condiciones</a>
29
+
30
+ ${TilliXCallout(__LANGUAGE__)}
31
+ `,
32
+ },
33
+
34
+ preferencesModal: {
35
+ title: `${TilliXCallout(__LANGUAGE__, 1)} Gestionar preferencias de cookies`,
36
+ acceptAllBtn: "Aceptar todas",
37
+ acceptNecessaryBtn: "Solo estrictamente necesarias",
38
+ savePreferencesBtn: "Guardar preferencias",
39
+ closeIconLabel: "Cerrar",
40
+ sections: [
41
+ {
42
+ title: "Uso de cookies",
43
+ description:
44
+ 'Utilizamos cookies para garantizar la funcionalidad básica del sitio web y para mejorar tu experiencia en línea. Puedes elegir, para cada categoría, habilitarlas o deshabilitarlas cuando lo desees. Para más detalles relacionados con cookies y otros datos sensibles, por favor lee la <a href="https://tilli.pro/privacy-policy" target="_blank">Política de Privacidad</a> completa.',
45
+ },
46
+
47
+ {
48
+ title: "Cookies estrictamente necesarias",
49
+ description:
50
+ "Estas cookies son esenciales para el funcionamiento básico del sitio web. Permiten funcionalidades clave como la seguridad y la accesibilidad. Sin estas cookies, ciertos servicios y funcionalidades pueden no funcionar correctamente.",
51
+ linkedCategory: "necessary",
52
+ cookieTable: {
53
+ headers: COOKIE_TABLE_HEADERS,
54
+ body: [...cookies.necessary.brf(__LANGUAGE__)],
55
+ },
56
+ },
57
+
58
+ /** DISABLED– not in use as of 12/17/2024. */
59
+ // {
60
+ // title: "Cookies de rendimiento",
61
+ // description:
62
+ // "Estas cookies nos ayudan a entender cómo interactúas con nuestro sitio web para mejorar su rendimiento. Rastrean métricas como vistas de página, tiempos de carga o cualquier error encontrado, permitiéndonos identificar y resolver problemas.",
63
+ // linkedCategory: "performance",
64
+ // },
65
+
66
+ {
67
+ title: "Cookies funcionales",
68
+ description:
69
+ "Estas cookies recuerdan tus preferencias y configuraciones para personalizar tu experiencia de navegación, como recordar tus elecciones de idioma o tema.",
70
+ linkedCategory: "functional",
71
+ cookieTable: {
72
+ headers: COOKIE_TABLE_HEADERS,
73
+ body: [...cookies.functional.brf(__LANGUAGE__)],
74
+ },
75
+ },
76
+
77
+ /** DISABLED– not in use as of 12/17/2024. */
78
+ // {
79
+ // title: "Cookies de publicidad",
80
+ // description:
81
+ // "Estas cookies se utilizan para mostrar anuncios relevantes según tus intereses. Pueden rastrear tu comportamiento de navegación en diferentes sitios y ayudar a los anunciantes a ofrecer anuncios más personalizados.",
82
+ // linkedCategory: "advertising",
83
+ // },
84
+
85
+ {
86
+ title: "Cookies de análisis",
87
+ description:
88
+ "Estas cookies recopilan datos anonimizados para ayudarnos a entender cómo los visitantes interactúan con nuestro sitio web. Los conocimientos que proporcionan nos ayudan a mejorar la experiencia del usuario.",
89
+ linkedCategory: "analytics",
90
+ cookieTable: {
91
+ headers: COOKIE_TABLE_HEADERS,
92
+ body: [...cookies.analytics.datadog(__LANGUAGE__)],
93
+ },
94
+ },
95
+
96
+ {
97
+ title: "Más información",
98
+ description:
99
+ 'Para cualquier consulta relacionada con nuestra política de cookies y tus opciones, por favor <a href="mailto:privacy@tilli.pro">contáctanos</a>.',
100
+ },
101
+ ],
102
+ },
103
+ } satisfies Translation;
@@ -0,0 +1,103 @@
1
+ import type { Translation } from "@tilli-pro/cookieconsent";
2
+
3
+ import type { CookieTableHeaders } from "../../cookies/types";
4
+ import cookies from "../../cookies";
5
+ import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
6
+ import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
7
+
8
+ const __LANGUAGE__ = "fr"; // "French" ("Français")
9
+
10
+ const COOKIE_TABLE_HEADERS: CookieTableHeaders = {
11
+ name: "Nom",
12
+ service: "Service",
13
+ description: "Description",
14
+ expiration: "Expiration",
15
+ };
16
+
17
+ export default {
18
+ consentModal: {
19
+ title: `${CookieIcon()} Notification sur les cookies`,
20
+ description: `{{revisionMessage}}Nous utilisons des cookies pour améliorer votre expérience sur notre site. Les cookies strictement nécessaires sont essentiels au fonctionnement de ce site et ne peuvent pas être désactivés. Les autres cookies nécessitent votre consentement. En cliquant sur "Tout accepter", vous consentez à l'utilisation de nos cookies. Vous pouvez également gérer vos préférences en matière de cookies en sélectionnant le bouton "Gérer les préférences" ci-dessous. Vous pouvez consulter et mettre à jour vos préférences relatives aux cookies à tout moment via l'icône ${CookieIcon(1, 0.5, 0, -0.3333)} en bas à droite. Veuillez lire notre <a href="https://tilli.pro/privacy-policy" target="_blank">Politique de confidentialité</a> pour plus d'informations.`,
21
+ acceptAllBtn: "Tout accepter",
22
+ acceptNecessaryBtn: "Strictement nécessaires uniquement",
23
+ showPreferencesBtn: "Gérer les préférences",
24
+ // closeIconLabel: "Fermer", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
25
+ revisionMessage: `Notre <a href="https://tilli.pro/privacy-policy" target="_blank">Politique de confidentialité</a> a récemment été mise à jour. <br><br> `,
26
+ footer: `
27
+ <a href="https://tilli.pro/privacy-policy" target="_blank">Politique de confidentialité</a>
28
+ <a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Conditions générales</a>
29
+
30
+ ${TilliXCallout(__LANGUAGE__)}
31
+ `,
32
+ },
33
+
34
+ preferencesModal: {
35
+ title: `${TilliXCallout(__LANGUAGE__, 1)} Gérer les préférences en matière de cookies`,
36
+ acceptAllBtn: "Tout accepter",
37
+ acceptNecessaryBtn: "Strictement nécessaires uniquement",
38
+ savePreferencesBtn: "Enregistrer les préférences",
39
+ closeIconLabel: "Fermer",
40
+ sections: [
41
+ {
42
+ title: "Utilisation des cookies",
43
+ description:
44
+ 'Nous utilisons des cookies pour garantir les fonctionnalités de base du site et améliorer votre expérience en ligne. Vous pouvez choisir d’activer/désactiver chaque catégorie à tout moment. Pour plus de détails sur les cookies et autres données sensibles, veuillez consulter la <a href="https://tilli.pro/privacy-policy" target="_blank">Politique de confidentialité</a>.',
45
+ },
46
+
47
+ {
48
+ title: "Cookies strictement nécessaires",
49
+ description:
50
+ "Ces cookies sont essentiels au bon fonctionnement du site. Ils permettent des fonctionnalités de base telles que la sécurité et l’accessibilité. Sans ces cookies, certains services et fonctionnalités peuvent ne pas fonctionner correctement.",
51
+ linkedCategory: "necessary",
52
+ cookieTable: {
53
+ headers: COOKIE_TABLE_HEADERS,
54
+ body: [...cookies.necessary.brf(__LANGUAGE__)],
55
+ },
56
+ },
57
+
58
+ /** DISABLED– not in use as of 12/17/2024. */
59
+ // {
60
+ // title: "Cookies de performance",
61
+ // description:
62
+ // "Ces cookies nous aident à comprendre comment vous interagissez avec notre site pour en améliorer les performances. Ils suivent des métriques telles que les pages consultées, les temps de chargement ou les erreurs rencontrées, nous permettant d'identifier et de résoudre les problèmes.",
63
+ // linkedCategory: "performance",
64
+ // },
65
+
66
+ {
67
+ title: "Cookies fonctionnels",
68
+ description:
69
+ "Ces cookies mémorisent vos préférences et paramètres pour personnaliser votre expérience de navigation, comme le choix du thème ou de la langue.",
70
+ linkedCategory: "functional",
71
+ cookieTable: {
72
+ headers: COOKIE_TABLE_HEADERS,
73
+ body: [...cookies.functional.brf(__LANGUAGE__)],
74
+ },
75
+ },
76
+
77
+ /** DISABLED– not in use as of 12/17/2024. */
78
+ // {
79
+ // title: "Cookies publicitaires",
80
+ // description:
81
+ // "Ces cookies sont utilisés pour diffuser des publicités correspondant à vos centres d’intérêt. Ils peuvent suivre vos comportements de navigation sur différents sites et aider les annonceurs à proposer des annonces plus personnalisées.",
82
+ // linkedCategory: "advertising",
83
+ // },
84
+
85
+ {
86
+ title: "Cookies d’analyse",
87
+ description:
88
+ "Ces cookies collectent des données anonymisées pour nous aider à comprendre comment les visiteurs interagissent avec notre site. Les informations qu’ils fournissent nous permettent d’améliorer l’expérience utilisateur.",
89
+ linkedCategory: "analytics",
90
+ cookieTable: {
91
+ headers: COOKIE_TABLE_HEADERS,
92
+ body: [...cookies.analytics.datadog(__LANGUAGE__)],
93
+ },
94
+ },
95
+
96
+ {
97
+ title: "Plus d'informations",
98
+ description:
99
+ 'Pour toute question relative à notre politique sur les cookies et vos choix, veuillez <a href="mailto:privacy@tilli.pro">nous contacter</a>.',
100
+ },
101
+ ],
102
+ },
103
+ } satisfies Translation;
@@ -0,0 +1,15 @@
1
+ import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
2
+
3
+ import de from "./de";
4
+ import en from "./en";
5
+ import es from "./es";
6
+ import fr from "./fr";
7
+ import it from "./it";
8
+
9
+ export default {
10
+ de,
11
+ en,
12
+ es,
13
+ fr,
14
+ it,
15
+ } satisfies CookieConsentConfig["language"]["translations"];
@@ -0,0 +1,103 @@
1
+ import type { Translation } from "@tilli-pro/cookieconsent";
2
+
3
+ import type { CookieTableHeaders } from "../../cookies/types";
4
+ import cookies from "../../cookies";
5
+ import CookieIcon from "../../gui-options/html-components/assets/CookieIcon";
6
+ import TilliXCallout from "../../gui-options/html-components/TilliXCallout";
7
+
8
+ const __LANGUAGE__ = "it"; // "Italian" ("Italiano")
9
+
10
+ const COOKIE_TABLE_HEADERS: CookieTableHeaders = {
11
+ name: "Nome",
12
+ service: "Servizio",
13
+ description: "Descrizione",
14
+ expiration: "Scadenza",
15
+ };
16
+
17
+ export default {
18
+ consentModal: {
19
+ title: `${CookieIcon()} Informativa sui Cookie`,
20
+ 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.`,
21
+ acceptAllBtn: "Accetta tutto",
22
+ acceptNecessaryBtn: "Solo strettamente necessari",
23
+ showPreferencesBtn: "Gestisci preferenze",
24
+ // closeIconLabel: "Chiudi", // generates a big "X" ("accept necessary") button – let's disable it for now (to force a choice)
25
+ revisionMessage: `La nostra <a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a> è stata recentemente aggiornata. <br><br> `,
26
+ footer: `
27
+ <a href="https://tilli.pro/privacy-policy" target="_blank">Informativa sulla Privacy</a>
28
+ <a href="https://tilli.pro/industries/terms-and-conditions" target="_blank">Termini e Condizioni</a>
29
+
30
+ ${TilliXCallout(__LANGUAGE__)}
31
+ `,
32
+ },
33
+
34
+ preferencesModal: {
35
+ title: `${TilliXCallout(__LANGUAGE__, 1)} Gestisci preferenze sui cookie`,
36
+ acceptAllBtn: "Accetta tutto",
37
+ acceptNecessaryBtn: "Solo strettamente necessari",
38
+ savePreferencesBtn: "Salva preferenze",
39
+ closeIconLabel: "Chiudi",
40
+ sections: [
41
+ {
42
+ title: "Uso dei cookie",
43
+ description:
44
+ '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>.',
45
+ },
46
+
47
+ {
48
+ title: "Cookie strettamente necessari",
49
+ description:
50
+ "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.",
51
+ linkedCategory: "necessary",
52
+ cookieTable: {
53
+ headers: COOKIE_TABLE_HEADERS,
54
+ body: [...cookies.necessary.brf(__LANGUAGE__)],
55
+ },
56
+ },
57
+
58
+ /** DISABLED– not in use as of 12/17/2024. */
59
+ // {
60
+ // title: "Cookie di prestazione",
61
+ // description:
62
+ // "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.",
63
+ // linkedCategory: "performance",
64
+ // },
65
+
66
+ {
67
+ title: "Cookie funzionali",
68
+ description:
69
+ "Questi cookie memorizzano le tue preferenze e impostazioni per personalizzare la tua esperienza di navigazione, come ricordare la scelta del tema o della lingua.",
70
+ linkedCategory: "functional",
71
+ cookieTable: {
72
+ headers: COOKIE_TABLE_HEADERS,
73
+ body: [...cookies.functional.brf(__LANGUAGE__)],
74
+ },
75
+ },
76
+
77
+ /** DISABLED– not in use as of 12/17/2024. */
78
+ // {
79
+ // title: "Cookie pubblicitari",
80
+ // description:
81
+ // "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.",
82
+ // linkedCategory: "advertising",
83
+ // },
84
+
85
+ {
86
+ title: "Cookie di analisi",
87
+ description:
88
+ "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.",
89
+ linkedCategory: "analytics",
90
+ cookieTable: {
91
+ headers: COOKIE_TABLE_HEADERS,
92
+ body: [...cookies.analytics.datadog(__LANGUAGE__)],
93
+ },
94
+ },
95
+
96
+ {
97
+ title: "Ulteriori informazioni",
98
+ description:
99
+ 'Per qualsiasi domanda relativa alla nostra politica sui cookie e alle tue scelte, ti preghiamo di <a href="mailto:privacy@tilli.pro">contattarci</a>.',
100
+ },
101
+ ],
102
+ },
103
+ } satisfies Translation;
@@ -0,0 +1,2 @@
1
+ export type Language = "de" | "en" | "es" | "fr" | "it";
2
+ export type Locale = `${Language}-${string}`; // -> "de-DE" | "en-US" | "es-ES" | "fr-FR" | "it-IT" | ...
@@ -0,0 +1,34 @@
1
+ "use client";
2
+
3
+ import { useEffect } from "react";
4
+
5
+ import { run } from "@tilli-pro/cookieconsent";
6
+
7
+ import { COOKIE_CONSENT_ENABLED } from "../_consts";
8
+ import config from "../config";
9
+ import { injectReactRemoveScrollToggle } from "../config/gui-options/scripts/forceDisableReactRemoveScroll";
10
+ import injectManageCookiePrefsButton from "../config/gui-options/scripts/injectManageCookiePrefsButton";
11
+
12
+ export default function CookieConsentInit() {
13
+ useEffect(() => {
14
+ if (!COOKIE_CONSENT_ENABLED) return;
15
+
16
+ void (async () => {
17
+ /** inject the cookie-consent banner (pop-up) */
18
+ await run(config);
19
+
20
+ /** ...then, inject the floating cookie consent "manage preferences" icon button into the DOM (floats @ the bottom right) */
21
+ injectManageCookiePrefsButton();
22
+
23
+ /** ...and, force-disable "react-remove-scroll" -- only upon opening up the "manage preferences" dialog
24
+ *
25
+ * > this handles the edge case where there's a shadcn (radix-ui) dialog open
26
+ * underneath the cookie banner's "manage preferences" dialog, which prevents
27
+ * the user from scrolling within the manage prefs dialog
28
+ */
29
+ injectReactRemoveScrollToggle();
30
+ })();
31
+ }, []);
32
+
33
+ return null;
34
+ }
@@ -0,0 +1,14 @@
1
+ import "server-only";
2
+
3
+ import { COOKIE_CONSENT_ENABLED } from "../_consts";
4
+ import CookieConsentInitClient from "./CookieConsentInit.client";
5
+
6
+ import "@tilli-pro/cookieconsent/dist/cookieconsent.css";
7
+ import "./styles/tenants/freeman.css";
8
+ import "./styles/tenants/frontier.css";
9
+
10
+ /** we use a server component to handle dynamic injection of the script all together
11
+ * > basically, there's no need to inject the client-side cookie-consent script if it's not in scope */
12
+ export default function CookieConsentInit() {
13
+ return COOKIE_CONSENT_ENABLED ? <CookieConsentInitClient /> : null;
14
+ }
@@ -0,0 +1,7 @@
1
+ export type Theme = "light" | "dark" | "system";
2
+ export type TenantRefId =
3
+ | "nudge" // internal
4
+ | "gps" // internal
5
+ | "freeman"
6
+ | "wgl-energy"
7
+ | "frontier"
@@ -0,0 +1,62 @@
1
+ import type { Language, Locale } from "../config/translations/types";
2
+ import type { TenantRefId, Theme } from "./_types";
3
+ import { COOKIE_CONSENT_TEST_SEARCH_PARAM_KEY_PREFIX } from "../_consts";
4
+
5
+ type SupportedTenantThemes = Partial<Record<TenantRefId, Theme[]>>;
6
+ const SUPPORTED_TENANT_THEMES = {
7
+ freeman: ["light"],
8
+ frontier: ["light"],
9
+ } satisfies SupportedTenantThemes;
10
+ type SupportedTenant = keyof typeof SUPPORTED_TENANT_THEMES;
11
+
12
+ interface CookieConsentThemeParams {
13
+ theme?: Theme;
14
+ defaultTo?: Exclude<Theme, "system">;
15
+ tenantRefId?: string;
16
+ url?: URL | null;
17
+ }
18
+
19
+ export const cookieConsentTheme = ({
20
+ theme,
21
+ defaultTo = "light",
22
+ tenantRefId,
23
+ url,
24
+ }: CookieConsentThemeParams) => {
25
+ theme ??= defaultTo; // apply default theme (if not provided)
26
+
27
+ /** handle cookie consent __test__ overrides */
28
+ if (url) {
29
+ const prefix = COOKIE_CONSENT_TEST_SEARCH_PARAM_KEY_PREFIX;
30
+ const searchParams = new URLSearchParams(url.search);
31
+ const cookieConsentTestParams = Object.fromEntries(
32
+ (["lang", "locale", "tenant", "product", "theme"] as const).map((key) => [
33
+ key,
34
+ searchParams.get(`${prefix}${key}`),
35
+ ]),
36
+ ) as {
37
+ lang?: Language;
38
+ locale?: Locale;
39
+ tenant?: TenantRefId | string; // we cannot guarantee the exact value
40
+ product?: "tilliX" | string; // we cannot guarantee the exact value
41
+ theme?: Exclude<Theme, "system">;
42
+ };
43
+
44
+ if (cookieConsentTestParams.tenant)
45
+ tenantRefId = cookieConsentTestParams.tenant;
46
+
47
+ if (cookieConsentTestParams.theme) theme = cookieConsentTestParams.theme;
48
+ }
49
+
50
+ /** handle tenant-specific themes */
51
+ const tenantThemes = SUPPORTED_TENANT_THEMES[
52
+ tenantRefId as SupportedTenant
53
+ ] as SupportedTenantThemes[SupportedTenant];
54
+ if (tenantThemes?.includes(theme))
55
+ return `cc--tenant:${tenantRefId}-${theme}`;
56
+
57
+ /** fallback to first tenant theme */
58
+ if (tenantThemes) return `cc--tenant:${tenantRefId}-${tenantThemes[0]}`;
59
+
60
+ /** handle dark mode */
61
+ if (theme === "dark") return "cc--elegant-black dark";
62
+ };