@tilli-pro/cookieconsent-plugin 0.2.0 → 0.2.42

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 (82) hide show
  1. package/.cache/tsbuildinfo.json +1 -1
  2. package/dist/_types.d.ts +3 -0
  3. package/dist/_types.d.ts.map +1 -0
  4. package/dist/_types.js +1 -0
  5. package/dist/_utils.d.ts +10 -0
  6. package/dist/_utils.d.ts.map +1 -0
  7. package/dist/_utils.js +31 -0
  8. package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.d.ts.map +1 -1
  9. package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.js +1 -1
  10. package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts +2 -0
  11. package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts.map +1 -1
  12. package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.js +4 -1
  13. package/dist/config/index.d.ts +26 -1
  14. package/dist/config/index.d.ts.map +1 -1
  15. package/dist/config/index.js +5 -1
  16. package/dist/config/translations/de/index.d.ts +5 -0
  17. package/dist/config/translations/de/index.d.ts.map +1 -1
  18. package/dist/config/translations/de/index.js +5 -0
  19. package/dist/config/translations/en/index.d.ts +5 -0
  20. package/dist/config/translations/en/index.d.ts.map +1 -1
  21. package/dist/config/translations/en/index.js +5 -0
  22. package/dist/config/translations/es/index.d.ts +5 -0
  23. package/dist/config/translations/es/index.d.ts.map +1 -1
  24. package/dist/config/translations/es/index.js +5 -0
  25. package/dist/config/translations/fr/index.d.ts +5 -0
  26. package/dist/config/translations/fr/index.d.ts.map +1 -1
  27. package/dist/config/translations/fr/index.js +5 -0
  28. package/dist/config/translations/index.d.ts +25 -0
  29. package/dist/config/translations/index.d.ts.map +1 -1
  30. package/dist/config/translations/it/index.d.ts +5 -0
  31. package/dist/config/translations/it/index.d.ts.map +1 -1
  32. package/dist/config/translations/it/index.js +5 -0
  33. package/dist/init/brf.d.ts +2 -0
  34. package/dist/init/brf.d.ts.map +1 -0
  35. package/dist/init/brf.js +65 -0
  36. package/dist/init/tilli-website.d.ts +2 -0
  37. package/dist/init/tilli-website.d.ts.map +1 -0
  38. package/dist/init/tilli-website.js +24 -0
  39. package/dist/init/utils.d.ts +5 -0
  40. package/dist/init/utils.d.ts.map +1 -0
  41. package/dist/init/utils.js +39 -0
  42. package/dist/init/website.d.ts +2 -0
  43. package/dist/init/website.d.ts.map +1 -0
  44. package/dist/init/website.js +73 -0
  45. package/dist/init.d.ts +15 -1
  46. package/dist/init.d.ts.map +1 -1
  47. package/dist/init.js +76 -3
  48. package/dist/react-components/CookieConsentInit.client.d.ts.map +1 -1
  49. package/dist/react-components/CookieConsentInit.client.js +2 -23
  50. package/dist/react-components/CookieConsentInit.server.d.ts +2 -2
  51. package/dist/react-components/CookieConsentInit.server.d.ts.map +1 -1
  52. package/dist/react-components/CookieConsentInit.server.js +2 -2
  53. package/dist/react-components/hooks/useCookieConsent.d.ts +4 -0
  54. package/dist/react-components/hooks/useCookieConsent.d.ts.map +1 -0
  55. package/dist/react-components/hooks/useCookieConsent.js +17 -0
  56. package/dist/styles/index.d.ts +8 -0
  57. package/dist/styles/index.d.ts.map +1 -0
  58. package/dist/styles/index.js +6 -0
  59. package/package.json +11 -11
  60. package/scripts/postbuild/inject-plugin.ts +127 -9
  61. package/src/{react-components/_utils.ts → _utils.ts} +2 -2
  62. package/src/config/gui-options/scripts/cookiePrefsButtonDragObserver.ts +2 -1
  63. package/src/config/gui-options/scripts/injectManageCookiePrefsButton.ts +13 -1
  64. package/src/config/index.ts +14 -1
  65. package/src/config/translations/de/index.ts +7 -0
  66. package/src/config/translations/en/index.ts +7 -0
  67. package/src/config/translations/es/index.ts +7 -0
  68. package/src/config/translations/fr/index.ts +7 -0
  69. package/src/config/translations/it/index.ts +7 -0
  70. package/src/init/brf.ts +78 -0
  71. package/src/init/tilli-website.ts +37 -0
  72. package/src/init/utils.ts +66 -0
  73. package/src/init.ts +102 -3
  74. package/src/react-components/CookieConsentInit.client.tsx +2 -27
  75. package/src/react-components/CookieConsentInit.server.tsx +2 -2
  76. package/src/react-components/hooks/useCookieConsent.ts +30 -0
  77. package/src/styles/index.ts +6 -0
  78. package/src/styles/tenants/freeman.css +63 -0
  79. package/src/styles/tenants/frontier.css +71 -0
  80. /package/{src/react-components → dist}/styles/tenants/freeman.css +0 -0
  81. /package/{src/react-components → dist}/styles/tenants/frontier.css +0 -0
  82. /package/src/{react-components/_types.ts → _types.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ import type { Theme } from "./_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/_utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,KAAK,EAAE,MAAM,UAAU,CAAC;AAUnD,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"}
