@tilli-pro/cookieconsent-plugin 0.7.54 → 0.7.60
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 -1
- package/demos/demo.html +2 -2
- package/demos/demo.min.html +1 -1
- package/demos/demo.styles.dark.html +2 -2
- package/demos/demo.styles.dark.min.html +1 -1
- package/demos/demo.styles.nudge-website.dark.html +18 -0
- package/demos/demo.styles.nudge-website.dark.min.html +9 -0
- package/demos/demo.styles.nudge-website.light.html +18 -0
- package/demos/demo.styles.nudge-website.light.min.html +9 -0
- package/demos/demo.styles.nudge.dark.html +2 -2
- package/demos/demo.styles.nudge.dark.min.html +1 -1
- package/demos/demo.styles.nudge.light.html +2 -2
- package/demos/demo.styles.nudge.light.min.html +1 -1
- package/demos/demo.styles.tenant_con-edison.dark.html +2 -2
- package/demos/demo.styles.tenant_con-edison.dark.min.html +1 -1
- package/demos/demo.styles.tenant_con-edison.light.html +2 -2
- package/demos/demo.styles.tenant_con-edison.light.min.html +1 -1
- package/demos/demo.styles.tenant_freeman.dark.html +2 -2
- package/demos/demo.styles.tenant_freeman.dark.min.html +1 -1
- package/demos/demo.styles.tenant_freeman.light.html +2 -2
- package/demos/demo.styles.tenant_frontier.dark.html +2 -2
- package/demos/demo.styles.tenant_frontier.dark.min.html +1 -1
- package/demos/demo.styles.tenant_frontier.light.html +2 -2
- package/demos/demo.styles.tenant_frontier.light.min.html +1 -1
- package/demos/demo.styles.tenant_oru.dark.html +2 -2
- package/demos/demo.styles.tenant_oru.dark.min.html +1 -1
- package/demos/demo.styles.tenant_oru.light.html +2 -2
- package/demos/demo.styles.tenant_oru.light.min.html +1 -1
- package/demos/demo.styles.tilli-pay.dark.html +2 -2
- package/demos/demo.styles.tilli-pay.dark.min.html +1 -1
- package/demos/demo.styles.tilli-pay.light.html +2 -2
- package/demos/demo.styles.tilli-pay.light.min.html +1 -1
- package/demos/demo.styles.tilli-website.dark.html +2 -2
- package/demos/demo.styles.tilli-website.dark.min.html +1 -1
- package/demos/demo.styles.tilli-website.light.html +2 -2
- package/demos/demo.styles.tilli-website.light.min.html +1 -1
- package/dist/init/_configs.d.ts +12 -0
- package/dist/init/_configs.d.ts.map +1 -0
- package/dist/init/_configs.js +17 -0
- package/dist/init/brf.config.d.ts +3 -0
- package/dist/init/brf.config.d.ts.map +1 -0
- package/dist/init/brf.config.js +61 -0
- package/dist/init/brf.js +2 -61
- package/dist/init/nudge-website.config.d.ts +3 -0
- package/dist/init/nudge-website.config.d.ts.map +1 -0
- package/dist/init/nudge-website.config.js +120 -0
- package/dist/init/nudge-website.js +2 -120
- package/dist/init/nudge.config.d.ts +3 -0
- package/dist/init/nudge.config.d.ts.map +1 -0
- package/dist/init/nudge.config.js +28 -0
- package/dist/init/nudge.js +2 -28
- package/dist/init/tilli-pay-website.config.d.ts +3 -0
- package/dist/init/tilli-pay-website.config.d.ts.map +1 -0
- package/dist/init/tilli-pay-website.config.js +200 -0
- package/dist/init/tilli-pay-website.js +2 -200
- package/dist/init/tilli-pay.config.d.ts +3 -0
- package/dist/init/tilli-pay.config.d.ts.map +1 -0
- package/dist/init/tilli-pay.config.js +18 -0
- package/dist/init/tilli-pay.js +2 -18
- package/dist/init/tilli-website.config.d.ts +3 -0
- package/dist/init/tilli-website.config.d.ts.map +1 -0
- package/dist/init/tilli-website.config.js +206 -0
- package/dist/init/tilli-website.js +2 -206
- package/dist/init/tilliX.config.d.ts +3 -0
- package/dist/init/tilliX.config.d.ts.map +1 -0
- package/dist/init/tilliX.config.js +20 -0
- package/dist/init/tilliX.js +2 -20
- package/dist/init.d.ts +1 -1
- package/dist/init.js +2 -2
- package/dist/react-components/CookieConsentInit.client.d.ts +6 -1
- package/dist/react-components/CookieConsentInit.client.d.ts.map +1 -1
- package/dist/react-components/CookieConsentInit.client.js +2 -2
- package/dist/react-components/CookieConsentInit.server.d.ts +6 -1
- package/dist/react-components/CookieConsentInit.server.d.ts.map +1 -1
- package/dist/react-components/CookieConsentInit.server.js +2 -2
- package/dist/react-components/hooks/useCookieConsent.d.ts +2 -1
- package/dist/react-components/hooks/useCookieConsent.d.ts.map +1 -1
- package/dist/react-components/hooks/useCookieConsent.js +6 -3
- package/package.json +1 -1
- package/src/init/_configs.ts +20 -0
- package/src/init/brf.config.ts +70 -0
- package/src/init/brf.ts +2 -73
- package/src/init/nudge-website.config.ts +132 -0
- package/src/init/nudge-website.ts +2 -135
- package/src/init/nudge.config.ts +37 -0
- package/src/init/nudge.ts +2 -40
- package/src/init/tilli-pay-website.config.ts +213 -0
- package/src/init/tilli-pay-website.ts +2 -216
- package/src/init/tilli-pay.config.ts +27 -0
- package/src/init/tilli-pay.ts +2 -30
- package/src/init/tilli-website.config.ts +219 -0
- package/src/init/tilli-website.ts +2 -222
- package/src/init/tilliX.config.ts +29 -0
- package/src/init/tilliX.ts +2 -32
- package/src/init.ts +2 -2
- package/src/react-components/CookieConsentInit.client.tsx +9 -2
- package/src/react-components/CookieConsentInit.server.tsx +11 -2
- package/src/react-components/hooks/useCookieConsent.ts +10 -3
@@ -0,0 +1,219 @@
|
|
1
|
+
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
2
|
+
|
3
|
+
import _config from "../config";
|
4
|
+
import { stripInvalidLinkedCategoriesFromTranslations } from "./utils";
|
5
|
+
|
6
|
+
const categories: CookieConsentConfig["categories"] = {
|
7
|
+
necessary: {
|
8
|
+
enabled: true, // "necessary" category is always enabled.
|
9
|
+
readOnly: true,
|
10
|
+
services: {
|
11
|
+
"Session": {
|
12
|
+
label: "Session",
|
13
|
+
cookies: [
|
14
|
+
{
|
15
|
+
name: /^(_scc_session)/, // session ID for core functionality
|
16
|
+
},
|
17
|
+
],
|
18
|
+
},
|
19
|
+
},
|
20
|
+
},
|
21
|
+
analytics: {
|
22
|
+
services: {
|
23
|
+
"Google Analytics": {
|
24
|
+
label: "Google Analytics",
|
25
|
+
cookies: [
|
26
|
+
{
|
27
|
+
name: /^(_ga_)/, // Google Analytics
|
28
|
+
domain: "tilli.pro",
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
"TelemetryDeck": {
|
33
|
+
label: "TelemetryDeck",
|
34
|
+
cookies: [
|
35
|
+
{
|
36
|
+
name: /^(_tccl_)/, // TelemetryDeck
|
37
|
+
domain: "tilli.pro",
|
38
|
+
},
|
39
|
+
],
|
40
|
+
},
|
41
|
+
},
|
42
|
+
autoClear: {
|
43
|
+
// TODO: DRY this with the services above
|
44
|
+
cookies: [
|
45
|
+
/** Google Analytics */
|
46
|
+
{
|
47
|
+
name: /^(_ga_)/, // Google Analytics
|
48
|
+
domain: "tilli.pro",
|
49
|
+
},
|
50
|
+
|
51
|
+
/** TelemetryDeck */
|
52
|
+
{
|
53
|
+
name: /^(_tccl_)/, // TelemetryDeck
|
54
|
+
domain: "tilli.pro",
|
55
|
+
},
|
56
|
+
],
|
57
|
+
},
|
58
|
+
},
|
59
|
+
marketing: {
|
60
|
+
services: {
|
61
|
+
"Google Tag Manager": {
|
62
|
+
label: "Google Tag Manager",
|
63
|
+
cookies: [
|
64
|
+
{
|
65
|
+
name: /^(_gtm_)/, // Google Tag Manager
|
66
|
+
domain: "tilli.pro",
|
67
|
+
},
|
68
|
+
{
|
69
|
+
name: /^(_gat)/, // Google Tag Manager (analytics)
|
70
|
+
domain: "tilli.pro",
|
71
|
+
},
|
72
|
+
{
|
73
|
+
name: /^(_gid)/, // Google Tag Manager (session ID)
|
74
|
+
domain: "tilli.pro",
|
75
|
+
},
|
76
|
+
],
|
77
|
+
},
|
78
|
+
"Hubspot": {
|
79
|
+
label: "Hubspot",
|
80
|
+
cookies: [
|
81
|
+
{
|
82
|
+
name: /^(__hs)/, // Hubspot (Session Tracking)
|
83
|
+
domain: "tilli.pro",
|
84
|
+
},
|
85
|
+
{
|
86
|
+
name: /^(hubspotutk)/, // Hubspot (User Tracking)
|
87
|
+
domain: "tilli.pro",
|
88
|
+
},
|
89
|
+
{
|
90
|
+
name: /^(__cf_bm)/, // Hubspot (Analytics - Cloudfare)
|
91
|
+
domain: ".hs-analytics.net",
|
92
|
+
},
|
93
|
+
{
|
94
|
+
name: /^(__cf_bm)/, // Hubspot (Banner - Cloudfare)
|
95
|
+
domain: ".hs-banner.com",
|
96
|
+
},
|
97
|
+
{
|
98
|
+
name: /^(__cf_bm)/, // Hubspot (Scripts - Cloudfare)
|
99
|
+
domain: ".hs-scripts.com",
|
100
|
+
},
|
101
|
+
{
|
102
|
+
name: /^(__cf_bm)/, // Hubspot (Adspixel - Cloudfare)
|
103
|
+
domain: ".hsadspixel.net",
|
104
|
+
},
|
105
|
+
{
|
106
|
+
name: /^(__cf_bm)/, // Hubspot (Twitter - Cloudfare)
|
107
|
+
domain: ".t.co",
|
108
|
+
},
|
109
|
+
{
|
110
|
+
name: /^(__cf_bm)/, // Hubspot (User Messages - Cloudfare)
|
111
|
+
domain: ".usermessages.com",
|
112
|
+
},
|
113
|
+
{
|
114
|
+
name: /^(_cfuvid)/, // Hubspot (Visitor ID - Cloudfare)
|
115
|
+
domain: ".hubspot.com",
|
116
|
+
},
|
117
|
+
],
|
118
|
+
},
|
119
|
+
"Facebook": {
|
120
|
+
label: "Facebook",
|
121
|
+
cookies: [
|
122
|
+
{
|
123
|
+
name: /^(_fb)/, // Facebook (ads)
|
124
|
+
domain: "tilli.pro",
|
125
|
+
},
|
126
|
+
],
|
127
|
+
},
|
128
|
+
"Twitter": {
|
129
|
+
label: "Twitter",
|
130
|
+
cookies: [
|
131
|
+
{
|
132
|
+
name: /^(muc_ads)/, // Twitter (ads)
|
133
|
+
domain: ".t.co",
|
134
|
+
},
|
135
|
+
],
|
136
|
+
},
|
137
|
+
},
|
138
|
+
autoClear: {
|
139
|
+
// TODO: DRY this with the services above
|
140
|
+
cookies: [
|
141
|
+
/** Google Tag Manager */
|
142
|
+
{
|
143
|
+
name: /^(_gtm_)/, // Google Tag Manager
|
144
|
+
domain: "tilli.pro",
|
145
|
+
},
|
146
|
+
{
|
147
|
+
name: /^(_gat)/, // Google Tag Manager (analytics)
|
148
|
+
domain: "tilli.pro",
|
149
|
+
},
|
150
|
+
{
|
151
|
+
name: /^(_gid)/, // Google Tag Manager (session ID)
|
152
|
+
domain: "tilli.pro",
|
153
|
+
},
|
154
|
+
|
155
|
+
/** Hubspot */
|
156
|
+
{
|
157
|
+
name: /^(__hs)/, // Hubspot (Session Tracking)
|
158
|
+
domain: "tilli.pro",
|
159
|
+
},
|
160
|
+
{
|
161
|
+
name: /^(__cf_bm)/, // Hubspot (Analytics - Cloudfare)
|
162
|
+
domain: ".hs-analytics.net",
|
163
|
+
},
|
164
|
+
{
|
165
|
+
name: /^(__cf_bm)/, // Hubspot (Banner - Cloudfare)
|
166
|
+
domain: ".hs-banner.com",
|
167
|
+
},
|
168
|
+
{
|
169
|
+
name: /^(__cf_bm)/, // Hubspot (Scripts - Cloudfare)
|
170
|
+
domain: ".hs-scripts.com",
|
171
|
+
},
|
172
|
+
{
|
173
|
+
name: /^(__cf_bm)/, // Hubspot (Adspixel - Cloudfare)
|
174
|
+
domain: ".hsadspixel.net",
|
175
|
+
},
|
176
|
+
{
|
177
|
+
name: /^(__cf_bm)/, // Hubspot (Twitter - Cloudfare)
|
178
|
+
domain: ".t.co",
|
179
|
+
},
|
180
|
+
{
|
181
|
+
name: /^(__cf_bm)/, // Hubspot (User Messages - Cloudfare)
|
182
|
+
domain: ".usermessages.com",
|
183
|
+
},
|
184
|
+
{
|
185
|
+
name: /^(_cfuvid)/, // Hubspot (Visitor ID - Cloudfare)
|
186
|
+
domain: ".hubspot.com",
|
187
|
+
},
|
188
|
+
|
189
|
+
/** Facebook */
|
190
|
+
{
|
191
|
+
name: /^(_fb)/, // Facebook (ads)
|
192
|
+
domain: "tilli.pro",
|
193
|
+
},
|
194
|
+
|
195
|
+
/** Twitter */
|
196
|
+
{
|
197
|
+
name: /^(muc_ads)/, // Twitter (ads)
|
198
|
+
domain: ".t.co",
|
199
|
+
},
|
200
|
+
],
|
201
|
+
},
|
202
|
+
},
|
203
|
+
};
|
204
|
+
|
205
|
+
// TODO: DRY further w/ `./brf.ts`
|
206
|
+
const language: CookieConsentConfig["language"] = {
|
207
|
+
..._config.language,
|
208
|
+
translations: stripInvalidLinkedCategoriesFromTranslations(
|
209
|
+
_config.language.translations,
|
210
|
+
categories,
|
211
|
+
true, // clear cookie tables // FIXME: refactor this to actually just use the proper cookie table accoring to the categories var
|
212
|
+
),
|
213
|
+
};
|
214
|
+
|
215
|
+
export const config: CookieConsentConfig = {
|
216
|
+
..._config,
|
217
|
+
categories,
|
218
|
+
language,
|
219
|
+
};
|
@@ -1,227 +1,7 @@
|
|
1
|
-
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
2
|
-
|
3
|
-
import _config from "../config";
|
4
1
|
import { run } from "../init";
|
5
|
-
import {
|
6
|
-
makeInitFn,
|
7
|
-
stripInvalidLinkedCategoriesFromTranslations,
|
8
|
-
} from "./utils";
|
2
|
+
import { makeInitFn } from "./utils";
|
9
3
|
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
10
|
-
|
11
|
-
const categories: CookieConsentConfig["categories"] = {
|
12
|
-
necessary: {
|
13
|
-
enabled: true, // "necessary" category is always enabled.
|
14
|
-
readOnly: true,
|
15
|
-
services: {
|
16
|
-
"Session": {
|
17
|
-
label: "Session",
|
18
|
-
cookies: [
|
19
|
-
{
|
20
|
-
name: /^(_scc_session)/, // session ID for core functionality
|
21
|
-
},
|
22
|
-
],
|
23
|
-
},
|
24
|
-
},
|
25
|
-
},
|
26
|
-
analytics: {
|
27
|
-
services: {
|
28
|
-
"Google Analytics": {
|
29
|
-
label: "Google Analytics",
|
30
|
-
cookies: [
|
31
|
-
{
|
32
|
-
name: /^(_ga_)/, // Google Analytics
|
33
|
-
domain: "tilli.pro",
|
34
|
-
},
|
35
|
-
],
|
36
|
-
},
|
37
|
-
"TelemetryDeck": {
|
38
|
-
label: "TelemetryDeck",
|
39
|
-
cookies: [
|
40
|
-
{
|
41
|
-
name: /^(_tccl_)/, // TelemetryDeck
|
42
|
-
domain: "tilli.pro",
|
43
|
-
},
|
44
|
-
],
|
45
|
-
},
|
46
|
-
},
|
47
|
-
autoClear: {
|
48
|
-
// TODO: DRY this with the services above
|
49
|
-
cookies: [
|
50
|
-
/** Google Analytics */
|
51
|
-
{
|
52
|
-
name: /^(_ga_)/, // Google Analytics
|
53
|
-
domain: "tilli.pro",
|
54
|
-
},
|
55
|
-
|
56
|
-
/** TelemetryDeck */
|
57
|
-
{
|
58
|
-
name: /^(_tccl_)/, // TelemetryDeck
|
59
|
-
domain: "tilli.pro",
|
60
|
-
},
|
61
|
-
],
|
62
|
-
},
|
63
|
-
},
|
64
|
-
marketing: {
|
65
|
-
services: {
|
66
|
-
"Google Tag Manager": {
|
67
|
-
label: "Google Tag Manager",
|
68
|
-
cookies: [
|
69
|
-
{
|
70
|
-
name: /^(_gtm_)/, // Google Tag Manager
|
71
|
-
domain: "tilli.pro",
|
72
|
-
},
|
73
|
-
{
|
74
|
-
name: /^(_gat)/, // Google Tag Manager (analytics)
|
75
|
-
domain: "tilli.pro",
|
76
|
-
},
|
77
|
-
{
|
78
|
-
name: /^(_gid)/, // Google Tag Manager (session ID)
|
79
|
-
domain: "tilli.pro",
|
80
|
-
},
|
81
|
-
],
|
82
|
-
},
|
83
|
-
"Hubspot": {
|
84
|
-
label: "Hubspot",
|
85
|
-
cookies: [
|
86
|
-
{
|
87
|
-
name: /^(__hs)/, // Hubspot (Session Tracking)
|
88
|
-
domain: "tilli.pro",
|
89
|
-
},
|
90
|
-
{
|
91
|
-
name: /^(hubspotutk)/, // Hubspot (User Tracking)
|
92
|
-
domain: "tilli.pro",
|
93
|
-
},
|
94
|
-
{
|
95
|
-
name: /^(__cf_bm)/, // Hubspot (Analytics - Cloudfare)
|
96
|
-
domain: ".hs-analytics.net",
|
97
|
-
},
|
98
|
-
{
|
99
|
-
name: /^(__cf_bm)/, // Hubspot (Banner - Cloudfare)
|
100
|
-
domain: ".hs-banner.com",
|
101
|
-
},
|
102
|
-
{
|
103
|
-
name: /^(__cf_bm)/, // Hubspot (Scripts - Cloudfare)
|
104
|
-
domain: ".hs-scripts.com",
|
105
|
-
},
|
106
|
-
{
|
107
|
-
name: /^(__cf_bm)/, // Hubspot (Adspixel - Cloudfare)
|
108
|
-
domain: ".hsadspixel.net",
|
109
|
-
},
|
110
|
-
{
|
111
|
-
name: /^(__cf_bm)/, // Hubspot (Twitter - Cloudfare)
|
112
|
-
domain: ".t.co",
|
113
|
-
},
|
114
|
-
{
|
115
|
-
name: /^(__cf_bm)/, // Hubspot (User Messages - Cloudfare)
|
116
|
-
domain: ".usermessages.com",
|
117
|
-
},
|
118
|
-
{
|
119
|
-
name: /^(_cfuvid)/, // Hubspot (Visitor ID - Cloudfare)
|
120
|
-
domain: ".hubspot.com",
|
121
|
-
},
|
122
|
-
],
|
123
|
-
},
|
124
|
-
"Facebook": {
|
125
|
-
label: "Facebook",
|
126
|
-
cookies: [
|
127
|
-
{
|
128
|
-
name: /^(_fb)/, // Facebook (ads)
|
129
|
-
domain: "tilli.pro",
|
130
|
-
},
|
131
|
-
],
|
132
|
-
},
|
133
|
-
"Twitter": {
|
134
|
-
label: "Twitter",
|
135
|
-
cookies: [
|
136
|
-
{
|
137
|
-
name: /^(muc_ads)/, // Twitter (ads)
|
138
|
-
domain: ".t.co",
|
139
|
-
},
|
140
|
-
],
|
141
|
-
},
|
142
|
-
},
|
143
|
-
autoClear: {
|
144
|
-
// TODO: DRY this with the services above
|
145
|
-
cookies: [
|
146
|
-
/** Google Tag Manager */
|
147
|
-
{
|
148
|
-
name: /^(_gtm_)/, // Google Tag Manager
|
149
|
-
domain: "tilli.pro",
|
150
|
-
},
|
151
|
-
{
|
152
|
-
name: /^(_gat)/, // Google Tag Manager (analytics)
|
153
|
-
domain: "tilli.pro",
|
154
|
-
},
|
155
|
-
{
|
156
|
-
name: /^(_gid)/, // Google Tag Manager (session ID)
|
157
|
-
domain: "tilli.pro",
|
158
|
-
},
|
159
|
-
|
160
|
-
/** Hubspot */
|
161
|
-
{
|
162
|
-
name: /^(__hs)/, // Hubspot (Session Tracking)
|
163
|
-
domain: "tilli.pro",
|
164
|
-
},
|
165
|
-
{
|
166
|
-
name: /^(__cf_bm)/, // Hubspot (Analytics - Cloudfare)
|
167
|
-
domain: ".hs-analytics.net",
|
168
|
-
},
|
169
|
-
{
|
170
|
-
name: /^(__cf_bm)/, // Hubspot (Banner - Cloudfare)
|
171
|
-
domain: ".hs-banner.com",
|
172
|
-
},
|
173
|
-
{
|
174
|
-
name: /^(__cf_bm)/, // Hubspot (Scripts - Cloudfare)
|
175
|
-
domain: ".hs-scripts.com",
|
176
|
-
},
|
177
|
-
{
|
178
|
-
name: /^(__cf_bm)/, // Hubspot (Adspixel - Cloudfare)
|
179
|
-
domain: ".hsadspixel.net",
|
180
|
-
},
|
181
|
-
{
|
182
|
-
name: /^(__cf_bm)/, // Hubspot (Twitter - Cloudfare)
|
183
|
-
domain: ".t.co",
|
184
|
-
},
|
185
|
-
{
|
186
|
-
name: /^(__cf_bm)/, // Hubspot (User Messages - Cloudfare)
|
187
|
-
domain: ".usermessages.com",
|
188
|
-
},
|
189
|
-
{
|
190
|
-
name: /^(_cfuvid)/, // Hubspot (Visitor ID - Cloudfare)
|
191
|
-
domain: ".hubspot.com",
|
192
|
-
},
|
193
|
-
|
194
|
-
/** Facebook */
|
195
|
-
{
|
196
|
-
name: /^(_fb)/, // Facebook (ads)
|
197
|
-
domain: "tilli.pro",
|
198
|
-
},
|
199
|
-
|
200
|
-
/** Twitter */
|
201
|
-
{
|
202
|
-
name: /^(muc_ads)/, // Twitter (ads)
|
203
|
-
domain: ".t.co",
|
204
|
-
},
|
205
|
-
],
|
206
|
-
},
|
207
|
-
},
|
208
|
-
};
|
209
|
-
|
210
|
-
// TODO: DRY further w/ `./brf.ts`
|
211
|
-
const language: CookieConsentConfig["language"] = {
|
212
|
-
..._config.language,
|
213
|
-
translations: stripInvalidLinkedCategoriesFromTranslations(
|
214
|
-
_config.language.translations,
|
215
|
-
categories,
|
216
|
-
true, // clear cookie tables // FIXME: refactor this to actually just use the proper cookie table accoring to the categories var
|
217
|
-
),
|
218
|
-
};
|
219
|
-
|
220
|
-
const config: CookieConsentConfig = {
|
221
|
-
..._config,
|
222
|
-
categories,
|
223
|
-
language,
|
224
|
-
};
|
4
|
+
import { config } from "./tilli-website.config";
|
225
5
|
|
226
6
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
227
7
|
const init = makeInitFn(run, config, showPreferences);
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
2
|
+
|
3
|
+
import _config from "../config";
|
4
|
+
import { stripInvalidLinkedCategoriesFromTranslations } from "./utils";
|
5
|
+
|
6
|
+
const categories: CookieConsentConfig["categories"] = {
|
7
|
+
necessary: {
|
8
|
+
enabled: true, // "necessary" category is always enabled.
|
9
|
+
readOnly: true,
|
10
|
+
},
|
11
|
+
functional: {},
|
12
|
+
analytics: {},
|
13
|
+
};
|
14
|
+
|
15
|
+
// TODO: DRY further w/ `./brf.ts`
|
16
|
+
const language: CookieConsentConfig["language"] = {
|
17
|
+
..._config.language,
|
18
|
+
translations: stripInvalidLinkedCategoriesFromTranslations(
|
19
|
+
_config.language.translations,
|
20
|
+
categories,
|
21
|
+
true, // clear cookie tables // FIXME: refactor this to actually just use the proper cookie table accoring to the categories var
|
22
|
+
),
|
23
|
+
};
|
24
|
+
|
25
|
+
export const config: CookieConsentConfig = {
|
26
|
+
..._config,
|
27
|
+
categories,
|
28
|
+
language,
|
29
|
+
};
|
package/src/init/tilliX.ts
CHANGED
@@ -1,37 +1,7 @@
|
|
1
|
-
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
2
|
-
|
3
|
-
import _config from "../config";
|
4
1
|
import { run } from "../init";
|
5
|
-
import {
|
6
|
-
makeInitFn,
|
7
|
-
stripInvalidLinkedCategoriesFromTranslations,
|
8
|
-
} from "./utils";
|
2
|
+
import { makeInitFn } from "./utils";
|
9
3
|
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
10
|
-
|
11
|
-
const categories: CookieConsentConfig["categories"] = {
|
12
|
-
necessary: {
|
13
|
-
enabled: true, // "necessary" category is always enabled.
|
14
|
-
readOnly: true,
|
15
|
-
},
|
16
|
-
functional: {},
|
17
|
-
analytics: {},
|
18
|
-
};
|
19
|
-
|
20
|
-
// TODO: DRY further w/ `./brf.ts`
|
21
|
-
const language: CookieConsentConfig["language"] = {
|
22
|
-
..._config.language,
|
23
|
-
translations: stripInvalidLinkedCategoriesFromTranslations(
|
24
|
-
_config.language.translations,
|
25
|
-
categories,
|
26
|
-
true, // clear cookie tables // FIXME: refactor this to actually just use the proper cookie table accoring to the categories var
|
27
|
-
),
|
28
|
-
};
|
29
|
-
|
30
|
-
const config: CookieConsentConfig = {
|
31
|
-
..._config,
|
32
|
-
categories,
|
33
|
-
language,
|
34
|
-
};
|
4
|
+
import { config } from "./tilliX.config";
|
35
5
|
|
36
6
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
37
7
|
const init = makeInitFn(run, config, showPreferences);
|
package/src/init.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@
|
1
|
+
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@95beecd12c0b52ac7b01a40f5a04ca8dff865bfb/dist/cookieconsent.umd.js";
|
2
2
|
|
3
3
|
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
4
4
|
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
@@ -18,7 +18,7 @@ declare global {
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
|
-
const GIT_SHA = "
|
21
|
+
const GIT_SHA = "95beecd12c0b52ac7b01a40f5a04ca8dff865bfb";
|
22
22
|
const GIT_REPO = "tilli-pro/cookieconsent";
|
23
23
|
const GIT_CDN_BASE_URL = "https://cdn.jsdelivr.net/gh";
|
24
24
|
const GIT_CDN_URL = `${GIT_CDN_BASE_URL}/${GIT_REPO}@${GIT_SHA}`;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
+
import { ConfigId } from "../init/_configs";
|
3
4
|
import { useCookieConsent } from "./hooks/useCookieConsent";
|
4
5
|
|
5
6
|
import "@tilli-pro/cookieconsent/dist/cookieconsent.css";
|
@@ -12,8 +13,14 @@ import "../styles/tenants/frontier.css";
|
|
12
13
|
import "../styles/tenants/con-edison.css";
|
13
14
|
import "../styles/tenants/oru.css";
|
14
15
|
|
15
|
-
|
16
|
-
|
16
|
+
interface CookieConsentInitProps {
|
17
|
+
config: ConfigId;
|
18
|
+
}
|
19
|
+
|
20
|
+
export default function CookieConsentInit({
|
21
|
+
config,
|
22
|
+
}: Readonly<CookieConsentInitProps>) {
|
23
|
+
useCookieConsent(config);
|
17
24
|
|
18
25
|
return null;
|
19
26
|
}
|
@@ -1,10 +1,19 @@
|
|
1
1
|
import "server-only";
|
2
2
|
|
3
|
+
import type { ConfigId } from "../init/_configs";
|
3
4
|
import { COOKIE_CONSENT_ENABLED } from "../_consts";
|
4
5
|
import CookieConsentInitClient from "./CookieConsentInit.client";
|
5
6
|
|
7
|
+
interface CookieConsentInitProps {
|
8
|
+
config: ConfigId;
|
9
|
+
}
|
10
|
+
|
6
11
|
/** we use a server component to handle dynamic injection of the script all together
|
7
12
|
* > basically, there's no need to inject the client-side cookie-consent script if it's not in scope */
|
8
|
-
export default function CookieConsentInit(
|
9
|
-
|
13
|
+
export default function CookieConsentInit({
|
14
|
+
config,
|
15
|
+
}: Readonly<CookieConsentInitProps>) {
|
16
|
+
return COOKIE_CONSENT_ENABLED ? (
|
17
|
+
<CookieConsentInitClient {...{ config }} />
|
18
|
+
) : null;
|
10
19
|
}
|
@@ -4,14 +4,21 @@ import { useEffect } from "react";
|
|
4
4
|
|
5
5
|
import { run } from "@tilli-pro/cookieconsent";
|
6
6
|
|
7
|
+
import type { ConfigId } from "../../init/_configs";
|
7
8
|
import { COOKIE_CONSENT_ENABLED } from "../../_consts";
|
8
|
-
import config from "../../config";
|
9
|
-
import { makeInitFn } from "../../init/utils";
|
10
9
|
import { showPreferences } from "../../config/gui-options/scripts/showPreferences.node";
|
10
|
+
import { getConfig } from "../../init/_configs";
|
11
|
+
import { makeInitFn } from "../../init/utils";
|
11
12
|
|
12
|
-
export function useCookieConsent() {
|
13
|
+
export function useCookieConsent(configId: ConfigId) {
|
13
14
|
useEffect(() => {
|
14
15
|
if (!COOKIE_CONSENT_ENABLED) return;
|
16
|
+
|
17
|
+
const config = getConfig(configId);
|
18
|
+
if (!config)
|
19
|
+
throw new Error(
|
20
|
+
`Unable to initialize the cookie consent banner (unable to find specified config: "${configId}")`,
|
21
|
+
);
|
15
22
|
|
16
23
|
const init = makeInitFn(run, config, showPreferences);
|
17
24
|
void init();
|