@soyio/soyio-widget 2.24.0 → 2.25.1

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 CHANGED
@@ -197,11 +197,37 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
197
197
  title: "Privacy preferences",
198
198
  description: "Manage your requests and consent settings.",
199
199
  },
200
+ consentManagement: {
201
+ header: {
202
+ title: "Manage your consent settings",
203
+ description: "Select which permissions should remain active.",
204
+ },
205
+ },
200
206
  rightExamples: {
201
207
  access: 'Example: "I want to know what data you store about me."',
202
208
  },
203
209
  },
204
210
 
211
+ // Consent management grouping customization (optional)
212
+ consentManagement: {
213
+ scopeGroups: [
214
+ {
215
+ title: "Financial products",
216
+ scopes: [
217
+ { scopeType: "product", scopeId: "prod_checking_account" },
218
+ { scopeType: "product", scopeId: "prod_credit_card" },
219
+ ],
220
+ },
221
+ {
222
+ title: "Main branches",
223
+ scopes: [
224
+ { scopeType: "branch", scopeId: "branch_centro" },
225
+ { scopeType: "branch", scopeId: "branch_providencia" },
226
+ ],
227
+ },
228
+ ],
229
+ },
230
+
205
231
  // Common options
206
232
  consentControl: "checkbox", // Optional: 'switch' (default) | 'checkbox'
207
233
  consentMode: "batch", // Optional: 'immediate' (default) | 'batch'
@@ -215,6 +241,7 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
215
241
  appearance: {
216
242
  config: {
217
243
  showHeader: true,
244
+ showConsentManagementHeader: true,
218
245
  },
219
246
  }, // Optional
220
247
  };
@@ -241,6 +268,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
241
268
  - `redecOperationIds`: Optional array of `{ id, label }` values for the Redec operation select. Required if `redec` right is included in `enabledRights` param.
242
269
  - `appearance.config.showHeader`: Optional boolean to show/hide the privacy center header (title and description).
243
270
  - `content.header`: Optional object with `title` and `description` overrides for the privacy center header copy.
271
+ - `appearance.config.showConsentManagementHeader`: Optional boolean to show/hide the title and description in the consent management page.
272
+ - `content.consentManagement.header`: Optional object with `title` and `description` overrides for the consent management header copy.
244
273
  - `content.rightExamples`: Optional object to override DSR right examples. Supported keys: `access`, `opposition`, `rectification`, `suppression`, `portability`, `redec_update`, `redec_rectification`, `redec_complementation`, `redec_cancellation`.
245
274
  - `header`: Optional legacy alias for `content.header`.
246
275
  - `rightExamples`: Optional legacy alias for `content.rightExamples`.
@@ -249,7 +278,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
249
278
  - `consentMode`: Optional, controls how consent changes are committed. Values: `'immediate'` (default) or `'batch'` (save multiple changes at once).
250
279
  - `consentRetentionPeriod`: Optional, specifies a duration during which a consent cannot be revoked after being granted. Format: `"<value> <unit>"`. Supported units: `day`, `week`, `month`, `year` (and their plural forms). Example: `'30 days'`, `'1 week'`.
251
280
  - `allowGranularScopeSelection`: Optional boolean, enables selecting/deselecting individual consent scopes in consent management when templates define multiple scopes. When enabled and a consent has more than one scope, the main consent checkbox supports partial state.
252
- - `groupConsentsByScope`: Optional boolean, groups consent templates by scope in consent management.
281
+ - `groupConsentsByScope`: Optional boolean, groups consent templates by scope in consent management. This must be enabled for `consentManagement.scopeGroups` to apply.
282
+ - `consentManagement.scopeGroups`: Optional array to customize accordion groups in consent management. Each group requires a `title` and a `scopes` array with `{ scopeType: 'product' | 'branch', scopeId: string }` entries. Scopes not included in custom groups keep the default scope grouping.
253
283
  - `showBatchConsentConfirmation`: Optional boolean, whether to show a confirmation dialog before saving consent changes in batch mode.
254
284
  - `appearance`: Customize the iframe appearance. See Appearance section below.
255
285
  - `onEvent`: Callback that receives events from the iframe.
@@ -257,6 +287,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
257
287
 
258
288
  Note:
259
289
  - When `sessionToken` is provided, do not pass `companyId`.
290
+ - `consentManagement.scopeGroups` is applied during initial iframe URL render and also synchronized through `SET_PRIVACY_CENTER_CONFIG` updates.
291
+ - `content.header`, `content.consentManagement.header`, and `appearance.config.showConsentManagementHeader` are applied through `SET_PRIVACY_CENTER_CONFIG`; the header may briefly appear before the update is received.
260
292
 
261
293
  ### Privacy Center Events
262
294
 
package/dist/index.d.ts CHANGED
@@ -338,6 +338,7 @@ declare type PrivacyCenterConfig = BaseConfig & {
338
338
  allowGranularScopeSelection?: boolean;
339
339
  groupConsentsByScope?: boolean;
340
340
  showBatchConsentConfirmation?: boolean;
341
+ consentManagement?: PrivacyCenterConsentManagementConfig;
341
342
  redecOperationIds?: RedecOperationId[];
342
343
  content?: PrivacyCenterContentConfig;
343
344
  header?: PrivacyCenterHeaderCopyConfig;
@@ -350,8 +351,25 @@ declare type PrivacyCenterConfig = BaseConfig & {
350
351
  companyId?: never;
351
352
  });
352
353
 
354
+ declare type PrivacyCenterConsentManagementConfig = {
355
+ scopeGroups?: [
356
+ PrivacyCenterConsentManagementScopeGroupConfig,
357
+ ...PrivacyCenterConsentManagementScopeGroupConfig[]
358
+ ];
359
+ };
360
+
361
+ declare type PrivacyCenterConsentManagementCopyConfig = {
362
+ header?: PrivacyCenterHeaderCopyConfig;
363
+ };
364
+
365
+ declare type PrivacyCenterConsentManagementScopeGroupConfig = {
366
+ title: string;
367
+ scopes: [PrivacyCenterScopeReference, ...PrivacyCenterScopeReference[]];
368
+ };
369
+
353
370
  declare type PrivacyCenterContentConfig = {
354
371
  header?: PrivacyCenterHeaderCopyConfig;
372
+ consentManagement?: PrivacyCenterConsentManagementCopyConfig;
355
373
  rightExamples?: Partial<Record<DataSubjectRequestKind, string>>;
356
374
  };
357
375
 
@@ -362,6 +380,11 @@ declare type PrivacyCenterHeaderCopyConfig = {
362
380
 
363
381
  declare type PrivacyCenterRight = 'arsop' | 'redec';
364
382
 
383
+ declare type PrivacyCenterScopeReference = {
384
+ scopeType: 'product' | 'branch';
385
+ scopeId: string;
386
+ };
387
+
365
388
  declare type PrivacyManagerFeature = 'DataSubjectRequest' | 'ConsentManagement' | 'RequestTracking';
366
389
 
367
390
  declare type RedecOperationId = {
@@ -405,6 +428,7 @@ declare interface SoyioAppearanceConfig {
405
428
  */
406
429
  consentControl?: 'switch' | 'checkbox';
407
430
  showHeader?: boolean;
431
+ showConsentManagementHeader?: boolean;
408
432
  /**
409
433
  * Icon name to use for hint/help tooltips on input labels.
410
434
  * Available icons: 'Question' (default), 'Info', 'QuestionMark', etc.