@uptick-ads/react-native-web-sdk 0.3.3 → 0.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uptick-ads/react-native-web-sdk",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "React Native component that runs the Uptick web SDK inside a WebView, inline or as a popup, with the web integration's parameters",
5
5
  "keywords": [
6
6
  "uptick",
package/src/UptickFlow.js CHANGED
@@ -139,16 +139,14 @@ export function UptickFlow({
139
139
  return <View style={[styles.transparent, { height: renderType === "inline" ? contentHeight : 1, overflow: "hidden" }, style]}>{webView}</View>;
140
140
  }
141
141
 
142
- // Popup: the page has already loaded inside the inline slot, so keep that WebView alive and move it into a system modal over a dimmed background.
143
- // React Native's Modal presents above the whole window regardless of where this component sits in the tree.
142
+ // Popup: a system modal over a dimmed background, which React Native presents above the whole window regardless of where this component sits in the tree.
143
+ // A presented modal swallows touches and the back button even when its content is transparent, so it is only presented while visible, and hiding it unmounts the WebView and ends the page.
144
144
  return (
145
145
  <View style={[styles.transparent, { height: 0 }, style]}>
146
- <Modal visible transparent animationType="fade" statusBarTranslucent onRequestClose={dismiss}>
147
- <View style={FILL} pointerEvents={visible ? "auto" : "none"}>
148
- <Pressable accessibilityRole="button" accessibilityLabel="Dismiss" style={[FILL, { backgroundColor, opacity: visible ? 1 : 0 }]} onPress={dismiss} />
149
- <View pointerEvents="box-none" style={[FILL, styles.cardWrap, { paddingTop: insets.top, paddingBottom: insets.bottom, opacity: visible ? 1 : 0 }]}>
150
- <View style={[styles.card, { height: Math.min(contentHeight, maxCardHeight) }, cardStyle]}>{webView}</View>
151
- </View>
146
+ <Modal visible={visible} transparent animationType="fade" statusBarTranslucent onRequestClose={dismiss}>
147
+ <Pressable accessibilityRole="button" accessibilityLabel="Dismiss" style={[FILL, { backgroundColor }]} onPress={dismiss} />
148
+ <View pointerEvents="box-none" style={[FILL, styles.cardWrap, { paddingTop: insets.top, paddingBottom: insets.bottom }]}>
149
+ <View style={[styles.card, { height: Math.min(contentHeight, maxCardHeight) }, cardStyle]}>{webView}</View>
152
150
  </View>
153
151
  </Modal>
154
152
  </View>
package/src/embedUrl.js CHANGED
@@ -29,6 +29,8 @@ function encodeQuery(params) {
29
29
  .join("&");
30
30
  }
31
31
 
32
+ const INTEGRATION_TYPE = "react_native";
33
+
32
34
  export function pickFlowParams(props) {
33
35
  const out = {};
34
36
  FLOW_PARAMS.forEach((key) => {
@@ -55,7 +57,7 @@ export function customizations(modal) {
55
57
  export function buildEmbedUrl({ host, integrationId, placement, params, version, customization }) {
56
58
  if (!integrationId) throw new Error("UptickFlow: integrationId is required");
57
59
  // The page renders whatever presentation the placement's template defines; `native` only asks it to leave the popup chrome to the app.
58
- const search = encodeQuery({ placement, variant: "native", integration_version: version });
60
+ const search = encodeQuery({ placement, variant: "native", integration_type: INTEGRATION_TYPE, integration_version: version });
59
61
  // Nested with bracket keys, the same shape the API stores for any other nested parameter.
60
62
  const nested = {};
61
63
  Object.keys(customization || {}).forEach((key) => { nested[`customization[${key}]`] = customization[key]; });
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Kept in step with package.json by the release pipeline; the API records it on every event as integration_version.
2
- export const version = "0.3.3";
2
+ export const version = "0.3.5";