@redacto.io/consent-sdk-react-native 5.0.1-beta.1 → 6.0.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 +148 -28
- package/dist/chunk-VM4GNLMU.mjs +557 -0
- package/dist/index.d.mts +176 -47
- package/dist/index.d.ts +176 -47
- package/dist/index.js +10382 -2950
- package/dist/index.mjs +9996 -2994
- package/dist/privacy-center.d.mts +504 -168
- package/dist/privacy-center.d.ts +504 -168
- package/dist/privacy-center.js +6706 -2882
- package/dist/privacy-center.mjs +6020 -2411
- package/dist/types-BYp89x8C.d.mts +28 -0
- package/dist/types-BYp89x8C.d.ts +28 -0
- package/package.json +5 -1
- package/dist/chunk-B2TXWC2C.mjs +0 -60
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** How checkbox rows are drawn: native checkboxes, or switches. */
|
|
2
|
+
declare const NOTICE_CONTROL_STYLES: readonly ["checkbox", "switch"];
|
|
3
|
+
/** Phones: a centred modal, or a sheet docked to the bottom edge. */
|
|
4
|
+
declare const NOTICE_MOBILE_LAYOUTS: readonly ["modal", "sheet"];
|
|
5
|
+
/** Where the notice sits on wider screens (tablets). */
|
|
6
|
+
declare const NOTICE_DESKTOP_POSITIONS: readonly ["center", "bottom-right", "bottom-left", "bottom-bar"];
|
|
7
|
+
/** The screen behind the notice: dimmed with `colors.overlay`, or left as is. */
|
|
8
|
+
declare const NOTICE_BACKDROPS: readonly ["dim", "none"];
|
|
9
|
+
/** Phone footer: three stacked buttons, or Accept All over the other two. */
|
|
10
|
+
declare const NOTICE_PHONE_FOOTERS: readonly ["stacked", "paired"];
|
|
11
|
+
declare const NOTICE_TEXT_SCALES: readonly ["sm", "md", "lg"];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Surface and layout family a notice is drawn with, chosen in the Redacto
|
|
15
|
+
* console and served on `active_config.appearance.style`. Colours never come
|
|
16
|
+
* from the style: they come from the admin's palette, else the notice's brand.
|
|
17
|
+
*/
|
|
18
|
+
type AppearanceStyle = "classic" | "glass" | "minimal" | "soft";
|
|
19
|
+
/** The subset the Privacy Center's `settings.theme` accepts. */
|
|
20
|
+
type PrivacyCenterTheme = Extract<AppearanceStyle, "classic" | "glass">;
|
|
21
|
+
type NoticeControlStyle = (typeof NOTICE_CONTROL_STYLES)[number];
|
|
22
|
+
type NoticeMobileLayout = (typeof NOTICE_MOBILE_LAYOUTS)[number];
|
|
23
|
+
type NoticeDesktopPosition = (typeof NOTICE_DESKTOP_POSITIONS)[number];
|
|
24
|
+
type NoticeBackdrop = (typeof NOTICE_BACKDROPS)[number];
|
|
25
|
+
type NoticePhoneFooter = (typeof NOTICE_PHONE_FOOTERS)[number];
|
|
26
|
+
type NoticeTextScale = (typeof NOTICE_TEXT_SCALES)[number];
|
|
27
|
+
|
|
28
|
+
export type { AppearanceStyle as A, NoticeControlStyle as N, PrivacyCenterTheme as P, NoticeMobileLayout as a, NoticeDesktopPosition as b, NoticeBackdrop as c, NoticePhoneFooter as d, NoticeTextScale as e };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** How checkbox rows are drawn: native checkboxes, or switches. */
|
|
2
|
+
declare const NOTICE_CONTROL_STYLES: readonly ["checkbox", "switch"];
|
|
3
|
+
/** Phones: a centred modal, or a sheet docked to the bottom edge. */
|
|
4
|
+
declare const NOTICE_MOBILE_LAYOUTS: readonly ["modal", "sheet"];
|
|
5
|
+
/** Where the notice sits on wider screens (tablets). */
|
|
6
|
+
declare const NOTICE_DESKTOP_POSITIONS: readonly ["center", "bottom-right", "bottom-left", "bottom-bar"];
|
|
7
|
+
/** The screen behind the notice: dimmed with `colors.overlay`, or left as is. */
|
|
8
|
+
declare const NOTICE_BACKDROPS: readonly ["dim", "none"];
|
|
9
|
+
/** Phone footer: three stacked buttons, or Accept All over the other two. */
|
|
10
|
+
declare const NOTICE_PHONE_FOOTERS: readonly ["stacked", "paired"];
|
|
11
|
+
declare const NOTICE_TEXT_SCALES: readonly ["sm", "md", "lg"];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Surface and layout family a notice is drawn with, chosen in the Redacto
|
|
15
|
+
* console and served on `active_config.appearance.style`. Colours never come
|
|
16
|
+
* from the style: they come from the admin's palette, else the notice's brand.
|
|
17
|
+
*/
|
|
18
|
+
type AppearanceStyle = "classic" | "glass" | "minimal" | "soft";
|
|
19
|
+
/** The subset the Privacy Center's `settings.theme` accepts. */
|
|
20
|
+
type PrivacyCenterTheme = Extract<AppearanceStyle, "classic" | "glass">;
|
|
21
|
+
type NoticeControlStyle = (typeof NOTICE_CONTROL_STYLES)[number];
|
|
22
|
+
type NoticeMobileLayout = (typeof NOTICE_MOBILE_LAYOUTS)[number];
|
|
23
|
+
type NoticeDesktopPosition = (typeof NOTICE_DESKTOP_POSITIONS)[number];
|
|
24
|
+
type NoticeBackdrop = (typeof NOTICE_BACKDROPS)[number];
|
|
25
|
+
type NoticePhoneFooter = (typeof NOTICE_PHONE_FOOTERS)[number];
|
|
26
|
+
type NoticeTextScale = (typeof NOTICE_TEXT_SCALES)[number];
|
|
27
|
+
|
|
28
|
+
export type { AppearanceStyle as A, NoticeControlStyle as N, PrivacyCenterTheme as P, NoticeMobileLayout as a, NoticeDesktopPosition as b, NoticeBackdrop as c, NoticePhoneFooter as d, NoticeTextScale as e };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redacto.io/consent-sdk-react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "React Native SDK for integrating Redacto consent notices and privacy center in mobile apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"consent",
|
|
@@ -96,8 +96,12 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
+
"@testing-library/react": "^16.3.0",
|
|
99
100
|
"@types/react": "^19.1.3",
|
|
101
|
+
"@types/react-dom": "^19.1.3",
|
|
100
102
|
"@types/react-native": "^0.73.0",
|
|
103
|
+
"jsdom": "^26.1.0",
|
|
104
|
+
"react-dom": "19.1.0",
|
|
101
105
|
"react-native": "0.76.9",
|
|
102
106
|
"react-native-svg": "^15.0.0",
|
|
103
107
|
"tsup": "^8.4.0",
|
package/dist/chunk-B2TXWC2C.mjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
// src/shared/languages.ts
|
|
9
|
-
var languageOptions = [
|
|
10
|
-
{ value: "en", label: "English" },
|
|
11
|
-
{ value: "hi", label: "\u0939\u093F\u0928\u094D\u0926\u0940 (Hindi)" },
|
|
12
|
-
{ value: "te", label: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41 (Telugu)" },
|
|
13
|
-
{ value: "mr", label: "\u092E\u0930\u093E\u0920\u0940 (Marathi)" },
|
|
14
|
-
{ value: "ta", label: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD (Tamil)" },
|
|
15
|
-
{ value: "ur", label: "\u0627\u0631\u062F\u0648 (Urdu)" },
|
|
16
|
-
{ value: "gu", label: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0 (Gujarati)" },
|
|
17
|
-
{ value: "kn", label: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1 (Kannada)" },
|
|
18
|
-
{ value: "ml", label: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02 (Malayalam)" },
|
|
19
|
-
{ value: "pa", label: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 (Punjabi)" },
|
|
20
|
-
{ value: "or", label: "\u0B13\u0B21\u0B3C\u0B3F\u0B06 (Odia)" },
|
|
21
|
-
{ value: "as", label: "\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE (Assamese)" },
|
|
22
|
-
{ value: "bn", label: "\u09AC\u09BE\u0982\u09B2\u09BE (Bengali)" },
|
|
23
|
-
{ value: "mai", label: "\u092E\u0948\u0925\u093F\u0932\u0940 (Maithili)" },
|
|
24
|
-
{ value: "ne", label: "\u0928\u0947\u092A\u093E\u0932\u0940 (Nepali)" },
|
|
25
|
-
{ value: "sd", label: "\u0633\u0646\u068C\u064A (Sindhi)" },
|
|
26
|
-
{ value: "doi", label: "\u0921\u094B\u0917\u0930\u0940 (Dogri)" },
|
|
27
|
-
{ value: "mni-Mtei", label: "\uABC3\uABE9\uABC7\uABE9\uABC2\uABE3\uABDF (Manipuri)" },
|
|
28
|
-
{ value: "gom", label: "\u0915\u094B\u0902\u0915\u0923\u0940 (Goan Konkani)" },
|
|
29
|
-
{ value: "sa", label: "\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D (Sanskrit)" },
|
|
30
|
-
{ value: "brx", label: "\u092C\u0921\u093C\u094B (Bodo)" },
|
|
31
|
-
{ value: "ks", label: "\u0643\u0672\u0634\u064F\u0631 (Kashmiri)" },
|
|
32
|
-
{ value: "sat", label: "\u1C65\u1C5F\u1C71\u1C5B\u1C5F\u1C72\u1C64 (Santali)" }
|
|
33
|
-
];
|
|
34
|
-
var codeByLabel = new Map(languageOptions.map((o) => [o.label, o.value]));
|
|
35
|
-
var codeByLower = new Map(languageOptions.map((o) => [o.value.toLowerCase(), o.value]));
|
|
36
|
-
var englishName = (label) => {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
return (_b = (_a = label.match(/\(([^)]+)\)\s*$/)) == null ? void 0 : _a[1]) != null ? _b : label;
|
|
39
|
-
};
|
|
40
|
-
var codeByName = new Map(
|
|
41
|
-
languageOptions.map((o) => [englishName(o.label).toLowerCase(), o.value])
|
|
42
|
-
);
|
|
43
|
-
function toLanguageCode(lang) {
|
|
44
|
-
var _a, _b, _c;
|
|
45
|
-
if (!lang) return void 0;
|
|
46
|
-
const trimmed = lang.trim();
|
|
47
|
-
if (!trimmed) return void 0;
|
|
48
|
-
const lower = trimmed.toLowerCase();
|
|
49
|
-
return (_c = (_b = (_a = codeByLabel.get(trimmed)) != null ? _a : codeByName.get(lower)) != null ? _b : codeByLower.get(lower)) != null ? _c : trimmed;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// src/shared/sandbox.ts
|
|
53
|
-
var SANDBOX_TOKEN_HEADER = "X-Consent-Token";
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
__require,
|
|
57
|
-
SANDBOX_TOKEN_HEADER,
|
|
58
|
-
languageOptions,
|
|
59
|
-
toLanguageCode
|
|
60
|
-
};
|