@soyio/soyio-widget 2.22.1 → 2.24.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 +31 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +808 -798
- package/dist/index.umd.cjs +26 -26
- package/package.json +1 -1
- package/src/schemas/appearance.schema.json +3 -0
- package/src/schemas/config.schema.json +150 -0
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ The **`ConsentBox`** is a component that allows you to embed a consent request d
|
|
|
85
85
|
onReady: () => console.log("ConsentBox is ready"), // Optional
|
|
86
86
|
optionalReconsentBehavior: "notice", // Optional
|
|
87
87
|
mandatoryReconsentBehavior: "notice", // Optional
|
|
88
|
+
allowGranularScopeSelection: true, // Optional
|
|
88
89
|
};
|
|
89
90
|
|
|
90
91
|
// Wait for DOM to be fully loaded
|
|
@@ -140,6 +141,7 @@ The `onEvent` follows the following format:
|
|
|
140
141
|
- `askAgain` will show the consent as if it wasn't given in the first place,
|
|
141
142
|
|
|
142
143
|
We don't support hiding the mandatory consent, and we strongly recommend using `notice` so the user doesn't have to give the consent again and knows what they have already given consent to.
|
|
144
|
+
- **`allowGranularScopeSelection`**: Enables selecting consent at a more granular scope when the template supports granular scopes.
|
|
143
145
|
|
|
144
146
|
## Privacy Center
|
|
145
147
|
|
|
@@ -189,11 +191,32 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
189
191
|
{ id: "op_rectification", label: "Rectification" },
|
|
190
192
|
],
|
|
191
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
|
+
rightExamples: {
|
|
201
|
+
access: 'Example: "I want to know what data you store about me."',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
|
|
192
205
|
// Common options
|
|
206
|
+
consentControl: "checkbox", // Optional: 'switch' (default) | 'checkbox'
|
|
207
|
+
consentMode: "batch", // Optional: 'immediate' (default) | 'batch'
|
|
208
|
+
showBatchConsentConfirmation: true, // Optional: only used in batch mode
|
|
209
|
+
consentRetentionPeriod: "30 days", // Optional: prevents immediate revoke for this period
|
|
210
|
+
allowGranularScopeSelection: true, // Optional: only applies when templates have multiple scopes
|
|
211
|
+
groupConsentsByScope: true, // Optional: groups consent templates by scope in consent management
|
|
193
212
|
onEvent: (event) => console.log(event),
|
|
194
213
|
onReady: () => console.log("PrivacyCenterBox is ready"), // Optional
|
|
195
214
|
isSandbox: true, // Optional
|
|
196
|
-
appearance: {
|
|
215
|
+
appearance: {
|
|
216
|
+
config: {
|
|
217
|
+
showHeader: true,
|
|
218
|
+
},
|
|
219
|
+
}, // Optional
|
|
197
220
|
};
|
|
198
221
|
|
|
199
222
|
// Wait for DOM to be fully loaded
|
|
@@ -216,10 +239,17 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
216
239
|
- `allowedExtensions`: Array of allowed file extensions (e.g. `['pdf', 'jpg']`). Default: `['pdf', 'png', 'jpeg', 'jpg']`.
|
|
217
240
|
- `maxFileSize`: Maximum file size in bytes. Default: `5 * 1024 * 1024` (5MB).
|
|
218
241
|
- `redecOperationIds`: Optional array of `{ id, label }` values for the Redec operation select. Required if `redec` right is included in `enabledRights` param.
|
|
242
|
+
- `appearance.config.showHeader`: Optional boolean to show/hide the privacy center header (title and description).
|
|
243
|
+
- `content.header`: Optional object with `title` and `description` overrides for the privacy center header copy.
|
|
244
|
+
- `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
|
+
- `header`: Optional legacy alias for `content.header`.
|
|
246
|
+
- `rightExamples`: Optional legacy alias for `content.rightExamples`.
|
|
219
247
|
- `isSandbox`: Whether to use the sandbox environment. Defaults to `false`.
|
|
220
248
|
- `consentControl`: Optional, controls the visual interaction for consent toggles. Values: `'switch'` (default) or `'checkbox'`.
|
|
221
249
|
- `consentMode`: Optional, controls how consent changes are committed. Values: `'immediate'` (default) or `'batch'` (save multiple changes at once).
|
|
222
250
|
- `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
|
+
- `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.
|
|
223
253
|
- `showBatchConsentConfirmation`: Optional boolean, whether to show a confirmation dialog before saving consent changes in batch mode.
|
|
224
254
|
- `appearance`: Customize the iframe appearance. See Appearance section below.
|
|
225
255
|
- `onEvent`: Callback that receives events from the iframe.
|
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ declare type ConsentConfig = BaseConfig & {
|
|
|
84
84
|
context?: string;
|
|
85
85
|
optionalReconsentBehavior?: 'notice' | 'askAgain' | 'hide';
|
|
86
86
|
mandatoryReconsentBehavior?: 'notice' | 'askAgain';
|
|
87
|
+
allowGranularScopeSelection?: boolean;
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
declare type ConsentEvent = ConsentCheckboxChangeEvent;
|
|
@@ -185,6 +186,8 @@ declare type CSSProperties = {
|
|
|
185
186
|
|
|
186
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';
|
|
187
188
|
|
|
189
|
+
declare type DataSubjectRequestKind = 'access' | 'opposition' | 'rectification' | 'suppression' | 'portability' | 'redec_update' | 'redec_rectification' | 'redec_complementation' | 'redec_cancellation';
|
|
190
|
+
|
|
188
191
|
export declare class DisclosureRequestBox extends BaseIframeBox<DisclosureRequestBoxEvent, DisclosureRequestBoxConfig> {
|
|
189
192
|
readonly defaultIframePrefix = "disclosure-request-box";
|
|
190
193
|
private passkeyPopupWindow;
|
|
@@ -332,8 +335,13 @@ declare type PrivacyCenterConfig = BaseConfig & {
|
|
|
332
335
|
};
|
|
333
336
|
consentMode?: 'immediate' | 'batch';
|
|
334
337
|
consentRetentionPeriod?: string;
|
|
338
|
+
allowGranularScopeSelection?: boolean;
|
|
339
|
+
groupConsentsByScope?: boolean;
|
|
335
340
|
showBatchConsentConfirmation?: boolean;
|
|
336
341
|
redecOperationIds?: RedecOperationId[];
|
|
342
|
+
content?: PrivacyCenterContentConfig;
|
|
343
|
+
header?: PrivacyCenterHeaderCopyConfig;
|
|
344
|
+
rightExamples?: PrivacyCenterContentConfig['rightExamples'];
|
|
337
345
|
} & ({
|
|
338
346
|
companyId: `com_${string}`;
|
|
339
347
|
sessionToken?: never;
|
|
@@ -342,6 +350,16 @@ declare type PrivacyCenterConfig = BaseConfig & {
|
|
|
342
350
|
companyId?: never;
|
|
343
351
|
});
|
|
344
352
|
|
|
353
|
+
declare type PrivacyCenterContentConfig = {
|
|
354
|
+
header?: PrivacyCenterHeaderCopyConfig;
|
|
355
|
+
rightExamples?: Partial<Record<DataSubjectRequestKind, string>>;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
declare type PrivacyCenterHeaderCopyConfig = {
|
|
359
|
+
title?: string;
|
|
360
|
+
description?: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
345
363
|
declare type PrivacyCenterRight = 'arsop' | 'redec';
|
|
346
364
|
|
|
347
365
|
declare type PrivacyManagerFeature = 'DataSubjectRequest' | 'ConsentManagement' | 'RequestTracking';
|
|
@@ -386,6 +404,7 @@ declare interface SoyioAppearanceConfig {
|
|
|
386
404
|
* @default 'switch'
|
|
387
405
|
*/
|
|
388
406
|
consentControl?: 'switch' | 'checkbox';
|
|
407
|
+
showHeader?: boolean;
|
|
389
408
|
/**
|
|
390
409
|
* Icon name to use for hint/help tooltips on input labels.
|
|
391
410
|
* Available icons: 'Question' (default), 'Info', 'QuestionMark', etc.
|