@soyio/soyio-widget 2.26.0 → 3.1.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 +24 -5
- package/dist/index.d.ts +23 -2
- package/dist/index.js +807 -797
- package/dist/index.umd.cjs +35 -35
- package/package.json +1 -1
- package/src/schemas/appearance.schema.json +16 -2
- package/src/schemas/config.schema.json +26 -2
package/README.md
CHANGED
|
@@ -193,6 +193,9 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
193
193
|
{ id: "op_rectification", label: "Rectification" },
|
|
194
194
|
],
|
|
195
195
|
|
|
196
|
+
// Override the "exercise your rights" link shown in consent-only mode (optional)
|
|
197
|
+
externalRightsExerciseUrl: "https://privacy.example.com/rights",
|
|
198
|
+
|
|
196
199
|
// Header and copy customization (optional)
|
|
197
200
|
content: {
|
|
198
201
|
header: {
|
|
@@ -268,6 +271,7 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
268
271
|
- `allowedExtensions`: Array of allowed file extensions (e.g. `['pdf', 'jpg']`). Default: `['pdf', 'png', 'jpeg', 'jpg']`.
|
|
269
272
|
- `maxFileSize`: Maximum file size in bytes. Default: `5 * 1024 * 1024` (5MB).
|
|
270
273
|
- `redecOperationIds`: Optional array of `{ id, label }` values for the Redec operation select. Required if `redec` right is included in `enabledRights` param.
|
|
274
|
+
- `externalRightsExerciseUrl`: Optional URL used by required consent alerts when users need to exercise their rights outside the embedded privacy center.
|
|
271
275
|
- `appearance.config.showHeader`: Optional boolean to show/hide the privacy center header (title and description).
|
|
272
276
|
- `content.header`: Optional object with `title` and `description` overrides for the privacy center header copy.
|
|
273
277
|
- `appearance.config.showConsentManagementHeader`: Optional boolean to show/hide the title and description in the consent management page.
|
|
@@ -290,7 +294,7 @@ The `PrivacyCenterBox` lets you embed the Privacy Center inside your page. You c
|
|
|
290
294
|
Note:
|
|
291
295
|
- When `sessionToken` is provided, do not pass `companyId`.
|
|
292
296
|
- `consentManagement.scopeGroups` is applied during initial iframe URL render and also synchronized through `SET_PRIVACY_CENTER_CONFIG` updates.
|
|
293
|
-
- `content.header`, `content.consentManagement.header`,
|
|
297
|
+
- `content.header`, `content.consentManagement.header`, `appearance.config.showConsentManagementHeader`, and `externalRightsExerciseUrl` are applied through `SET_PRIVACY_CENTER_CONFIG`; those overrides may briefly appear after the iframe is ready.
|
|
294
298
|
|
|
295
299
|
### Privacy Center Events
|
|
296
300
|
|
|
@@ -595,19 +599,31 @@ Built-in themes provide pre-configured color palettes and component styles:
|
|
|
595
599
|
| Theme | Description |
|
|
596
600
|
| ----- | ----------- |
|
|
597
601
|
| `"soyio"` | Default light theme with Soyio brand colors (purple/indigo), uppercase titles |
|
|
598
|
-
| `"night"` | Dark mode theme with deep blues, muted colors, and subtle borders |
|
|
599
602
|
| `"flat"` | Minimal theme with square corners, normal-case titles, thicker borders |
|
|
603
|
+
| `"neutral"` | Neutral palette that works well for both light and dark modes |
|
|
604
|
+
| `"night"` | Deprecated alias for `theme: "soyio"` with `mode: "dark"` |
|
|
600
605
|
|
|
601
606
|
**Theme style differences:**
|
|
602
607
|
|
|
603
608
|
- **soyio**: Standard styling with rounded corners and uppercase card titles
|
|
604
|
-
- **night**: Dark backgrounds, lighter text, borders using theme variables
|
|
605
609
|
- **flat**: No border radius, sentence-case titles (no uppercase), 2px borders, lighter font weights
|
|
610
|
+
- **neutral**: Balanced grayscale palette intended for a more subdued branded experience
|
|
611
|
+
|
|
612
|
+
### Color Modes
|
|
613
|
+
|
|
614
|
+
Appearance now supports a `mode` field:
|
|
615
|
+
|
|
616
|
+
| Mode | Description |
|
|
617
|
+
| ---- | ----------- |
|
|
618
|
+
| `"light"` | Forces light mode |
|
|
619
|
+
| `"dark"` | Forces dark mode |
|
|
620
|
+
| `"auto"` | Follows the user's system color scheme |
|
|
606
621
|
|
|
607
622
|
**Example:**
|
|
608
623
|
```javascript
|
|
609
624
|
const appearance = {
|
|
610
|
-
theme: "
|
|
625
|
+
theme: "soyio",
|
|
626
|
+
mode: "dark",
|
|
611
627
|
variables: {
|
|
612
628
|
// You can still override specific variables
|
|
613
629
|
colorPrimary: "#FF6B6B",
|
|
@@ -621,6 +637,8 @@ const appearance = {
|
|
|
621
637
|
|
|
622
638
|
Theme variables and rules are applied first, then your custom overrides take precedence.
|
|
623
639
|
|
|
640
|
+
> `theme: "night"` is still accepted as a deprecated alias for backwards compatibility, but new integrations should use `theme + mode`.
|
|
641
|
+
|
|
624
642
|
### Config
|
|
625
643
|
|
|
626
644
|
The `config` object allows you to adjust component behavior settings.
|
|
@@ -1055,7 +1073,8 @@ const ajv = new Ajv();
|
|
|
1055
1073
|
const validate = ajv.compile(appearanceSchema);
|
|
1056
1074
|
|
|
1057
1075
|
const appearance = {
|
|
1058
|
-
theme: "
|
|
1076
|
+
theme: "soyio",
|
|
1077
|
+
mode: "dark",
|
|
1059
1078
|
variables: {
|
|
1060
1079
|
colorPrimary: "#007bff",
|
|
1061
1080
|
borderRadius: "8px"
|
package/dist/index.d.ts
CHANGED
|
@@ -329,6 +329,8 @@ export declare class PrivacyCenterBox extends BaseIframeBox<Record<string, unkno
|
|
|
329
329
|
declare type PrivacyCenterConfig = BaseConfig & {
|
|
330
330
|
enabledFeatures?: PrivacyManagerFeature[];
|
|
331
331
|
enabledRights?: PrivacyCenterRight[];
|
|
332
|
+
/** @format uri @minLength 1 */
|
|
333
|
+
externalRightsExerciseUrl?: string;
|
|
332
334
|
dataSubjects?: DataSubject[];
|
|
333
335
|
requestReference?: string;
|
|
334
336
|
demo?: boolean;
|
|
@@ -412,10 +414,11 @@ declare type SignatureRequestConfig = {
|
|
|
412
414
|
developmentUrl?: string;
|
|
413
415
|
};
|
|
414
416
|
|
|
415
|
-
declare type SkeletonConstructor = new (id: string,
|
|
417
|
+
declare type SkeletonConstructor = new (id: string, appearance?: SoyioAppearance) => ISkeletonView;
|
|
416
418
|
|
|
417
419
|
declare interface SoyioAppearance {
|
|
418
420
|
theme?: SoyioTheme;
|
|
421
|
+
mode?: SoyioColorMode;
|
|
419
422
|
variables?: SoyioAppearanceVariables;
|
|
420
423
|
rules?: SoyioRule;
|
|
421
424
|
config?: SoyioAppearanceConfig;
|
|
@@ -518,6 +521,15 @@ declare interface SoyioAppearanceVariables {
|
|
|
518
521
|
|
|
519
522
|
declare type SoyioBaseRule = '.MainContainer' | '.Button' | '.Checkbox' | '.CheckboxInput' | '.CheckboxLabel' | '.CheckboxCheck' | '.Input' | '.Label' | '.HintIcon' | '.Title' | '.CategoryTag' | '.StepTitle' | '.Link' | '.Card' | '.CardTitle' | '.Select' | '.Loader' | '.TextArea' | '.ErrorMessage' | '.Description' | '.Switch' | '.SwitchRoot' | '.SwitchThumb' | '.SwitchIcon' | '.Alert' | '.AlertIcon' | '.AlertContent' | '.Radio' | '.RadioButton' | '.RadioIndicator' | '.RadioLabel' | '.Chip' | '.Dialog' | '.DialogOverlay' | '.DialogContent' | '.DialogTitle' | '.DialogDescription' | '.Combobox' | '.NinInput' | '.TrackingCodeInput' | '.TrackingCodeInputCell' | '.TrackingCodeInputSeparator' | '.RadioCard' | '.RadioCardButton' | '.RadioCardIndicator' | '.RadioCardTitle' | '.StepIndicatorContainer' | '.StepIndicator' | '.StepIndicatorLine' | '.StepIndicatorIcon' | '.StepIndicatorDot' | '.StepIndicatorNumber' | '.TooltipContent';
|
|
520
523
|
|
|
524
|
+
/**
|
|
525
|
+
* Appearance color mode.
|
|
526
|
+
*
|
|
527
|
+
* - `light`: force light mode
|
|
528
|
+
* - `dark`: force dark mode
|
|
529
|
+
* - `auto`: follow the consumer's system color scheme
|
|
530
|
+
*/
|
|
531
|
+
declare type SoyioColorMode = 'light' | 'dark' | 'auto';
|
|
532
|
+
|
|
521
533
|
declare type SoyioElementState = '--checked';
|
|
522
534
|
|
|
523
535
|
declare interface SoyioIconConfig {
|
|
@@ -556,7 +568,12 @@ declare type SoyioRuleKey = `${SoyioBaseRule}${SoyioElementState | SoyioPseudoCl
|
|
|
556
568
|
|
|
557
569
|
declare type SoyioStateRule = '.Input--error' | '.Alert--error' | '.Alert--warning' | '.Alert--info' | '.Alert--note' | '.Alert--success' | '.Chip--info' | '.Chip--green' | '.Chip--red' | '.Chip--amber' | '.RadioCard--checked' | '.RadioCardIndicator--checked' | '.StepIndicator--active' | '.StepIndicator--completed' | '.StepIndicator--pending' | '.StepIndicatorLine--top' | '.StepIndicatorLine--bottom';
|
|
558
570
|
|
|
559
|
-
|
|
571
|
+
/**
|
|
572
|
+
* Appearance theme palette.
|
|
573
|
+
*
|
|
574
|
+
* `night` is kept as a deprecated alias for `theme: 'soyio'` + `mode: 'dark'`.
|
|
575
|
+
*/
|
|
576
|
+
declare type SoyioTheme = 'soyio' | 'flat' | 'neutral' | 'night';
|
|
560
577
|
|
|
561
578
|
declare namespace SoyioTypes {
|
|
562
579
|
export {
|
|
@@ -564,6 +581,10 @@ declare namespace SoyioTypes {
|
|
|
564
581
|
ConsentConfig,
|
|
565
582
|
PrivacyCenterConfig,
|
|
566
583
|
SoyioAppearance,
|
|
584
|
+
SoyioAppearanceConfig,
|
|
585
|
+
SoyioAppearanceVariables,
|
|
586
|
+
SoyioColorMode,
|
|
587
|
+
SoyioTheme,
|
|
567
588
|
Request_2 as Request,
|
|
568
589
|
NewDisclosureRequestProps,
|
|
569
590
|
ExistingDisclosureRequestProps,
|