@upeex/ads-sdk 1.1.25 → 1.1.27

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 (2) hide show
  1. package/dist/index.js +41 -37
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -172,16 +172,16 @@ function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme
172
172
  }
173
173
  };
174
174
  if (isPopup) {
175
- return (jsx(Modal, { transparent: true, animationType: "fade", visible: true, onRequestClose: () => { }, children: jsxs(View, { style: styles.modalBackground, children: [jsx(View, { style: styles.progressBarContainer, children: jsx(AnimatedView, { style: [
176
- styles.progressBar,
177
- {
178
- width: progressAnim.interpolate({
179
- inputRange: [0, 1],
180
- outputRange: ['0%', '100%'],
181
- }),
182
- backgroundColor: '#fff',
183
- },
184
- ] }) }), !canClose && (jsx(View, { style: styles.spinnerOverlay, children: jsx(ActivityIndicator, { size: "small", color: "#fff" }) })), canClose && (jsx(TouchableOpacity, { style: styles.closeButton, onPress: () => { }, children: jsx(Text, { style: styles.closeButtonText, children: "X" }) })), jsx(TouchableOpacity, { style: styles.fullScreenTouch, activeOpacity: 1, onPress: handleFallbackPress, children: jsx(Image, { source: { uri: fallbackImage }, style: styles.fullScreenImage, resizeMode: "contain" }) })] }) }));
175
+ return (jsx(Modal, { transparent: true, animationType: "fade", visible: true, onRequestClose: () => { }, children: jsx(View, { style: styles.modalBackground, children: jsxs(View, { style: styles.imageWrapper, children: [jsx(View, { style: styles.progressBarContainer, children: jsx(AnimatedView, { style: [
176
+ styles.progressBar,
177
+ {
178
+ width: progressAnim.interpolate({
179
+ inputRange: [0, 1],
180
+ outputRange: ['0%', '100%'],
181
+ }),
182
+ backgroundColor: '#fff',
183
+ },
184
+ ] }) }), !canClose && (jsx(View, { style: styles.spinnerOverlay, children: jsx(ActivityIndicator, { size: "small", color: "#fff" }) })), canClose && (jsx(TouchableOpacity, { style: styles.closeButton, onPress: () => { }, children: jsx(Text, { style: styles.closeButtonText, children: "X" }) })), jsx(TouchableOpacity, { activeOpacity: 1, onPress: handleFallbackPress, children: jsx(Image, { source: { uri: fallbackImage }, style: styles.popupImage, resizeMode: "contain" }) })] }) }) }));
185
185
  }
186
186
  // Banner fallback
187
187
  return (jsx(TouchableOpacity, { activeOpacity: 0.9, style: [styles.container, theme === 'dark' && styles.dark, style], onPress: handleFallbackPress, children: jsx(Image, { source: { uri: fallbackImage }, style: { width: 320, height: 50, resizeMode: 'contain' } }) }));
@@ -206,16 +206,16 @@ function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme
206
206
  };
207
207
  // ─── POPUP ─────────────────────────────────────────────────────────────────
