react-native-applovin-max 6.5.0 → 7.0.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.
Files changed (238) hide show
  1. package/android/build.gradle +46 -100
  2. package/android/gradle.properties +4 -4
  3. package/android/src/main/AndroidManifest.xml +2 -2
  4. package/android/src/main/AndroidManifestNew.xml +2 -0
  5. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +123 -163
  6. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +24 -17
  7. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +242 -0
  8. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModule.java +297 -336
  9. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +13 -12
  10. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +11 -14
  11. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXPackage.java +3 -3
  12. package/ios/AppLovinMAX.h +1 -1
  13. package/ios/AppLovinMAX.m +62 -12
  14. package/ios/AppLovinMAXAdView.h +12 -0
  15. package/ios/AppLovinMAXAdView.m +120 -142
  16. package/ios/AppLovinMAXAdViewUIComponent.h +27 -0
  17. package/ios/AppLovinMAXAdViewUIComponent.m +199 -0
  18. package/lib/commonjs/AdView.js +348 -0
  19. package/lib/commonjs/AdView.js.map +1 -0
  20. package/lib/commonjs/AppLovinMAX.js +52 -0
  21. package/lib/commonjs/AppLovinMAX.js.map +1 -0
  22. package/lib/commonjs/AppOpenAd.js +102 -0
  23. package/lib/commonjs/AppOpenAd.js.map +1 -0
  24. package/lib/commonjs/BannerAd.js +139 -0
  25. package/lib/commonjs/BannerAd.js.map +1 -0
  26. package/lib/commonjs/EventEmitter.js +32 -0
  27. package/lib/commonjs/EventEmitter.js.map +1 -0
  28. package/lib/commonjs/InterstitialAd.js +102 -0
  29. package/lib/commonjs/InterstitialAd.js.map +1 -0
  30. package/lib/commonjs/MRecAd.js +117 -0
  31. package/lib/commonjs/MRecAd.js.map +1 -0
  32. package/lib/commonjs/Privacy.js +12 -0
  33. package/lib/commonjs/Privacy.js.map +1 -0
  34. package/lib/commonjs/RewardedAd.js +116 -0
  35. package/lib/commonjs/RewardedAd.js.map +1 -0
  36. package/lib/commonjs/TargetingData.js +179 -0
  37. package/lib/commonjs/TargetingData.js.map +1 -0
  38. package/lib/commonjs/index.js +256 -0
  39. package/lib/commonjs/index.js.map +1 -0
  40. package/lib/commonjs/nativeAd/NativeAdView.js +147 -0
  41. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -0
  42. package/lib/commonjs/nativeAd/NativeAdViewComponents.js +197 -0
  43. package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -0
  44. package/lib/commonjs/nativeAd/NativeAdViewProvider.js +37 -0
  45. package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -0
  46. package/lib/commonjs/types/AdEvent.js +6 -0
  47. package/lib/commonjs/types/AdEvent.js.map +1 -0
  48. package/lib/commonjs/types/AdInfo.js +48 -0
  49. package/lib/commonjs/types/AdInfo.js.map +1 -0
  50. package/lib/commonjs/types/AdProps.js +6 -0
  51. package/lib/commonjs/types/AdProps.js.map +1 -0
  52. package/lib/commonjs/types/AdViewProps.js +6 -0
  53. package/lib/commonjs/types/AdViewProps.js.map +1 -0
  54. package/lib/commonjs/types/AppLovinMAX.js +6 -0
  55. package/lib/commonjs/types/AppLovinMAX.js.map +1 -0
  56. package/lib/commonjs/types/AppOpenAd.js +6 -0
  57. package/lib/commonjs/types/AppOpenAd.js.map +1 -0
  58. package/lib/commonjs/types/BannerAd.js +6 -0
  59. package/lib/commonjs/types/BannerAd.js.map +1 -0
  60. package/lib/commonjs/types/CMPError.js +6 -0
  61. package/lib/commonjs/types/CMPError.js.map +1 -0
  62. package/lib/commonjs/types/Configuration.js +6 -0
  63. package/lib/commonjs/types/Configuration.js.map +1 -0
  64. package/lib/commonjs/types/FullscreenAd.js +6 -0
  65. package/lib/commonjs/types/FullscreenAd.js.map +1 -0
  66. package/lib/commonjs/types/InterstitialAd.js +6 -0
  67. package/lib/commonjs/types/InterstitialAd.js.map +1 -0
  68. package/lib/commonjs/types/MRecAd.js +6 -0
  69. package/lib/commonjs/types/MRecAd.js.map +1 -0
  70. package/lib/commonjs/types/NativeAd.js +2 -0
  71. package/lib/commonjs/types/NativeAd.js.map +1 -0
  72. package/lib/commonjs/types/NativeAdViewProps.js +6 -0
  73. package/lib/commonjs/types/NativeAdViewProps.js.map +1 -0
  74. package/lib/commonjs/types/Privacy.js +2 -0
  75. package/lib/commonjs/types/Privacy.js.map +1 -0
  76. package/lib/commonjs/types/RewardedAd.js +6 -0
  77. package/lib/commonjs/types/RewardedAd.js.map +1 -0
  78. package/lib/commonjs/types/TargetingData.js +6 -0
  79. package/lib/commonjs/types/TargetingData.js.map +1 -0
  80. package/lib/commonjs/types/ViewAd.js +6 -0
  81. package/lib/commonjs/types/ViewAd.js.map +1 -0
  82. package/lib/commonjs/types/index.js +61 -0
  83. package/lib/commonjs/types/index.js.map +1 -0
  84. package/lib/module/AdView.js +335 -0
  85. package/lib/module/AdView.js.map +1 -0
  86. package/lib/module/AppLovinMAX.js +48 -0
  87. package/lib/module/AppLovinMAX.js.map +1 -0
  88. package/lib/module/AppOpenAd.js +96 -0
  89. package/lib/module/AppOpenAd.js.map +1 -0
  90. package/lib/module/BannerAd.js +133 -0
  91. package/lib/module/BannerAd.js.map +1 -0
  92. package/lib/module/EventEmitter.js +24 -0
  93. package/lib/module/EventEmitter.js.map +1 -0
  94. package/lib/module/InterstitialAd.js +96 -0
  95. package/lib/module/InterstitialAd.js.map +1 -0
  96. package/lib/module/MRecAd.js +111 -0
  97. package/lib/module/MRecAd.js.map +1 -0
  98. package/lib/module/Privacy.js +6 -0
  99. package/lib/module/Privacy.js.map +1 -0
  100. package/lib/module/RewardedAd.js +110 -0
  101. package/lib/module/RewardedAd.js.map +1 -0
  102. package/lib/module/TargetingData.js +175 -0
  103. package/lib/module/TargetingData.js.map +1 -0
  104. package/lib/module/index.js +14 -0
  105. package/lib/module/index.js.map +1 -0
  106. package/lib/module/nativeAd/NativeAdView.js +139 -0
  107. package/lib/module/nativeAd/NativeAdView.js.map +1 -0
  108. package/lib/module/nativeAd/NativeAdViewComponents.js +181 -0
  109. package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -0
  110. package/lib/module/nativeAd/NativeAdViewProvider.js +28 -0
  111. package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -0
  112. package/lib/module/types/AdEvent.js +2 -0
  113. package/lib/module/types/AdEvent.js.map +1 -0
  114. package/lib/module/types/AdInfo.js +52 -0
  115. package/lib/module/types/AdInfo.js.map +1 -0
  116. package/lib/module/types/AdProps.js +2 -0
  117. package/lib/module/types/AdProps.js.map +1 -0
  118. package/lib/module/types/AdViewProps.js +2 -0
  119. package/lib/module/types/AdViewProps.js.map +1 -0
  120. package/lib/module/types/AppLovinMAX.js +2 -0
  121. package/lib/module/types/AppLovinMAX.js.map +1 -0
  122. package/lib/module/types/AppOpenAd.js +2 -0
  123. package/lib/module/types/AppOpenAd.js.map +1 -0
  124. package/lib/module/types/BannerAd.js +2 -0
  125. package/lib/module/types/BannerAd.js.map +1 -0
  126. package/lib/module/types/CMPError.js +2 -0
  127. package/lib/module/types/CMPError.js.map +1 -0
  128. package/lib/module/types/Configuration.js +2 -0
  129. package/lib/module/types/Configuration.js.map +1 -0
  130. package/lib/module/types/FullscreenAd.js +2 -0
  131. package/lib/module/types/FullscreenAd.js.map +1 -0
  132. package/lib/module/types/InterstitialAd.js +2 -0
  133. package/lib/module/types/InterstitialAd.js.map +1 -0
  134. package/lib/module/types/MRecAd.js +2 -0
  135. package/lib/module/types/MRecAd.js.map +1 -0
  136. package/lib/module/types/NativeAd.js +2 -0
  137. package/lib/module/types/NativeAd.js.map +1 -0
  138. package/lib/module/types/NativeAdViewProps.js +2 -0
  139. package/lib/module/types/NativeAdViewProps.js.map +1 -0
  140. package/lib/module/types/Privacy.js +2 -0
  141. package/lib/module/types/Privacy.js.map +1 -0
  142. package/lib/module/types/RewardedAd.js +2 -0
  143. package/lib/module/types/RewardedAd.js.map +1 -0
  144. package/lib/module/types/TargetingData.js +2 -0
  145. package/lib/module/types/TargetingData.js.map +1 -0
  146. package/lib/module/types/ViewAd.js +2 -0
  147. package/lib/module/types/ViewAd.js.map +1 -0
  148. package/lib/module/types/index.js +6 -0
  149. package/lib/module/types/index.js.map +1 -0
  150. package/lib/typescript/src/AdView.d.ts +115 -0
  151. package/lib/typescript/src/AdView.d.ts.map +1 -0
  152. package/lib/typescript/src/AppLovinMAX.d.ts +73 -0
  153. package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -0
  154. package/lib/typescript/src/AppOpenAd.d.ts +4 -0
  155. package/lib/typescript/src/AppOpenAd.d.ts.map +1 -0
  156. package/lib/typescript/src/BannerAd.d.ts +4 -0
  157. package/lib/typescript/src/BannerAd.d.ts.map +1 -0
  158. package/lib/typescript/src/EventEmitter.d.ts +4 -0
  159. package/lib/typescript/src/EventEmitter.d.ts.map +1 -0
  160. package/lib/typescript/src/InterstitialAd.d.ts +4 -0
  161. package/lib/typescript/src/InterstitialAd.d.ts.map +1 -0
  162. package/lib/typescript/src/MRecAd.d.ts +4 -0
  163. package/lib/typescript/src/MRecAd.d.ts.map +1 -0
  164. package/lib/typescript/src/Privacy.d.ts +3 -0
  165. package/lib/typescript/src/Privacy.d.ts.map +1 -0
  166. package/lib/typescript/src/RewardedAd.d.ts +4 -0
  167. package/lib/typescript/src/RewardedAd.d.ts.map +1 -0
  168. package/lib/typescript/src/TargetingData.d.ts +26 -0
  169. package/lib/typescript/src/TargetingData.d.ts.map +1 -0
  170. package/lib/typescript/src/index.d.ts +14 -0
  171. package/lib/typescript/src/index.d.ts.map +1 -0
  172. package/lib/typescript/src/nativeAd/NativeAdView.d.ts +42 -0
  173. package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -0
  174. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts +11 -0
  175. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -0
  176. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +16 -0
  177. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -0
  178. package/lib/typescript/src/types/AdEvent.d.ts +15 -0
  179. package/lib/typescript/src/types/AdEvent.d.ts.map +1 -0
  180. package/lib/typescript/src/types/AdInfo.d.ts +295 -0
  181. package/lib/typescript/src/types/AdInfo.d.ts.map +1 -0
  182. package/lib/typescript/src/types/AdProps.d.ts +58 -0
  183. package/lib/typescript/src/types/AdProps.d.ts.map +1 -0
  184. package/lib/typescript/src/types/AdViewProps.d.ts +73 -0
  185. package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -0
  186. package/lib/typescript/src/types/AppLovinMAX.d.ts +133 -0
  187. package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -0
  188. package/lib/typescript/src/types/AppOpenAd.d.ts +3 -0
  189. package/lib/typescript/src/types/AppOpenAd.d.ts.map +1 -0
  190. package/lib/typescript/src/types/BannerAd.d.ts +42 -0
  191. package/lib/typescript/src/types/BannerAd.d.ts.map +1 -0
  192. package/lib/typescript/src/types/CMPError.d.ts +20 -0
  193. package/lib/typescript/src/types/CMPError.d.ts.map +1 -0
  194. package/lib/typescript/src/types/Configuration.d.ts +33 -0
  195. package/lib/typescript/src/types/Configuration.d.ts.map +1 -0
  196. package/lib/typescript/src/types/FullscreenAd.d.ts +123 -0
  197. package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -0
  198. package/lib/typescript/src/types/InterstitialAd.d.ts +3 -0
  199. package/lib/typescript/src/types/InterstitialAd.d.ts.map +1 -0
  200. package/lib/typescript/src/types/MRecAd.d.ts +12 -0
  201. package/lib/typescript/src/types/MRecAd.d.ts.map +1 -0
  202. package/lib/typescript/src/types/NativeAd.d.ts +42 -0
  203. package/lib/typescript/src/types/NativeAd.d.ts.map +1 -0
  204. package/lib/typescript/src/types/NativeAdViewProps.d.ts +15 -0
  205. package/lib/typescript/src/types/NativeAdViewProps.d.ts.map +1 -0
  206. package/lib/typescript/src/types/Privacy.d.ts +35 -0
  207. package/lib/typescript/src/types/Privacy.d.ts.map +1 -0
  208. package/lib/typescript/src/types/RewardedAd.d.ts +18 -0
  209. package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -0
  210. package/lib/typescript/src/types/TargetingData.d.ts +43 -0
  211. package/lib/typescript/src/types/TargetingData.d.ts.map +1 -0
  212. package/lib/typescript/src/types/ViewAd.d.ts +141 -0
  213. package/lib/typescript/src/types/ViewAd.d.ts.map +1 -0
  214. package/lib/typescript/src/types/index.d.ts +6 -0
  215. package/lib/typescript/src/types/index.d.ts.map +1 -0
  216. package/package.json +102 -21
  217. package/react-native-applovin-max.podspec +29 -5
  218. package/src/AdView.tsx +83 -26
  219. package/src/AppLovinMAX.ts +1 -1
  220. package/src/InterstitialAd.ts +1 -3
  221. package/src/MRecAd.ts +2 -8
  222. package/src/TargetingData.ts +2 -15
  223. package/src/index.ts +9 -10
  224. package/src/nativeAd/NativeAdView.tsx +33 -49
  225. package/src/nativeAd/NativeAdViewComponents.tsx +22 -31
  226. package/src/types/AdViewProps.ts +29 -1
  227. package/android/.project +0 -17
  228. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  229. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  230. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  231. package/android/gradlew +0 -172
  232. package/android/gradlew.bat +0 -84
  233. package/ios/AppLovinMAX.xcodeproj/project.pbxproj +0 -368
  234. package/ios/AppLovinMAX.xcodeproj/xcshareddata/xcschemes/AppLovinMAX.xcscheme +0 -67
  235. package/ios/AppLovinMAX.xcworkspace/contents.xcworkspacedata +0 -10
  236. package/ios/AppLovinMAX.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  237. package/ios/Podfile +0 -40
  238. package/ios/Podfile.lock +0 -373
