rampkit-expo-dev 0.0.74 → 0.0.76

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.
@@ -1002,6 +1002,8 @@ ${js}
1002
1002
  const SLIDE_FADE_OFFSET = 200;
1003
1003
  const SLIDE_FADE_DURATION = 320;
1004
1004
  function Overlay(props) {
1005
+ // Get explicit window dimensions to prevent flex-based layout recalculations during transitions
1006
+ const { width: windowWidth, height: windowHeight } = (0, react_native_1.useWindowDimensions)();
1005
1007
  const pagerRef = (0, react_1.useRef)(null);
1006
1008
  const [index, setIndex] = (0, react_1.useState)(0);
1007
1009
  const [loadedCount, setLoadedCount] = (0, react_1.useState)(0);
@@ -1627,7 +1629,7 @@ function Overlay(props) {
1627
1629
  opacity: pagerOpacity,
1628
1630
  transform: [{ translateX: pagerTranslateX }],
1629
1631
  },
1630
- ], children: (0, jsx_runtime_1.jsx)(react_native_pager_view_1.default, { ref: pagerRef, style: react_native_1.StyleSheet.absoluteFill, scrollEnabled: false, initialPage: 0, onPageSelected: onPageSelected, offscreenPageLimit: props.screens.length, overScrollMode: "never", children: docs.map((doc, i) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.page, renderToHardwareTextureAndroid: true, children: (0, jsx_runtime_1.jsx)(react_native_webview_1.WebView, { ref: (r) => (webviewsRef.current[i] = r), style: styles.webview, originWhitelist: ["*"], source: { html: doc }, injectedJavaScriptBeforeContentLoaded: exports.injectedHardening + exports.injectedDynamicTapHandler + exports.injectedButtonAnimations, injectedJavaScript: exports.injectedNoSelect + exports.injectedVarsHandler + exports.injectedButtonAnimations, automaticallyAdjustContentInsets: false, contentInsetAdjustmentBehavior: "never", bounces: false, scrollEnabled: false, overScrollMode: "never", scalesPageToFit: false, showsHorizontalScrollIndicator: false, dataDetectorTypes: "none", allowsLinkPreview: false, allowsInlineMediaPlayback: true, mediaPlaybackRequiresUserAction: false, cacheEnabled: true, javaScriptEnabled: true, domStorageEnabled: true, hideKeyboardAccessoryView: true, onLoadEnd: () => {
1632
+ ], children: (0, jsx_runtime_1.jsx)(react_native_pager_view_1.default, { ref: pagerRef, style: react_native_1.StyleSheet.absoluteFill, scrollEnabled: false, initialPage: 0, onPageSelected: onPageSelected, offscreenPageLimit: props.screens.length, overScrollMode: "never", children: docs.map((doc, i) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: windowWidth, height: windowHeight }, renderToHardwareTextureAndroid: true, children: (0, jsx_runtime_1.jsx)(react_native_webview_1.WebView, { ref: (r) => (webviewsRef.current[i] = r), style: { width: windowWidth, height: windowHeight }, originWhitelist: ["*"], source: { html: doc }, injectedJavaScriptBeforeContentLoaded: exports.injectedHardening + exports.injectedDynamicTapHandler + exports.injectedButtonAnimations, injectedJavaScript: exports.injectedNoSelect + exports.injectedVarsHandler + exports.injectedButtonAnimations, automaticallyAdjustContentInsets: false, contentInsetAdjustmentBehavior: "never", bounces: false, scrollEnabled: false, overScrollMode: "never", scalesPageToFit: false, showsHorizontalScrollIndicator: false, dataDetectorTypes: "none", allowsLinkPreview: false, allowsInlineMediaPlayback: true, mediaPlaybackRequiresUserAction: false, cacheEnabled: true, javaScriptEnabled: true, domStorageEnabled: true, hideKeyboardAccessoryView: true, onLoadEnd: () => {
1631
1633
  // Only initialize each screen ONCE to avoid repeated processing
1632
1634
  if (initializedScreensRef.current.has(i)) {
1633
1635
  if (__DEV__)
@@ -1648,10 +1650,14 @@ function Overlay(props) {
1648
1650
  if (__DEV__)
1649
1651
  console.log("[Rampkit] onLoadEnd initializing screen", i);
1650
1652
  sendVarsToWebView(i, true);
1651
- // Only send onboarding state to the ACTIVE screen (index 0 on initial load)
1652
- if (i === activeScreenIndexRef.current) {
1653
- sendOnboardingStateToWebView(i);
1654
- }
1653
+ // Send onboarding state to ALL screens during initial load (matching iOS SDK behavior).
1654
+ // This prevents a visual glitch where content shifts on first navigation to each screen.
1655
+ // Previously, we only sent state to the active screen (screen 0), which meant screens 1, 2, etc.
1656
+ // received their onboarding state for the first time during navigation - causing DOM updates
1657
+ // and layout shifts visible during the transition animation.
1658
+ // By sending state to all screens upfront, the DOM is already in its final state
1659
+ // before any navigation occurs.
1660
+ sendOnboardingStateToWebView(i);
1655
1661
  }, onMessage: (ev) => {
1656
1662
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1657
1663
  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.74",
3
+ "version": "0.0.76",
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",