@consenti/ui 0.5.0 → 0.6.0

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/dist/react.d.cts CHANGED
@@ -64,6 +64,10 @@ type ComplianceType = 'auto' | ComplianceGroupId | (string & {}) | Symbol;
64
64
 
65
65
  interface ComplianceMapData {
66
66
  version: string;
67
+ /** `true` (default): this map replaces the embedded one entirely, so only the countries listed here
68
+ * resolve (server side). `false`: `countries` is merged over the embedded map — a listed country
69
+ * replaces its embedded entry wholesale, every unlisted country keeps its built-in mapping. */
70
+ override?: boolean;
67
71
  countries: Record<string, CountryComplianceEntry>;
68
72
  }
69
73
  interface CountryComplianceEntry {
@@ -83,6 +87,9 @@ interface ConsentDbRecord {
83
87
  tenantId: string;
84
88
  visitorId: string;
85
89
  profileId: string;
90
+ /** The profile's `version` when this consent was last given — with `profileId`, pins the exact
91
+ * on-disk snapshot (the banner text the visitor saw). Absent on records from before it was tracked. */
92
+ profileVersion?: number;
86
93
  locale: string;
87
94
  consentJson: ConsentValue;
88
95
  gpcDetected: boolean;
@@ -281,7 +288,12 @@ interface ResolvedProfile {
281
288
  /** Apply WCAG 2.1 AA accessibility enhancements to the widget. */
282
289
  enhanceAccessibility?: boolean;
283
290
  }
284
- type WidgetCountryResolverFn = () => Promise<{
291
+ type WidgetCountryResolverFn = (hints: {
292
+ timezone: string;
293
+ language: string;
294
+ languages: string[];
295
+ locale: string;
296
+ }) => Promise<{
285
297
  country: string | null;
286
298
  region: string | null;
287
299
  confidence: number;
@@ -340,8 +352,11 @@ interface ComplianceWidgetConfig {
340
352
  * document from (the browser's own HTTP cache honors whatever `Cache-Control`/`ETag` the
341
353
  * response sends — no custom caching here), or an inline operator-supplied `ComplianceMapData`
342
354
  * object. Invalid data from either a URL or an object logs a warning and falls back to
343
- * `'default'`. Only overrides the country→group mapping — country/region detection itself
344
- * always uses the embedded geo data. */
355
+ * `'default'`. Only overrides the country→group mapping — country/region detection itself always
356
+ * uses the embedded geo data. A country the map doesn't list falls back to the embedded mapping
357
+ * unless the document sets `override: true` (then it gets the strictest group, `'opt-in'`).
358
+ * Unlike the server, an omitted `override` is NOT `true` here: widget maps have always merged
359
+ * over the embedded mapping, and that stays the default. */
345
360
  complianceMap?: 'default' | string | ComplianceMapData;
346
361
  tcf?: TcfWidgetConfig;
347
362
  gpp?: GppWidgetConfig;
package/dist/react.d.ts CHANGED
@@ -64,6 +64,10 @@ type ComplianceType = 'auto' | ComplianceGroupId | (string & {}) | Symbol;
64
64
 
65
65
  interface ComplianceMapData {
66
66
  version: string;
67
+ /** `true` (default): this map replaces the embedded one entirely, so only the countries listed here
68
+ * resolve (server side). `false`: `countries` is merged over the embedded map — a listed country
69
+ * replaces its embedded entry wholesale, every unlisted country keeps its built-in mapping. */
70
+ override?: boolean;
67
71
  countries: Record<string, CountryComplianceEntry>;
68
72
  }
69
73
  interface CountryComplianceEntry {
@@ -83,6 +87,9 @@ interface ConsentDbRecord {
83
87
  tenantId: string;
84
88
  visitorId: string;
85
89
  profileId: string;
90
+ /** The profile's `version` when this consent was last given — with `profileId`, pins the exact
91
+ * on-disk snapshot (the banner text the visitor saw). Absent on records from before it was tracked. */
92
+ profileVersion?: number;
86
93
  locale: string;
87
94
  consentJson: ConsentValue;
88
95
  gpcDetected: boolean;
@@ -281,7 +288,12 @@ interface ResolvedProfile {
281
288
  /** Apply WCAG 2.1 AA accessibility enhancements to the widget. */
282
289
  enhanceAccessibility?: boolean;
283
290
  }
284
- type WidgetCountryResolverFn = () => Promise<{
291
+ type WidgetCountryResolverFn = (hints: {
292
+ timezone: string;
293
+ language: string;
294
+ languages: string[];
295
+ locale: string;
296
+ }) => Promise<{
285
297
  country: string | null;
286
298
  region: string | null;
287
299
  confidence: number;
@@ -340,8 +352,11 @@ interface ComplianceWidgetConfig {
340
352
  * document from (the browser's own HTTP cache honors whatever `Cache-Control`/`ETag` the
341
353
  * response sends — no custom caching here), or an inline operator-supplied `ComplianceMapData`
342
354
  * object. Invalid data from either a URL or an object logs a warning and falls back to
343
- * `'default'`. Only overrides the country→group mapping — country/region detection itself
344
- * always uses the embedded geo data. */
355
+ * `'default'`. Only overrides the country→group mapping — country/region detection itself always
356
+ * uses the embedded geo data. A country the map doesn't list falls back to the embedded mapping
357
+ * unless the document sets `override: true` (then it gets the strictest group, `'opt-in'`).
358
+ * Unlike the server, an omitted `override` is NOT `true` here: widget maps have always merged
359
+ * over the embedded mapping, and that stays the default. */
345
360
  complianceMap?: 'default' | string | ComplianceMapData;
346
361
  tcf?: TcfWidgetConfig;
347
362
  gpp?: GppWidgetConfig;
package/dist/vue.d.cts CHANGED
@@ -66,6 +66,10 @@ type ComplianceType = 'auto' | ComplianceGroupId | (string & {}) | Symbol;
66
66
 
67
67
  interface ComplianceMapData {
68
68
  version: string;
69
+ /** `true` (default): this map replaces the embedded one entirely, so only the countries listed here
70
+ * resolve (server side). `false`: `countries` is merged over the embedded map — a listed country
71
+ * replaces its embedded entry wholesale, every unlisted country keeps its built-in mapping. */
72
+ override?: boolean;
69
73
  countries: Record<string, CountryComplianceEntry>;
70
74
  }
71
75
  interface CountryComplianceEntry {
@@ -85,6 +89,9 @@ interface ConsentDbRecord {
85
89
  tenantId: string;
86
90
  visitorId: string;
87
91
  profileId: string;
92
+ /** The profile's `version` when this consent was last given — with `profileId`, pins the exact
93
+ * on-disk snapshot (the banner text the visitor saw). Absent on records from before it was tracked. */
94
+ profileVersion?: number;
88
95
  locale: string;
89
96
  consentJson: ConsentValue;
90
97
  gpcDetected: boolean;
@@ -283,7 +290,12 @@ interface ResolvedProfile {
283
290
  /** Apply WCAG 2.1 AA accessibility enhancements to the widget. */
284
291
  enhanceAccessibility?: boolean;
285
292
  }
286
- type WidgetCountryResolverFn = () => Promise<{
293
+ type WidgetCountryResolverFn = (hints: {
294
+ timezone: string;
295
+ language: string;
296
+ languages: string[];
297
+ locale: string;
298
+ }) => Promise<{
287
299
  country: string | null;
288
300
  region: string | null;
289
301
  confidence: number;
@@ -342,8 +354,11 @@ interface ComplianceWidgetConfig {
342
354
  * document from (the browser's own HTTP cache honors whatever `Cache-Control`/`ETag` the
343
355
  * response sends — no custom caching here), or an inline operator-supplied `ComplianceMapData`
344
356
  * object. Invalid data from either a URL or an object logs a warning and falls back to
345
- * `'default'`. Only overrides the country→group mapping — country/region detection itself
346
- * always uses the embedded geo data. */
357
+ * `'default'`. Only overrides the country→group mapping — country/region detection itself always
358
+ * uses the embedded geo data. A country the map doesn't list falls back to the embedded mapping
359
+ * unless the document sets `override: true` (then it gets the strictest group, `'opt-in'`).
360
+ * Unlike the server, an omitted `override` is NOT `true` here: widget maps have always merged
361
+ * over the embedded mapping, and that stays the default. */
347
362
  complianceMap?: 'default' | string | ComplianceMapData;
348
363
  tcf?: TcfWidgetConfig;
349
364
  gpp?: GppWidgetConfig;
package/dist/vue.d.ts CHANGED
@@ -66,6 +66,10 @@ type ComplianceType = 'auto' | ComplianceGroupId | (string & {}) | Symbol;
66
66
 
67
67
  interface ComplianceMapData {
68
68
  version: string;
69
+ /** `true` (default): this map replaces the embedded one entirely, so only the countries listed here
70
+ * resolve (server side). `false`: `countries` is merged over the embedded map — a listed country
71
+ * replaces its embedded entry wholesale, every unlisted country keeps its built-in mapping. */
72
+ override?: boolean;
69
73
  countries: Record<string, CountryComplianceEntry>;
70
74
  }
71
75
  interface CountryComplianceEntry {
@@ -85,6 +89,9 @@ interface ConsentDbRecord {
85
89
  tenantId: string;
86
90
  visitorId: string;
87
91
  profileId: string;
92
+ /** The profile's `version` when this consent was last given — with `profileId`, pins the exact
93
+ * on-disk snapshot (the banner text the visitor saw). Absent on records from before it was tracked. */
94
+ profileVersion?: number;
88
95
  locale: string;
89
96
  consentJson: ConsentValue;
90
97
  gpcDetected: boolean;
@@ -283,7 +290,12 @@ interface ResolvedProfile {
283
290
  /** Apply WCAG 2.1 AA accessibility enhancements to the widget. */
284
291
  enhanceAccessibility?: boolean;
285
292
  }
286
- type WidgetCountryResolverFn = () => Promise<{
293
+ type WidgetCountryResolverFn = (hints: {
294
+ timezone: string;
295
+ language: string;
296
+ languages: string[];
297
+ locale: string;
298
+ }) => Promise<{
287
299
  country: string | null;
288
300
  region: string | null;
289
301
  confidence: number;
@@ -342,8 +354,11 @@ interface ComplianceWidgetConfig {
342
354
  * document from (the browser's own HTTP cache honors whatever `Cache-Control`/`ETag` the
343
355
  * response sends — no custom caching here), or an inline operator-supplied `ComplianceMapData`
344
356
  * object. Invalid data from either a URL or an object logs a warning and falls back to
345
- * `'default'`. Only overrides the country→group mapping — country/region detection itself
346
- * always uses the embedded geo data. */
357
+ * `'default'`. Only overrides the country→group mapping — country/region detection itself always
358
+ * uses the embedded geo data. A country the map doesn't list falls back to the embedded mapping
359
+ * unless the document sets `override: true` (then it gets the strictest group, `'opt-in'`).
360
+ * Unlike the server, an omitted `override` is NOT `true` here: widget maps have always merged
361
+ * over the embedded mapping, and that stays the default. */
347
362
  complianceMap?: 'default' | string | ComplianceMapData;
348
363
  tcf?: TcfWidgetConfig;
349
364
  gpp?: GppWidgetConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consenti/ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "GDPR-style cookie consent widget — zero required runtime dependencies",
5
5
  "license": "Apache-2.0",
6
6
  "author": {