rampkit-expo-dev 0.0.102 → 0.0.104
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/build/EventManager.d.ts +2 -1
- package/build/EventManager.js +3 -2
- package/build/RampkitOverlay.js +31 -3
- package/build/constants.d.ts +1 -1
- package/build/constants.js +1 -1
- package/package.json +1 -1
package/build/EventManager.d.ts
CHANGED
|
@@ -152,8 +152,9 @@ declare class EventManager {
|
|
|
152
152
|
trackScreenNavigated(fromScreenName: string | null, toScreenName: string, direction: "forward" | "back", trigger?: "button"): void;
|
|
153
153
|
/**
|
|
154
154
|
* Track variable set event
|
|
155
|
+
* @param screenName - The screen where the variable was set (captured at time of change, not firing)
|
|
155
156
|
*/
|
|
156
|
-
trackVariableSet(variableName: string, previousValue: any, newValue: any): void;
|
|
157
|
+
trackVariableSet(variableName: string, previousValue: any, newValue: any, screenName?: string | null): void;
|
|
157
158
|
/**
|
|
158
159
|
* Reset the event manager (e.g., on logout)
|
|
159
160
|
*/
|
package/build/EventManager.js
CHANGED
|
@@ -379,8 +379,9 @@ class EventManager {
|
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* Track variable set event
|
|
382
|
+
* @param screenName - The screen where the variable was set (captured at time of change, not firing)
|
|
382
383
|
*/
|
|
383
|
-
trackVariableSet(variableName, previousValue, newValue) {
|
|
384
|
+
trackVariableSet(variableName, previousValue, newValue, screenName) {
|
|
384
385
|
const valueType = (() => {
|
|
385
386
|
if (newValue === null || newValue === undefined)
|
|
386
387
|
return "unknown";
|
|
@@ -397,7 +398,7 @@ class EventManager {
|
|
|
397
398
|
newValue,
|
|
398
399
|
previousValue,
|
|
399
400
|
source: "user_input",
|
|
400
|
-
});
|
|
401
|
+
}, screenName ? { screenName } : undefined);
|
|
401
402
|
}
|
|
402
403
|
/**
|
|
403
404
|
* Reset the event manager (e.g., on logout)
|
package/build/RampkitOverlay.js
CHANGED
|
@@ -1070,8 +1070,8 @@ function Overlay(props) {
|
|
|
1070
1070
|
if (pending.timer) {
|
|
1071
1071
|
clearTimeout(pending.timer);
|
|
1072
1072
|
}
|
|
1073
|
-
// Fire the event
|
|
1074
|
-
EventManager_1.eventManager.trackVariableSet(variableName, pending.previousValue, pending.newValue);
|
|
1073
|
+
// Fire the event with the screen name captured when variable changed
|
|
1074
|
+
EventManager_1.eventManager.trackVariableSet(variableName, pending.previousValue, pending.newValue, pending.screenName);
|
|
1075
1075
|
// Remove from pending
|
|
1076
1076
|
pendingVariableEventsRef.current.delete(variableName);
|
|
1077
1077
|
};
|
|
@@ -1082,14 +1082,18 @@ function Overlay(props) {
|
|
|
1082
1082
|
if (existing === null || existing === void 0 ? void 0 : existing.timer) {
|
|
1083
1083
|
clearTimeout(existing.timer);
|
|
1084
1084
|
}
|
|
1085
|
+
// Capture current screen name at time of change (not when event fires)
|
|
1086
|
+
const currentScreen = props.screens[activeScreenIndexRef.current];
|
|
1087
|
+
const screenName = (currentScreen === null || currentScreen === void 0 ? void 0 : currentScreen.label) || null;
|
|
1085
1088
|
// Schedule new timer
|
|
1086
1089
|
const timer = setTimeout(() => {
|
|
1087
1090
|
fireVariableSetEvent(variableName);
|
|
1088
1091
|
}, VARIABLE_DEBOUNCE_MS);
|
|
1089
|
-
// Store pending event
|
|
1092
|
+
// Store pending event with screen name
|
|
1090
1093
|
pendingVariableEventsRef.current.set(variableName, {
|
|
1091
1094
|
previousValue: existing ? existing.previousValue : previousValue, // Keep original previousValue
|
|
1092
1095
|
newValue,
|
|
1096
|
+
screenName: existing ? existing.screenName : screenName, // Keep original screenName
|
|
1093
1097
|
timer,
|
|
1094
1098
|
});
|
|
1095
1099
|
};
|
|
@@ -2059,6 +2063,10 @@ function Overlay(props) {
|
|
|
2059
2063
|
}
|
|
2060
2064
|
// 5) Onboarding finished event from page
|
|
2061
2065
|
if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:onboarding-finished") {
|
|
2066
|
+
// Only process from active screen to prevent duplicate events
|
|
2067
|
+
if (!isScreenActive(i)) {
|
|
2068
|
+
return;
|
|
2069
|
+
}
|
|
2062
2070
|
setOnboardingCompleted(true);
|
|
2063
2071
|
try {
|
|
2064
2072
|
(_a = props.onOnboardingFinished) === null || _a === void 0 ? void 0 : _a.call(props, data === null || data === void 0 ? void 0 : data.payload);
|
|
@@ -2069,6 +2077,10 @@ function Overlay(props) {
|
|
|
2069
2077
|
}
|
|
2070
2078
|
// 6) Request to show paywall
|
|
2071
2079
|
if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:show-paywall") {
|
|
2080
|
+
// Only process from active screen to prevent duplicate events
|
|
2081
|
+
if (!isScreenActive(i)) {
|
|
2082
|
+
return;
|
|
2083
|
+
}
|
|
2072
2084
|
try {
|
|
2073
2085
|
(_b = props.onShowPaywall) === null || _b === void 0 ? void 0 : _b.call(props, data === null || data === void 0 ? void 0 : data.payload);
|
|
2074
2086
|
}
|
|
@@ -2116,6 +2128,10 @@ function Overlay(props) {
|
|
|
2116
2128
|
return;
|
|
2117
2129
|
}
|
|
2118
2130
|
if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:close") {
|
|
2131
|
+
// Only process from active screen to prevent duplicate events
|
|
2132
|
+
if (!isScreenActive(i)) {
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2119
2135
|
// Track close action for onboarding completion
|
|
2120
2136
|
try {
|
|
2121
2137
|
(_c = props.onCloseAction) === null || _c === void 0 ? void 0 : _c.call(props, i, ((_d = props.screens[i]) === null || _d === void 0 ? void 0 : _d.id) || "");
|
|
@@ -2166,6 +2182,10 @@ function Overlay(props) {
|
|
|
2166
2182
|
return;
|
|
2167
2183
|
}
|
|
2168
2184
|
if (raw === "rampkit:onboarding-finished") {
|
|
2185
|
+
// Only process from active screen to prevent duplicate events
|
|
2186
|
+
if (!isScreenActive(i)) {
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2169
2189
|
setOnboardingCompleted(true);
|
|
2170
2190
|
try {
|
|
2171
2191
|
(_e = props.onOnboardingFinished) === null || _e === void 0 ? void 0 : _e.call(props, undefined);
|
|
@@ -2175,6 +2195,10 @@ function Overlay(props) {
|
|
|
2175
2195
|
return;
|
|
2176
2196
|
}
|
|
2177
2197
|
if (raw === "rampkit:show-paywall") {
|
|
2198
|
+
// Only process from active screen to prevent duplicate events
|
|
2199
|
+
if (!isScreenActive(i)) {
|
|
2200
|
+
return;
|
|
2201
|
+
}
|
|
2178
2202
|
try {
|
|
2179
2203
|
(_f = props.onShowPaywall) === null || _f === void 0 ? void 0 : _f.call(props);
|
|
2180
2204
|
}
|
|
@@ -2213,6 +2237,10 @@ function Overlay(props) {
|
|
|
2213
2237
|
return;
|
|
2214
2238
|
}
|
|
2215
2239
|
if (raw === "rampkit:close") {
|
|
2240
|
+
// Only process from active screen to prevent duplicate events
|
|
2241
|
+
if (!isScreenActive(i)) {
|
|
2242
|
+
return;
|
|
2243
|
+
}
|
|
2216
2244
|
// Track close action for onboarding completion
|
|
2217
2245
|
try {
|
|
2218
2246
|
(_g = props.onCloseAction) === null || _g === void 0 ? void 0 : _g.call(props, i, ((_h = props.screens[i]) === null || _h === void 0 ? void 0 : _h.id) || "");
|
package/build/constants.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* RampKit SDK Constants
|
|
3
3
|
* Note: SDK_VERSION is updated by sync-versions.sh from package.json
|
|
4
4
|
*/
|
|
5
|
-
export declare const SDK_VERSION = "0.0.
|
|
5
|
+
export declare const SDK_VERSION = "0.0.102";
|
|
6
6
|
export declare const ENDPOINTS: {
|
|
7
7
|
readonly BASE_URL: "https://uustlzuvjmochxkxatfx.supabase.co/functions/v1";
|
|
8
8
|
readonly APP_USERS: "/app-users";
|
package/build/constants.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.SUPABASE_ANON_KEY = exports.CAPABILITIES = exports.STORAGE_KEYS = exports.MANIFEST_BASE_URL = exports.ENDPOINTS = exports.SDK_VERSION = void 0;
|
|
8
|
-
exports.SDK_VERSION = "0.0.
|
|
8
|
+
exports.SDK_VERSION = "0.0.102";
|
|
9
9
|
exports.ENDPOINTS = {
|
|
10
10
|
BASE_URL: "https://uustlzuvjmochxkxatfx.supabase.co/functions/v1",
|
|
11
11
|
APP_USERS: "/app-users",
|
package/package.json
CHANGED