@redacto.io/consent-sdk-js 2.0.1 → 2.1.0-beta.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/dist/montserrat.generated-75WXFSY6.mjs +22 -0
- package/dist/poweredByRedacto-VYZHZOZ5.mjs +5 -0
- package/dist/privacy-center/images/poweredByRedacto.svg +9 -0
- package/dist/privacy-center/images/sentImg.svg +9 -0
- package/dist/privacy-center/locales/as.js +1 -0
- package/dist/privacy-center/locales/bn.js +1 -0
- package/dist/privacy-center/locales/brx.js +1 -0
- package/dist/privacy-center/locales/doi.js +1 -0
- package/dist/privacy-center/locales/gom.js +1 -0
- package/dist/privacy-center/locales/gu.js +1 -0
- package/dist/privacy-center/locales/hi.js +1 -0
- package/dist/privacy-center/locales/kn.js +1 -0
- package/dist/privacy-center/locales/ks.js +1 -0
- package/dist/privacy-center/locales/mai.js +1 -0
- package/dist/privacy-center/locales/ml.js +1 -0
- package/dist/privacy-center/locales/mni-Mtei.js +1 -0
- package/dist/privacy-center/locales/mr.js +1 -0
- package/dist/privacy-center/locales/ne.js +1 -0
- package/dist/privacy-center/locales/or.js +1 -0
- package/dist/privacy-center/locales/pa.js +1 -0
- package/dist/privacy-center/locales/sa.js +1 -0
- package/dist/privacy-center/locales/sat.js +1 -0
- package/dist/privacy-center/locales/sd.js +1 -0
- package/dist/privacy-center/locales/ta.js +1 -0
- package/dist/privacy-center/locales/te.js +1 -0
- package/dist/privacy-center/locales/ur.js +1 -0
- package/dist/redacto-privacy-center.d.mts +230 -0
- package/dist/redacto-privacy-center.d.ts +230 -0
- package/dist/redacto-privacy-center.global.js +3852 -0
- package/dist/redacto-privacy-center.global.js.map +1 -0
- package/dist/redacto-privacy-center.js +39562 -0
- package/dist/redacto-privacy-center.mjs +31831 -0
- package/dist/redacto.global.js +107 -107
- package/dist/redacto.global.js.map +1 -1
- package/dist/redacto.js +337 -92
- package/dist/redacto.mjs +337 -92
- package/dist/sentImg-RN2XSS4V.mjs +5 -0
- package/dist/translation-3IAUHBQO.mjs +1020 -0
- package/dist/translation-3TCIC57D.mjs +1020 -0
- package/dist/translation-4VNBLMFS.mjs +1020 -0
- package/dist/translation-54VF5MY3.mjs +1020 -0
- package/dist/translation-5O732WWG.mjs +1020 -0
- package/dist/translation-62B5PCBT.mjs +1020 -0
- package/dist/translation-7MGWGIAV.mjs +1020 -0
- package/dist/translation-BEC2RYFD.mjs +1020 -0
- package/dist/translation-BQABMEQU.mjs +1020 -0
- package/dist/translation-BX3FJA6E.mjs +1020 -0
- package/dist/translation-C4EA7NR6.mjs +1020 -0
- package/dist/translation-DBJE52UX.mjs +1020 -0
- package/dist/translation-DRTKVWFD.mjs +1020 -0
- package/dist/translation-FNXKSX4V.mjs +1020 -0
- package/dist/translation-GTONCNVZ.mjs +1029 -0
- package/dist/translation-HUUSKQB5.mjs +1020 -0
- package/dist/translation-ITVO7LSO.mjs +1020 -0
- package/dist/translation-MBGE7KYU.mjs +1020 -0
- package/dist/translation-NAWDRQYM.mjs +1020 -0
- package/dist/translation-TP6K4SC4.mjs +1020 -0
- package/dist/translation-W6HTCTKZ.mjs +1020 -0
- package/dist/translation-WFBFKNV5.mjs +1020 -0
- package/package.json +6 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surface and layout family a notice is drawn with, chosen in the Redacto
|
|
3
|
+
* console and served on `active_config.appearance.style`. Colours never come
|
|
4
|
+
* from the style: they come from the admin's palette, else the notice's brand.
|
|
5
|
+
*/
|
|
6
|
+
type AppearanceStyle = "classic" | "glass" | "minimal" | "soft";
|
|
7
|
+
/** The subset the Privacy Center's `settings.theme` accepts. */
|
|
8
|
+
type PrivacyCenterTheme = Extract<AppearanceStyle, "classic" | "glass">;
|
|
9
|
+
|
|
10
|
+
/** Menu sections, keyed by the `InternalPage` each one opens. */
|
|
11
|
+
type PrivacyCenterSectionKey = "consent-manager" | "form" | "activity" | "receipts" | "notifications";
|
|
12
|
+
/** Request types, keyed by the lower-case value a case is created with. */
|
|
13
|
+
type PrivacyCenterRequestTypeKey = "access" | "correction" | "erasure" | "nomination" | "grievance";
|
|
14
|
+
type PrivacyCenterGrievanceCategory = "consent_violation" | "unlawful_processing" | "data_breach";
|
|
15
|
+
type PrivacyCenterSignInLayout = "card" | "split" | "minimal";
|
|
16
|
+
type PrivacyCenterSignInAlign = "center" | "left";
|
|
17
|
+
type PrivacyCenterSignInBackground = "gradient" | "solid" | "image";
|
|
18
|
+
type PrivacyCenterSignInChannels = "both" | "email" | "sms";
|
|
19
|
+
type PrivacyCenterSection = Readonly<{
|
|
20
|
+
key: PrivacyCenterSectionKey;
|
|
21
|
+
/** `null` uses the built-in, translated label. */
|
|
22
|
+
label: string | null;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
type PrivacyCenterRequestType = Readonly<{
|
|
26
|
+
key: PrivacyCenterRequestTypeKey;
|
|
27
|
+
/** `null` uses the built-in, translated label. */
|
|
28
|
+
label: string | null;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
type PrivacyCenterFooterLink = Readonly<{
|
|
32
|
+
label: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}>;
|
|
35
|
+
type PrivacyCenterLogoAlign = "auto" | "left" | "center" | "right";
|
|
36
|
+
type PrivacyCenterBrandingSettings = Readonly<{
|
|
37
|
+
inherit_identity: boolean;
|
|
38
|
+
display_name: string | null;
|
|
39
|
+
logo_url: string | null;
|
|
40
|
+
/** 28–96 px; `null` keeps the built-in size. */
|
|
41
|
+
logo_height: number | null;
|
|
42
|
+
/** `"auto"` keeps the logo on the leading edge of the top bar. */
|
|
43
|
+
logo_align: PrivacyCenterLogoAlign;
|
|
44
|
+
inherit_colors: boolean;
|
|
45
|
+
primary_color: string | null;
|
|
46
|
+
accent_color: string | null;
|
|
47
|
+
inherit_font: boolean;
|
|
48
|
+
font_family: string | null;
|
|
49
|
+
style: PrivacyCenterTheme;
|
|
50
|
+
/** 0–24 px; `null` keeps the built-in radii. */
|
|
51
|
+
corner_radius: number | null;
|
|
52
|
+
}>;
|
|
53
|
+
type PrivacyCenterSignInSettings = Readonly<{
|
|
54
|
+
layout: PrivacyCenterSignInLayout;
|
|
55
|
+
align: PrivacyCenterSignInAlign;
|
|
56
|
+
background_type: PrivacyCenterSignInBackground;
|
|
57
|
+
background_from: string;
|
|
58
|
+
background_to: string;
|
|
59
|
+
background_color: string;
|
|
60
|
+
background_image_url: string | null;
|
|
61
|
+
highlights: readonly string[];
|
|
62
|
+
show_logo: boolean;
|
|
63
|
+
title: string;
|
|
64
|
+
tagline: string | null;
|
|
65
|
+
heading: string;
|
|
66
|
+
description: string | null;
|
|
67
|
+
channels: PrivacyCenterSignInChannels;
|
|
68
|
+
default_country_code: string;
|
|
69
|
+
field_label: string | null;
|
|
70
|
+
placeholder: string | null;
|
|
71
|
+
help_text: string | null;
|
|
72
|
+
button_text: string;
|
|
73
|
+
show_notice_line: boolean;
|
|
74
|
+
notice_line: string | null;
|
|
75
|
+
show_support_link: boolean;
|
|
76
|
+
support_text: string;
|
|
77
|
+
support_link_text: string;
|
|
78
|
+
otp_heading: string;
|
|
79
|
+
otp_description: string | null;
|
|
80
|
+
otp_button_text: string;
|
|
81
|
+
otp_resend_text: string;
|
|
82
|
+
}>;
|
|
83
|
+
type PrivacyCenterPortalSettings = Readonly<{
|
|
84
|
+
sections: readonly PrivacyCenterSection[];
|
|
85
|
+
welcome_enabled: boolean;
|
|
86
|
+
welcome_title: string;
|
|
87
|
+
welcome_message: string;
|
|
88
|
+
request_types: readonly PrivacyCenterRequestType[];
|
|
89
|
+
grievance_categories: readonly PrivacyCenterGrievanceCategory[];
|
|
90
|
+
/** `null` asks the data principal, as today. */
|
|
91
|
+
revoke_consents_on_erasure: boolean | null;
|
|
92
|
+
/** `null` uses the built-in warning; a purpose's own message still wins. */
|
|
93
|
+
withdraw_warning: string | null;
|
|
94
|
+
/** `null` never signs out for inactivity. */
|
|
95
|
+
session_timeout_minutes: number | null;
|
|
96
|
+
}>;
|
|
97
|
+
type PrivacyCenterLanguageSettings = Readonly<{
|
|
98
|
+
enabled: readonly string[];
|
|
99
|
+
default: string;
|
|
100
|
+
auto_detect: boolean;
|
|
101
|
+
show_switcher: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
type PrivacyCenterFooterSettings = Readonly<{
|
|
104
|
+
links: readonly PrivacyCenterFooterLink[];
|
|
105
|
+
show_privacy_policy: boolean;
|
|
106
|
+
show_contact: boolean;
|
|
107
|
+
copyright: string | null;
|
|
108
|
+
show_powered_by: boolean;
|
|
109
|
+
}>;
|
|
110
|
+
type PrivacyCenterSeoSettings = Readonly<{
|
|
111
|
+
page_title: string;
|
|
112
|
+
noindex: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Host overrides for `RedactoPrivacyCenter`'s `settings` prop. Each group is
|
|
116
|
+
* merged field by field over the published settings, so a host can change one
|
|
117
|
+
* value and keep the rest of what the console published.
|
|
118
|
+
*/
|
|
119
|
+
type PrivacyCenterSettings = Readonly<{
|
|
120
|
+
/**
|
|
121
|
+
* Visual style, kept as an alias for `branding.style`. `"classic"` (the
|
|
122
|
+
* default) is the standard look; `"glass"` is a frosted, sheet-based style.
|
|
123
|
+
* An unrecognised value falls back to classic.
|
|
124
|
+
*/
|
|
125
|
+
theme?: PrivacyCenterTheme;
|
|
126
|
+
branding?: Partial<PrivacyCenterBrandingSettings>;
|
|
127
|
+
sign_in?: Partial<PrivacyCenterSignInSettings>;
|
|
128
|
+
portal?: Partial<PrivacyCenterPortalSettings>;
|
|
129
|
+
languages?: Partial<PrivacyCenterLanguageSettings>;
|
|
130
|
+
footer?: Partial<PrivacyCenterFooterSettings>;
|
|
131
|
+
seo?: Partial<PrivacyCenterSeoSettings>;
|
|
132
|
+
custom_css?: string | null;
|
|
133
|
+
}>;
|
|
134
|
+
|
|
135
|
+
type ConsentAction = "revoke" | "regrant" | "renew";
|
|
136
|
+
/** Passed to `onReady` once the first screen is on show. */
|
|
137
|
+
type PrivacyCenterReadyEvent = Readonly<{
|
|
138
|
+
/** False when the built-in sign-in screen is what the visitor sees. */
|
|
139
|
+
signedIn: boolean;
|
|
140
|
+
}>;
|
|
141
|
+
/** Passed to `onConsentChange` after a consent was changed successfully. */
|
|
142
|
+
type PrivacyCenterConsentChange = Readonly<{
|
|
143
|
+
/** `revoke` withdraws consent; `regrant` and `renew` give it again. */
|
|
144
|
+
action: ConsentAction;
|
|
145
|
+
purposeUuid: string;
|
|
146
|
+
productUuid: string | null;
|
|
147
|
+
/** The data elements the change covered; empty when it covered the whole purpose. */
|
|
148
|
+
dataElementUuids: readonly string[];
|
|
149
|
+
/** Set when the visitor acted on behalf of someone who nominated them. */
|
|
150
|
+
nominatorUuid: string | null;
|
|
151
|
+
}>;
|
|
152
|
+
/** Passed to `onRequestSubmit` after a data request (case) was created. */
|
|
153
|
+
type PrivacyCenterRequestSubmission = Readonly<{
|
|
154
|
+
/** The human-readable case id shown to the visitor. */
|
|
155
|
+
caseId: string;
|
|
156
|
+
caseUuid: string;
|
|
157
|
+
requestType: PrivacyCenterRequestTypeKey;
|
|
158
|
+
/** The product the request is about; null for nomination and grievance. */
|
|
159
|
+
productUuid: string | null;
|
|
160
|
+
}>;
|
|
161
|
+
/**
|
|
162
|
+
* Why the visitor was signed out: they chose to (`user`), they were idle for
|
|
163
|
+
* the configured session timeout (`timeout`), or their session could no longer
|
|
164
|
+
* be refreshed (`session-expired`).
|
|
165
|
+
*/
|
|
166
|
+
type PrivacyCenterSignOutReason = "user" | "timeout" | "session-expired";
|
|
167
|
+
type PrivacyCenterSignOutEvent = Readonly<{
|
|
168
|
+
reason: PrivacyCenterSignOutReason;
|
|
169
|
+
}>;
|
|
170
|
+
|
|
171
|
+
type InternalPage = "consent-manager" | "form" | "activity" | "case-details" | "notifications" | "receipts";
|
|
172
|
+
|
|
173
|
+
type PrivacyCenterNativeOptions = Readonly<{
|
|
174
|
+
target: string | HTMLElement;
|
|
175
|
+
baseUrl: string;
|
|
176
|
+
ledgerBaseUrl?: string;
|
|
177
|
+
accessToken?: string;
|
|
178
|
+
refreshToken?: string;
|
|
179
|
+
token?: string;
|
|
180
|
+
email?: string;
|
|
181
|
+
mobile?: string;
|
|
182
|
+
ucic?: string;
|
|
183
|
+
organisationUuid?: string;
|
|
184
|
+
workspaceUuid?: string;
|
|
185
|
+
onError: (error: Error) => boolean;
|
|
186
|
+
initialPage?: InternalPage;
|
|
187
|
+
onBack?: "back" | "signout";
|
|
188
|
+
settings?: PrivacyCenterSettings;
|
|
189
|
+
builtInSignIn?: boolean;
|
|
190
|
+
onReady?: (e: PrivacyCenterReadyEvent) => void;
|
|
191
|
+
onConsentChange?: (c: PrivacyCenterConsentChange) => void;
|
|
192
|
+
onRequestSubmit?: (r: PrivacyCenterRequestSubmission) => void;
|
|
193
|
+
onSignOut?: (e: PrivacyCenterSignOutEvent) => void;
|
|
194
|
+
/**
|
|
195
|
+
* `<script>` build only: the http(s) URL of the folder holding the
|
|
196
|
+
* Privacy Center's `locales/` and `images/` (the package's
|
|
197
|
+
* `dist/privacy-center/`). Defaults to the `privacy-center/` folder next to
|
|
198
|
+
* the script, so a CDN copy of the package needs nothing. Set it when you
|
|
199
|
+
* host the script and that folder apart. A relative value resolves against
|
|
200
|
+
* the page; a query or fragment is dropped; any other scheme is ignored with
|
|
201
|
+
* a console.error. The npm (ESM/CJS) builds load these through `import()`
|
|
202
|
+
* (bundled by your bundler, same-origin) and ignore it.
|
|
203
|
+
*
|
|
204
|
+
* The folder needs no CORS headers: translations load as `<script>` tags
|
|
205
|
+
* and images as `<img>`, and the font is bundled in the script. With a
|
|
206
|
+
* Content Security Policy, allow its origin in `script-src` (translations)
|
|
207
|
+
* and `img-src` (images); the bundled font is a `data:` URL (`font-src
|
|
208
|
+
* data:`), as in the npm builds. A nonce on the Privacy Center's own
|
|
209
|
+
* `<script>` tag is copied onto each translation `<script>` it inserts.
|
|
210
|
+
*/
|
|
211
|
+
assetBaseUrl?: string;
|
|
212
|
+
}>;
|
|
213
|
+
type PrivacyCenterInstance = Readonly<{
|
|
214
|
+
destroy(): void;
|
|
215
|
+
updateToken(accessToken: string, refreshToken?: string): void;
|
|
216
|
+
navigate(page: InternalPage): void;
|
|
217
|
+
setLanguage(code: string): void;
|
|
218
|
+
}>;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Mounts the native Privacy Center into `target` and returns its handle.
|
|
222
|
+
*
|
|
223
|
+
* Builds the services in React's provider order (Events → Settings → Scope
|
|
224
|
+
* root → Appearance → Branding → BaseUrl → Auth → Navigation → PageChrome)
|
|
225
|
+
* and mounts the layout into the scoped root. Everything they start is
|
|
226
|
+
* registered on one root ctx, which `destroy()` disposes.
|
|
227
|
+
*/
|
|
228
|
+
declare function renderPrivacyCenter(options: PrivacyCenterNativeOptions): PrivacyCenterInstance;
|
|
229
|
+
|
|
230
|
+
export { type ConsentAction, type InternalPage, type PrivacyCenterConsentChange, type PrivacyCenterInstance, type PrivacyCenterNativeOptions, type PrivacyCenterReadyEvent, type PrivacyCenterRequestSubmission, type PrivacyCenterSettings, type PrivacyCenterSignOutEvent, type PrivacyCenterSignOutReason, renderPrivacyCenter };
|