@namiml/expo-sdk 3.4.1-dev.202605280043 → 3.4.1-dev.202605300006
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 +22 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/NamiView.tsx +19 -4
- package/src/components/elements/NamiProgressIndicator.tsx +3 -1
- package/src/index.ts +5 -1
package/dist/index.cjs
CHANGED
|
@@ -3306,6 +3306,7 @@ const FocusContext = require$$0.createContext(true);
|
|
|
3306
3306
|
require$$0.createContext(null);
|
|
3307
3307
|
const FocusProvider = ({ children, enabled }) => (jsxRuntimeExports.jsx(FocusContext.Provider, { value: enabled, children: children }));
|
|
3308
3308
|
|
|
3309
|
+
const { NamiFlowManager } = sdkCore._internal;
|
|
3309
3310
|
const DEFAULT_CONTEXT = {
|
|
3310
3311
|
productGroups: [],
|
|
3311
3312
|
customAttributes: {},
|
|
@@ -3394,8 +3395,14 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
|
|
|
3394
3395
|
const activeFlow = flowRef.current;
|
|
3395
3396
|
if (!activeFlow)
|
|
3396
3397
|
return;
|
|
3397
|
-
|
|
3398
|
-
|
|
3398
|
+
// Cast comparison sides to `unknown` first — `currentFlow` is typed via
|
|
3399
|
+
// the `_internal` namespace's NamiFlow class declaration (NAM-1217),
|
|
3400
|
+
// `activeFlow` (via flowRef) is typed via the public-barrel's NamiFlow.
|
|
3401
|
+
// Identical runtime class, but bundled .d.ts emits each separately and
|
|
3402
|
+
// TS treats them as nominally distinct. See the cast in the
|
|
3403
|
+
// presentFlow block below.
|
|
3404
|
+
if (NamiFlowManager.instance.currentFlow === activeFlow || NamiFlowManager.instance.flowOpen) {
|
|
3405
|
+
NamiFlowManager.finish();
|
|
3399
3406
|
}
|
|
3400
3407
|
flowRef.current = undefined;
|
|
3401
3408
|
lastAppearStepIdRef.current = '';
|
|
@@ -3426,7 +3433,7 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
|
|
|
3426
3433
|
&& attempt.flow === activeFlow
|
|
3427
3434
|
&& activePaywallId === attempt.paywallId
|
|
3428
3435
|
&& (activeFlow?.currentFlowStep?.type === 'exit'
|
|
3429
|
-
||
|
|
3436
|
+
|| NamiFlowManager.instance.flowOpen === false);
|
|
3430
3437
|
const shouldFallbackClose = !isClosing
|
|
3431
3438
|
&& !!attempt
|
|
3432
3439
|
&& ((attempt.flow === activeFlow
|
|
@@ -3576,15 +3583,15 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
|
|
|
3576
3583
|
}, [finishActiveFlow]);
|
|
3577
3584
|
// ─── Flow handlers ───────────────────────────────────────────────────
|
|
3578
3585
|
require$$0.useEffect(() => {
|
|
3579
|
-
|
|
3586
|
+
NamiFlowManager.registerStepHandoff((handoffTag, handoffData) => {
|
|
3580
3587
|
onHandoffRef.current?.(handoffTag, handoffData);
|
|
3581
3588
|
});
|
|
3582
|
-
|
|
3589
|
+
NamiFlowManager.registerEventHandler((eventData) => {
|
|
3583
3590
|
onFlowEventRef.current?.(eventData);
|
|
3584
3591
|
});
|
|
3585
3592
|
return () => {
|
|
3586
|
-
|
|
3587
|
-
|
|
3593
|
+
NamiFlowManager.registerStepHandoff(undefined);
|
|
3594
|
+
NamiFlowManager.registerEventHandler(undefined);
|
|
3588
3595
|
};
|
|
3589
3596
|
}, []);
|
|
3590
3597
|
// ─── ExpoUIAdapter listener subscriptions ────────────────────────────
|
|
@@ -3705,11 +3712,16 @@ const NamiView = ({ placement, url, onClose, onSignIn, onDeepLink, onPurchase, o
|
|
|
3705
3712
|
return;
|
|
3706
3713
|
if (flowRef.current)
|
|
3707
3714
|
return;
|
|
3708
|
-
const flow =
|
|
3715
|
+
const flow = NamiFlowManager.instance.presentFlow(campaignData, {
|
|
3709
3716
|
type: resolvedLaunch.type,
|
|
3710
3717
|
value: resolvedLaunch.value,
|
|
3711
3718
|
context: ctx,
|
|
3712
3719
|
}, ctx);
|
|
3720
|
+
// `presentFlow` returns the class from the `_internal` namespace
|
|
3721
|
+
// (NAM-1217); flowRef.current is typed via the public-barrel re-export
|
|
3722
|
+
// of the same class. Bundled .d.ts files emit each declaration in
|
|
3723
|
+
// isolation, so TypeScript sees them as nominally distinct classes
|
|
3724
|
+
// even though they're the same runtime constructor. Cast to align.
|
|
3713
3725
|
flowRef.current = flow;
|
|
3714
3726
|
}, [campaignData, resolvedLaunch.type, resolvedLaunch.value, ctx, reloadKey]);
|
|
3715
3727
|
require$$0.useEffect(() => {
|
|
@@ -4031,9 +4043,9 @@ Object.defineProperty(exports, "NamiPaywallManager", {
|
|
|
4031
4043
|
enumerable: true,
|
|
4032
4044
|
get: function () { return sdkCore.NamiPaywallManager; }
|
|
4033
4045
|
});
|
|
4034
|
-
Object.defineProperty(exports, "
|
|
4046
|
+
Object.defineProperty(exports, "NamiPurchaseManager", {
|
|
4035
4047
|
enumerable: true,
|
|
4036
|
-
get: function () { return sdkCore.
|
|
4048
|
+
get: function () { return sdkCore.NamiPurchaseManager; }
|
|
4037
4049
|
});
|
|
4038
4050
|
exports.ExpoDeviceAdapter = ExpoDeviceAdapter;
|
|
4039
4051
|
exports.ExpoPurchaseAdapter = ExpoPurchaseAdapter;
|