package/dist/_utils.js ADDED
@@ -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
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"cookiePrefsButtonDragObserver.d.ts","sourceRoot":"","sources":["../../../../src/config/gui-options/scripts/cookiePrefsButtonDragObserver.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;yBAuHG,OAAO,SAAS,OAAO,eAAe,cAAc,CAAC,OAAO,SAAS,IAAI,GAC3E,cAAc,GACd,aAAa,CAAC;AAxHlB,wBAwHoB;AAEpB,MAAM,MAAM,8BAA8B,GAAG,cAAc,GAAG;IAC5D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,UAAU,EA0BlB,8BAA8B,CAAC,YAAY,CAAC,CAAC;AAElD,wCAAwC;AACxC,eAAO,MAAM,YAAY,EAOpB,8BAA8B,CAAC,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"cookiePrefsButtonDragObserver.d.ts","sourceRoot":"","sources":["../../../../src/config/gui-options/scripts/cookiePrefsButtonDragObserver.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;yBAuHG,OAAO,SAAS,OAAO,eAAe,cAAc,CAAC,OAAO,SAAS,IAAI,GAC3E,cAAc,GACd,aAAa,CAAC;AAxHlB,wBAwHoB;AAEpB,MAAM,MAAM,8BAA8B,GAAG,cAAc,GAAG;IAC5D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,UAAU,EA0BlB,8BAA8B,CAAC,YAAY,CAAC,CAAC;AAElD,wCAAwC;AACxC,eAAO,MAAM,YAAY,EAOpB,8BAA8B,CAAC,cAAc,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { showPreferences } from "@tilli-pro/cookieconsent";
3
2
  import { buttonId } from "../html-components/ManageCookiePrefsButton";
3
+ import { showPreferences } from "./injectManageCookiePrefsButton";
4
4
  /**
5
5
  * attach a MutationObserver the **first time** the user hovers over–
6
6
  * enabling a limited "drag up" functionality for the floating button.
@@ -1,3 +1,5 @@
1
+ import type * as _CookieConsent from "@tilli-pro/cookieconsent";
2
+ export declare const showPreferences: typeof _CookieConsent.showPreferences;
1
3
  /** injects the floating cookie consent "manage preferences" icon button into the DOM */
2
4
  declare const inject: () => HTMLDivElement;
3
5
  declare const _default: () => ReturnType<typeof inject>;
@@ -1 +1 @@
1
- {"version":3,"file":"injectManageCookiePrefsButton.d.ts","sourceRoot":"","sources":["../../../../src/config/gui-options/scripts/injectManageCookiePrefsButton.ts"],"names":[],"mappings":"AAaA,wFAAwF;AACxF,QAAA,MAAM,MAAM,QAAO,cAkBlB,CAAC;8BACiB,UAAU,CAAC,OAAO,MAAM,CAAC;AAA5C,wBAgBI"}
1
+ {"version":3,"file":"injectManageCookiePrefsButton.d.ts","sourceRoot":"","sources":["../../../../src/config/gui-options/scripts/injectManageCookiePrefsButton.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,cAAc,MAAM,0BAA0B,CAAC;AAiBhE,eAAO,MAAM,eAAe,uCAIoC,CAAC;AAEjE,wFAAwF;AACxF,QAAA,MAAM,MAAM,QAAO,cAkBlB,CAAC;8BACiB,UAAU,CAAC,OAAO,MAAM,CAAC;AAA5C,wBAgBI"}
@@ -1,7 +1,10 @@
1
1
  "use client";
2
- import { showPreferences } from "@tilli-pro/cookieconsent";
3
2
  import ManageCookiePrefsButton, { containerId, } from "../html-components/ManageCookiePrefsButton";
4
3
  import cookiePrefsButtonDragObserver, { ontouchend, ontouchstart, } from "./cookiePrefsButtonDragObserver";
4
+ export const showPreferences = typeof CookieConsent !== "undefined" &&
5
+ typeof CookieConsent.showPreferences === "function"
6
+ ? CookieConsent.showPreferences
7
+ : (await import("@tilli-pro/cookieconsent")).showPreferences;
5
8
  /** injects the floating cookie consent "manage preferences" icon button into the DOM */
6
9
  const inject = () => {
7
10
  const container = document.body.appendChild(Object.assign(document.createElement("div"), {
@@ -85,6 +85,11 @@ declare const _default: {
85
85
  headers: import("./cookies/types").CookieTableHeaders;
86
86
  body: import("./cookies/types").CookieTableItem[];
87
87
  };
88
+ } | {
89
+ title: string;
90
+ description: string;
91
+ linkedCategory: string;
92
+ cookieTable?: undefined;
88
93
  })[];
89
94
  };
90
95
  };
@@ -117,6 +122,11 @@ declare const _default: {
117
122
  headers: import("./cookies/types").CookieTableHeaders;
118
123
  body: import("./cookies/types").CookieTableItem[];
119
124
  };
125
+ } | {
126
+ title: string;
127
+ description: string;
128
+ linkedCategory: string;
129
+ cookieTable?: undefined;
120
130
  })[];
