@usercentrics/react-native-sdk 2.28.0 → 2.28.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/android/build.gradle.kts +1 -1
- package/android/src/main/java/com/usercentrics/reactnative/extensions/BannerInitCustomizationExtensions.kt +45 -0
- package/android/src/main/java/com/usercentrics/reactnative/extensions/BannerSettingsExtensions.kt +1 -0
- package/android/src/main/java/com/usercentrics/reactnative/extensions/ReadableMapExtensions.kt +4 -0
- package/android/src/main/java/com/usercentrics/reactnative/extensions/UserOptionsExtensions.kt +4 -0
- package/android/src/test/java/com/usercentrics/reactnative/extensions/BannerInitCustomizationExtensionsTest.kt +107 -0
- package/ios/Extensions/BannerInitCustomization+Dict.swift +53 -0
- package/ios/Extensions/BannerSettings+Dict.swift +6 -1
- package/ios/Extensions/UsercentricsOptions+Dict.swift +4 -0
- package/lib/models/BannerInitCustomization.d.ts +66 -0
- package/lib/models/BannerInitCustomization.js +41 -0
- package/lib/models/BannerInitCustomization.js.map +1 -0
- package/lib/models/BannerSettings.d.ts +7 -2
- package/lib/models/BannerSettings.js +2 -1
- package/lib/models/BannerSettings.js.map +1 -1
- package/lib/models/UsercentricsOptions.d.ts +8 -2
- package/lib/models/UsercentricsOptions.js +2 -1
- package/lib/models/UsercentricsOptions.js.map +1 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/index.test.ts +76 -0
- package/src/models/BannerInitCustomization.tsx +125 -0
- package/src/models/BannerSettings.tsx +8 -2
- package/src/models/UsercentricsOptions.tsx +11 -3
- package/src/models/index.tsx +1 -0
package/android/build.gradle.kts
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.usercentrics.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableMap
|
|
4
|
+
import com.usercentrics.sdk.BannerInitCustomization
|
|
5
|
+
import com.usercentrics.sdk.PurposeListStyle
|
|
6
|
+
|
|
7
|
+
internal fun ReadableMap.bannerInitCustomizationFromMap(): BannerInitCustomization {
|
|
8
|
+
return BannerInitCustomization(
|
|
9
|
+
paddingTop = getIntOrNull("paddingTop"),
|
|
10
|
+
paddingBottom = getIntOrNull("paddingBottom"),
|
|
11
|
+
paddingStart = getIntOrNull("paddingStart"),
|
|
12
|
+
paddingEnd = getIntOrNull("paddingEnd"),
|
|
13
|
+
lineSpacingMultiplier = getFloatOrNull("lineSpacingMultiplier"),
|
|
14
|
+
titleFontSize = getIntOrNull("titleFontSize"),
|
|
15
|
+
bodyFontSize = getIntOrNull("bodyFontSize"),
|
|
16
|
+
linkFontSize = getIntOrNull("linkFontSize"),
|
|
17
|
+
titleFontBold = getBooleanOrNull("titleFontBold"),
|
|
18
|
+
headerPaddingTop = getIntOrNull("headerPaddingTop"),
|
|
19
|
+
headerPaddingSides = getIntOrNull("headerPaddingSides"),
|
|
20
|
+
headerPaddingBetweenElements = getIntOrNull("headerPaddingBetweenElements"),
|
|
21
|
+
buttonBorderColor = getString("buttonBorderColor"),
|
|
22
|
+
buttonBorderWidth = getIntOrNull("buttonBorderWidth"),
|
|
23
|
+
purposeListStyle = getString("purposeListStyle")?.purposeListStyleFromEnumString(),
|
|
24
|
+
stickyHeader = getBooleanOrNull("stickyHeader"),
|
|
25
|
+
hideLanguageSwitcher = getBooleanOrNull("hideLanguageSwitcher"),
|
|
26
|
+
buttonHeightDp = getIntOrNull("buttonHeightDp"),
|
|
27
|
+
buttonHorizontalPaddingDp = getIntOrNull("buttonHorizontalPaddingDp"),
|
|
28
|
+
buttonSpacingDp = getIntOrNull("buttonSpacingDp"),
|
|
29
|
+
linkUnderline = getBooleanOrNull("linkUnderline"),
|
|
30
|
+
showSecondLayerCloseButton = getBooleanOrNull("showSecondLayerCloseButton"),
|
|
31
|
+
tabFontSize = getIntOrNull("tabFontSize"),
|
|
32
|
+
tabActiveColor = getString("tabActiveColor"),
|
|
33
|
+
denyAllButtonBackground = getString("denyAllButtonBackground"),
|
|
34
|
+
acceptAllButtonBackground = getString("acceptAllButtonBackground"),
|
|
35
|
+
linkColor = getString("linkColor"),
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
internal fun String.purposeListStyleFromEnumString(): PurposeListStyle? {
|
|
40
|
+
return when (this) {
|
|
41
|
+
"BOXED" -> PurposeListStyle.BOXED
|
|
42
|
+
"FLAT" -> PurposeListStyle.FLAT
|
|
43
|
+
else -> null
|
|
44
|
+
}
|
|
45
|
+
}
|
package/android/src/main/java/com/usercentrics/reactnative/extensions/BannerSettingsExtensions.kt
CHANGED
|
@@ -26,6 +26,7 @@ internal fun ReadableMap.bannerSettingsFromMap(context: Context): BannerSettings
|
|
|
26
26
|
secondLayerStyleSettings = rawSecondLayerStyleSettings?.secondLayerStyleSettingsFromMap(context),
|
|
27
27
|
generalStyleSettings = rawGeneralStyleSettings?.generalStyleSettingsFromMap(context),
|
|
28
28
|
variantName = getString("variantName"),
|
|
29
|
+
initCustomization = getMap("initCustomization")?.bannerInitCustomizationFromMap(),
|
|
29
30
|
)
|
|
30
31
|
}
|
|
31
32
|
|
package/android/src/main/java/com/usercentrics/reactnative/extensions/ReadableMapExtensions.kt
CHANGED
|
@@ -29,6 +29,10 @@ internal fun ReadableMap.getBooleanOrNull(key: String): Boolean? {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
internal fun ReadableMap.getFloatOrNull(key: String): Float? {
|
|
33
|
+
return getDoubleOrNull(key)?.toFloat()
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
internal fun List<*>.serialize(): WritableArray {
|
|
33
37
|
val array = Arguments.createArray()
|
|
34
38
|
forEach { value ->
|
package/android/src/main/java/com/usercentrics/reactnative/extensions/UserOptionsExtensions.kt
CHANGED
|
@@ -56,5 +56,9 @@ internal fun ReadableMap.usercentricsOptionsFromMap(): UsercentricsOptions {
|
|
|
56
56
|
options.initTimeoutMillis = it.toLong()
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
getMap("bannerCustomization")?.let {
|
|
60
|
+
options.bannerCustomization = it.bannerInitCustomizationFromMap()
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
return options
|
|
60
64
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
package com.usercentrics.reactnative.extensions
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.JavaOnlyMap
|
|
4
|
+
import com.usercentrics.sdk.PurposeListStyle
|
|
5
|
+
import org.junit.Assert.*
|
|
6
|
+
import org.junit.Test
|
|
7
|
+
|
|
8
|
+
class BannerInitCustomizationExtensionsTest {
|
|
9
|
+
|
|
10
|
+
@Test
|
|
11
|
+
fun `bannerInitCustomizationFromMap maps all fields`() {
|
|
12
|
+
val map = JavaOnlyMap().apply {
|
|
13
|
+
putInt("paddingTop", 16)
|
|
14
|
+
putInt("paddingBottom", 16)
|
|
15
|
+
putInt("paddingStart", 8)
|
|
16
|
+
putInt("paddingEnd", 8)
|
|
17
|
+
putDouble("lineSpacingMultiplier", 1.2)
|
|
18
|
+
putInt("titleFontSize", 18)
|
|
19
|
+
putInt("bodyFontSize", 14)
|
|
20
|
+
putInt("linkFontSize", 14)
|
|
21
|
+
putBoolean("titleFontBold", true)
|
|
22
|
+
putInt("headerPaddingTop", 12)
|
|
23
|
+
putInt("headerPaddingSides", 12)
|
|
24
|
+
putInt("headerPaddingBetweenElements", 4)
|
|
25
|
+
putString("buttonBorderColor", "#004dcf")
|
|
26
|
+
putInt("buttonBorderWidth", 1)
|
|
27
|
+
putString("purposeListStyle", "FLAT")
|
|
28
|
+
putBoolean("stickyHeader", true)
|
|
29
|
+
putBoolean("hideLanguageSwitcher", false)
|
|
30
|
+
putInt("buttonHeightDp", 48)
|
|
31
|
+
putInt("buttonHorizontalPaddingDp", 16)
|
|
32
|
+
putInt("buttonSpacingDp", 8)
|
|
33
|
+
putBoolean("linkUnderline", true)
|
|
34
|
+
putBoolean("showSecondLayerCloseButton", true)
|
|
35
|
+
putInt("tabFontSize", 14)
|
|
36
|
+
putString("tabActiveColor", "#004dcf")
|
|
37
|
+
putString("denyAllButtonBackground", "#ffffff")
|
|
38
|
+
putString("acceptAllButtonBackground", "#004dcf")
|
|
39
|
+
putString("linkColor", "#004dcf")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
val customization = map.bannerInitCustomizationFromMap()
|
|
43
|
+
|
|
44
|
+
assertEquals(16, customization.paddingTop)
|
|
45
|
+
assertEquals(16, customization.paddingBottom)
|
|
46
|
+
assertEquals(8, customization.paddingStart)
|
|
47
|
+
assertEquals(8, customization.paddingEnd)
|
|
48
|
+
assertEquals(1.2f, customization.lineSpacingMultiplier)
|
|
49
|
+
assertEquals(18, customization.titleFontSize)
|
|
50
|
+
assertEquals(14, customization.bodyFontSize)
|
|
51
|
+
assertEquals(14, customization.linkFontSize)
|
|
52
|
+
assertEquals(true, customization.titleFontBold)
|
|
53
|
+
assertEquals(12, customization.headerPaddingTop)
|
|
54
|
+
assertEquals(12, customization.headerPaddingSides)
|
|
55
|
+
assertEquals(4, customization.headerPaddingBetweenElements)
|
|
56
|
+
assertEquals("#004dcf", customization.buttonBorderColor)
|
|
57
|
+
assertEquals(1, customization.buttonBorderWidth)
|
|
58
|
+
assertEquals(PurposeListStyle.FLAT, customization.purposeListStyle)
|
|
59
|
+
assertEquals(true, customization.stickyHeader)
|
|
60
|
+
assertEquals(false, customization.hideLanguageSwitcher)
|
|
61
|
+
assertEquals(48, customization.buttonHeightDp)
|
|
62
|
+
assertEquals(16, customization.buttonHorizontalPaddingDp)
|
|
63
|
+
assertEquals(8, customization.buttonSpacingDp)
|
|
64
|
+
assertEquals(true, customization.linkUnderline)
|
|
65
|
+
assertEquals(true, customization.showSecondLayerCloseButton)
|
|
66
|
+
assertEquals(14, customization.tabFontSize)
|
|
67
|
+
assertEquals("#004dcf", customization.tabActiveColor)
|
|
68
|
+
assertEquals("#ffffff", customization.denyAllButtonBackground)
|
|
69
|
+
assertEquals("#004dcf", customization.acceptAllButtonBackground)
|
|
70
|
+
assertEquals("#004dcf", customization.linkColor)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@Test
|
|
74
|
+
fun `bannerInitCustomizationFromMap omits unset fields instead of defaulting`() {
|
|
75
|
+
val map = JavaOnlyMap()
|
|
76
|
+
|
|
77
|
+
val customization = map.bannerInitCustomizationFromMap()
|
|
78
|
+
|
|
79
|
+
assertNull(customization.paddingTop)
|
|
80
|
+
assertNull(customization.buttonBorderColor)
|
|
81
|
+
assertNull(customization.purposeListStyle)
|
|
82
|
+
assertNull(customization.stickyHeader)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@Test
|
|
86
|
+
fun `purposeListStyleFromEnumString maps known values and returns null otherwise`() {
|
|
87
|
+
assertEquals(PurposeListStyle.BOXED, "BOXED".purposeListStyleFromEnumString())
|
|
88
|
+
assertEquals(PurposeListStyle.FLAT, "FLAT".purposeListStyleFromEnumString())
|
|
89
|
+
assertNull("UNKNOWN".purposeListStyleFromEnumString())
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@Test
|
|
93
|
+
fun `usercentricsOptionsFromMap maps nested bannerCustomization`() {
|
|
94
|
+
val map = JavaOnlyMap().apply {
|
|
95
|
+
putString("settingsId", "123")
|
|
96
|
+
putMap("bannerCustomization", JavaOnlyMap().apply {
|
|
97
|
+
putInt("paddingTop", 16)
|
|
98
|
+
putString("purposeListStyle", "FLAT")
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
val options = map.usercentricsOptionsFromMap()
|
|
103
|
+
|
|
104
|
+
assertEquals(16, options.bannerCustomization?.paddingTop)
|
|
105
|
+
assertEquals(PurposeListStyle.FLAT, options.bannerCustomization?.purposeListStyle)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import Usercentrics
|
|
3
|
+
|
|
4
|
+
extension BannerInitCustomization {
|
|
5
|
+
convenience init?(from dictionary: NSDictionary?) {
|
|
6
|
+
guard let dictionary = dictionary else { return nil }
|
|
7
|
+
|
|
8
|
+
self.init(
|
|
9
|
+
paddingTop: (dictionary["paddingTop"] as? Int32).map { KotlinInt(value: $0) },
|
|
10
|
+
paddingBottom: (dictionary["paddingBottom"] as? Int32).map { KotlinInt(value: $0) },
|
|
11
|
+
paddingStart: (dictionary["paddingStart"] as? Int32).map { KotlinInt(value: $0) },
|
|
12
|
+
paddingEnd: (dictionary["paddingEnd"] as? Int32).map { KotlinInt(value: $0) },
|
|
13
|
+
lineSpacingMultiplier: (dictionary["lineSpacingMultiplier"] as? Double).map { KotlinFloat(value: Float($0)) },
|
|
14
|
+
titleFontSize: (dictionary["titleFontSize"] as? Int32).map { KotlinInt(value: $0) },
|
|
15
|
+
bodyFontSize: (dictionary["bodyFontSize"] as? Int32).map { KotlinInt(value: $0) },
|
|
16
|
+
linkFontSize: (dictionary["linkFontSize"] as? Int32).map { KotlinInt(value: $0) },
|
|
17
|
+
titleFontBold: (dictionary["titleFontBold"] as? Bool).map { KotlinBoolean(value: $0) },
|
|
18
|
+
headerPaddingTop: (dictionary["headerPaddingTop"] as? Int32).map { KotlinInt(value: $0) },
|
|
19
|
+
headerPaddingSides: (dictionary["headerPaddingSides"] as? Int32).map { KotlinInt(value: $0) },
|
|
20
|
+
headerPaddingBetweenElements: (dictionary["headerPaddingBetweenElements"] as? Int32).map { KotlinInt(value: $0) },
|
|
21
|
+
buttonBorderColor: dictionary["buttonBorderColor"] as? String,
|
|
22
|
+
buttonBorderWidth: (dictionary["buttonBorderWidth"] as? Int32).map { KotlinInt(value: $0) },
|
|
23
|
+
purposeListStyle: PurposeListStyle.from(enumString: dictionary["purposeListStyle"] as? String),
|
|
24
|
+
stickyHeader: (dictionary["stickyHeader"] as? Bool).map { KotlinBoolean(value: $0) },
|
|
25
|
+
hideLanguageSwitcher: (dictionary["hideLanguageSwitcher"] as? Bool).map { KotlinBoolean(value: $0) },
|
|
26
|
+
buttonHeightDp: (dictionary["buttonHeightDp"] as? Int32).map { KotlinInt(value: $0) },
|
|
27
|
+
buttonHorizontalPaddingDp: (dictionary["buttonHorizontalPaddingDp"] as? Int32).map { KotlinInt(value: $0) },
|
|
28
|
+
buttonSpacingDp: (dictionary["buttonSpacingDp"] as? Int32).map { KotlinInt(value: $0) },
|
|
29
|
+
linkUnderline: (dictionary["linkUnderline"] as? Bool).map { KotlinBoolean(value: $0) },
|
|
30
|
+
showSecondLayerCloseButton: (dictionary["showSecondLayerCloseButton"] as? Bool).map { KotlinBoolean(value: $0) },
|
|
31
|
+
tabFontSize: (dictionary["tabFontSize"] as? Int32).map { KotlinInt(value: $0) },
|
|
32
|
+
tabActiveColor: dictionary["tabActiveColor"] as? String,
|
|
33
|
+
denyAllButtonBackground: dictionary["denyAllButtonBackground"] as? String,
|
|
34
|
+
acceptAllButtonBackground: dictionary["acceptAllButtonBackground"] as? String,
|
|
35
|
+
linkColor: dictionary["linkColor"] as? String
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
extension PurposeListStyle {
|
|
41
|
+
static func from(enumString: String?) -> PurposeListStyle? {
|
|
42
|
+
guard let enumString = enumString else { return nil }
|
|
43
|
+
|
|
44
|
+
switch enumString {
|
|
45
|
+
case "BOXED":
|
|
46
|
+
return .boxed
|
|
47
|
+
case "FLAT":
|
|
48
|
+
return .flat
|
|
49
|
+
default:
|
|
50
|
+
return nil
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Foundation
|
|
2
|
+
import Usercentrics
|
|
2
3
|
import UsercentricsUI
|
|
3
4
|
import UIKit
|
|
4
5
|
|
|
@@ -16,10 +17,14 @@ extension BannerSettings {
|
|
|
16
17
|
let secondLayerStyleSettingsDict = dictionary["secondLayerStyleSettings"] as? NSDictionary
|
|
17
18
|
let secondLayerSettings = SecondLayerStyleSettings(from: secondLayerStyleSettingsDict, bannerFontHolder: bannerFontHolder)
|
|
18
19
|
|
|
20
|
+
let initCustomizationDict = dictionary["initCustomization"] as? NSDictionary
|
|
21
|
+
let initCustomization = BannerInitCustomization(from: initCustomizationDict)
|
|
22
|
+
|
|
19
23
|
self.init(generalStyleSettings: generalStyleSettings,
|
|
20
24
|
firstLayerStyleSettings: firstLayerSettings,
|
|
21
25
|
secondLayerStyleSettings: secondLayerSettings,
|
|
22
|
-
variantName: dictionary["variantName"] as? String
|
|
26
|
+
variantName: dictionary["variantName"] as? String,
|
|
27
|
+
initCustomization: initCustomization)
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
|
|
@@ -41,6 +41,10 @@ public extension UsercentricsOptions {
|
|
|
41
41
|
options.initTimeoutMillis = Int64(initTimeoutMillis)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
if let bannerCustomizationDict = dictionary["bannerCustomization"] as? NSDictionary {
|
|
45
|
+
options.bannerCustomization = BannerInitCustomization(from: bannerCustomizationDict)
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
return options
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare enum PurposeListStyle {
|
|
2
|
+
boxed = "BOXED",
|
|
3
|
+
flat = "FLAT"
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated BannerInitCustomization is deprecated and will be removed in a future release.
|
|
7
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BannerInitCustomization {
|
|
10
|
+
paddingTop?: number;
|
|
11
|
+
paddingBottom?: number;
|
|
12
|
+
paddingStart?: number;
|
|
13
|
+
paddingEnd?: number;
|
|
14
|
+
lineSpacingMultiplier?: number;
|
|
15
|
+
titleFontSize?: number;
|
|
16
|
+
bodyFontSize?: number;
|
|
17
|
+
linkFontSize?: number;
|
|
18
|
+
titleFontBold?: boolean;
|
|
19
|
+
headerPaddingTop?: number;
|
|
20
|
+
headerPaddingSides?: number;
|
|
21
|
+
headerPaddingBetweenElements?: number;
|
|
22
|
+
buttonBorderColor?: string;
|
|
23
|
+
buttonBorderWidth?: number;
|
|
24
|
+
purposeListStyle?: PurposeListStyle;
|
|
25
|
+
stickyHeader?: boolean;
|
|
26
|
+
hideLanguageSwitcher?: boolean;
|
|
27
|
+
buttonHeightDp?: number;
|
|
28
|
+
buttonHorizontalPaddingDp?: number;
|
|
29
|
+
buttonSpacingDp?: number;
|
|
30
|
+
linkUnderline?: boolean;
|
|
31
|
+
showSecondLayerCloseButton?: boolean;
|
|
32
|
+
tabFontSize?: number;
|
|
33
|
+
tabActiveColor?: string;
|
|
34
|
+
denyAllButtonBackground?: string;
|
|
35
|
+
acceptAllButtonBackground?: string;
|
|
36
|
+
linkColor?: string;
|
|
37
|
+
constructor({ paddingTop, paddingBottom, paddingStart, paddingEnd, lineSpacingMultiplier, titleFontSize, bodyFontSize, linkFontSize, titleFontBold, headerPaddingTop, headerPaddingSides, headerPaddingBetweenElements, buttonBorderColor, buttonBorderWidth, purposeListStyle, stickyHeader, hideLanguageSwitcher, buttonHeightDp, buttonHorizontalPaddingDp, buttonSpacingDp, linkUnderline, showSecondLayerCloseButton, tabFontSize, tabActiveColor, denyAllButtonBackground, acceptAllButtonBackground, linkColor }?: {
|
|
38
|
+
paddingTop?: number;
|
|
39
|
+
paddingBottom?: number;
|
|
40
|
+
paddingStart?: number;
|
|
41
|
+
paddingEnd?: number;
|
|
42
|
+
lineSpacingMultiplier?: number;
|
|
43
|
+
titleFontSize?: number;
|
|
44
|
+
bodyFontSize?: number;
|
|
45
|
+
linkFontSize?: number;
|
|
46
|
+
titleFontBold?: boolean;
|
|
47
|
+
headerPaddingTop?: number;
|
|
48
|
+
headerPaddingSides?: number;
|
|
49
|
+
headerPaddingBetweenElements?: number;
|
|
50
|
+
buttonBorderColor?: string;
|
|
51
|
+
buttonBorderWidth?: number;
|
|
52
|
+
purposeListStyle?: PurposeListStyle;
|
|
53
|
+
stickyHeader?: boolean;
|
|
54
|
+
hideLanguageSwitcher?: boolean;
|
|
55
|
+
buttonHeightDp?: number;
|
|
56
|
+
buttonHorizontalPaddingDp?: number;
|
|
57
|
+
buttonSpacingDp?: number;
|
|
58
|
+
linkUnderline?: boolean;
|
|
59
|
+
showSecondLayerCloseButton?: boolean;
|
|
60
|
+
tabFontSize?: number;
|
|
61
|
+
tabActiveColor?: string;
|
|
62
|
+
denyAllButtonBackground?: string;
|
|
63
|
+
acceptAllButtonBackground?: string;
|
|
64
|
+
linkColor?: string;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export var PurposeListStyle;
|
|
2
|
+
(function (PurposeListStyle) {
|
|
3
|
+
PurposeListStyle["boxed"] = "BOXED";
|
|
4
|
+
PurposeListStyle["flat"] = "FLAT";
|
|
5
|
+
})(PurposeListStyle || (PurposeListStyle = {}));
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated BannerInitCustomization is deprecated and will be removed in a future release.
|
|
8
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
9
|
+
*/
|
|
10
|
+
export class BannerInitCustomization {
|
|
11
|
+
constructor({ paddingTop = undefined, paddingBottom = undefined, paddingStart = undefined, paddingEnd = undefined, lineSpacingMultiplier = undefined, titleFontSize = undefined, bodyFontSize = undefined, linkFontSize = undefined, titleFontBold = undefined, headerPaddingTop = undefined, headerPaddingSides = undefined, headerPaddingBetweenElements = undefined, buttonBorderColor = undefined, buttonBorderWidth = undefined, purposeListStyle = undefined, stickyHeader = undefined, hideLanguageSwitcher = undefined, buttonHeightDp = undefined, buttonHorizontalPaddingDp = undefined, buttonSpacingDp = undefined, linkUnderline = undefined, showSecondLayerCloseButton = undefined, tabFontSize = undefined, tabActiveColor = undefined, denyAllButtonBackground = undefined, acceptAllButtonBackground = undefined, linkColor = undefined } = {}) {
|
|
12
|
+
this.paddingTop = paddingTop;
|
|
13
|
+
this.paddingBottom = paddingBottom;
|
|
14
|
+
this.paddingStart = paddingStart;
|
|
15
|
+
this.paddingEnd = paddingEnd;
|
|
16
|
+
this.lineSpacingMultiplier = lineSpacingMultiplier;
|
|
17
|
+
this.titleFontSize = titleFontSize;
|
|
18
|
+
this.bodyFontSize = bodyFontSize;
|
|
19
|
+
this.linkFontSize = linkFontSize;
|
|
20
|
+
this.titleFontBold = titleFontBold;
|
|
21
|
+
this.headerPaddingTop = headerPaddingTop;
|
|
22
|
+
this.headerPaddingSides = headerPaddingSides;
|
|
23
|
+
this.headerPaddingBetweenElements = headerPaddingBetweenElements;
|
|
24
|
+
this.buttonBorderColor = buttonBorderColor;
|
|
25
|
+
this.buttonBorderWidth = buttonBorderWidth;
|
|
26
|
+
this.purposeListStyle = purposeListStyle;
|
|
27
|
+
this.stickyHeader = stickyHeader;
|
|
28
|
+
this.hideLanguageSwitcher = hideLanguageSwitcher;
|
|
29
|
+
this.buttonHeightDp = buttonHeightDp;
|
|
30
|
+
this.buttonHorizontalPaddingDp = buttonHorizontalPaddingDp;
|
|
31
|
+
this.buttonSpacingDp = buttonSpacingDp;
|
|
32
|
+
this.linkUnderline = linkUnderline;
|
|
33
|
+
this.showSecondLayerCloseButton = showSecondLayerCloseButton;
|
|
34
|
+
this.tabFontSize = tabFontSize;
|
|
35
|
+
this.tabActiveColor = tabActiveColor;
|
|
36
|
+
this.denyAllButtonBackground = denyAllButtonBackground;
|
|
37
|
+
this.acceptAllButtonBackground = acceptAllButtonBackground;
|
|
38
|
+
this.linkColor = linkColor;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=BannerInitCustomization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerInitCustomization.js","sourceRoot":"","sources":["../../src/models/BannerInitCustomization.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB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,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,4BAA4B,GAAG,4BAA4B,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACjD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;QAC3D,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;QAC7D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QACvD,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;QAC3D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageResolvedAssetSource } from "react-native";
|
|
2
|
-
import { FirstLayerStyleSettings, SecondLayerStyleSettings } from ".";
|
|
2
|
+
import { BannerInitCustomization, FirstLayerStyleSettings, SecondLayerStyleSettings } from ".";
|
|
3
3
|
export declare class BannerLogo {
|
|
4
4
|
logoName: string;
|
|
5
5
|
logoPath: string;
|
|
@@ -46,5 +46,10 @@ export declare class BannerSettings {
|
|
|
46
46
|
secondLayerStyleSettings?: SecondLayerStyleSettings;
|
|
47
47
|
generalStyleSettings?: GeneralStyleSettings;
|
|
48
48
|
variantName?: String;
|
|
49
|
-
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated initCustomization is deprecated and will be removed in a future release.
|
|
51
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
52
|
+
*/
|
|
53
|
+
initCustomization?: BannerInitCustomization;
|
|
54
|
+
constructor(firstLayerStyleSettings?: FirstLayerStyleSettings, secondLayerStyleSettings?: SecondLayerStyleSettings, generalStyleSettings?: GeneralStyleSettings, variantName?: String, initCustomization?: BannerInitCustomization);
|
|
50
55
|
}
|
|
@@ -45,11 +45,12 @@ export class GeneralStyleSettings {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export class BannerSettings {
|
|
48
|
-
constructor(firstLayerStyleSettings, secondLayerStyleSettings, generalStyleSettings, variantName) {
|
|
48
|
+
constructor(firstLayerStyleSettings, secondLayerStyleSettings, generalStyleSettings, variantName, initCustomization) {
|
|
49
49
|
this.firstLayerStyleSettings = firstLayerStyleSettings;
|
|
50
50
|
this.secondLayerStyleSettings = secondLayerStyleSettings;
|
|
51
51
|
this.generalStyleSettings = generalStyleSettings;
|
|
52
52
|
this.variantName = variantName;
|
|
53
|
+
this.initCustomization = initCustomization;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
//# sourceMappingURL=BannerSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerSettings.js","sourceRoot":"","sources":["../../src/models/BannerSettings.tsx"],"names":[],"mappings":"AAGA,MAAM,OAAO,UAAU;IAMnB,YAAY,QAAgB,EAAE,QAAkC,EAAE,OAAgB;QAC9E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACJ;AAED,MAAM,OAAO,UAAU;IAMnB,YAAY,WAAmB,EAAE,QAAgB,EAAE,QAAgB;QAC/D,IAAI,CAAC,WAAW,GAAG,WA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";
|
|
1
|
+
import { BannerInitCustomization, NetworkMode, UsercentricsLoggerLevel } from ".";
|
|
2
2
|
export declare class UsercentricsOptions {
|
|
3
3
|
settingsId?: string;
|
|
4
4
|
ruleSetId?: string;
|
|
@@ -9,7 +9,12 @@ export declare class UsercentricsOptions {
|
|
|
9
9
|
networkMode?: NetworkMode;
|
|
10
10
|
consentMediation?: Boolean;
|
|
11
11
|
initTimeoutMillis?: number;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated bannerCustomization is deprecated and will be removed in a future release.
|
|
14
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
15
|
+
*/
|
|
16
|
+
bannerCustomization?: BannerInitCustomization;
|
|
17
|
+
constructor({ settingsId, ruleSetId, defaultLanguage, loggerLevel, timeoutMillis, version, networkMode, consentMediation, initTimeoutMillis, bannerCustomization }: {
|
|
13
18
|
settingsId?: string;
|
|
14
19
|
ruleSetId?: string;
|
|
15
20
|
defaultLanguage?: string;
|
|
@@ -19,5 +24,6 @@ export declare class UsercentricsOptions {
|
|
|
19
24
|
networkMode?: NetworkMode;
|
|
20
25
|
consentMediation?: Boolean;
|
|
21
26
|
initTimeoutMillis?: number;
|
|
27
|
+
bannerCustomization?: BannerInitCustomization;
|
|
22
28
|
});
|
|
23
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class UsercentricsOptions {
|
|
2
|
-
constructor({ settingsId = "", ruleSetId = "", defaultLanguage = undefined, loggerLevel = undefined, timeoutMillis = undefined, version = undefined, networkMode = undefined, consentMediation = undefined, initTimeoutMillis = undefined }) {
|
|
2
|
+
constructor({ settingsId = "", ruleSetId = "", defaultLanguage = undefined, loggerLevel = undefined, timeoutMillis = undefined, version = undefined, networkMode = undefined, consentMediation = undefined, initTimeoutMillis = undefined, bannerCustomization = undefined }) {
|
|
3
3
|
this.settingsId = settingsId;
|
|
4
4
|
this.ruleSetId = ruleSetId;
|
|
5
5
|
this.defaultLanguage = defaultLanguage;
|
|
@@ -9,6 +9,7 @@ export class UsercentricsOptions {
|
|
|
9
9
|
this.networkMode = networkMode;
|
|
10
10
|
this.consentMediation = consentMediation;
|
|
11
11
|
this.initTimeoutMillis = initTimeoutMillis;
|
|
12
|
+
this.bannerCustomization = bannerCustomization;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=UsercentricsOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsercentricsOptions.js","sourceRoot":"","sources":["../../src/models/UsercentricsOptions.tsx"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"UsercentricsOptions.js","sourceRoot":"","sources":["../../src/models/UsercentricsOptions.tsx"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;IAgB5B,YAAY,EACI,UAAU,GAAG,EAAE,EACf,SAAS,GAAG,EAAE,EACd,eAAe,GAAG,SAAS,EAC3B,WAAW,GAAG,SAAS,EACvB,aAAa,GAAG,SAAS,EACzB,OAAO,GAAG,SAAS,EACnB,WAAW,GAAG,SAAS,EACvB,gBAAgB,GAAG,SAAS,EAC5B,iBAAiB,GAAG,SAAS,EAC7B,mBAAmB,GAAG,SAAS,EAY9C;QACG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACxC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;IAClD,CAAC;CACJ"}
|
package/lib/models/index.d.ts
CHANGED
package/lib/models/index.js
CHANGED
package/lib/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.tsx"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usercentrics/react-native-sdk",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.1",
|
|
4
4
|
"description": "Usercentrics SDK",
|
|
5
5
|
"homepage": "https://usercentrics.com",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
8
8
|
"author": "Usercentrics <developer@usercentrics.com>",
|
|
9
9
|
"iosPackageName": "react-native-usercentrics",
|
|
10
|
-
"iosPackageVersion": "2.28.
|
|
10
|
+
"iosPackageVersion": "2.28.1",
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE",
|
|
12
12
|
"files": [
|
|
13
13
|
"android",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {NativeModules} from 'react-native';
|
|
2
2
|
import {
|
|
3
|
+
BannerInitCustomization,
|
|
3
4
|
BannerSettings,
|
|
4
5
|
NetworkMode,
|
|
6
|
+
PurposeListStyle,
|
|
5
7
|
TCFData,
|
|
6
8
|
TCFDecisionUILayer,
|
|
7
9
|
UsercentricsConsentType,
|
|
@@ -87,6 +89,50 @@ describe('Test Usercentrics Module', () => {
|
|
|
87
89
|
expect(call).toBe(options)
|
|
88
90
|
})
|
|
89
91
|
|
|
92
|
+
test('testConfigureBridgeWithBannerCustomization', () => {
|
|
93
|
+
const bannerCustomization = new BannerInitCustomization({
|
|
94
|
+
paddingTop: 16,
|
|
95
|
+
paddingBottom: 16,
|
|
96
|
+
paddingStart: 8,
|
|
97
|
+
paddingEnd: 8,
|
|
98
|
+
lineSpacingMultiplier: 1.2,
|
|
99
|
+
titleFontSize: 18,
|
|
100
|
+
bodyFontSize: 14,
|
|
101
|
+
linkFontSize: 14,
|
|
102
|
+
titleFontBold: true,
|
|
103
|
+
headerPaddingTop: 12,
|
|
104
|
+
headerPaddingSides: 12,
|
|
105
|
+
headerPaddingBetweenElements: 4,
|
|
106
|
+
buttonBorderColor: "#004dcf",
|
|
107
|
+
buttonBorderWidth: 1,
|
|
108
|
+
purposeListStyle: PurposeListStyle.flat,
|
|
109
|
+
stickyHeader: true,
|
|
110
|
+
hideLanguageSwitcher: false,
|
|
111
|
+
buttonHeightDp: 48,
|
|
112
|
+
buttonHorizontalPaddingDp: 16,
|
|
113
|
+
buttonSpacingDp: 8,
|
|
114
|
+
linkUnderline: true,
|
|
115
|
+
showSecondLayerCloseButton: true,
|
|
116
|
+
tabFontSize: 14,
|
|
117
|
+
tabActiveColor: "#004dcf",
|
|
118
|
+
denyAllButtonBackground: "#ffffff",
|
|
119
|
+
acceptAllButtonBackground: "#004dcf",
|
|
120
|
+
linkColor: "#004dcf"
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const options = new UsercentricsOptions({
|
|
124
|
+
settingsId: "abc",
|
|
125
|
+
ruleSetId: "qwer",
|
|
126
|
+
bannerCustomization
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
Usercentrics.configure(options);
|
|
130
|
+
const calls = RNUsercentricsModule.configure.mock.calls;
|
|
131
|
+
const call = calls[calls.length - 1][0];
|
|
132
|
+
expect(call).toBe(options);
|
|
133
|
+
expect(call.bannerCustomization).toBe(bannerCustomization);
|
|
134
|
+
})
|
|
135
|
+
|
|
90
136
|
test('testStatus', async () => {
|
|
91
137
|
const readyStatus = new UsercentricsReadyStatus(
|
|
92
138
|
true,
|
|
@@ -178,6 +224,36 @@ describe('Test Usercentrics Module', () => {
|
|
|
178
224
|
expect(call).toBe(bannerSettings)
|
|
179
225
|
})
|
|
180
226
|
|
|
227
|
+
test('testShowFirstLayerWithInitCustomization', async () => {
|
|
228
|
+
const response = new UsercentricsConsentUserResponse(
|
|
229
|
+
"abc",
|
|
230
|
+
UsercentricsUserInteraction.acceptAll,
|
|
231
|
+
[]
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
RNUsercentricsModule.showFirstLayer.mockImplementationOnce(
|
|
235
|
+
(): Promise<any> => Promise.resolve(response)
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
const initCustomization = new BannerInitCustomization({
|
|
239
|
+
paddingTop: 16,
|
|
240
|
+
buttonBorderColor: "#004dcf",
|
|
241
|
+
purposeListStyle: PurposeListStyle.flat
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
const bannerSettings: BannerSettings = {
|
|
245
|
+
initCustomization
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const data = await Usercentrics.showFirstLayer(bannerSettings)
|
|
249
|
+
expect(data).toBe(response);
|
|
250
|
+
|
|
251
|
+
const calls = RNUsercentricsModule.showFirstLayer.mock.calls;
|
|
252
|
+
const call = calls[calls.length - 1][0];
|
|
253
|
+
expect(call).toBe(bannerSettings);
|
|
254
|
+
expect(call.initCustomization).toBe(initCustomization);
|
|
255
|
+
})
|
|
256
|
+
|
|
181
257
|
test('testRestoreUserSession', async () => {
|
|
182
258
|
const readyStatus = new UsercentricsReadyStatus(
|
|
183
259
|
true,
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export enum PurposeListStyle {
|
|
2
|
+
boxed = "BOXED",
|
|
3
|
+
flat = "FLAT"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated BannerInitCustomization is deprecated and will be removed in a future release.
|
|
8
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
9
|
+
*/
|
|
10
|
+
export class BannerInitCustomization {
|
|
11
|
+
|
|
12
|
+
paddingTop?: number;
|
|
13
|
+
paddingBottom?: number;
|
|
14
|
+
paddingStart?: number;
|
|
15
|
+
paddingEnd?: number;
|
|
16
|
+
lineSpacingMultiplier?: number;
|
|
17
|
+
titleFontSize?: number;
|
|
18
|
+
bodyFontSize?: number;
|
|
19
|
+
linkFontSize?: number;
|
|
20
|
+
titleFontBold?: boolean;
|
|
21
|
+
headerPaddingTop?: number;
|
|
22
|
+
headerPaddingSides?: number;
|
|
23
|
+
headerPaddingBetweenElements?: number;
|
|
24
|
+
buttonBorderColor?: string;
|
|
25
|
+
buttonBorderWidth?: number;
|
|
26
|
+
purposeListStyle?: PurposeListStyle;
|
|
27
|
+
stickyHeader?: boolean;
|
|
28
|
+
hideLanguageSwitcher?: boolean;
|
|
29
|
+
buttonHeightDp?: number;
|
|
30
|
+
buttonHorizontalPaddingDp?: number;
|
|
31
|
+
buttonSpacingDp?: number;
|
|
32
|
+
linkUnderline?: boolean;
|
|
33
|
+
showSecondLayerCloseButton?: boolean;
|
|
34
|
+
tabFontSize?: number;
|
|
35
|
+
tabActiveColor?: string;
|
|
36
|
+
denyAllButtonBackground?: string;
|
|
37
|
+
acceptAllButtonBackground?: string;
|
|
38
|
+
linkColor?: string;
|
|
39
|
+
|
|
40
|
+
constructor({
|
|
41
|
+
paddingTop = undefined,
|
|
42
|
+
paddingBottom = undefined,
|
|
43
|
+
paddingStart = undefined,
|
|
44
|
+
paddingEnd = undefined,
|
|
45
|
+
lineSpacingMultiplier = undefined,
|
|
46
|
+
titleFontSize = undefined,
|
|
47
|
+
bodyFontSize = undefined,
|
|
48
|
+
linkFontSize = undefined,
|
|
49
|
+
titleFontBold = undefined,
|
|
50
|
+
headerPaddingTop = undefined,
|
|
51
|
+
headerPaddingSides = undefined,
|
|
52
|
+
headerPaddingBetweenElements = undefined,
|
|
53
|
+
buttonBorderColor = undefined,
|
|
54
|
+
buttonBorderWidth = undefined,
|
|
55
|
+
purposeListStyle = undefined,
|
|
56
|
+
stickyHeader = undefined,
|
|
57
|
+
hideLanguageSwitcher = undefined,
|
|
58
|
+
buttonHeightDp = undefined,
|
|
59
|
+
buttonHorizontalPaddingDp = undefined,
|
|
60
|
+
buttonSpacingDp = undefined,
|
|
61
|
+
linkUnderline = undefined,
|
|
62
|
+
showSecondLayerCloseButton = undefined,
|
|
63
|
+
tabFontSize = undefined,
|
|
64
|
+
tabActiveColor = undefined,
|
|
65
|
+
denyAllButtonBackground = undefined,
|
|
66
|
+
acceptAllButtonBackground = undefined,
|
|
67
|
+
linkColor = undefined
|
|
68
|
+
}: {
|
|
69
|
+
paddingTop?: number,
|
|
70
|
+
paddingBottom?: number,
|
|
71
|
+
paddingStart?: number,
|
|
72
|
+
paddingEnd?: number,
|
|
73
|
+
lineSpacingMultiplier?: number,
|
|
74
|
+
titleFontSize?: number,
|
|
75
|
+
bodyFontSize?: number,
|
|
76
|
+
linkFontSize?: number,
|
|
77
|
+
titleFontBold?: boolean,
|
|
78
|
+
headerPaddingTop?: number,
|
|
79
|
+
headerPaddingSides?: number,
|
|
80
|
+
headerPaddingBetweenElements?: number,
|
|
81
|
+
buttonBorderColor?: string,
|
|
82
|
+
buttonBorderWidth?: number,
|
|
83
|
+
purposeListStyle?: PurposeListStyle,
|
|
84
|
+
stickyHeader?: boolean,
|
|
85
|
+
hideLanguageSwitcher?: boolean,
|
|
86
|
+
buttonHeightDp?: number,
|
|
87
|
+
buttonHorizontalPaddingDp?: number,
|
|
88
|
+
buttonSpacingDp?: number,
|
|
89
|
+
linkUnderline?: boolean,
|
|
90
|
+
showSecondLayerCloseButton?: boolean,
|
|
91
|
+
tabFontSize?: number,
|
|
92
|
+
tabActiveColor?: string,
|
|
93
|
+
denyAllButtonBackground?: string,
|
|
94
|
+
acceptAllButtonBackground?: string,
|
|
95
|
+
linkColor?: string
|
|
96
|
+
} = {}) {
|
|
97
|
+
this.paddingTop = paddingTop;
|
|
98
|
+
this.paddingBottom = paddingBottom;
|
|
99
|
+
this.paddingStart = paddingStart;
|
|
100
|
+
this.paddingEnd = paddingEnd;
|
|
101
|
+
this.lineSpacingMultiplier = lineSpacingMultiplier;
|
|
102
|
+
this.titleFontSize = titleFontSize;
|
|
103
|
+
this.bodyFontSize = bodyFontSize;
|
|
104
|
+
this.linkFontSize = linkFontSize;
|
|
105
|
+
this.titleFontBold = titleFontBold;
|
|
106
|
+
this.headerPaddingTop = headerPaddingTop;
|
|
107
|
+
this.headerPaddingSides = headerPaddingSides;
|
|
108
|
+
this.headerPaddingBetweenElements = headerPaddingBetweenElements;
|
|
109
|
+
this.buttonBorderColor = buttonBorderColor;
|
|
110
|
+
this.buttonBorderWidth = buttonBorderWidth;
|
|
111
|
+
this.purposeListStyle = purposeListStyle;
|
|
112
|
+
this.stickyHeader = stickyHeader;
|
|
113
|
+
this.hideLanguageSwitcher = hideLanguageSwitcher;
|
|
114
|
+
this.buttonHeightDp = buttonHeightDp;
|
|
115
|
+
this.buttonHorizontalPaddingDp = buttonHorizontalPaddingDp;
|
|
116
|
+
this.buttonSpacingDp = buttonSpacingDp;
|
|
117
|
+
this.linkUnderline = linkUnderline;
|
|
118
|
+
this.showSecondLayerCloseButton = showSecondLayerCloseButton;
|
|
119
|
+
this.tabFontSize = tabFontSize;
|
|
120
|
+
this.tabActiveColor = tabActiveColor;
|
|
121
|
+
this.denyAllButtonBackground = denyAllButtonBackground;
|
|
122
|
+
this.acceptAllButtonBackground = acceptAllButtonBackground;
|
|
123
|
+
this.linkColor = linkColor;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ImageResolvedAssetSource} from "react-native";
|
|
2
|
-
import {FirstLayerStyleSettings, SecondLayerStyleSettings} from ".";
|
|
2
|
+
import {BannerInitCustomization, FirstLayerStyleSettings, SecondLayerStyleSettings} from ".";
|
|
3
3
|
|
|
4
4
|
export class BannerLogo {
|
|
5
5
|
|
|
@@ -107,11 +107,17 @@ export class BannerSettings {
|
|
|
107
107
|
secondLayerStyleSettings?: SecondLayerStyleSettings;
|
|
108
108
|
generalStyleSettings?: GeneralStyleSettings;
|
|
109
109
|
variantName?: String
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated initCustomization is deprecated and will be removed in a future release.
|
|
112
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
113
|
+
*/
|
|
114
|
+
initCustomization?: BannerInitCustomization;
|
|
110
115
|
|
|
111
|
-
constructor(firstLayerStyleSettings?: FirstLayerStyleSettings, secondLayerStyleSettings?: SecondLayerStyleSettings, generalStyleSettings?: GeneralStyleSettings, variantName?: String) {
|
|
116
|
+
constructor(firstLayerStyleSettings?: FirstLayerStyleSettings, secondLayerStyleSettings?: SecondLayerStyleSettings, generalStyleSettings?: GeneralStyleSettings, variantName?: String, initCustomization?: BannerInitCustomization) {
|
|
112
117
|
this.firstLayerStyleSettings = firstLayerStyleSettings;
|
|
113
118
|
this.secondLayerStyleSettings = secondLayerStyleSettings;
|
|
114
119
|
this.generalStyleSettings = generalStyleSettings;
|
|
115
120
|
this.variantName = variantName;
|
|
121
|
+
this.initCustomization = initCustomization;
|
|
116
122
|
}
|
|
117
123
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {NetworkMode, UsercentricsLoggerLevel} from ".";
|
|
1
|
+
import {BannerInitCustomization, NetworkMode, UsercentricsLoggerLevel} from ".";
|
|
2
2
|
|
|
3
3
|
export class UsercentricsOptions {
|
|
4
4
|
settingsId?: string;
|
|
@@ -10,6 +10,11 @@ export class UsercentricsOptions {
|
|
|
10
10
|
networkMode?: NetworkMode;
|
|
11
11
|
consentMediation?: Boolean;
|
|
12
12
|
initTimeoutMillis?: number;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated bannerCustomization is deprecated and will be removed in a future release.
|
|
15
|
+
* Configure banner appearance via the Usercentrics dashboard instead.
|
|
16
|
+
*/
|
|
17
|
+
bannerCustomization?: BannerInitCustomization;
|
|
13
18
|
|
|
14
19
|
constructor({
|
|
15
20
|
settingsId = "",
|
|
@@ -20,7 +25,8 @@ export class UsercentricsOptions {
|
|
|
20
25
|
version = undefined,
|
|
21
26
|
networkMode = undefined,
|
|
22
27
|
consentMediation = undefined,
|
|
23
|
-
initTimeoutMillis = undefined
|
|
28
|
+
initTimeoutMillis = undefined,
|
|
29
|
+
bannerCustomization = undefined
|
|
24
30
|
}: {
|
|
25
31
|
settingsId?: string,
|
|
26
32
|
ruleSetId?: string,
|
|
@@ -30,7 +36,8 @@ export class UsercentricsOptions {
|
|
|
30
36
|
version?: string,
|
|
31
37
|
networkMode?: NetworkMode,
|
|
32
38
|
consentMediation?: Boolean,
|
|
33
|
-
initTimeoutMillis?: number
|
|
39
|
+
initTimeoutMillis?: number,
|
|
40
|
+
bannerCustomization?: BannerInitCustomization
|
|
34
41
|
}) {
|
|
35
42
|
this.settingsId = settingsId;
|
|
36
43
|
this.ruleSetId = ruleSetId;
|
|
@@ -41,5 +48,6 @@ export class UsercentricsOptions {
|
|
|
41
48
|
this.networkMode = networkMode
|
|
42
49
|
this.consentMediation = consentMediation
|
|
43
50
|
this.initTimeoutMillis = initTimeoutMillis
|
|
51
|
+
this.bannerCustomization = bannerCustomization
|
|
44
52
|
}
|
|
45
53
|
}
|
package/src/models/index.tsx
CHANGED