@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.
Files changed (145) hide show
  1. package/README.dev.md +237 -12
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +147 -64
  4. package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKPackage.kt +0 -1
  5. package/ios/OsanoCmpSDK.mm +33 -3
  6. package/ios/OsanoCmpSdk.h +0 -7
  7. package/lib/commonjs/ConsentManager.js +32 -4
  8. package/lib/commonjs/ConsentManager.js.map +1 -1
  9. package/lib/commonjs/components/Button.js +105 -95
  10. package/lib/commonjs/components/Button.js.map +1 -1
  11. package/lib/commonjs/components/Locale.js +5 -3
  12. package/lib/commonjs/components/Locale.js.map +1 -1
  13. package/lib/commonjs/index.js +1 -1
  14. package/lib/commonjs/index.js.map +1 -1
  15. package/lib/commonjs/native/OsanoCmp.js +35 -8
  16. package/lib/commonjs/native/OsanoCmp.js.map +1 -1
  17. package/lib/commonjs/native/OsanoCmpSdkSpec.js +9 -0
  18. package/lib/commonjs/native/OsanoCmpSdkSpec.js.map +1 -0
  19. package/lib/commonjs/services/consent.js +6 -2
  20. package/lib/commonjs/services/consent.js.map +1 -1
  21. package/lib/commonjs/utils/ExpoDetector.js +105 -0
  22. package/lib/commonjs/utils/ExpoDetector.js.map +1 -0
  23. package/lib/commonjs/utils/ExpoGoMemoryStorage.js +61 -0
  24. package/lib/commonjs/utils/ExpoGoMemoryStorage.js.map +1 -0
  25. package/lib/commonjs/views/Dialog/Buttons.js +26 -16
  26. package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
  27. package/lib/commonjs/views/Dialog/index.js +58 -95
  28. package/lib/commonjs/views/Dialog/index.js.map +1 -1
  29. package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +12 -13
  30. package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
  31. package/lib/commonjs/views/Drawer/Drawer.Header.js +2 -2
  32. package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
  33. package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +10 -1
  34. package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
  35. package/lib/commonjs/views/Drawer/index.js +5 -4
  36. package/lib/commonjs/views/Drawer/index.js.map +1 -1
  37. package/lib/module/ConsentManager.js +32 -4
  38. package/lib/module/ConsentManager.js.map +1 -1
  39. package/lib/module/components/Button.js +99 -88
  40. package/lib/module/components/Button.js.map +1 -1
  41. package/lib/module/components/Locale.js +4 -3
  42. package/lib/module/components/Locale.js.map +1 -1
  43. package/lib/module/index.js +1 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/native/OsanoCmp.js +34 -8
  46. package/lib/module/native/OsanoCmp.js.map +1 -1
  47. package/lib/module/native/OsanoCmpSdkSpec.js +3 -0
  48. package/lib/module/native/OsanoCmpSdkSpec.js.map +1 -0
  49. package/lib/module/services/consent.js +7 -3
  50. package/lib/module/services/consent.js.map +1 -1
  51. package/lib/module/utils/ExpoDetector.js +98 -0
  52. package/lib/module/utils/ExpoDetector.js.map +1 -0
  53. package/lib/module/utils/ExpoGoMemoryStorage.js +54 -0
  54. package/lib/module/utils/ExpoGoMemoryStorage.js.map +1 -0
  55. package/lib/module/views/Dialog/Buttons.js +27 -17
  56. package/lib/module/views/Dialog/Buttons.js.map +1 -1
  57. package/lib/module/views/Dialog/index.js +59 -96
  58. package/lib/module/views/Dialog/index.js.map +1 -1
  59. package/lib/module/views/Drawer/Drawer.ConsentCategories.js +10 -12
  60. package/lib/module/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
  61. package/lib/module/views/Drawer/Drawer.Header.js +2 -2
  62. package/lib/module/views/Drawer/Drawer.Header.js.map +1 -1
  63. package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js +10 -1
  64. package/lib/module/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
  65. package/lib/module/views/Drawer/index.js +6 -6
  66. package/lib/module/views/Drawer/index.js.map +1 -1
  67. package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -1
  68. package/lib/typescript/lib/commonjs/components/Button.d.ts +4 -4
  69. package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -1
  70. package/lib/typescript/lib/commonjs/components/Locale.d.ts.map +1 -1
  71. package/lib/typescript/lib/commonjs/hooks/useDeviceOrientation.d.ts +1 -1
  72. package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -1
  73. package/lib/typescript/lib/commonjs/native/OsanoCmpSdkSpec.d.ts +5 -0
  74. package/lib/typescript/lib/commonjs/native/OsanoCmpSdkSpec.d.ts.map +1 -0
  75. package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -1
  76. package/lib/typescript/lib/commonjs/utils/ExpoDetector.d.ts +28 -0
  77. package/lib/typescript/lib/commonjs/utils/ExpoDetector.d.ts.map +1 -0
  78. package/lib/typescript/lib/commonjs/utils/ExpoGoMemoryStorage.d.ts +22 -0
  79. package/lib/typescript/lib/commonjs/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
  80. package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -1
  81. package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -1
  82. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
  83. package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
  84. package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -1
  85. package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/components/Button.d.ts +7 -7
  87. package/lib/typescript/lib/module/components/Button.d.ts.map +1 -1
  88. package/lib/typescript/lib/module/components/Locale.d.ts +4 -1
  89. package/lib/typescript/lib/module/components/Locale.d.ts.map +1 -1
  90. package/lib/typescript/lib/module/hooks/useDeviceOrientation.d.ts +1 -1
  91. package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -1
  92. package/lib/typescript/lib/module/native/OsanoCmpSdkSpec.d.ts +3 -0
  93. package/lib/typescript/lib/module/native/OsanoCmpSdkSpec.d.ts.map +1 -0
  94. package/lib/typescript/lib/module/services/consent.d.ts.map +1 -1
  95. package/lib/typescript/lib/module/utils/ExpoDetector.d.ts +27 -0
  96. package/lib/typescript/lib/module/utils/ExpoDetector.d.ts.map +1 -0
  97. package/lib/typescript/lib/module/utils/ExpoGoMemoryStorage.d.ts +21 -0
  98. package/lib/typescript/lib/module/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
  99. package/lib/typescript/lib/module/views/Dialog/Buttons.d.ts.map +1 -1
  100. package/lib/typescript/lib/module/views/Dialog/index.d.ts.map +1 -1
  101. package/lib/typescript/lib/module/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
  102. package/lib/typescript/lib/module/views/Drawer/Drawer.Header.d.ts.map +1 -1
  103. package/lib/typescript/lib/module/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
  104. package/lib/typescript/lib/module/views/Drawer/index.d.ts.map +1 -1
  105. package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
  106. package/lib/typescript/src/components/Button.d.ts +7 -7
  107. package/lib/typescript/src/components/Button.d.ts.map +1 -1
  108. package/lib/typescript/src/components/Locale.d.ts +2 -1
  109. package/lib/typescript/src/components/Locale.d.ts.map +1 -1
  110. package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -1
  111. package/lib/typescript/src/native/OsanoCmpSdkSpec.d.ts +17 -0
  112. package/lib/typescript/src/native/OsanoCmpSdkSpec.d.ts.map +1 -0
  113. package/lib/typescript/src/services/consent.d.ts.map +1 -1
  114. package/lib/typescript/src/utils/ExpoDetector.d.ts +29 -0
  115. package/lib/typescript/src/utils/ExpoDetector.d.ts.map +1 -0
  116. package/lib/typescript/src/utils/ExpoGoMemoryStorage.d.ts +21 -0
  117. package/lib/typescript/src/utils/ExpoGoMemoryStorage.d.ts.map +1 -0
  118. package/lib/typescript/src/views/Dialog/Buttons.d.ts +4 -2
  119. package/lib/typescript/src/views/Dialog/Buttons.d.ts.map +1 -1
  120. package/lib/typescript/src/views/Dialog/index.d.ts +1 -1
  121. package/lib/typescript/src/views/Dialog/index.d.ts.map +1 -1
  122. package/lib/typescript/src/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
  123. package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts +1 -1
  124. package/lib/typescript/src/views/Drawer/Drawer.Header.d.ts.map +1 -1
  125. package/lib/typescript/src/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
  126. package/lib/typescript/src/views/Drawer/index.d.ts.map +1 -1
  127. package/osano-cmp-sdk.podspec +15 -15
  128. package/package.json +28 -3
  129. package/src/ConsentManager.ts +37 -4
  130. package/src/components/Button.tsx +122 -88
  131. package/src/components/Locale.tsx +28 -28
  132. package/src/constants.ts +2 -2
  133. package/src/index.tsx +1 -1
  134. package/src/native/OsanoCmp.ts +39 -23
  135. package/src/native/OsanoCmpSdkSpec.ts +25 -0
  136. package/src/services/consent.ts +9 -3
  137. package/src/utils/ExpoDetector.ts +114 -0
  138. package/src/utils/ExpoGoMemoryStorage.ts +61 -0
  139. package/src/views/Dialog/Buttons.tsx +33 -23
  140. package/src/views/Dialog/index.tsx +164 -208
  141. package/src/views/Drawer/Drawer.ConsentCategories.tsx +25 -25
  142. package/src/views/Drawer/Drawer.Header.tsx +7 -7
  143. package/src/views/Drawer/Drawer.Iab.Disclosures.tsx +6 -3
  144. package/src/views/Drawer/index.tsx +20 -19
  145. 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}
@@ -1,2 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>