121
131
  };
122
132
  };
@@ -149,6 +159,11 @@ declare const _default: {
149
159
  headers: import("./cookies/types").CookieTableHeaders;
150
160
  body: import("./cookies/types").CookieTableItem[];
151
161
  };
162
+ } | {
163
+ title: string;
164
+ description: string;
165
+ linkedCategory: string;
166
+ cookieTable?: undefined;
152
167
  })[];
153
168
  };
154
169
  };
@@ -181,6 +196,11 @@ declare const _default: {
181
196
  headers: import("./cookies/types").CookieTableHeaders;
182
197
  body: import("./cookies/types").CookieTableItem[];
183
198
  };
199
+ } | {
200
+ title: string;
201
+ description: string;
202
+ linkedCategory: string;
203
+ cookieTable?: undefined;
184
204
  })[];
185
205
  };
186
206
  };
@@ -213,6 +233,11 @@ declare const _default: {
213
233
  headers: import("./cookies/types").CookieTableHeaders;
214
234
  body: import("./cookies/types").CookieTableItem[];
215
235
  };
236
+ } | {
237
+ title: string;
238
+ description: string;
239
+ linkedCategory: string;
240
+ cookieTable?: undefined;
216
241
  })[];
217
242
  };
218
243
  };
@@ -221,7 +246,7 @@ declare const _default: {
221
246
  cookie: {
222
247
  name: string;
223
248
  };
224
- hideFromBots: boolean;
249
+ hideFromBots: true;
225
250
  };
