@tilli-pro/cookieconsent-plugin 0.7.51 → 0.7.54
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.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/config/gui-options/scripts/cookiePrefsButtonDragObserver.d.ts +2 -1
- package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.d.ts.map +1 -1
- package/dist/config/gui-options/scripts/cookiePrefsButtonDragObserver.js +2 -6
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts +3 -4
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.d.ts.map +1 -1
- package/dist/config/gui-options/scripts/injectManageCookiePrefsButton.js +6 -13
- package/dist/config/gui-options/scripts/showPreferences.mjs.d.ts +3 -0
- package/dist/config/gui-options/scripts/showPreferences.mjs.d.ts.map +1 -0
- package/dist/config/gui-options/scripts/showPreferences.mjs.js +6 -0
- package/dist/config/gui-options/scripts/showPreferences.node.d.ts +2 -0
- package/dist/config/gui-options/scripts/showPreferences.node.d.ts.map +1 -0
- package/dist/config/gui-options/scripts/showPreferences.node.js +1 -0
- package/dist/init/brf.js +2 -1
- package/dist/init/nudge-website.js +2 -1
- package/dist/init/nudge.js +2 -1
- package/dist/init/tilli-pay-website.js +2 -1
- package/dist/init/tilli-pay.js +2 -1
- package/dist/init/tilli-website.js +2 -1
- package/dist/init/tilliX.js +2 -1
- package/dist/init/utils.d.ts +2 -1
- package/dist/init/utils.d.ts.map +1 -1
- package/dist/init/utils.js +2 -2
- package/dist/init.d.ts +1 -1
- package/dist/init.js +2 -2
- package/dist/react-components/hooks/useCookieConsent.d.ts.map +1 -1
- package/dist/react-components/hooks/useCookieConsent.js +2 -1
- package/package.json +1 -1
- package/src/config/gui-options/scripts/cookiePrefsButtonDragObserver.ts +3 -6
- package/src/config/gui-options/scripts/injectManageCookiePrefsButton.ts +9 -24
- package/src/config/gui-options/scripts/showPreferences.d.ts +5 -0
- package/src/config/gui-options/scripts/showPreferences.mjs.ts +18 -0
- package/src/config/gui-options/scripts/showPreferences.node.ts +1 -0
- package/src/init/brf.ts +2 -1
- package/src/init/nudge-website.ts +2 -1
- package/src/init/nudge.ts +2 -1
- package/src/init/tilli-pay-website.ts +2 -1
- package/src/init/tilli-pay.ts +2 -1
- package/src/init/tilli-website.ts +2 -1
- package/src/init/tilliX.ts +2 -1
- package/src/init/utils.ts +3 -1
- package/src/init.ts +2 -2
- package/src/react-components/hooks/useCookieConsent.ts +2 -1
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
const categories = {
|
5
6
|
necessary: {
|
6
7
|
enabled: true, // "necessary" category is always enabled.
|
@@ -120,5 +121,5 @@ const config = {
|
|
120
121
|
language,
|
121
122
|
};
|
122
123
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
123
|
-
const init = makeInitFn(run, config);
|
124
|
+
const init = makeInitFn(run, config, showPreferences);
|
124
125
|
void init();
|
package/dist/init/nudge.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
const categories = {
|
5
6
|
necessary: {
|
6
7
|
enabled: true, // "necessary" category is always enabled.
|
@@ -28,5 +29,5 @@ const config = {
|
|
28
29
|
language,
|
29
30
|
};
|
30
31
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
31
|
-
const init = makeInitFn(run, config);
|
32
|
+
const init = makeInitFn(run, config, showPreferences);
|
32
33
|
void init();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
// TODO: migrate from monay.com to tillipay.com
|
5
6
|
const categories = {
|
6
7
|
necessary: {
|
@@ -200,5 +201,5 @@ const config = {
|
|
200
201
|
language,
|
201
202
|
};
|
202
203
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
203
|
-
const init = makeInitFn(run, config);
|
204
|
+
const init = makeInitFn(run, config, showPreferences);
|
204
205
|
void init();
|
package/dist/init/tilli-pay.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
const categories = {
|
5
6
|
necessary: {
|
6
7
|
enabled: true, // "necessary" category is always enabled.
|
@@ -18,5 +19,5 @@ const config = {
|
|
18
19
|
language,
|
19
20
|
};
|
20
21
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
21
|
-
const init = makeInitFn(run, config);
|
22
|
+
const init = makeInitFn(run, config, showPreferences);
|
22
23
|
void init();
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
const categories = {
|
5
6
|
necessary: {
|
6
7
|
enabled: true, // "necessary" category is always enabled.
|
@@ -206,5 +207,5 @@ const config = {
|
|
206
207
|
language,
|
207
208
|
};
|
208
209
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
209
|
-
const init = makeInitFn(run, config);
|
210
|
+
const init = makeInitFn(run, config, showPreferences);
|
210
211
|
void init();
|
package/dist/init/tilliX.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import _config from "../config";
|
2
2
|
import { run } from "../init";
|
3
3
|
import { makeInitFn, stripInvalidLinkedCategoriesFromTranslations, } from "./utils";
|
4
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
4
5
|
const categories = {
|
5
6
|
necessary: {
|
6
7
|
enabled: true, // "necessary" category is always enabled.
|
@@ -20,5 +21,5 @@ const config = {
|
|
20
21
|
language,
|
21
22
|
};
|
22
23
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
23
|
-
const init = makeInitFn(run, config);
|
24
|
+
const init = makeInitFn(run, config, showPreferences);
|
24
25
|
void init();
|
package/dist/init/utils.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
2
2
|
import type * as CookieConsent from "@tilli-pro/cookieconsent";
|
3
|
-
|
3
|
+
import type { ShowPreferencesFn } from "../config/gui-options/scripts/showPreferences.d";
|
4
|
+
export declare const makeInitFn: (initFn: typeof CookieConsent.run, config: CookieConsentConfig, showPreferences: ShowPreferencesFn) => () => Promise<void>;
|
4
5
|
export declare const stripInvalidLinkedCategoriesFromTranslations: (translations: CookieConsentConfig["language"]["translations"], categories: CookieConsentConfig["categories"], alsoClearCookieTables?: boolean) => CookieConsentConfig["language"]["translations"];
|
5
6
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/init/utils.d.ts.map
CHANGED
@@ -1 +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;
|
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;AAI/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEzF,eAAO,MAAM,UAAU,WACb,OAAO,aAAa,CAAC,GAAG,UACxB,mBAAmB,mBACV,iBAAiB,wBAiBnC,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"}
|
package/dist/init/utils.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import { injectReactRemoveScrollToggle } from "../config/gui-options/scripts/forceDisableReactRemoveScroll";
|
2
2
|
import { injectManageCookiePrefsButton } from "../config/gui-options/scripts/injectManageCookiePrefsButton";
|
3
|
-
export const makeInitFn = (initFn, config) => {
|
3
|
+
export const makeInitFn = (initFn, config, showPreferences) => {
|
4
4
|
return async () => {
|
5
5
|
/** inject the cookie-consent banner (pop-up) */
|
6
6
|
await initFn(config);
|
7
7
|
/** ...then, inject the floating cookie consent "manage preferences" icon button into the DOM (floats @ the bottom right) */
|
8
|
-
injectManageCookiePrefsButton();
|
8
|
+
injectManageCookiePrefsButton(showPreferences);
|
9
9
|
/** ...and, force-disable "react-remove-scroll" -- only upon opening up the "manage preferences" dialog
|
10
10
|
*
|
11
11
|
* > this handles the edge case where there's a shadcn (radix-ui) dialog open
|
package/dist/init.d.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@49b255420f7606d2a641e5294a5a9c09db612cca/dist/cookieconsent.umd.js";
|
2
2
|
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
3
3
|
import type { CookieConsentConfig } from "@tilli-pro/cookieconsent";
|
4
4
|
import { cookieConsentTheme } from "./_utils";
|
package/dist/init.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@
|
1
|
+
import "https://cdn.jsdelivr.net/gh/tilli-pro/cookieconsent@49b255420f7606d2a641e5294a5a9c09db612cca/dist/cookieconsent.umd.js";
|
2
2
|
import { cookieConsentTheme } from "./_utils";
|
3
3
|
import _config from "./config";
|
4
4
|
import styles from "./styles";
|
5
5
|
import { initTheme } from "./init/utils.script";
|
6
|
-
const GIT_SHA = "
|
6
|
+
const GIT_SHA = "49b255420f7606d2a641e5294a5a9c09db612cca";
|
7
7
|
const GIT_REPO = "tilli-pro/cookieconsent";
|
8
8
|
const GIT_CDN_BASE_URL = "https://cdn.jsdelivr.net/gh";
|
9
9
|
const GIT_CDN_URL = `${GIT_CDN_BASE_URL}/${GIT_REPO}@${GIT_SHA}`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCookieConsent.d.ts","sourceRoot":"","sources":["../../../src/react-components/hooks/useCookieConsent.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useCookieConsent.d.ts","sourceRoot":"","sources":["../../../src/react-components/hooks/useCookieConsent.ts"],"names":[],"mappings":"AAWA,wBAAgB,gBAAgB,SAO/B"}
|
@@ -4,11 +4,12 @@ import { run } from "@tilli-pro/cookieconsent";
|
|
4
4
|
import { COOKIE_CONSENT_ENABLED } from "../../_consts";
|
5
5
|
import config from "../../config";
|
6
6
|
import { makeInitFn } from "../../init/utils";
|
7
|
+
import { showPreferences } from "../../config/gui-options/scripts/showPreferences.node";
|
7
8
|
export function useCookieConsent() {
|
8
9
|
useEffect(() => {
|
9
10
|
if (!COOKIE_CONSENT_ENABLED)
|
10
11
|
return;
|
11
|
-
const init = makeInitFn(run, config);
|
12
|
+
const init = makeInitFn(run, config, showPreferences);
|
12
13
|
void init();
|
13
14
|
}, []);
|
14
15
|
}
|
package/package.json
CHANGED
@@ -3,11 +3,7 @@
|
|
3
3
|
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
4
4
|
|
5
5
|
import { buttonId } from "../html-components/ManageCookiePrefsButton";
|
6
|
-
|
7
|
-
|
8
|
-
const showPreferences = () => {
|
9
|
-
console.debug("showPreferences");
|
10
|
-
};
|
6
|
+
import type { ShowPreferencesFn } from "./showPreferences.d";
|
11
7
|
|
12
8
|
/**
|
13
9
|
* attach a MutationObserver the **first time** the user hovers over–
|
@@ -149,6 +145,7 @@ export type HTMLDivElementWithDragObserver = HTMLDivElement & {
|
|
149
145
|
export const ontouchend = function ontouchend(
|
150
146
|
this: HTMLDivElementWithDragObserver,
|
151
147
|
e: TouchEvent,
|
148
|
+
showPreferences: ShowPreferencesFn,
|
152
149
|
): void {
|
153
150
|
const touch = e.changedTouches[0];
|
154
151
|
const { clientX: endX, clientY: endY } = touch ?? {};
|
@@ -172,7 +169,7 @@ export const ontouchend = function ontouchend(
|
|
172
169
|
/** reset coordinates to avoid future issues */
|
173
170
|
this._startX = null;
|
174
171
|
this._startY = null;
|
175
|
-
} as HTMLDivElementWithDragObserver["ontouchend"];
|
172
|
+
} // as HTMLDivElementWithDragObserver["ontouchend"]; // disabled since we added `showPreferences` as a param
|
176
173
|
|
177
174
|
/** store the touch start coordinates */
|
178
175
|
export const ontouchstart = function ontouchstart(
|
@@ -1,7 +1,5 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
-
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
4
|
-
|
5
3
|
import type { HTMLDivElementWithDragObserver } from "./cookiePrefsButtonDragObserver";
|
6
4
|
import ManageCookiePrefsButton, {
|
7
5
|
containerId,
|
@@ -10,26 +8,10 @@ import cookiePrefsButtonDragObserver, {
|
|
10
8
|
ontouchend,
|
11
9
|
ontouchstart,
|
12
10
|
} from "./cookiePrefsButtonDragObserver";
|
13
|
-
|
14
|
-
declare const CookieConsent:
|
15
|
-
| {
|
16
|
-
showPreferences?: typeof _CookieConsent.showPreferences;
|
17
|
-
}
|
18
|
-
| undefined;
|
19
|
-
|
20
|
-
const _showPreferences = () => {
|
21
|
-
console.debug("showPreferences [injectManageCookiePrefsButton]");
|
22
|
-
};
|
23
|
-
|
24
|
-
export const showPreferences =
|
25
|
-
typeof CookieConsent !== "undefined" &&
|
26
|
-
typeof CookieConsent.showPreferences === "function"
|
27
|
-
? CookieConsent.showPreferences
|
28
|
-
: _showPreferences;
|
29
|
-
// (await import("@tilli-pro/cookieconsent")).showPreferences;
|
11
|
+
import type { ShowPreferencesFn } from "./showPreferences.d";
|
30
12
|
|
31
13
|
/** injects the floating cookie consent "manage preferences" icon button into the DOM */
|
32
|
-
const inject = (): HTMLDivElement => {
|
14
|
+
const inject = (showPreferences: ShowPreferencesFn): HTMLDivElement => {
|
33
15
|
const container = document.body.appendChild(
|
34
16
|
Object.assign(document.createElement("div"), {
|
35
17
|
id: containerId,
|
@@ -38,7 +20,7 @@ const inject = (): HTMLDivElement => {
|
|
38
20
|
showPreferences /** prefer over `data-cc="show-preferencesModal"` -- @see https://cookieconsent.orestbida.com/reference/api-reference.html#showpreferences */,
|
39
21
|
onmouseover: cookiePrefsButtonDragObserver,
|
40
22
|
// [mobile (touch) support]
|
41
|
-
ontouchend,
|
23
|
+
ontouchend: (e) => ontouchend?.call(container, e, showPreferences),
|
42
24
|
ontouchstart,
|
43
25
|
} satisfies Partial<HTMLDivElement>),
|
44
26
|
) as HTMLDivElementWithDragObserver;
|
@@ -50,7 +32,9 @@ const inject = (): HTMLDivElement => {
|
|
50
32
|
};
|
51
33
|
|
52
34
|
/** entry point */
|
53
|
-
export function injectManageCookiePrefsButton(
|
35
|
+
export function injectManageCookiePrefsButton(
|
36
|
+
showPreferences: ShowPreferencesFn,
|
37
|
+
): ReturnType<typeof inject> {
|
54
38
|
return ((container) => {
|
55
39
|
/** observe the DOM (to handle the case where the injected manage prefs button somehow gets removed) */
|
56
40
|
new MutationObserver(() => {
|
@@ -60,11 +44,12 @@ export function injectManageCookiePrefsButton(): ReturnType<typeof inject> {
|
|
60
44
|
if (alreadyInjected) return;
|
61
45
|
|
62
46
|
/** if the container is no longer in <body>, re-inject */
|
63
|
-
container = inject();
|
47
|
+
container = inject(showPreferences);
|
64
48
|
}).observe(document.body, { childList: true, subtree: true });
|
65
49
|
|
66
50
|
return container;
|
67
51
|
})(
|
68
|
-
(document.getElementById(containerId) as HTMLDivElement | null) ??
|
52
|
+
(document.getElementById(containerId) as HTMLDivElement | null) ??
|
53
|
+
inject(showPreferences),
|
69
54
|
);
|
70
55
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type * as _CookieConsent from "@tilli-pro/cookieconsent";
|
2
|
+
import type { ShowPreferencesFn } from "./showPreferences.d";
|
3
|
+
|
4
|
+
declare const CookieConsent:
|
5
|
+
| {
|
6
|
+
showPreferences?: typeof _CookieConsent.showPreferences;
|
7
|
+
}
|
8
|
+
| undefined;
|
9
|
+
|
10
|
+
export const showPreferences =
|
11
|
+
typeof CookieConsent !== "undefined" &&
|
12
|
+
typeof CookieConsent.showPreferences === "function"
|
13
|
+
? CookieConsent.showPreferences
|
14
|
+
: (() => {
|
15
|
+
console.error(
|
16
|
+
"Attempted to open cookie preferences modal, but the cookie consent plugin is not available at this time.",
|
17
|
+
);
|
18
|
+
})() as unknown as ShowPreferencesFn;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { showPreferences } from "@tilli-pro/cookieconsent";
|
package/src/init/brf.ts
CHANGED
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
makeInitFn,
|
9
9
|
stripInvalidLinkedCategoriesFromTranslations,
|
10
10
|
} from "./utils";
|
11
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
11
12
|
|
12
13
|
// TODO: auto-detect detect language
|
13
14
|
const __LANGUAGE__ = "en"; // "English" ("English")
|
@@ -74,5 +75,5 @@ const config: CookieConsentConfig = {
|
|
74
75
|
};
|
75
76
|
|
76
77
|
// console.debug({ config }, "Initializing Cookie Consent (BRF)...");
|
77
|
-
const init = makeInitFn(run, config);
|
78
|
+
const init = makeInitFn(run, config, showPreferences);
|
78
79
|
void init();
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
const categories: CookieConsentConfig["categories"] = {
|
11
12
|
necessary: {
|
@@ -136,5 +137,5 @@ const config: CookieConsentConfig = {
|
|
136
137
|
};
|
137
138
|
|
138
139
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
139
|
-
const init = makeInitFn(run, config);
|
140
|
+
const init = makeInitFn(run, config, showPreferences);
|
140
141
|
void init();
|
package/src/init/nudge.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
const categories: CookieConsentConfig["categories"] = {
|
11
12
|
necessary: {
|
@@ -41,5 +42,5 @@ const config: CookieConsentConfig = {
|
|
41
42
|
};
|
42
43
|
|
43
44
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
44
|
-
const init = makeInitFn(run, config);
|
45
|
+
const init = makeInitFn(run, config, showPreferences);
|
45
46
|
void init();
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
// TODO: migrate from monay.com to tillipay.com
|
11
12
|
|
@@ -217,5 +218,5 @@ const config: CookieConsentConfig = {
|
|
217
218
|
};
|
218
219
|
|
219
220
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
220
|
-
const init = makeInitFn(run, config);
|
221
|
+
const init = makeInitFn(run, config, showPreferences);
|
221
222
|
void init();
|
package/src/init/tilli-pay.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
const categories: CookieConsentConfig["categories"] = {
|
11
12
|
necessary: {
|
@@ -31,5 +32,5 @@ const config: CookieConsentConfig = {
|
|
31
32
|
};
|
32
33
|
|
33
34
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
34
|
-
const init = makeInitFn(run, config);
|
35
|
+
const init = makeInitFn(run, config, showPreferences);
|
35
36
|
void init();
|
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
const categories: CookieConsentConfig["categories"] = {
|
11
12
|
necessary: {
|
@@ -223,5 +224,5 @@ const config: CookieConsentConfig = {
|
|
223
224
|
};
|
224
225
|
|
225
226
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
226
|
-
const init = makeInitFn(run, config);
|
227
|
+
const init = makeInitFn(run, config, showPreferences);
|
227
228
|
void init();
|
package/src/init/tilliX.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6
6
|
makeInitFn,
|
7
7
|
stripInvalidLinkedCategoriesFromTranslations,
|
8
8
|
} from "./utils";
|
9
|
+
import { showPreferences } from "../config/gui-options/scripts/showPreferences.mjs";
|
9
10
|
|
10
11
|
const categories: CookieConsentConfig["categories"] = {
|
11
12
|
necessary: {
|
@@ -33,5 +34,5 @@ const config: CookieConsentConfig = {
|
|
33
34
|
};
|
34
35
|
|
35
36
|
// console.debug({ config }, "Initializing Cookie Consent (tilli Website)...");
|
36
|
-
const init = makeInitFn(run, config);
|
37
|
+
const init = makeInitFn(run, config, showPreferences);
|
37
38
|
void init();
|
package/src/init/utils.ts
CHANGED
@@ -3,17 +3,19 @@ import type * as CookieConsent from "@tilli-pro/cookieconsent";
|
|
3
3
|
|
4
4
|
import { injectReactRemoveScrollToggle } from "../config/gui-options/scripts/forceDisableReactRemoveScroll";
|
5
5
|
import { injectManageCookiePrefsButton } from "../config/gui-options/scripts/injectManageCookiePrefsButton";
|
6
|
+
import type { ShowPreferencesFn } from "../config/gui-options/scripts/showPreferences.d";
|
6
7
|
|
7
8
|
export const makeInitFn = (
|
8
9
|
initFn: typeof CookieConsent.run,
|
9
10
|
config: CookieConsentConfig,
|
11
|
+
showPreferences: ShowPreferencesFn,
|
10
12
|
) => {
|
11
13
|
return async () => {
|
12
14
|
/** inject the cookie-consent banner (pop-up) */
|
13
15
|
await initFn(config);
|
14
16
|
|
15
17
|
/** ...then, inject the floating cookie consent "manage preferences" icon button into the DOM (floats @ the bottom right) */
|
16
|
-
injectManageCookiePrefsButton();
|
18
|
+
injectManageCookiePrefsButton(showPreferences);
|
17
19
|
|
18
20
|
/** ...and, force-disable "react-remove-scroll" -- only upon opening up the "manage preferences" dialog
|
19
21
|
*
|
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@49b255420f7606d2a641e5294a5a9c09db612cca/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 = "49b255420f7606d2a641e5294a5a9c09db612cca";
|
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}`;
|
@@ -7,12 +7,13 @@ import { run } from "@tilli-pro/cookieconsent";
|
|
7
7
|
import { COOKIE_CONSENT_ENABLED } from "../../_consts";
|
8
8
|
import config from "../../config";
|
9
9
|
import { makeInitFn } from "../../init/utils";
|
10
|
+
import { showPreferences } from "../../config/gui-options/scripts/showPreferences.node";
|
10
11
|
|
11
12
|
export function useCookieConsent() {
|
12
13
|
useEffect(() => {
|
13
14
|
if (!COOKIE_CONSENT_ENABLED) return;
|
14
15
|
|
15
|
-
const init = makeInitFn(run, config);
|
16
|
+
const init = makeInitFn(run, config, showPreferences);
|
16
17
|
void init();
|
17
18
|
}, []);
|
18
19
|
}
|