@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
package/dist/wrappers/next.d.cts
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { C as ConsentConfig } from '../types--kyI7OOR.cjs';
|
|
2
|
+
export { ConsentGate, ConsentGateFallbackContext, ConsentGateProps, CookiePolicy, CookiePolicyProps, LegalNotice, LegalNoticeProps, PrivacyPolicy, PrivacyPolicyProps, useConsent, useConsentLocale, useConsentService, useGpc, useSyncConsentLocale } from './react.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initialize consent engine in Next.js applications (Pages or App Router).
|
|
7
|
+
* If initialLocale is provided, it synchronizes immediately.
|
|
8
|
+
* Otherwise, it automatically detects the parent locale from <html lang> or route params.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // app/layout.tsx
|
|
13
|
+
* "use client";
|
|
14
|
+
* import { useEffect } from "react";
|
|
15
|
+
* import { initNextConsent } from "@solvenza/cookies-compliance/next";
|
|
16
|
+
*
|
|
17
|
+
* export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
18
|
+
* useEffect(() => {
|
|
19
|
+
* void initNextConsent('/consent.json');
|
|
20
|
+
* }, []);
|
|
21
|
+
* return <html><body>{children}</body></html>;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function initNextConsent(configUrl?: string | ConsentConfig, initialLocale?: string): Promise<void> | void;
|
|
2
26
|
|
|
3
27
|
export { initNextConsent };
|
package/dist/wrappers/next.d.ts
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { C as ConsentConfig } from '../types--kyI7OOR.js';
|
|
2
|
+
export { ConsentGate, ConsentGateFallbackContext, ConsentGateProps, CookiePolicy, CookiePolicyProps, LegalNotice, LegalNoticeProps, PrivacyPolicy, PrivacyPolicyProps, useConsent, useConsentLocale, useConsentService, useGpc, useSyncConsentLocale } from './react.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initialize consent engine in Next.js applications (Pages or App Router).
|
|
7
|
+
* If initialLocale is provided, it synchronizes immediately.
|
|
8
|
+
* Otherwise, it automatically detects the parent locale from <html lang> or route params.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // app/layout.tsx
|
|
13
|
+
* "use client";
|
|
14
|
+
* import { useEffect } from "react";
|
|
15
|
+
* import { initNextConsent } from "@solvenza/cookies-compliance/next";
|
|
16
|
+
*
|
|
17
|
+
* export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
18
|
+
* useEffect(() => {
|
|
19
|
+
* void initNextConsent('/consent.json');
|
|
20
|
+
* }, []);
|
|
21
|
+
* return <html><body>{children}</body></html>;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function initNextConsent(configUrl?: string | ConsentConfig, initialLocale?: string): Promise<void> | void;
|
|
2
26
|
|
|
3
27
|
export { initNextConsent };
|
package/dist/wrappers/next.js
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConsentGate,
|
|
3
|
+
CookiePolicy,
|
|
4
|
+
LegalNotice,
|
|
5
|
+
PrivacyPolicy,
|
|
6
|
+
useConsent,
|
|
7
|
+
useConsentLocale,
|
|
8
|
+
useConsentService,
|
|
9
|
+
useGpc,
|
|
10
|
+
useSyncConsentLocale
|
|
11
|
+
} from "../chunk-UQU54ANZ.js";
|
|
1
12
|
import {
|
|
2
13
|
Consent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-C5QPXHTH.js";
|
|
15
|
+
import "../chunk-OHOHIAK6.js";
|
|
16
|
+
import "../chunk-Q3FZFXQE.js";
|
|
5
17
|
|
|
6
18
|
// src/wrappers/next.ts
|
|
7
|
-
function initNextConsent(configUrl = "/consent.json") {
|
|
19
|
+
function initNextConsent(configUrl = "/consent.json", initialLocale) {
|
|
8
20
|
if (typeof window !== "undefined") {
|
|
9
|
-
|
|
21
|
+
return Consent.init(configUrl).then(() => {
|
|
22
|
+
if (initialLocale) {
|
|
23
|
+
Consent.syncLocale(initialLocale);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
10
26
|
}
|
|
11
27
|
}
|
|
12
28
|
export {
|
|
13
|
-
|
|
29
|
+
ConsentGate,
|
|
30
|
+
CookiePolicy,
|
|
31
|
+
LegalNotice,
|
|
32
|
+
PrivacyPolicy,
|
|
33
|
+
initNextConsent,
|
|
34
|
+
useConsent,
|
|
35
|
+
useConsentLocale,
|
|
36
|
+
useConsentService,
|
|
37
|
+
useGpc,
|
|
38
|
+
useSyncConsentLocale
|
|
14
39
|
};
|
|
15
40
|
//# sourceMappingURL=next.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/wrappers/next.ts"],"sourcesContent":["import { Consent } from \"../core/consent-engine.js\";\n\nexport function initNextConsent(configUrl = \"/consent.json\") {\n if (typeof window !== \"undefined\") {\n
|
|
1
|
+
{"version":3,"sources":["../../src/wrappers/next.ts"],"sourcesContent":["import { Consent } from \"../core/consent-engine.js\";\nimport type { ConsentConfig } from \"../core/types.js\";\n\nexport {\n useConsent,\n useConsentService,\n useConsentLocale,\n useSyncConsentLocale,\n useGpc,\n ConsentGate,\n type ConsentGateProps,\n type ConsentGateFallbackContext,\n CookiePolicy,\n type CookiePolicyProps,\n LegalNotice,\n type LegalNoticeProps,\n PrivacyPolicy,\n type PrivacyPolicyProps,\n} from \"./react.js\";\n\n/**\n * Initialize consent engine in Next.js applications (Pages or App Router).\n * If initialLocale is provided, it synchronizes immediately.\n * Otherwise, it automatically detects the parent locale from <html lang> or route params.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * \"use client\";\n * import { useEffect } from \"react\";\n * import { initNextConsent } from \"@solvenza/cookies-compliance/next\";\n *\n * export default function RootLayout({ children }: { children: React.ReactNode }) {\n * useEffect(() => {\n * void initNextConsent('/consent.json');\n * }, []);\n * return <html><body>{children}</body></html>;\n * }\n * ```\n */\nexport function initNextConsent(\n configUrl: string | ConsentConfig = \"/consent.json\",\n initialLocale?: string,\n): Promise<void> | void {\n if (typeof window !== \"undefined\") {\n return Consent.init(configUrl).then(() => {\n if (initialLocale) {\n Consent.syncLocale(initialLocale);\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwCO,SAAS,gBACd,YAAoC,iBACpC,eACsB;AACtB,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,QAAQ,KAAK,SAAS,EAAE,KAAK,MAAM;AACxC,UAAI,eAAe;AACjB,gBAAQ,WAAW,aAAa;AAAA,MAClC;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|