226
251
  export default _default;
227
252
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAOgC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,wBAOgC"}
@@ -2,11 +2,15 @@ import { COOKIE_PREFERENCES_COOKIE_NAME, REVISION } from "../_consts";
2
2
  import categories from "./categories";
3
3
  import guiOptions from "./gui-options";
4
4
  import translations from "./translations";
5
+ const isProduction = (typeof process !== "undefined" &&
6
+ typeof process.env !== "undefined" &&
7
+ typeof process.env.NODE_ENV === "string" &&
8
+ process.env.NODE_ENV === "production") || true;
5
9
  export default {
6
10
  revision: REVISION,
7
11
  guiOptions,
8
12
  categories,
9
13
  language: { default: "en", autoDetect: "browser", translations },
10
14
  cookie: { name: COOKIE_PREFERENCES_COOKIE_NAME },
11
- hideFromBots: process.env.NODE_ENV === "production", // disabled in local dev to enable ui-testing (via Playwright)
15
+ hideFromBots: isProduction, // disabled in local dev to enable ui-testing (via Playwright)
12
16
  };
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: CookieTableHeaders;
29
29
  body: import("../../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/de/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBAsFwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/de/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBA6FwB"}
@@ -76,6 +76,11 @@ export default {
76
76
  body: [...cookies.analytics.datadog(__LANGUAGE__)],
77
77
  },
78
78
  },
79
+ {
80
+ title: "Marketing-Cookies",
81
+ description: "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: "marketing",
83
+ },
79
84
  {
80
85
  title: "Weitere Informationen",
81
86
  description: '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>.',
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: CookieTableHeaders;
29
29
  body: import("../../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/en/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBAsFwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/en/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBA6FwB"}
@@ -76,6 +76,11 @@ export default {
76
76
  body: [...cookies.analytics.datadog(__LANGUAGE__)],
77
77
  },
78
78
  },
79
+ {
80
+ title: "Marketing cookies",
81
+ description: "These cookies are used to deliver advertisements that are relevant to your interests. They may track your browsing behaviors across different sites and help advertisers serve more personalized ads.",
82
+ linkedCategory: "marketing",
83
+ },
79
84
  {
80
85
  title: "More information",
81
86
  description: 'For any queries in relation to our policy on cookies and your choices, please <a href="mailto:privacy@tilli.pro">contact us</a>.',
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: CookieTableHeaders;
29
29
  body: import("../../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/es/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBAsFwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/es/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBA6FwB"}
@@ -76,6 +76,11 @@ export default {
76
76
  body: [...cookies.analytics.datadog(__LANGUAGE__)],
77
77
  },
78
78
  },
79
+ {
80
+ title: "Cookies de marketing",
81
+ description: "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: "marketing",
83
+ },
79
84
  {
80
85
  title: "Más información",
81
86
  description: 'Para cualquier consulta relacionada con nuestra política de cookies y tus opciones, por favor <a href="mailto:privacy@tilli.pro">contáctanos</a>.',
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: CookieTableHeaders;
29
29
  body: import("../../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/fr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBAsFwB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/translations/fr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAc9D,wBA6FwB"}
@@ -76,6 +76,11 @@ export default {
76
76
  body: [...cookies.analytics.datadog(__LANGUAGE__)],
77
77
  },
78
78
  },
