@osano/osano-cmp-react-native 0.13.0 → 0.15.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.dev.md +237 -12
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +147 -64
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKPackage.kt +0 -1
- package/ios/OsanoCmpSDK.mm +33 -3
- package/ios/OsanoCmpSdk.h +0 -7
- package/lib/commonjs/ConsentManager.js +32 -4
- package/lib/commonjs/ConsentManager.js.map +1 -1
- package/lib/commonjs/components/Button.js +105 -95
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Locale.js +5 -3
- package/lib/commonjs/components/Locale.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native/OsanoCmp.js +35 -8
- package/lib/commonjs/native/OsanoCmp.js.map +1 -1
- package/lib/commonjs/native/OsanoCmpSdkSpec.js +9 -0
- package/lib/commonjs/native/OsanoCmpSdkSpec.js.map +1 -0
- package/lib/commonjs/services/consent.js +6 -2
- package/lib/commonjs/services/consent.js.map +1 -1
- package/lib/commonjs/utils/ExpoDetector.js +105 -0
- package/lib/commonjs/utils/ExpoDetector.js.map +1 -0
- package/lib/commonjs/utils/ExpoGoMemoryStorage.js +61 -0
- package/lib/commonjs/utils/ExpoGoMemoryStorage.js.map +1 -0
- package/lib/commonjs/views/Dialog/Buttons.js +26 -16
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
- package/lib/commonjs/views/Dialog/index.js +58 -95
- package/lib/commonjs/views/Dialog/index.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +12 -13
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Header.js +2 -2
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +10 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/commonjs/views/Drawer/index.js +5 -4
- package/lib/commonjs/views/Drawer/index.js.map +1 -1
- package/lib/module/ConsentManager.js +32 -4
- package/lib/module/ConsentManager.js.map +1 -1
- package/lib/module/components/Button.js +99 -88
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/components/Locale.js +4 -3
- package/lib/module/components/Locale.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/OsanoCmp.js +34 -8
- package/lib/module/native/OsanoCmp.js.map +1 -1
- package/lib/module/native/OsanoCmpSdkSpec.js +3 -0
- package/lib/module/native/OsanoCmpSdkSpec.js.map +1 -0
- package/lib/module/services/consent.js +7 -3
- package/lib/module/services/consent.js.map +1 -1
- package/lib/module/utils/ExpoDetector.js +98 -0
- package/lib/module/utils/ExpoDetector.js.map +1 -0
- package/lib/module/utils/ExpoGoMemoryStorage.js +54 -0
- package/lib/module/utils/ExpoGoMemoryStorage.js.map +1 -0
- package/lib/module/views/Dialog/Buttons.js +27 -17
- package/lib/module/views/Dialog/Buttons.js.map +1 -1
- package/lib/module/views/Dialog/index.js +59 -96
- package/lib/module/views/Dialog/index.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js +10 -12
- package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.Header.js +2 -2
- package/lib/module/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +10 -1
- package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/module/views/Drawer/index.js +6 -6
- package/lib/module/views/Drawer/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Button.d.ts +4 -4
- package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Locale.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts +1 -1
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/native/OsanoCmpSdkSpec.d.ts +5 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmpSdkSpec.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/ExpoDetector.d.ts +28 -0
- package/lib/typescript/lib/commonjs/utils/ExpoDetector.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/ExpoGoMemoryStorage.d.ts +22 -0
- package/lib/typescript/lib/commonjs/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/Button.d.ts +7 -7
- package/lib/typescript/lib/module/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/Locale.d.ts +4 -1
- package/lib/typescript/lib/module/components/Locale.d.ts.map +1 -1
- package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts +1 -1
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/module/native/OsanoCmpSdkSpec.d.ts +3 -0
- package/lib/typescript/lib/module/native/OsanoCmpSdkSpec.d.ts.map +1 -0
- package/lib/typescript/lib/module/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/ExpoDetector.d.ts +27 -0
- package/lib/typescript/lib/module/utils/ExpoDetector.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/ExpoGoMemoryStorage.d.ts +21 -0
- package/lib/typescript/lib/module/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
- package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/lib/module/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/lib/module/views/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/src/components/Button.d.ts +7 -7
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Locale.d.ts +2 -1
- package/lib/typescript/src/components/Locale.d.ts.map +1 -1
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/src/native/OsanoCmpSdkSpec.d.ts +17 -0
- package/lib/typescript/src/native/OsanoCmpSdkSpec.d.ts.map +1 -0
- package/lib/typescript/src/services/consent.d.ts.map +1 -1
- package/lib/typescript/src/utils/ExpoDetector.d.ts +29 -0
- package/lib/typescript/src/utils/ExpoDetector.d.ts.map +1 -0
- package/lib/typescript/src/utils/ExpoGoMemoryStorage.d.ts +21 -0
- package/lib/typescript/src/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
- package/lib/typescript/src/views/Dialog/Buttons.d.ts +4 -2
- package/lib/typescript/src/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/src/views/Dialog/index.d.ts +1 -1
- package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/src/views/Drawer/index.d.ts.map +1 -1
- package/osano-cmp-sdk.podspec +15 -15
- package/package.json +28 -3
- package/src/ConsentManager.ts +37 -4
- package/src/components/Button.tsx +122 -88
- package/src/components/Locale.tsx +28 -28
- package/src/constants.ts +2 -2
- package/src/index.tsx +1 -1
- package/src/native/OsanoCmp.ts +39 -23
- package/src/native/OsanoCmpSdkSpec.ts +25 -0
- package/src/services/consent.ts +9 -3
- package/src/utils/ExpoDetector.ts +114 -0
- package/src/utils/ExpoGoMemoryStorage.ts +61 -0
- package/src/views/Dialog/Buttons.tsx +33 -23
- package/src/views/Dialog/index.tsx +164 -208
- package/src/views/Drawer/Drawer.ConsentCategories.tsx +25 -25
- package/src/views/Drawer/Drawer.Header.tsx +7 -7
- package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +6 -3
- package/src/views/Drawer/index.tsx +20 -19
- package/android/src/main/AndroidManifestNew.xml +0 -2
|
@@ -1,38 +1,38 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useContext,
|
|
4
|
+
useLayoutEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
} from 'react';
|
|
1
8
|
import {
|
|
2
9
|
Animated,
|
|
3
10
|
Easing,
|
|
11
|
+
type GestureResponderEvent,
|
|
4
12
|
type LayoutChangeEvent,
|
|
5
13
|
Modal,
|
|
14
|
+
type NativePointerEvent,
|
|
15
|
+
type NativeSyntheticEvent,
|
|
6
16
|
Platform,
|
|
7
17
|
SafeAreaView,
|
|
8
18
|
type StyleProp,
|
|
9
19
|
StyleSheet,
|
|
10
20
|
type ViewStyle,
|
|
11
|
-
type NativeSyntheticEvent,
|
|
12
|
-
type GestureResponderEvent,
|
|
13
|
-
type NativePointerEvent,
|
|
14
21
|
} from 'react-native';
|
|
15
|
-
import React, {
|
|
16
|
-
useCallback,
|
|
17
|
-
useContext,
|
|
18
|
-
useLayoutEffect,
|
|
19
|
-
useMemo,
|
|
20
|
-
useRef,
|
|
21
|
-
} from 'react';
|
|
22
|
-
import { close } from '../../actions';
|
|
23
|
-
import { getStack } from '../../selectors';
|
|
24
22
|
import {
|
|
23
|
+
close,
|
|
25
24
|
SHOW_DRAWER,
|
|
26
25
|
SHOW_IAB_DISCLOSURES,
|
|
27
26
|
SHOW_IAB_VENDORS,
|
|
28
27
|
} from '../../actions';
|
|
28
|
+
import { getStack } from '../../selectors';
|
|
29
29
|
|
|
30
30
|
import { CloseButton } from '../../components/Button';
|
|
31
|
+
import { OsanoPrivateContext } from '../../context';
|
|
32
|
+
import Translator from '../../utils/Translator';
|
|
31
33
|
import ConsentCategoriesDrawer from './Drawer.ConsentCategories';
|
|
32
34
|
import IabDisclosuresDrawer from './Drawer.Iab.Disclosures';
|
|
33
35
|
import IabVendorsDrawer from './Drawer.Iab.Vendors';
|
|
34
|
-
import { OsanoPrivateContext } from '../../context';
|
|
35
|
-
import Translator from '../../utils/Translator';
|
|
36
36
|
|
|
37
37
|
type DrawerProps = React.PropsWithChildren<object>;
|
|
38
38
|
|
|
@@ -76,12 +76,12 @@ export const Drawer: React.FC<DrawerProps> = () => {
|
|
|
76
76
|
Platform.OS === 'web'
|
|
77
77
|
? maxWebDrawerWidth
|
|
78
78
|
: Number.MAX_SAFE_INTEGER,
|
|
79
|
-
width
|
|
79
|
+
width,
|
|
80
80
|
)
|
|
81
81
|
: width;
|
|
82
82
|
setLayoutWidth(newWidth);
|
|
83
83
|
},
|
|
84
|
-
[initialPositionX]
|
|
84
|
+
[initialPositionX],
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
const drawerRange = useMemo(
|
|
@@ -91,7 +91,7 @@ export const Drawer: React.FC<DrawerProps> = () => {
|
|
|
91
91
|
extrapolateLeft: 'clamp' as Animated.ExtrapolateType,
|
|
92
92
|
extrapolateRight: 'clamp' as Animated.ExtrapolateType,
|
|
93
93
|
}),
|
|
94
|
-
[layoutWidth, infoDialogPosition]
|
|
94
|
+
[layoutWidth, infoDialogPosition],
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
useLayoutEffect(() => {
|
|
@@ -145,7 +145,7 @@ export const Drawer: React.FC<DrawerProps> = () => {
|
|
|
145
145
|
e:
|
|
146
146
|
| NativeSyntheticEvent<NativePointerEvent>
|
|
147
147
|
| PointerEvent
|
|
148
|
-
| GestureResponderEvent
|
|
148
|
+
| GestureResponderEvent,
|
|
149
149
|
) => {
|
|
150
150
|
if (e && e.target) {
|
|
151
151
|
if (e.target === overlayRef.current) {
|
|
@@ -155,7 +155,7 @@ export const Drawer: React.FC<DrawerProps> = () => {
|
|
|
155
155
|
dispatch(close(cmp));
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
[]
|
|
158
|
+
[],
|
|
159
159
|
);
|
|
160
160
|
const drawerStyles = useMemo(() => {
|
|
161
161
|
return {
|
|
@@ -196,6 +196,7 @@ export const Drawer: React.FC<DrawerProps> = () => {
|
|
|
196
196
|
visible={stack.length > 0}
|
|
197
197
|
onRequestClose={handleClose}
|
|
198
198
|
transparent={Platform.OS === 'web' ? true : false}
|
|
199
|
+
supportedOrientations={['portrait', 'landscape']}
|
|
199
200
|
>
|
|
200
201
|
<SafeAreaView
|
|
201
202
|
ref={overlayRef}
|