@namiml/expo-sdk 3.4.1-dev.202605270014 → 3.4.1-dev.202605280043

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/dist/index.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  var sdkCore = require('@namiml/sdk-core');
4
4
  var reactNative = require('react-native');
5
5
  var require$$0 = require('react');
6
+ var reactNativeSafeAreaContext = require('react-native-safe-area-context');
6
7
 
7
8
  class ExpoStorageAdapter {
8
9
  constructor() {
@@ -2941,6 +2942,17 @@ function renderResolvedComponent(componentType, resolvedComponent, scaleFactor,
2941
2942
  function splitContainerStyles(style) {
2942
2943
  const { paddingLeft, paddingRight, paddingTop, paddingBottom, flexDirection, alignItems, justifyContent, ...rest } = style;
2943
2944
  const outer = { ...rest };
2945
+ // The content container is always the page's vertical fill region: styles.outer
2946
+ // declares flex:1 and the body scrolls internally. A payload height of
2947
+ // 'fitContent' makes sizeStyles emit flexGrow:0, which would otherwise override
2948
+ // that fill and collapse the body to 0 height — the flex:1 ScrollView child
2949
+ // can't give an unbounded parent a height. Drop the flex-sizing keys so the
2950
+ // fill stays authoritative, matching the native renderers which always
2951
+ // fill-and-scroll this region regardless of the authored height.
2952
+ delete outer.flex;
2953
+ delete outer.flexGrow;
2954
+ delete outer.flexBasis;
2955
+ delete outer.flexShrink;
2944
2956
  const inner = {
2945
2957
  ...(paddingLeft != null ? { paddingLeft } : {}),
2946
2958
  ...(paddingRight != null ? { paddingRight } : {}),
@@ -3142,7 +3154,19 @@ catch {
3142
3154
  const fontGateCache = new Map();
3143
3155
  const PaywallScreen = ({ paywall, onClose, onCommitted, holdInteractionUntilFocus = false, isActive = true, }) => {
3144
3156
  const ctx = usePaywallContext();
3157
+ const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
3145
3158
  const focusReadyCtx = useFirstFocusReadyContext();
3159
+ // Push the measured top safe-area inset into paywall state so templates can
3160
+ // position chrome via ${state.safeAreaTop} (e.g. header topPadding,
3161
+ // background topMargin). Mirrors the native Android renderer, which measures
3162
+ // the display cutout and calls setSafeAreaTop. The full-bleed root lets the
3163
+ // background extend under the status bar; this offsets the content back into
3164
+ // the safe area. No safeAreaBottom equivalent exists in core/Android state.
3165
+ // Depend only on insets.top (stable per device/orientation) — depending on
3166
+ // ctx would re-run every render and loop through setState.
3167
+ require$$0.useEffect(() => {
3168
+ ctx.setSafeAreaTop(insets.top);
3169
+ }, [insets.top]);
3146
3170
  const scaleFactor = sdkCore.getDeviceScaleFactor(ctx.state.formFactor);
3147
3171
  const userInteractionEnabled = ctx.state.userInteractionEnabled !== false;
3148
3172
  const currentPageName = ctx.state.selectedPaywall === paywall
@@ -3329,8 +3353,13 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
3329
3353
  return launchRequest;
3330
3354
  if (url)
3331
3355
  return { type: 'url', value: url };
3332
- if (placement)
3333
- return { type: 'label', value: placement };
3356
+ if (placement) {
3357
+ // A URL/deeplink campaign carries its URL in the value. If one is handed
3358
+ // in via the placement prop, classify it as a url launch so core takes
3359
+ // the URL-match branch — otherwise the label lookup misses, no paywall
3360
+ // resolves, and NamiView spins on the placeholder forever.
3361
+ return { type: sdkCore.isValidUrl(placement) ? 'url' : 'label', value: placement };
3362
+ }
3334
3363
  return { type: undefined, value: '' };
3335
3364
  }, [launchRequest, url, placement]);
3336
3365
  const ctx = require$$0.useMemo(() => ({
@@ -3731,12 +3760,19 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
3731
3760
  setInitialScreenCommitted(true);
3732
3761
  }, []);
3733
3762
  if (isClosing) {
3734
- return jsxRuntimeExports.jsx(reactNative.SafeAreaView, { style: styles.root });
3763
+ return jsxRuntimeExports.jsx(reactNative.View, { style: styles.root });
3735
3764
  }
3736
3765
  if (loading || !campaignData || (!isFlowCampaign && !paywallData) || (isFlowCampaign && !hasFlowScreen)) {
3737
3766
  return jsxRuntimeExports.jsx(LaunchPlaceholder, { paywall: launchPlaceholderPaywall });
3738
3767
  }
3739
- return (jsxRuntimeExports.jsxs(reactNative.SafeAreaView, { style: styles.root, children: [jsxRuntimeExports.jsx(reactNative.StatusBar, { barStyle: "light-content" }), isFlowCampaign ? (jsxRuntimeExports.jsx(FlowRenderer, { paywalls: flowState.paywalls, currentIndex: flowState.index, animation: flowState.animation ?? undefined, onSettled: handleFlowAnimationSettled, onTransitionVisible: () => setPendingTransitionPaywall(null), onInitialCommitted: handleInitialCommitted, onClose: onClose, campaign: campaignData, context: ctx, flow: flowRef.current })) : (jsxRuntimeExports.jsx(PaywallProvider, { paywall: paywallData, context: ctx, campaign: campaignData, children: jsxRuntimeExports.jsx(PaywallScreen, { paywall: paywallData, onClose: requestClose, onCommitted: handleInitialCommitted, isActive: true }) })), !isClosing && showLaunchPlaceholder && jsxRuntimeExports.jsx(LaunchPlaceholder, { paywall: launchPlaceholderPaywall, overlay: true }), showTransitionPlaceholder && jsxRuntimeExports.jsx(LaunchPlaceholder, { paywall: pendingTransitionPaywall, overlay: true })] }));
3768
+ return (
3769
+ // Full-bleed root so the paywall background extends under the status bar and
3770
+ // home indicator (edge-to-edge). Safe-area insets are applied only to the
3771
+ // chrome (header/footer) via useSafeAreaInsets, not the whole tree — the
3772
+ // previous core SafeAreaView inset every edge and let the #000 root show
3773
+ // through as letterbox bands. SafeAreaProvider guarantees an inset context
3774
+ // even if the host app didn't mount one (nested providers are supported).
3775
+ jsxRuntimeExports.jsxs(reactNativeSafeAreaContext.SafeAreaProvider, { initialMetrics: reactNativeSafeAreaContext.initialWindowMetrics, style: styles.root, children: [jsxRuntimeExports.jsx(reactNative.StatusBar, { barStyle: "light-content", translucent: true, backgroundColor: "transparent" }), isFlowCampaign ? (jsxRuntimeExports.jsx(FlowRenderer, { paywalls: flowState.paywalls, currentIndex: flowState.index, animation: flowState.animation ?? undefined, onSettled: handleFlowAnimationSettled, onTransitionVisible: () => setPendingTransitionPaywall(null), onInitialCommitted: handleInitialCommitted, onClose: onClose, campaign: campaignData, context: ctx, flow: flowRef.current })) : (jsxRuntimeExports.jsx(PaywallProvider, { paywall: paywallData, context: ctx, campaign: campaignData, children: jsxRuntimeExports.jsx(PaywallScreen, { paywall: paywallData, onClose: requestClose, onCommitted: handleInitialCommitted, isActive: true }) })), !isClosing && showLaunchPlaceholder && jsxRuntimeExports.jsx(LaunchPlaceholder, { paywall: launchPlaceholderPaywall, overlay: true }), showTransitionPlaceholder && jsxRuntimeExports.jsx(LaunchPlaceholder, { paywall: pendingTransitionPaywall, overlay: true })] }));
3740
3776
  };
3741
3777
  const LaunchPlaceholder = ({ paywall, overlay = false }) => {
3742
3778
  const initialPageName = paywall?.template?.initialState?.currentPage ?? 'page1';