79
+ {
80
+ title: "Cookies de marketing",
81
+ description: "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: "marketing",
83
+ },
79
84
  {
80
85
  title: "Plus d'informations",
81
86
  description: 'Pour toute question relative à notre politique sur les cookies et vos choix, veuillez <a href="mailto:privacy@tilli.pro">nous contacter</a>.',
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: import("../cookies/types").CookieTableHeaders;
29
29
  body: import("../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -60,6 +65,11 @@ declare const _default: {
60
65
  headers: import("../cookies/types").CookieTableHeaders;
61
66
  body: import("../cookies/types").CookieTableItem[];
62
67
  };
68
+ } | {
69
+ title: string;
70
+ description: string;
71
+ linkedCategory: string;
72
+ cookieTable?: undefined;
63
73
  })[];
64
74
  };
65
75
  };
@@ -92,6 +102,11 @@ declare const _default: {
92
102
  headers: import("../cookies/types").CookieTableHeaders;
93
103
  body: import("../cookies/types").CookieTableItem[];
94
104
  };
105
+ } | {
106
+ title: string;
107
+ description: string;
108
+ linkedCategory: string;
109
+ cookieTable?: undefined;
95
110
  })[];
96
111
  };
97
112
  };
@@ -124,6 +139,11 @@ declare const _default: {
124
139
  headers: import("../cookies/types").CookieTableHeaders;
125
140
  body: import("../cookies/types").CookieTableItem[];
126
141
  };
142
+ } | {
143
+ title: string;
144
+ description: string;
145
+ linkedCategory: string;
146
+ cookieTable?: undefined;
127
147
  })[];
128
148
  };
129
149
  };
@@ -156,6 +176,11 @@ declare const _default: {
156
176
  headers: import("../cookies/types").CookieTableHeaders;
157
177
  body: import("../cookies/types").CookieTableItem[];
158
178
  };
179
+ } | {
180
+ title: string;
181
+ description: string;
182
+ linkedCategory: string;
183
+ cookieTable?: undefined;
159
184
  })[];
160
185
  };
161
186
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/translations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAM4D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/translations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAM4D"}
@@ -28,6 +28,11 @@ declare const _default: {
28
28
  headers: CookieTableHeaders;
29
29
  body: import("../../cookies/types").CookieTableItem[];
30
30
  };
31
+ } | {
32
+ title: string;
33
+ description: string;
34
+ linkedCategory: string;
35
+ cookieTable?: undefined;
31
36
  })[];
32
37
  };
33
38
  };
@@ -1 +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"}
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,wBA6FwB"}
@@ -76,6 +76,11 @@ export default {
76
76
  body: [...cookies.analytics.datadog(__LANGUAGE__)],
77
77
  },
78
78
  },