@@ -0,0 +1,139 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import * as React from 'react';
3
+ import { forwardRef, useContext, useImperativeHandle, useRef, useState, useEffect, useCallback } from 'react';
4
+ import { NativeModules, requireNativeComponent, UIManager, findNodeHandle } from 'react-native';
5
+ import { NativeAdViewContext, NativeAdViewProvider } from './NativeAdViewProvider';
6
+ const {
7
+ AppLovinMAX
8
+ } = NativeModules;
9
+ const NativeAdViewComponent = requireNativeComponent('AppLovinMAXNativeAdView');
10
+
11
+ /**
12
+ * The {@link NativeAdView} component that you use building a native ad. This loads a native ad and
13
+ * renders it with the asset views:
14
+ *
15
+ * - {@link IconView}
16
+ * - {@link TitleView}
17
+ * - {@link AdvertiserView}
18
+ * - {@link StarRatingView}
19
+ * - {@link BodyView}
20
+ * - {@link MediaView}
21
+ * - {@link CallToActionView}
22
+ *
23
+ * {@link NativeAdView} fills each asset view with the data of a native ad as soon as it loads the native
24
+ * ad, but you need to provide the layout and style of the asset views.
25
+ * {@link NativeAdView} can reload a new native ad by using the ref handler.
26
+ *
27
+ * ### Example:
28
+ * ```js
29
+ * <NativeAdView
30
+ * ref={nativeAdViewHandler}
31
+ * adUnitId={adUnitId}
32
+ * style={styles.nativead}
33
+ * onAdLoaded={(adInfo: AdInfo) => { ... }}
34
+ * >
35
+ * <View style={ ... }>
36
+ * <IconView style={styles.icon} />
37
+ * <TitleView style={styles.title} />
38
+ * <AdvertiserView style={styles.advertiser} />
39
+ * <StarRatingView style={styles.starRatingView} />
40
+ * <OptionsView style={styles.optionsView} />
41
+ * <BodyView style={styles.body} />
42
+ * <MediaView style={styles.mediaView} />
43
+ * <CallToActionView style={styles.callToAction} />
44
+ * </View>
45
+ * </NativeAdView>
46
+ * ```
47
+ */
48
+ export const NativeAdView = /*#__PURE__*/forwardRef(function NativeAdView(props, ref) {
49
+ const [isInitialized, setIsInitialized] = useState(false);
50
+ useEffect(() => {
51
+ // check that AppLovinMAX has been initialized
52
+ AppLovinMAX.isInitialized().then(result => {
53
+ setIsInitialized(result);
54
+ if (!result) {
55
+ console.warn('NativeAdView is mounted before the initialization of the AppLovin MAX React Native module');
56
+ }
57
+ });
58
+ }, []);
59
+
60
+ // Not ready to render NativeAdView
61
+ if (!isInitialized) {
62
+ return null;
63
+ }
64
+ return /*#__PURE__*/React.createElement(NativeAdViewProvider, null, /*#__PURE__*/React.createElement(NativeAdViewImpl, _extends({}, props, {
65
+ ref: ref
66
+ })));
67
+ });
68
+ const NativeAdViewImpl = /*#__PURE__*/forwardRef(function NativeAdViewImpl({
69
+ adUnitId,
70
+ placement,
71
+ customData,
72
+ extraParameters,
73
+ localExtraParameters,
74
+ onAdLoaded,
75
+ onAdLoadFailed,
76
+ onAdClicked,
77
+ onAdRevenuePaid,
78
+ children,
79
+ style,
80
+ ...otherProps
81
+ }, ref) {
82
+ // context from NativeAdViewProvider
83
+ const {
84
+ setNativeAd,
85
+ setNativeAdView
86
+ } = useContext(NativeAdViewContext);
87
+
88
+ // keep the nativeAdView ref
89
+ const nativeAdViewRef = useRef(null);
90
+
91
+ // invoke the native ad loader
92
+ const loadAd = () => {
93
+ if (nativeAdViewRef) {
94
+ UIManager.dispatchViewManagerCommand(findNodeHandle(nativeAdViewRef.current),
95
+ // @ts-ignore: Issue in RN ts defs
96
+ UIManager.getViewManagerConfig('AppLovinMAXNativeAdView').Commands.loadAd, undefined);
97
+ }
98
+ };
99
+
100
+ // expose a list of functions via the provided ref
101
+ useImperativeHandle(ref, () => ({
102
+ loadAd
103
+ }), []);
104
+
105
+ // save the DOM element via the ref callback
106
+ const saveElement = useCallback(element => {
107
+ if (element) {
108
+ nativeAdViewRef.current = element;
109
+ setNativeAdView(element);
110
+ }
111
+ }, [setNativeAdView]);
112
+ const onAdLoadedEvent = event => {
113
+ setNativeAd(event.nativeEvent.nativeAd);
114
+ if (onAdLoaded) onAdLoaded(event.nativeEvent.adInfo);
115
+ };
116
+ const onAdLoadFailedEvent = event => {
117
+ if (onAdLoadFailed) onAdLoadFailed(event.nativeEvent);
118
+ };
119
+ const onAdClickedEvent = event => {
120
+ if (onAdClicked) onAdClicked(event.nativeEvent);
121
+ };
122
+ const onAdRevenuePaidEvent = event => {
123
+ if (onAdRevenuePaid) onAdRevenuePaid(event.nativeEvent);
124
+ };
125
+ return /*#__PURE__*/React.createElement(NativeAdViewComponent, _extends({
126
+ ref: saveElement,
127
+ adUnitId: adUnitId,
128
+ placement: placement,
129
+ customData: customData,
130
+ extraParameters: extraParameters,
131
+ localExtraParameters: localExtraParameters,
132
+ onAdLoadedEvent: onAdLoadedEvent,
133
+ onAdLoadFailedEvent: onAdLoadFailedEvent,
134
+ onAdClickedEvent: onAdClickedEvent,
135
+ onAdRevenuePaidEvent: onAdRevenuePaidEvent,
136
+ style: style
137
+ }, otherProps), children);
138
+ });
139
+ //# sourceMappingURL=NativeAdView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","forwardRef","useContext","useImperativeHandle","useRef","useState","useEffect","useCallback","NativeModules","requireNativeComponent","UIManager","findNodeHandle","NativeAdViewContext","NativeAdViewProvider","AppLovinMAX","NativeAdViewComponent","NativeAdView","props","ref","isInitialized","setIsInitialized","then","result","console","warn","createElement","NativeAdViewImpl","_extends","adUnitId","placement","customData","extraParameters","localExtraParameters","onAdLoaded","onAdLoadFailed","onAdClicked","onAdRevenuePaid","children","style","otherProps","setNativeAd","setNativeAdView","nativeAdViewRef","loadAd","dispatchViewManagerCommand","current","getViewManagerConfig","Commands","undefined","saveElement","element","onAdLoadedEvent","event","nativeEvent","nativeAd","adInfo","onAdLoadFailedEvent","onAdClickedEvent","onAdRevenuePaidEvent"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdView.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B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ACzD,CAAC;EAED,MAAMI,gBAAgB,GAAIL,KAA4B,IAAK;IACvD,IAAIjB,WAAW,EAAEA,WAAW,CAACiB,KAAK,CAACC,WAAW,CAAC;EACnD,CAAC;EAED,MAAMK,oBAAoB,GAAIN,KAAmC,IAAK;IAClE,IAAIhB,eAAe,EAAEA,eAAe,CAACgB,KAAK,CAACC,WAAW,CAAC;EAC3D,CAAC;EAED,oBACIrD,KAAA,CAAAyB,aAAA,CAACV,qBAAqB,EAAAY,QAAA;IAClBT,GAAG,EAAE+B,WAAY;IACjBrB,QAAQ,EAAEA,QAAS;IACnBC,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBC,eAAe,EAAEA,eAAgB;IACjCC,oBAAoB,EAAEA,oBAAqB;IAC3CmB,eAAe,EAAEA,eAAgB;IACjCK,mBAAmB,EAAEA,mBAAoB;IACzCC,gBAAgB,EAAEA,gBAAiB;IACnCC,oBAAoB,EAAEA,oBAAqB;IAC3CpB,KAAK,EAAEA;EAAM,GACTC,UAAU,GAEbF,QACkB,CAAC;AAEhC,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,181 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import * as React from 'react';
3
+ import { useContext, useRef, useEffect } from 'react';
4
+ import { findNodeHandle, Text, Image, View, TouchableOpacity, StyleSheet } from 'react-native';
5
+ import { NativeAdViewContext } from './NativeAdViewProvider';
6
+ export const TitleView = props => {
7
+ const titleRef = useRef(null);
8
+ const {
9
+ nativeAd,
10
+ nativeAdView
11
+ } = useContext(NativeAdViewContext);
12
+ useEffect(() => {
13
+ if (!nativeAd.title || !titleRef.current) return;
14
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
15
+ titleView: findNodeHandle(titleRef.current)
16
+ });
17
+ }, [nativeAd, nativeAdView]);
18
+ return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
19
+ ref: titleRef
20
+ }), nativeAd.title || null);
21
+ };
22
+ export const AdvertiserView = props => {
23
+ const advertiserRef = useRef(null);
24
+ const {
25
+ nativeAd,
26
+ nativeAdView
27
+ } = useContext(NativeAdViewContext);
28
+ useEffect(() => {
29
+ if (!nativeAd.advertiser || !advertiserRef.current) return;
30
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
31
+ advertiserView: findNodeHandle(advertiserRef.current)
32
+ });
33
+ }, [nativeAd, nativeAdView]);
34
+ return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
35
+ ref: advertiserRef
36
+ }), nativeAd.advertiser || null);
37
+ };
38
+ export const BodyView = props => {
39
+ const bodyRef = useRef(null);
40
+ const {
41
+ nativeAd,
42
+ nativeAdView
43
+ } = useContext(NativeAdViewContext);
44
+ useEffect(() => {
45
+ if (!nativeAd.body || !bodyRef.current) return;
46
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
47
+ bodyView: findNodeHandle(bodyRef.current)
48
+ });
49
+ }, [nativeAd, nativeAdView]);
50
+ return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
51
+ ref: bodyRef
52
+ }), nativeAd.body || null);
53
+ };
54
+ export const CallToActionView = props => {
55
+ const callToActionRef = useRef(null);
56
+ const {
57
+ nativeAd,
58
+ nativeAdView
59
+ } = useContext(NativeAdViewContext);
60
+ useEffect(() => {
61
+ if (!nativeAd.callToAction || !callToActionRef.current) return;
62
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
63
+ callToActionView: findNodeHandle(callToActionRef.current)
64
+ });
65
+ }, [nativeAd, nativeAdView]);
66
+ return /*#__PURE__*/React.createElement(TouchableOpacity, null, /*#__PURE__*/React.createElement(Text, _extends({}, props, {
67
+ ref: callToActionRef
68
+ }), nativeAd.callToAction || null));
69
+ };
70
+ export const IconView = props => {
71
+ const imageRef = useRef(null);
72
+ const {
73
+ nativeAd,
74
+ nativeAdView
75
+ } = useContext(NativeAdViewContext);
76
+ useEffect(() => {
77
+ if (!(nativeAd.image || nativeAd.url) || !imageRef.current) return;
78
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
79
+ iconView: findNodeHandle(imageRef.current)
80
+ });
81
+ }, [nativeAd, nativeAdView]);
82
+ return nativeAd.url ? /*#__PURE__*/React.createElement(Image, _extends({}, props, {
83
+ ref: imageRef,
84
+ source: {
85
+ uri: nativeAd.url
86
+ }
87
+ })) : nativeAd.image ? /*#__PURE__*/React.createElement(Image, _extends({}, props, {
88
+ ref: imageRef,
89
+ source: 0
90
+ })) : /*#__PURE__*/React.createElement(View, props);
91
+ };
92
+ export const OptionsView = props => {
93
+ const viewRef = useRef(null);
94
+ const {
95
+ nativeAd,
96
+ nativeAdView
97
+ } = useContext(NativeAdViewContext);
98
+ useEffect(() => {
99
+ if (!nativeAd.isOptionsViewAvailable || !viewRef.current) return;
100
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
101
+ optionsView: findNodeHandle(viewRef.current)
102
+ });
103
+ }, [nativeAd, nativeAdView]);
104
+ return /*#__PURE__*/React.createElement(View, _extends({}, props, {
105
+ ref: viewRef
106
+ }));
107
+ };
108
+ export const MediaView = props => {
109
+ const viewRef = useRef(null);
110
+ const {
111
+ nativeAd,
112
+ nativeAdView
113
+ } = useContext(NativeAdViewContext);
114
+ useEffect(() => {
115
+ if (!nativeAd.isMediaViewAvailable || !viewRef.current) return;
116
+ nativeAdView === null || nativeAdView === void 0 || nativeAdView.setNativeProps({
117
+ mediaView: findNodeHandle(viewRef.current)
118
+ });
119
+ }, [nativeAd, nativeAdView]);
120
+ return /*#__PURE__*/React.createElement(View, _extends({}, props, {
121
+ ref: viewRef
122
+ }));
123
+ };
124
+ export const StarRatingView = props => {
125
+ const {
126
+ style,
127
+ ...restProps
128
+ } = props;
129
+ const maxStarCount = 5;
130
+ const starColor = StyleSheet.flatten(style || {}).color ?? '#ffe234';
131
+ const starSize = StyleSheet.flatten(style || {}).fontSize ?? 10;
132
+ const {
133
+ nativeAd
134
+ } = useContext(NativeAdViewContext);
135
+ return /*#__PURE__*/React.createElement(View, _extends({}, restProps, {
136
+ style: [style, styles.starRatingContainer]
137
+ }), (() => {
138
+ const stars = [];
139
+ for (let index = 0; index < maxStarCount; index++) {
140
+ if (nativeAd.starRating) {
141
+ const width = (nativeAd.starRating - index) * starSize;
142
+ stars.push( /*#__PURE__*/React.createElement(View, {
143
+ key: index
144
+ }, /*#__PURE__*/React.createElement(Text, {
145
+ style: {
146
+ fontSize: starSize,
147
+ color: starColor
148
+ }
149
+ }, String.fromCodePoint(0x2606)), nativeAd.starRating > index && /*#__PURE__*/React.createElement(View, {
150
+ style: [{
151
+ width: width
152
+ }, styles.starRating]
153
+ }, /*#__PURE__*/React.createElement(Text, {
154
+ style: {
155
+ fontSize: starSize,
156
+ color: starColor
157
+ }
158
+ }, String.fromCodePoint(0x2605)))));
159
+ } else {
160
+ stars.push( /*#__PURE__*/React.createElement(Text, {
161
+ key: index,
162
+ style: {
163
+ fontSize: starSize
164
+ }
165
+ }, ' '));
166
+ }
167
+ }
168
+ return stars;
169
+ })());
170
+ };
171
+ const styles = StyleSheet.create({
172
+ starRatingContainer: {
173
+ flexDirection: 'row',
174
+ alignItems: 'center'
175
+ },
176
+ starRating: {
177
+ overflow: 'hidden',
178
+ position: 'absolute'
179
+ }
180
+ });
181
+ //# sourceMappingURL=NativeAdViewComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useContext","useRef","useEffect","findNodeHandle","Text","Image","View","TouchableOpacity","StyleSheet","NativeAdViewContext","TitleView","props","titleRef","nativeAd","nativeAdView","title","current","setNativeProps","titleView","createElement","_extends","ref","AdvertiserView","advertiserRef","advertiser","advertiserView","BodyView","bodyRef","body","bodyView","CallToActionView","callToActionRef","callToAction","callToActionView","IconView","imageRef","image","url","iconView","source","uri","OptionsView","viewRef","isOptionsViewAvailable","optionsView","MediaView","isMediaViewAvailable","mediaView","StarRatingView","style","restProps","maxStarCount","starColor","flatten","color","starSize","fontSize","styles","starRatingContainer","stars","index","starRating","width","push","key","String","fromCodePoint","create","flexDirection","alignItems","overflow","position"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewComponents.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAErD,SAASC,cAAc,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,cAAc;AAE9F,SAASC,mBAAmB,QAAQ,wBAAwB;AAE5D,OAAO,MAAMC,SAAS,GAAIC,KAAgB,IAAK;EAC3C,MAAMC,QAAQ,GAAGX,MAAM,CAAC,IAAI,CAAC;EAC7B,MAAM;IAAEY,QAAQ;IAAEC;EAAa,CAAC,GAAGd,UAAU,CAACS,mBAAmB,CAAC;EAElEP,SAAS,CAAC,MAAM;IACZ,IAAI,CAACW,QAAQ,CAACE,KAAK,IAAI,CAACH,QAAQ,CAACI,OAAO,EAAE;IAE1CF,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAEG,cAAc,CAAC;MACzBC,SAAS,EAAEf,cAAc,CAACS,QAAQ,CAACI,OAAO;IAC9C,CAAC,CAAC;EACN,CAAC,EAAE,CAACH,QAAQ,EAAEC,YAAY,CAAC,CAAC;EAE5B,oBACIf,KAAA,CAAAoB,aAAA,CAACf,IAAI,EAAAgB,QAAA,KAAKT,KAAK;IAAEU,GAAG,EAAET;EAAS,IAC1BC,QAAQ,CAACE,KAAK,IAAI,IACjB,CAAC;AAEf,CAAC;AAED,OAAO,MAAMO,cAAc,GAAIX,KAAgB,IAAK;EAChD,MAAMY,aAAa,GAAGtB,MAAM,CAAC,IAAI,CAAC;EAClC,MAAM;IAAEY,QAAQ;IAAEC;EAAa,CAAC,GAA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KAAK,EAAE;YAAEO,QAAQ,EAAED,QAAQ;YAAED,KAAK,EAAEF;UAAU;QAAE,GAAEa,MAAM,CAACC,aAAa,CAAC,MAAM,CAAQ,CAAC,EAC3FrD,QAAQ,CAACgD,UAAU,GAAGD,KAAK,iBACxB7D,KAAA,CAAAoB,aAAA,CAACb,IAAI;UAAC2C,KAAK,EAAE,CAAC;YAAEa,KAAK,EAAEA;UAAM,CAAC,EAAEL,MAAM,CAACI,UAAU;QAAE,gBAC/C9D,KAAA,CAAAoB,aAAA,CAACf,IAAI;UAAC6C,KAAK,EAAE;YAAEO,QAAQ,EAAED,QAAQ;YAAED,KAAK,EAAEF;UAAU;QAAE,GAAEa,MAAM,CAACC,aAAa,CAAC,MAAM,CAAQ,CACzF,CAER,CACV,CAAC;MACL,CAAC,MAAM;QACHP,KAAK,CAACI,IAAI,eACNhE,KAAA,CAAAoB,aAAA,CAACf,IAAI;UAAC4D,GAAG,EAAEJ,KAAM;UAACX,KAAK,EAAE;YAAEO,QAAQ,EAAED;UAAS;QAAE,GAC3C,GACC,CACV,CAAC;MACL;IACJ;IACA,OAAOI,KAAK;EAChB,CAAC,EAAE,CACD,CAAC;AAEf,CAAC;AAED,MAAMF,MAAM,GAAGjD,UAAU,CAAC2D,MAAM,CAAC;EAC7BT,mBAAmB,EAAE;IACjBU,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EAChB,CAAC;EACDR,UAAU,EAAE;IACRS,QAAQ,EAAE,QAAQ;IAClBC,QAAQ,EAAE;EACd;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { useState, createContext } from 'react';
3
+ export const NativeAdViewContext = /*#__PURE__*/createContext({
4
+ nativeAd: {
5
+ isOptionsViewAvailable: false,
6
+ isMediaViewAvailable: false
7
+ },
8
+ nativeAdView: null,
9
+ setNativeAd: () => {},
10
+ setNativeAdView: () => {}
11
+ });
12
+ export const NativeAdViewProvider = props => {
13
+ const [nativeAd, setNativeAd] = useState({
14
+ isOptionsViewAvailable: false,
15
+ isMediaViewAvailable: false
16
+ });
17
+ const [nativeAdView, setNativeAdView] = useState(Object);
18
+ const providerValue = {
19
+ nativeAd,
20
+ nativeAdView,
21
+ setNativeAd,
22
+ setNativeAdView
23
+ };
24
+ return /*#__PURE__*/React.createElement(NativeAdViewContext.Provider, {
25
+ value: providerValue
26
+ }, props.children);
27
+ };
28
+ //# sourceMappingURL=NativeAdViewProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","createContext","NativeAdViewContext","nativeAd","isOptionsViewAvailable","isMediaViewAvailable","nativeAdView","setNativeAd","setNativeAdView","NativeAdViewProvider","props","Object","providerValue","createElement","Provider","value","children"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewProvider.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,QAAQ,OAAO;AAc/C,OAAO,MAAMC,mBAAmB,gBAAGD,aAAa,CAA0B;EACtEE,QAAQ,EAAE;IAAEC,sBAAsB,EAAE,KAAK;IAAEC,oBAAoB,EAAE;EAAM,CAAC;EACxEC,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAEA,CAAA,KAAM,CAAC,CAAC;EACrBC,eAAe,EAAEA,CAAA,KAAM,CAAC;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAMC,oBAA6D,GAAIC,KAAK,IAAK;EACpF,MAAM,CAACP,QAAQ,EAAEI,WAAW,CAAC,GAAGP,QAAQ,CAAC;IACrCI,sBAAsB,EAAE,KAAK;IAC7BC,oBAAoB,EAAE;EAC1B,CAAC,CAAC;EACF,MAAM,CAACC,YAAY,EAAEE,eAAe,CAAC,GAAGR,QAAQ,CAACW,MAAM,CAAC;EAExD,MAAMC,aAAa,GAAG;IAClBT,QAAQ;IACRG,YAAY;IACZC,WAAW;IACXC;EACJ,CAAC;EAED,oBAAOT,KAAA,CAAAc,aAAA,CAACX,mBAAmB,CAACY,QAAQ;IAACC,KAAK,EAAEH;EAAc,GAAEF,KAAK,CAACM,QAAuC,CAAC;AAC9G,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AdEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/AdEvent.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Represents an ad that has been served by AppLovin MAX.
3
+ */
4
+
5
+ /**
6
+ * Encapsulates various data for MAX load errors.
7
+ */
8
+
9
+ /**
10
+ * Encapsulates various data for MAX display errors.
11
+ */
12
+
13
+ /**
14
+ * Represents a reward given to the user.
15
+ */
16
+
17
+ /**
18
+ * Represents revenue given to the publisher.
19
+ */
20
+
21
+ /**
22
+ * Represents a native ad.
23
+ */
24
+
25
+ /**
26
+ * Represents an ad waterfall, encapsulating various metadata such as total latency, underlying ad
27
+ * responses, etc.
28
+ */
29
+
30
+ /**
31
+ * This enum contains possible states of an ad in the waterfall.
32
+ * Each adapter response {@link AdNetworkResponseInfo} corresponds to one of these states.
33
+ */
34
+ export let AdLoadState = /*#__PURE__*/function (AdLoadState) {
35
+ AdLoadState[AdLoadState["LoadStateAdLoadNotAttempted"] = 0] = "LoadStateAdLoadNotAttempted";
36
+ AdLoadState[AdLoadState["LoadStateAdLoaded"] = 1] = "LoadStateAdLoaded";
37
+ AdLoadState[AdLoadState["LoadStateAdFailedToLoad"] = 2] = "LoadStateAdFailedToLoad";
38
+ return AdLoadState;
39
+ }({});
40
+
41
+ /**
42
+ * Encapsulates load and display errors.
43
+ */
44
+
45
+ /**
46
+ * This class represents an ad response in a waterfall.
47
+ */
48
+
49
+ /**
50
+ * This class represents information for a mediated network.
51
+ */
52
+ //# sourceMappingURL=AdInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdLoadState"],"sourceRoot":"../../../src","sources":["types/AdInfo.ts"],"mappings":"AAAA;AACA;AACA;;AA0DA;AACA;AACA;;AAsCA;AACA;AACA;;AAuBA;AACA;AACA;;AAaA;AACA;AACA;;AAyBA;AACA;AACA;;AAgDA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAkBvB;AACA;AACA;;AAkBA;AACA;AACA;;AAgCA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AdProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/AdProps.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AdViewProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/AdViewProps.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AppLovinMAX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/AppLovinMAX.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AppOpenAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/AppOpenAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BannerAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/BannerAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CMPError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/CMPError.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Configuration.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FullscreenAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/FullscreenAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=InterstitialAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/InterstitialAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MRecAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/MRecAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=NativeAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/NativeAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NativeAdViewProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/NativeAdViewProps.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=Privacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Privacy.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RewardedAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/RewardedAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TargetingData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/TargetingData.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ViewAd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/ViewAd.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ export * from './Configuration';
2
+ export * from './CMPError';
3
+ export * from './AdInfo';
4
+ export * from './AdViewProps';
5
+ export * from './NativeAdViewProps';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAAA,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,qBAAqB","ignoreList":[]}