@solvenza/cookies-compliance 1.2.1 → 1.5.3
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/README.md +960 -36
- package/bin/audit-cli.js +134 -13
- package/dist/audit.cjs +811 -0
- package/dist/audit.cjs.map +1 -0
- package/dist/audit.d.cts +60 -0
- package/dist/audit.d.ts +60 -0
- package/dist/audit.js +380 -0
- package/dist/audit.js.map +1 -0
- package/dist/chunk-C5QPXHTH.js +3557 -0
- package/dist/chunk-C5QPXHTH.js.map +1 -0
- package/dist/chunk-OHOHIAK6.js +442 -0
- package/dist/chunk-OHOHIAK6.js.map +1 -0
- package/dist/chunk-Q3FZFXQE.js +89 -0
- package/dist/chunk-UQU54ANZ.js +225 -0
- package/dist/chunk-UQU54ANZ.js.map +1 -0
- package/dist/chunk-W5MG56VI.js +269 -0
- package/dist/chunk-W5MG56VI.js.map +1 -0
- package/dist/consent.esm.cjs +2195 -84
- package/dist/consent.esm.cjs.map +1 -1
- package/dist/consent.esm.d.cts +173 -6
- package/dist/consent.esm.d.ts +173 -6
- package/dist/consent.esm.js +57 -23
- package/dist/consent.esm.js.map +1 -1
- package/dist/consent.min.js +437 -55
- package/dist/consent.min.js.map +1 -1
- package/dist/presets.cjs +495 -0
- package/dist/presets.cjs.map +1 -0
- package/dist/presets.d.cts +51 -0
- package/dist/presets.d.ts +51 -0
- package/dist/presets.js +16 -0
- package/dist/presets.js.map +1 -0
- package/dist/types--kyI7OOR.d.cts +314 -0
- package/dist/types--kyI7OOR.d.ts +314 -0
- package/dist/wrappers/angular.cjs +2341 -65
- package/dist/wrappers/angular.cjs.map +1 -1
- package/dist/wrappers/angular.d.cts +85 -5
- package/dist/wrappers/angular.d.ts +85 -5
- package/dist/wrappers/angular.js +217 -3
- package/dist/wrappers/angular.js.map +1 -1
- package/dist/wrappers/next.cjs +2353 -103
- package/dist/wrappers/next.cjs.map +1 -1
- package/dist/wrappers/next.d.cts +25 -1
- package/dist/wrappers/next.d.ts +25 -1
- package/dist/wrappers/next.js +30 -5
- package/dist/wrappers/next.js.map +1 -1
- package/dist/wrappers/nuxt.cjs +4171 -0
- package/dist/wrappers/nuxt.cjs.map +1 -0
- package/dist/wrappers/nuxt.d.cts +33 -0
- package/dist/wrappers/nuxt.d.ts +33 -0
- package/dist/wrappers/nuxt.js +51 -0
- package/dist/wrappers/nuxt.js.map +1 -0
- package/dist/wrappers/react.cjs +2336 -141
- package/dist/wrappers/react.cjs.map +1 -1
- package/dist/wrappers/react.d.cts +87 -1
- package/dist/wrappers/react.d.ts +87 -1
- package/dist/wrappers/react.js +21 -51
- package/dist/wrappers/react.js.map +1 -1
- package/dist/wrappers/vue.cjs +4163 -0
- package/dist/wrappers/vue.cjs.map +1 -0
- package/dist/wrappers/vue.d.cts +144 -0
- package/dist/wrappers/vue.d.ts +144 -0
- package/dist/wrappers/vue.js +28 -0
- package/dist/wrappers/vue.js.map +1 -0
- package/dist/wrappers/wordpress.js +1 -1
- package/package.json +26 -5
- package/schema.json +143 -4
- package/dist/chunk-DDAAVRWG.js +0 -25
- package/dist/chunk-FBRP4MSA.js +0 -1907
- package/dist/chunk-FBRP4MSA.js.map +0 -1
- package/dist/consent-engine-DOMyEKfk.d.cts +0 -193
- package/dist/consent-engine-DOMyEKfk.d.ts +0 -193
- /package/dist/{chunk-DDAAVRWG.js.map → chunk-Q3FZFXQE.js.map} +0 -0
|
@@ -1,4 +1,90 @@
|
|
|
1
|
+
import { L as LegalPolicyOptions } from '../types--kyI7OOR.cjs';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* React hook to reactively subscribe to a consent category.
|
|
6
|
+
*
|
|
7
|
+
* @param category - Category ID (e.g. 'analytics', 'marketing')
|
|
8
|
+
* @returns boolean indicating if the category is allowed
|
|
9
|
+
*/
|
|
1
10
|
declare function useConsent(category: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* React hook to reactively subscribe to a specific service.
|
|
13
|
+
*
|
|
14
|
+
* @param serviceId - Service ID (e.g. 'ga4', 'youtube')
|
|
15
|
+
* @returns boolean indicating if the service is allowed
|
|
16
|
+
*/
|
|
2
17
|
declare function useConsentService(serviceId: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* React hook to reactively subscribe to the cookie consent library's active locale.
|
|
20
|
+
*/
|
|
21
|
+
declare function useConsentLocale(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Zero-boilerplate React hook to synchronize parent application i18n state
|
|
24
|
+
* (such as react-i18next i18n.language or next-intl locale) with the consent library.
|
|
25
|
+
*/
|
|
26
|
+
declare function useSyncConsentLocale(locale?: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* React hook to check if Global Privacy Control (GPC) or Do Not Track (DNT) signal is active.
|
|
29
|
+
*/
|
|
30
|
+
declare function useGpc(): boolean;
|
|
31
|
+
interface ConsentGateFallbackContext {
|
|
32
|
+
category?: string;
|
|
33
|
+
service?: string;
|
|
34
|
+
openPreferences: () => void;
|
|
35
|
+
}
|
|
36
|
+
interface ConsentGateProps {
|
|
37
|
+
category?: string;
|
|
38
|
+
service?: string;
|
|
39
|
+
fallback?: ReactNode | ((context: ConsentGateFallbackContext) => ReactNode);
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Declarative React Component to conditionally render content/media based on consent status.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <ConsentGate
|
|
48
|
+
* category="marketing"
|
|
49
|
+
* fallback={(
|
|
50
|
+
* <div className="consent-placeholder">
|
|
51
|
+
* <p>Este vídeo requiere cookies de marketing para reproducirse.</p>
|
|
52
|
+
* <button onClick={() => Consent.openPreferences()}>Configurar permisos</button>
|
|
53
|
+
* </div>
|
|
54
|
+
* )}
|
|
55
|
+
* >
|
|
56
|
+
* <iframe src="https://www.youtube.com/embed/xyz" />
|
|
57
|
+
* </ConsentGate>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function ConsentGate({ category, service, fallback, children, }: ConsentGateProps): any;
|
|
61
|
+
interface CookiePolicyProps {
|
|
62
|
+
view?: "full" | "table-only" | "summary";
|
|
63
|
+
options?: LegalPolicyOptions;
|
|
64
|
+
className?: string;
|
|
65
|
+
style?: any;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Declarative React component that renders the full Cookie Policy document or cookie inventory table.
|
|
69
|
+
*/
|
|
70
|
+
declare function CookiePolicy({ view, options, className, style, }: CookiePolicyProps): any;
|
|
71
|
+
interface LegalNoticeProps {
|
|
72
|
+
options?: LegalPolicyOptions;
|
|
73
|
+
className?: string;
|
|
74
|
+
style?: any;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Declarative React component that renders the Legal Notice (Aviso Legal LSSI-CE art. 10).
|
|
78
|
+
*/
|
|
79
|
+
declare function LegalNotice({ options, className, style }: LegalNoticeProps): any;
|
|
80
|
+
interface PrivacyPolicyProps {
|
|
81
|
+
options?: LegalPolicyOptions;
|
|
82
|
+
className?: string;
|
|
83
|
+
style?: any;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Declarative React component that renders the GDPR Privacy Policy document.
|
|
87
|
+
*/
|
|
88
|
+
declare function PrivacyPolicy({ options, className, style }: PrivacyPolicyProps): any;
|
|
3
89
|
|
|
4
|
-
export { useConsent, useConsentService };
|
|
90
|
+
export { ConsentGate, type ConsentGateFallbackContext, type ConsentGateProps, CookiePolicy, type CookiePolicyProps, LegalNotice, type LegalNoticeProps, PrivacyPolicy, type PrivacyPolicyProps, useConsent, useConsentLocale, useConsentService, useGpc, useSyncConsentLocale };
|
package/dist/wrappers/react.d.ts
CHANGED
|
@@ -1,4 +1,90 @@
|
|
|
1
|
+
import { L as LegalPolicyOptions } from '../types--kyI7OOR.js';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* React hook to reactively subscribe to a consent category.
|
|
6
|
+
*
|
|
7
|
+
* @param category - Category ID (e.g. 'analytics', 'marketing')
|
|
8
|
+
* @returns boolean indicating if the category is allowed
|
|
9
|
+
*/
|
|
1
10
|
declare function useConsent(category: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* React hook to reactively subscribe to a specific service.
|
|
13
|
+
*
|
|
14
|
+
* @param serviceId - Service ID (e.g. 'ga4', 'youtube')
|
|
15
|
+
* @returns boolean indicating if the service is allowed
|
|
16
|
+
*/
|
|
2
17
|
declare function useConsentService(serviceId: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* React hook to reactively subscribe to the cookie consent library's active locale.
|
|
20
|
+
*/
|
|
21
|
+
declare function useConsentLocale(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Zero-boilerplate React hook to synchronize parent application i18n state
|
|
24
|
+
* (such as react-i18next i18n.language or next-intl locale) with the consent library.
|
|
25
|
+
*/
|
|
26
|
+
declare function useSyncConsentLocale(locale?: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* React hook to check if Global Privacy Control (GPC) or Do Not Track (DNT) signal is active.
|
|
29
|
+
*/
|
|
30
|
+
declare function useGpc(): boolean;
|
|
31
|
+
interface ConsentGateFallbackContext {
|
|
32
|
+
category?: string;
|
|
33
|
+
service?: string;
|
|
34
|
+
openPreferences: () => void;
|
|
35
|
+
}
|
|
36
|
+
interface ConsentGateProps {
|
|
37
|
+
category?: string;
|
|
38
|
+
service?: string;
|
|
39
|
+
fallback?: ReactNode | ((context: ConsentGateFallbackContext) => ReactNode);
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Declarative React Component to conditionally render content/media based on consent status.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <ConsentGate
|
|
48
|
+
* category="marketing"
|
|
49
|
+
* fallback={(
|
|
50
|
+
* <div className="consent-placeholder">
|
|
51
|
+
* <p>Este vídeo requiere cookies de marketing para reproducirse.</p>
|
|
52
|
+
* <button onClick={() => Consent.openPreferences()}>Configurar permisos</button>
|
|
53
|
+
* </div>
|
|
54
|
+
* )}
|
|
55
|
+
* >
|
|
56
|
+
* <iframe src="https://www.youtube.com/embed/xyz" />
|
|
57
|
+
* </ConsentGate>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function ConsentGate({ category, service, fallback, children, }: ConsentGateProps): any;
|
|
61
|
+
interface CookiePolicyProps {
|
|
62
|
+
view?: "full" | "table-only" | "summary";
|
|
63
|
+
options?: LegalPolicyOptions;
|
|
64
|
+
className?: string;
|
|
65
|
+
style?: any;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Declarative React component that renders the full Cookie Policy document or cookie inventory table.
|
|
69
|
+
*/
|
|
70
|
+
declare function CookiePolicy({ view, options, className, style, }: CookiePolicyProps): any;
|
|
71
|
+
interface LegalNoticeProps {
|
|
72
|
+
options?: LegalPolicyOptions;
|
|
73
|
+
className?: string;
|
|
74
|
+
style?: any;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Declarative React component that renders the Legal Notice (Aviso Legal LSSI-CE art. 10).
|
|
78
|
+
*/
|
|
79
|
+
declare function LegalNotice({ options, className, style }: LegalNoticeProps): any;
|
|
80
|
+
interface PrivacyPolicyProps {
|
|
81
|
+
options?: LegalPolicyOptions;
|
|
82
|
+
className?: string;
|
|
83
|
+
style?: any;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Declarative React component that renders the GDPR Privacy Policy document.
|
|
87
|
+
*/
|
|
88
|
+
declare function PrivacyPolicy({ options, className, style }: PrivacyPolicyProps): any;
|
|
3
89
|
|
|
4
|
-
export { useConsent, useConsentService };
|
|
90
|
+
export { ConsentGate, type ConsentGateFallbackContext, type ConsentGateProps, CookiePolicy, type CookiePolicyProps, LegalNotice, type LegalNoticeProps, PrivacyPolicy, type PrivacyPolicyProps, useConsent, useConsentLocale, useConsentService, useGpc, useSyncConsentLocale };
|
package/dist/wrappers/react.js
CHANGED
|
@@ -1,56 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const unsub1 = Consent.on("consent:changed", update);
|
|
16
|
-
const unsub2 = Consent.on("consent:accepted", update);
|
|
17
|
-
const unsub3 = Consent.on("consent:rejected", update);
|
|
18
|
-
const unsub4 = Consent.on("consent:withdrawn", update);
|
|
19
|
-
const unsub5 = Consent.on("ready", update);
|
|
20
|
-
return () => {
|
|
21
|
-
unsub1();
|
|
22
|
-
unsub2();
|
|
23
|
-
unsub3();
|
|
24
|
-
unsub4();
|
|
25
|
-
unsub5();
|
|
26
|
-
};
|
|
27
|
-
}, [category]);
|
|
28
|
-
return allowed;
|
|
29
|
-
}
|
|
30
|
-
function useConsentService(serviceId) {
|
|
31
|
-
const [allowed, setAllowed] = useState(() => Consent.hasService(serviceId));
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const update = () => {
|
|
34
|
-
setAllowed(Consent.hasService(serviceId));
|
|
35
|
-
};
|
|
36
|
-
update();
|
|
37
|
-
const unsub1 = Consent.on("consent:changed", update);
|
|
38
|
-
const unsub2 = Consent.on("consent:accepted", update);
|
|
39
|
-
const unsub3 = Consent.on("consent:rejected", update);
|
|
40
|
-
const unsub4 = Consent.on("consent:withdrawn", update);
|
|
41
|
-
const unsub5 = Consent.on("ready", update);
|
|
42
|
-
return () => {
|
|
43
|
-
unsub1();
|
|
44
|
-
unsub2();
|
|
45
|
-
unsub3();
|
|
46
|
-
unsub4();
|
|
47
|
-
unsub5();
|
|
48
|
-
};
|
|
49
|
-
}, [serviceId]);
|
|
50
|
-
return allowed;
|
|
51
|
-
}
|
|
2
|
+
ConsentGate,
|
|
3
|
+
CookiePolicy,
|
|
4
|
+
LegalNotice,
|
|
5
|
+
PrivacyPolicy,
|
|
6
|
+
useConsent,
|
|
7
|
+
useConsentLocale,
|
|
8
|
+
useConsentService,
|
|
9
|
+
useGpc,
|
|
10
|
+
useSyncConsentLocale
|
|
11
|
+
} from "../chunk-UQU54ANZ.js";
|
|
12
|
+
import "../chunk-C5QPXHTH.js";
|
|
13
|
+
import "../chunk-OHOHIAK6.js";
|
|
14
|
+
import "../chunk-Q3FZFXQE.js";
|
|
52
15
|
export {
|
|
16
|
+
ConsentGate,
|
|
17
|
+
CookiePolicy,
|
|
18
|
+
LegalNotice,
|
|
19
|
+
PrivacyPolicy,
|
|
53
20
|
useConsent,
|
|
54
|
-
|
|
21
|
+
useConsentLocale,
|
|
22
|
+
useConsentService,
|
|
23
|
+
useGpc,
|
|
24
|
+
useSyncConsentLocale
|
|
55
25
|
};
|
|
56
26
|
//# sourceMappingURL=react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|