79
+ {
80
+ title: "Cookie di marketing",
81
+ description: "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: "marketing",
83
+ },
79
84
  {
80
85
  title: "Ulteriori informazioni",
81
86
  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>.',
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=brf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brf.d.ts","sourceRoot":"","sources":["../../src/init/brf.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import _config from "../config";
2
+ import { LABELS } from "../config/categories/labels";
3
+ import cookies from "../config/cookies";
4
+ import { run } from "../init";
5
+ import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
6
+ // TODO: auto-detect detect language
7
+ const __LANGUAGE__ = "en"; // "English" ("English")
8
+ const categories = {
9
+ necessary: {
10
+ enabled: true, // "necessary" category is always enabled.
11
+ readOnly: true,
12
+ services: {
13
+ /** tilliX (BRF) */
14
+ tilliX: {
15
+ label: LABELS.en.necessary.tilliX,
16
+ cookies: [...cookies.necessary.brf(__LANGUAGE__)],
17
+ },
18
+ },
19
+ },
20
+ functional: {
21
+ services: {
22
+ /** tilliX (BRF) */
23
+ tilliX: {
24
+ label: LABELS.en.functional.tilliX,
25
+ cookies: [...cookies.functional.brf(__LANGUAGE__)],
26
+ },
27
+ },
28
+ autoClear: {
29
+ cookies: [
30
+ {
31
+ name: /^(tx-theme)/, // tilliX theme (-> "light" | "dark")
32
+ },
33
+ ],
34
+ },
35
+ },
36
+ analytics: {
37
+ services: {
38
+ /** Datadog (RUM) */
39
+ datadog: {
40
+ label: LABELS.en.analytics.datadog,
41
+ cookies: [...cookies.analytics.datadog(__LANGUAGE__)],
42
+ },
43
+ },
44
+ autoClear: {
45
+ cookies: [
46
+ {
47
+ name: /^(_tilli_analytics_dd_)/, // Datadog (RUM)
48
+ },
49
+ ],
50
+ },
51
+ },
52
+ };
53
+ // TODO: DRY further w/ `./tilli-website.ts`
54
+ const language = {
55
+ ..._config.language,
56
+ translations: stripInvalidLinkedCategoriesFromTranslations(_config.language.translations, categories),
57
+ };
58
+ const config = {
59
+ ..._config,
60
+ categories,
61
+ language,
62
+ };
63
+ // console.debug({ config }, "Initializing Cookie Consent (BRF)...");
64
+ const init = makeInitFn(run, config);
65
+ void init();
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tilli-website.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tilli-website.d.ts","sourceRoot":"","sources":["../../src/init/tilli-website.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import _config from "../config";
2
+ import { run } from "../init";
3
+ import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
4
+ const categories = {
5
+ necessary: {
6
+ enabled: true, // "necessary" category is always enabled.
7
+ readOnly: true,
8
+ },
9
+ analytics: {},
10
+ marketing: {},
11
+ };
12
+ // TODO: DRY further w/ `./brf.ts`
13
+ const language = {
14
+ ..._config.language,
15
+ translations: stripInvalidLinkedCategoriesFromTranslations(_config.language.translations, categories, true),
16
+ };
17
+ const config = {
18
+ ..._config,
19
+ categories,
20
+ language,
21
+ };
22
+ // console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
23
+ const init = makeInitFn(run, config);
24
+ void init();
@@ -0,0 +1,5 @@
1
+ import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
2
+ import type * as CookieConsent from "@tilli-pro/cookieconsent";
3
+ export declare const makeInitFn: (initFn: typeof CookieConsent.run, config: CookieConsentConfig) => () => Promise<void>;
4
+ export declare const stripInvalidLinkedCategoriesFromTranslations: (translations: CookieConsentConfig["language"]["translations"], categories: CookieConsentConfig["categories"], alsoClearCookieTables?: boolean) => CookieConsentConfig["language"]["translations"];
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/init/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAK/D,eAAO,MAAM,UAAU,WACb,OAAO,aAAa,CAAC,GAAG,UACxB,mBAAmB,wBAiB5B,CAAC;AAEF,eAAO,MAAM,4CAA4C,iBACzC,mBAAmB,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,cACjD,mBAAmB,CAAC,YAAY,CAAC,0BACtB,OAAO,KAC7B,mBAAmB,CAAC,UAAU,CAAC,CAAC,cAAc,CAkC9C,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { injectReactRemoveScrollToggle } from "../config/gui-options/scripts/forceDisableReactRemoveScroll";
2
+ import injectManageCookiePrefsButton from "../config/gui-options/scripts/injectManageCookiePrefsButton";
3
+ export const makeInitFn = (initFn, config) => {
4
+ return async () => {
5
+ /** inject the cookie-consent banner (pop-up) */
6
+ await initFn(config);
7
+ /** ...then, inject the floating cookie consent "manage preferences" icon button into the DOM (floats @ the bottom right) */
8
+ injectManageCookiePrefsButton();
9
+ /** ...and, force-disable "react-remove-scroll" -- only upon opening up the "manage preferences" dialog
10
+ *
11
+ * > this handles the edge case where there's a shadcn (radix-ui) dialog open
12
+ * underneath the cookie banner's "manage preferences" dialog, which prevents
13
+ * the user from scrolling within the manage prefs dialog
14
+ */
15
+ injectReactRemoveScrollToggle();
16
+ };
17
+ };
18
+ export const stripInvalidLinkedCategoriesFromTranslations = (translations, categories, alsoClearCookieTables = false) => Object.fromEntries(Object.entries(translations).map(([lang, translation]) => {
19
+ if (translation &&
20
+ typeof translation === "object" &&
21
+ translation.preferencesModal &&
22
+ Array.isArray(translation.preferencesModal.sections)) {
23
+ /** filter out irrelevant sections */
24
+ const filteredSections = translation.preferencesModal.sections.filter((section) => !section.linkedCategory || categories[section.linkedCategory]);
25
+ if (alsoClearCookieTables)
26
+ filteredSections.forEach((section) => (section.cookieTable = undefined));
27
+ return [
28
+ lang,
29
+ {
30
+ ...translation,
31
+ preferencesModal: {
32
+ ...translation.preferencesModal,
33
+ sections: filteredSections,
34
+ },
35
+ },
36
+ ];
37
+ }
38
+ return [lang, translation];
39
+ }));
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=website.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"website.d.ts","sourceRoot":"","sources":["../../src/init/website.ts"],"names":[],"mappings":""}
@@ -0,0 +1,73 @@
1
+ import _config from "../config";
2
+ import { run } from "../init";
3
+ import { makeInitFn } from "./utils";
4
+ // TODO: auto-detect detect language
5
+ const __LANGUAGE__ = "en"; // "English" ("English")
6
+ const categories = {
7
+ necessary: {
8
+ enabled: true, // "necessary" category is always enabled.
9
+ readOnly: true,
10
+ // services: {
11
+ // /** tilliX (BRF) */
12
+ // tilliX: {
13
+ // label: LABELS.en.necessary.tilliX,
14
+ // cookies: [...cookies.necessary.brf(__LANGUAGE__)],
15
+ // },
16
+ // },
17
+ },
18
+ // functional: {
19
+ // // services: {
20
+ // // /** tilliX (BRF) */
21
+ // // tilliX: {
22
+ // // label: LABELS.en.functional.tilliX,
23
+ // // cookies: [...cookies.functional.brf(__LANGUAGE__)],
24
+ // // },
25
+ // // },
26
+ // // autoClear: {
27
+ // // cookies: [
28
+ // // {
29
+ // // name: /^(tx-theme)/, // tilliX theme (-> "light" | "dark")
30
+ // // },
31
+ // // ],
32
+ // // },
33
+ // },
34
+ analytics: {
35
+ // services: {
36
+ // /** Datadog (RUM) */
37
+ // datadog: {
38
+ // label: LABELS.en.analytics.datadog,
39
+ // cookies: [...cookies.analytics.datadog(__LANGUAGE__)],
40
+ // },
41
+ // },
42
+ // autoClear: {
43
+ // cookies: [
44
+ // {
45
+ // name: /^(_tilli_analytics_dd_)/, // Datadog (RUM)
46
+ // },
47
+ // ],
48
+ // },
49
+ },
50
+ marketing: {
51
+ // services: {
52
+ // /** Datadog (RUM) */
53
+ // datadog: {
54
+ // label: LABELS.en.analytics.datadog,
55
+ // cookies: [...cookies.analytics.datadog(__LANGUAGE__)],
56
+ // },
57
+ // },
58
+ // autoClear: {
59
+ // cookies: [
60
+ // {
61
+ // name: /^(_tilli_analytics_dd_)/, // Datadog (RUM)
62
+ // },
63
+ // ],
64
+ // },
65
+ },
66
+ };
67
+ const config = {
68
+ ..._config,
69
+ categories,
70
+ };
71
+ // console.debug({ config }, "Initializing Cookie Consent (BRF)...");
72
+ const init = makeInitFn(run, config);
73
+ void init();