208
208
  if (isPopup) {
209
- return (jsx(Modal, { transparent: true, animationType: "fade", visible: modalVisible, onRequestClose: () => canClose && setModalVisible(false), children: jsxs(View, { style: styles.modalBackground, children: [jsx(View, { style: styles.progressBarContainer, children: jsx(AnimatedView, { style: [
210
- styles.progressBar,
211
- {
212
- width: progressAnim.interpolate({
213
- inputRange: [0, 1],
214
- outputRange: ['0%', '100%'],
215
- }),
216
- backgroundColor: '#fff',
217
- },
218
- ] }) }), !canClose && (jsx(View, { style: styles.spinnerOverlay, children: jsx(ActivityIndicator, { size: "small", color: "#fff" }) })), canClose && (jsx(TouchableOpacity, { style: styles.closeButton, onPress: () => setModalVisible(false), children: jsx(Text, { style: styles.closeButtonText, children: "X" }) })), jsx(TouchableOpacity, { style: styles.fullScreenTouch, activeOpacity: 1, onPress: handlePress, children: jsx(Image, { source: { uri: ad.image }, style: styles.fullScreenImage, resizeMode: "contain" }) })] }) }));
209
+ return (jsx(Modal, { transparent: true, animationType: "fade", visible: modalVisible, onRequestClose: () => canClose && setModalVisible(false), children: jsx(View, { style: styles.modalBackground, children: jsxs(View, { style: styles.imageWrapper, children: [jsx(View, { style: styles.progressBarContainer, children: jsx(AnimatedView, { style: [
210
+ styles.progressBar,
211
+ {
212
+ width: progressAnim.interpolate({
213
+ inputRange: [0, 1],
214
+ outputRange: ['0%', '100%'],
215
+ }),
216
+ backgroundColor: '#fff',
217
+ },
218
+ ] }) }), !canClose && (jsx(View, { style: styles.spinnerOverlay, children: jsx(ActivityIndicator, { size: "small", color: "#fff" }) })), canClose && (jsx(TouchableOpacity, { style: styles.closeButton, onPress: () => setModalVisible(false), children: jsx(Text, { style: styles.closeButtonText, children: "X" }) })), jsx(TouchableOpacity, { activeOpacity: 1, onPress: handlePress, children: jsx(Image, { source: { uri: ad.image }, style: styles.popupImage, resizeMode: "contain" }) })] }) }) }));
219
219
  }
220
220
  // ─── BANNER ────────────────────────────────────────────────────────────────
221
221
  return (jsx(TouchableOpacity, { activeOpacity: 0.9, style: [styles.container, theme === 'dark' && styles.dark, style], onPress: handlePress, children: jsx(Image, { source: { uri: ad.image }, style: {
@@ -255,32 +255,33 @@ const styles = StyleSheet.create({
255
255
  justifyContent: 'center',
256
256
  alignItems: 'center',
257
257
  },
258
- fullScreenTouch: {
259
- flex: 1,
258
+ // Wrapper that groups image + progress bar + close button together
259
+ imageWrapper: {
260
+ position: 'relative',
261
+ width: screenWidth * 0.88,
262
+ aspectRatio: 1,
263
+ maxWidth: 420,
264
+ },
265
+ popupImage: {
260
266
  width: '100%',
261
267
  height: '100%',
262
- justifyContent: 'center',
263
- alignItems: 'center',
264
- },
265
- fullScreenImage: {
266
- width: '90%',
267
- height: '90%',
268
+ borderRadius: 8,
268
269
  },
269
270
  closeButton: {
270
271
  position: 'absolute',
271
- top: 50,
272
- right: 20,
273
- backgroundColor: 'rgba(0,0,0,0.6)',
274
- width: 40,
275
- height: 40,
276
- borderRadius: 20,
272
+ top: 8,
273
+ right: 8,
274
+ backgroundColor: 'rgba(0,0,0,0.65)',
275
+ width: 32,
276
+ height: 32,
277
+ borderRadius: 16,
277
278
  justifyContent: 'center',
278
279
  alignItems: 'center',
279
280
  zIndex: 999,
280
281
  },
281
282
  closeButtonText: {
282
283
  color: '#fff',
283
- fontSize: 18,
284
+ fontSize: 15,
284
285
  fontWeight: 'bold',
285
286
  },
286
287
  progressBarContainer: {
@@ -290,15 +291,18 @@ const styles = StyleSheet.create({
290
291
  width: '100%',
291
292
  height: 5,
292
293
  backgroundColor: 'rgba(255,255,255,0.3)',
294
+ borderTopLeftRadius: 8,
295
+ borderTopRightRadius: 8,
293
296
  zIndex: 1000,
294
297
  },
295
298
  progressBar: {
296
299
  height: '100%',
300
+ borderTopLeftRadius: 8,
297
301
  },
298
302
  spinnerOverlay: {
299
303
  position: 'absolute',
300
- top: 12,
301
- right: 20,
304
+ top: 10,
305
+ right: 10,
302
306
  zIndex: 1000,
303
307
  },
304
308
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upeex/ads-sdk",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "description": "Upeex Ads SDK for React Native and universal apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,4 +39,4 @@
39
39
  "react": "18.2.0",
40
40
  "react-native": "0.73.0"
41
41
  }
42
- }
42
+ }