@soyio/soyio-widget 2.23.0 → 2.25.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/README.md CHANGED
@@ -191,6 +191,43 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
191
191
  { id: "op_rectification", label: "Rectification" },
192
192
  ],
193
193
 
194
+ // Header and copy customization (optional)
195
+ content: {
196
+ header: {
197
+ title: "Privacy preferences",
198
+ description: "Manage your requests and consent settings.",
199
+ },
200
+ consentManagement: {
201
+ header: {
202
+ title: "Manage your consent settings",
203
+ description: "Select which permissions should remain active.",
204
+ },
205
+ },
206
+ rightExamples: {
207
+ access: 'Example: "I want to know what data you store about me."',
208
+ },
209
+ },
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
+
194
231
  // Common options
195
232
  consentControl: "checkbox", // Optional: 'switch' (default) | 'checkbox'
196
233
  consentMode: "batch", // Optional: 'immediate' (default) | 'batch'
@@ -201,7 +238,12 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
201
238
  onEvent: (event) => console.log(event),
202
239
  onReady: () => console.log("PrivacyCenterBox is ready"), // Optional
203
240
  isSandbox: true, // Optional
204
- appearance: {}, // Optional
241
+ appearance: {
242
+ config: {
243
+ showHeader: true,
244
+ showConsentManagementHeader: true,
245
+ },
246
+ }, // Optional
205
247
  };
206
248
 
207
249
  // Wait for DOM to be fully loaded
@@ -224,12 +266,20 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
224
266
  - `allowedExtensions`: Array of allowed file extensions (e.g. `['pdf', 'jpg']`). Default: `['pdf', 'png', 'jpeg', 'jpg']`.
225
267
  - `maxFileSize`: Maximum file size in bytes. Default: `5 * 1024 * 1024` (5MB).
226
268
  - `redecOperationIds`: Optional array of `{ id, label }` values for the Redec operation select. Required if `redec` right is included in `enabledRights` param.
269
+ - `appearance.config.showHeader`: Optional boolean to show/hide the privacy center header (title and description).
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.
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`.
274
+ - `header`: Optional legacy alias for `content.header`.
275
+ - `rightExamples`: Optional legacy alias for `content.rightExamples`.
227
276
  - `isSandbox`: Whether to use the sandbox environment. Defaults to `false`.
228
277
  - `consentControl`: Optional, controls the visual interaction for consent toggles. Values: `'switch'` (default) or `'checkbox'`.
229
278
  - `consentMode`: Optional, controls how consent changes are committed. Values: `'immediate'` (default) or `'batch'` (save multiple changes at once).
230
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'`.
231
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.
232
- - `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.
233
283
  - `showBatchConsentConfirmation`: Optional boolean, whether to show a confirmation dialog before saving consent changes in batch mode.
234
284
  - `appearance`: Customize the iframe appearance. See Appearance section below.
235
285
  - `onEvent`: Callback that receives events from the iframe.
@@ -237,6 +287,8 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
237
287
 
238
288
  Note:
239
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.
240
292
 
241
293
  ### Privacy Center Events
242
294
 
package/dist/index.d.ts CHANGED
@@ -186,6 +186,8 @@ declare type CSSProperties = {
186
186
 
187
187
  declare type DataSubject = 'anonymous_user' | 'citizen_voter' | 'commuter' | 'consultant' | 'customer' | 'employee' | 'job_applicant' | 'next_of_kin' | 'passenger' | 'patient' | 'prospect' | 'shareholder' | 'supplier_vendor' | 'trainee' | 'visitor';
188
188
 
189
+ declare type DataSubjectRequestKind = 'access' | 'opposition' | 'rectification' | 'suppression' | 'portability' | 'redec_update' | 'redec_rectification' | 'redec_complementation' | 'redec_cancellation';
190
+
189
191
  export declare class DisclosureRequestBox extends BaseIframeBox<DisclosureRequestBoxEvent, DisclosureRequestBoxConfig> {
190
192
  readonly defaultIframePrefix = "disclosure-request-box";
191
193
  private passkeyPopupWindow;
@@ -336,7 +338,11 @@ declare type PrivacyCenterConfig = BaseConfig & {
336
338
  allowGranularScopeSelection?: boolean;
337
339
  groupConsentsByScope?: boolean;
338
340
  showBatchConsentConfirmation?: boolean;
341
+ consentManagement?: PrivacyCenterConsentManagementConfig;
339
342
  redecOperationIds?: RedecOperationId[];
343
+ content?: PrivacyCenterContentConfig;
344
+ header?: PrivacyCenterHeaderCopyConfig;
345
+ rightExamples?: PrivacyCenterContentConfig['rightExamples'];
340
346
  } & ({
341
347
  companyId: `com_${string}`;
342
348
  sessionToken?: never;
@@ -345,8 +351,40 @@ declare type PrivacyCenterConfig = BaseConfig & {
345
351
  companyId?: never;
346
352
  });
347
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
+
370
+ declare type PrivacyCenterContentConfig = {
371
+ header?: PrivacyCenterHeaderCopyConfig;
372
+ consentManagement?: PrivacyCenterConsentManagementCopyConfig;
373
+ rightExamples?: Partial<Record<DataSubjectRequestKind, string>>;
374
+ };
375
+
376
+ declare type PrivacyCenterHeaderCopyConfig = {
377
+ title?: string;
378
+ description?: string;
379
+ };
380
+
348
381
  declare type PrivacyCenterRight = 'arsop' | 'redec';
349
382
 
383
+ declare type PrivacyCenterScopeReference = {
384
+ scopeType: 'product' | 'branch';
385
+ scopeId: string;
386
+ };
387
+
350
388
  declare type PrivacyManagerFeature = 'DataSubjectRequest' | 'ConsentManagement' | 'RequestTracking';
351
389
 
352
390
  declare type RedecOperationId = {
@@ -389,6 +427,8 @@ declare interface SoyioAppearanceConfig {
389
427
  * @default 'switch'
390
428
  */
391
429
  consentControl?: 'switch' | 'checkbox';
430
+ showHeader?: boolean;
431
+ showConsentManagementHeader?: boolean;
392
432
  /**
393
433
  * Icon name to use for hint/help tooltips on input labels.
394
434
  * Available icons: 'Question' (default), 'Info', 'QuestionMark', etc.