@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.
Files changed (72) hide show
  1. package/README.md +960 -36
  2. package/bin/audit-cli.js +134 -13
  3. package/dist/audit.cjs +811 -0
  4. package/dist/audit.cjs.map +1 -0
  5. package/dist/audit.d.cts +60 -0
  6. package/dist/audit.d.ts +60 -0
  7. package/dist/audit.js +380 -0
  8. package/dist/audit.js.map +1 -0
  9. package/dist/chunk-C5QPXHTH.js +3557 -0
  10. package/dist/chunk-C5QPXHTH.js.map +1 -0
  11. package/dist/chunk-OHOHIAK6.js +442 -0
  12. package/dist/chunk-OHOHIAK6.js.map +1 -0
  13. package/dist/chunk-Q3FZFXQE.js +89 -0
  14. package/dist/chunk-UQU54ANZ.js +225 -0
  15. package/dist/chunk-UQU54ANZ.js.map +1 -0
  16. package/dist/chunk-W5MG56VI.js +269 -0
  17. package/dist/chunk-W5MG56VI.js.map +1 -0
  18. package/dist/consent.esm.cjs +2195 -84
  19. package/dist/consent.esm.cjs.map +1 -1
  20. package/dist/consent.esm.d.cts +173 -6
  21. package/dist/consent.esm.d.ts +173 -6
  22. package/dist/consent.esm.js +57 -23
  23. package/dist/consent.esm.js.map +1 -1
  24. package/dist/consent.min.js +437 -55
  25. package/dist/consent.min.js.map +1 -1
  26. package/dist/presets.cjs +495 -0
  27. package/dist/presets.cjs.map +1 -0
  28. package/dist/presets.d.cts +51 -0
  29. package/dist/presets.d.ts +51 -0
  30. package/dist/presets.js +16 -0
  31. package/dist/presets.js.map +1 -0
  32. package/dist/types--kyI7OOR.d.cts +314 -0
  33. package/dist/types--kyI7OOR.d.ts +314 -0
  34. package/dist/wrappers/angular.cjs +2341 -65
  35. package/dist/wrappers/angular.cjs.map +1 -1
  36. package/dist/wrappers/angular.d.cts +85 -5
  37. package/dist/wrappers/angular.d.ts +85 -5
  38. package/dist/wrappers/angular.js +217 -3
  39. package/dist/wrappers/angular.js.map +1 -1
  40. package/dist/wrappers/next.cjs +2353 -103
  41. package/dist/wrappers/next.cjs.map +1 -1
  42. package/dist/wrappers/next.d.cts +25 -1
  43. package/dist/wrappers/next.d.ts +25 -1
  44. package/dist/wrappers/next.js +30 -5
  45. package/dist/wrappers/next.js.map +1 -1
  46. package/dist/wrappers/nuxt.cjs +4171 -0
  47. package/dist/wrappers/nuxt.cjs.map +1 -0
  48. package/dist/wrappers/nuxt.d.cts +33 -0
  49. package/dist/wrappers/nuxt.d.ts +33 -0
  50. package/dist/wrappers/nuxt.js +51 -0
  51. package/dist/wrappers/nuxt.js.map +1 -0
  52. package/dist/wrappers/react.cjs +2336 -141
  53. package/dist/wrappers/react.cjs.map +1 -1
  54. package/dist/wrappers/react.d.cts +87 -1
  55. package/dist/wrappers/react.d.ts +87 -1
  56. package/dist/wrappers/react.js +21 -51
  57. package/dist/wrappers/react.js.map +1 -1
  58. package/dist/wrappers/vue.cjs +4163 -0
  59. package/dist/wrappers/vue.cjs.map +1 -0
  60. package/dist/wrappers/vue.d.cts +144 -0
  61. package/dist/wrappers/vue.d.ts +144 -0
  62. package/dist/wrappers/vue.js +28 -0
  63. package/dist/wrappers/vue.js.map +1 -0
  64. package/dist/wrappers/wordpress.js +1 -1
  65. package/package.json +26 -5
  66. package/schema.json +143 -4
  67. package/dist/chunk-DDAAVRWG.js +0 -25
  68. package/dist/chunk-FBRP4MSA.js +0 -1907
  69. package/dist/chunk-FBRP4MSA.js.map +0 -1
  70. package/dist/consent-engine-DOMyEKfk.d.cts +0 -193
  71. package/dist/consent-engine-DOMyEKfk.d.ts +0 -193
  72. /package/dist/{chunk-DDAAVRWG.js.map → chunk-Q3FZFXQE.js.map} +0 -0
@@ -1,3 +1,27 @@
1
- declare function initNextConsent(configUrl?: string): void;
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 };
@@ -1,3 +1,27 @@
1
- declare function initNextConsent(configUrl?: string): void;
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 };
@@ -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-FBRP4MSA.js";
4
- import "../chunk-DDAAVRWG.js";
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
- void Consent.init(configUrl);
21
+ return Consent.init(configUrl).then(() => {
22
+ if (initialLocale) {
23
+ Consent.syncLocale(initialLocale);
24
+ }
25
+ });
10
26
  }
11
27
  }
12
28
  export {
13
- initNextConsent
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 void Consent.init(configUrl);\n }\n}\n"],"mappings":";;;;;;AAEO,SAAS,gBAAgB,YAAY,iBAAiB;AAC3D,MAAI,OAAO,WAAW,aAAa;AACjC,SAAK,QAAQ,KAAK,SAAS;AAAA,EAC7B;AACF;","names":[]}
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":[]}