rampkit-expo-dev 0.0.53 → 0.0.54

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.
@@ -1219,6 +1219,7 @@ function Overlay(props) {
1219
1219
  // This ensures the webview receives the latest state
1220
1220
  requestAnimationFrame(() => {
1221
1221
  sendVarsToWebView(nextIndex);
1222
+ sendOnboardingStateToWebView(nextIndex);
1222
1223
  });
1223
1224
  return;
1224
1225
  }
@@ -1267,8 +1268,9 @@ function Overlay(props) {
1267
1268
  useNativeDriver: true,
1268
1269
  }),
1269
1270
  ]).start(() => {
1270
- // Send vars to the new page
1271
+ // Send vars and onboarding state to the new page
1271
1272
  sendVarsToWebView(nextIndex);
1273
+ sendOnboardingStateToWebView(nextIndex);
1272
1274
  setIsTransitioning(false);
1273
1275
  });
1274
1276
  });
@@ -1287,10 +1289,11 @@ function Overlay(props) {
1287
1289
  // @ts-ignore: method exists on PagerView instance
1288
1290
  (_c = (_b = (_a = pagerRef.current) === null || _a === void 0 ? void 0 : _a.setPageWithoutAnimation) === null || _b === void 0 ? void 0 : _b.call(_a, nextIndex)) !== null && _c !== void 0 ? _c : (_d = pagerRef.current) === null || _d === void 0 ? void 0 : _d.setPage(nextIndex);
1289
1291
  requestAnimationFrame(() => {
1290
- // Explicitly send vars to the new page after the page switch completes
1292
+ // Explicitly send vars and onboarding state to the new page after the page switch completes
1291
1293
  // This ensures the webview receives the latest state even if onPageSelected
1292
1294
  // timing was off during the transition
1293
1295
  sendVarsToWebView(nextIndex);
1296
+ sendOnboardingStateToWebView(nextIndex);
1294
1297
  react_native_1.Animated.timing(fadeOpacity, {
1295
1298
  toValue: 0,
1296
1299
  duration: 160,
@@ -1408,8 +1411,9 @@ function Overlay(props) {
1408
1411
  // This is more reliable as it doesn't depend on event listeners being set up
1409
1412
  // @ts-ignore: injectJavaScript exists on WebView instance
1410
1413
  wv.injectJavaScript(buildDirectVarsScript(varsRef.current));
1411
- // Also send onboarding state so templates like ${onboarding.progress} are resolved
1412
- sendOnboardingStateToWebView(i);
1414
+ // NOTE: Do NOT call sendOnboardingStateToWebView here - it would cause infinite loops
1415
+ // because the WebView echoes back variables which triggers another sendVarsToWebView.
1416
+ // Onboarding state is sent separately in onLoadEnd and onPageSelected.
1413
1417
  }
1414
1418
  /**
1415
1419
  * Broadcast variables to all WebViews, optionally excluding one.
@@ -1491,6 +1495,8 @@ function Overlay(props) {
1491
1495
  // so we retry a few times.
1492
1496
  requestAnimationFrame(() => {
1493
1497
  sendVarsToWebView(pos);
1498
+ // Send onboarding state once after vars
1499
+ sendOnboardingStateToWebView(pos);
1494
1500
  });
1495
1501
  // Retry after a short delay in case the first send didn't work
1496
1502
  setTimeout(() => {
@@ -1639,6 +1645,8 @@ function Overlay(props) {
1639
1645
  if (__DEV__)
1640
1646
  console.log("[Rampkit] onLoadEnd init send vars", i);
1641
1647
  sendVarsToWebView(i, true);
1648
+ // Send onboarding state on initial load (separate from vars to avoid loops)
1649
+ sendOnboardingStateToWebView(i);
1642
1650
  }, onMessage: (ev) => {
1643
1651
  var _a, _b, _c, _d;
1644
1652
  const raw = ev.nativeEvent.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampkit-expo-dev",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "The Expo SDK for RampKit. Build, test, and personalize app onboardings with instant updates.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",