rampkit-expo-dev 0.0.95 → 0.0.97
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
CHANGED
|
@@ -149,7 +149,7 @@ declare class EventManager {
|
|
|
149
149
|
/**
|
|
150
150
|
* Track screen navigation
|
|
151
151
|
*/
|
|
152
|
-
trackScreenNavigated(
|
|
152
|
+
trackScreenNavigated(fromScreenName: string | null, toScreenName: string, direction: "forward" | "back", trigger?: "button"): void;
|
|
153
153
|
/**
|
|
154
154
|
* Track variable set event
|
|
155
155
|
*/
|
package/build/EventManager.js
CHANGED
|
@@ -369,10 +369,10 @@ class EventManager {
|
|
|
369
369
|
/**
|
|
370
370
|
* Track screen navigation
|
|
371
371
|
*/
|
|
372
|
-
trackScreenNavigated(
|
|
372
|
+
trackScreenNavigated(fromScreenName, toScreenName, direction, trigger = "button") {
|
|
373
373
|
this.track("screen_navigated", {
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
fromScreenName,
|
|
375
|
+
toScreenName,
|
|
376
376
|
direction,
|
|
377
377
|
trigger,
|
|
378
378
|
});
|
|
@@ -6,6 +6,7 @@ export declare const injectedDynamicTapHandler = "\n(function() {\n if (windo
|
|
|
6
6
|
export declare const injectedButtonAnimations = "\n(function(){\n try {\n if (window.__rkButtonAnimApplied) return true;\n window.__rkButtonAnimApplied = true;\n\n var pressed = null;\n var pressedOriginalTransform = '';\n var pressedOriginalOpacity = '';\n var pressedOriginalTransition = '';\n var releaseTimer = null;\n\n // Find interactive element - looks for clickable-looking elements\n function findInteractive(el) {\n var current = el;\n for (var i = 0; i < 20 && current && current !== document.body && current !== document.documentElement; i++) {\n if (!current || !current.tagName) { current = current.parentElement; continue; }\n var tag = current.tagName.toLowerCase();\n\n // Skip tiny elements (likely icons inside buttons)\n var rect = current.getBoundingClientRect();\n if (rect.width < 20 || rect.height < 20) { current = current.parentElement; continue; }\n\n // Match standard interactive elements\n if (tag === 'button' || tag === 'a' || tag === 'input' || tag === 'select') return current;\n\n // Match elements with tap/click-related data attributes\n // Exclude lifecycle attributes like data-on-open-actions, data-on-close-actions\n var attrs = current.attributes;\n if (attrs) {\n for (var j = 0; j < attrs.length; j++) {\n var attrName = attrs[j].name.toLowerCase();\n // Skip lifecycle attributes (on-open, on-close, on-load, on-appear, etc.)\n // These are for screen lifecycle events, not user tap interactions\n var isLifecycleAttr = (attrName.indexOf('on-open') !== -1 || attrName.indexOf('on-close') !== -1 ||\n attrName.indexOf('on-load') !== -1 || attrName.indexOf('on-appear') !== -1 ||\n attrName.indexOf('onopen') !== -1 || attrName.indexOf('onclose') !== -1 ||\n attrName.indexOf('onload') !== -1 || attrName.indexOf('onappear') !== -1);\n if (isLifecycleAttr) {\n continue;\n }\n // Match tap/click interaction attributes\n if (attrName.indexOf('click') !== -1 || attrName.indexOf('tap') !== -1 ||\n attrName.indexOf('action') !== -1 || attrName.indexOf('navigate') !== -1 ||\n attrName.indexOf('press') !== -1) {\n return current;\n }\n }\n }\n\n // Match elements with onclick\n if (current.onclick || current.hasAttribute('onclick')) return current;\n\n // Match elements with role=\"button\"\n if (current.getAttribute('role') === 'button') return current;\n\n // Match any element with an ID containing button/btn/cta\n var id = current.id || '';\n if (id && (id.toLowerCase().indexOf('button') !== -1 || id.toLowerCase().indexOf('btn') !== -1 || id.toLowerCase().indexOf('cta') !== -1)) return current;\n\n // Match elements with button-like classes\n var className = current.className;\n if (className && typeof className === 'string') {\n var cls = className.toLowerCase();\n if (cls.indexOf('btn') !== -1 || cls.indexOf('button') !== -1 || cls.indexOf('cta') !== -1 ||\n cls.indexOf('clickable') !== -1 || cls.indexOf('tappable') !== -1 || cls.indexOf('pressable') !== -1) {\n return current;\n }\n }\n\n // Match elements with cursor pointer\n try {\n var computed = window.getComputedStyle(current);\n if (computed && computed.cursor === 'pointer') return current;\n } catch(e) {}\n\n current = current.parentElement;\n }\n return null;\n }\n\n function applyPressedStyle(el) {\n if (!el || !el.style) return;\n // Save original styles\n pressedOriginalTransform = el.style.transform || '';\n pressedOriginalOpacity = el.style.opacity || '';\n pressedOriginalTransition = el.style.transition || '';\n // Apply pressed style with inline styles for maximum specificity\n el.style.transition = 'transform 80ms cubic-bezier(0.25, 0.1, 0.25, 1), opacity 80ms cubic-bezier(0.25, 0.1, 0.25, 1)';\n el.style.transform = 'scale(0.97)';\n el.style.opacity = '0.8';\n }\n\n function applyReleasedStyle(el) {\n if (!el || !el.style) return;\n // Apply spring-back animation\n el.style.transition = 'transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1)';\n el.style.transform = pressedOriginalTransform || 'scale(1)';\n el.style.opacity = pressedOriginalOpacity || '1';\n }\n\n function resetStyle(el) {\n if (!el || !el.style) return;\n el.style.transform = pressedOriginalTransform;\n el.style.opacity = pressedOriginalOpacity;\n el.style.transition = pressedOriginalTransition;\n }\n\n function onTouchStart(e) {\n try {\n var target = findInteractive(e.target);\n if (!target) return;\n if (releaseTimer) { clearTimeout(releaseTimer); releaseTimer = null; }\n if (pressed && pressed !== target) { resetStyle(pressed); }\n applyPressedStyle(target);\n pressed = target;\n } catch(err) {}\n }\n \n function onTouchEnd(e) {\n try {\n if (!pressed) return;\n var t = pressed;\n applyReleasedStyle(t);\n releaseTimer = setTimeout(function() {\n resetStyle(t);\n releaseTimer = null;\n }, 300);\n pressed = null;\n } catch(err) {}\n }\n \n function onTouchCancel(e) {\n try {\n if (!pressed) return;\n resetStyle(pressed);\n pressed = null;\n if (releaseTimer) { clearTimeout(releaseTimer); releaseTimer = null; }\n } catch(err) {}\n }\n \n // Use capture phase for immediate response before any other handlers\n document.addEventListener('touchstart', onTouchStart, { passive: true, capture: true });\n document.addEventListener('touchend', onTouchEnd, { passive: true, capture: true });\n document.addEventListener('touchcancel', onTouchCancel, { passive: true, capture: true });\n // Mouse events for testing\n document.addEventListener('mousedown', onTouchStart, { passive: true, capture: true });\n document.addEventListener('mouseup', onTouchEnd, { passive: true, capture: true });\n \n } catch (err) {}\n true;\n})();\n";
|
|
7
7
|
export type ScreenPayload = {
|
|
8
8
|
id: string;
|
|
9
|
+
label?: string;
|
|
9
10
|
html: string;
|
|
10
11
|
css?: string;
|
|
11
12
|
js?: string;
|
package/build/RampkitOverlay.js
CHANGED
|
@@ -1486,7 +1486,6 @@ function Overlay(props) {
|
|
|
1486
1486
|
// in a stack and we animate individual screen opacity/transform values.
|
|
1487
1487
|
// This ensures all WebViews complete their first paint before any navigation.
|
|
1488
1488
|
const navigateToIndex = (nextIndex, animation = "fade") => {
|
|
1489
|
-
var _a, _b;
|
|
1490
1489
|
if (nextIndex === index ||
|
|
1491
1490
|
nextIndex < 0 ||
|
|
1492
1491
|
nextIndex >= props.screens.length)
|
|
@@ -1497,10 +1496,12 @@ function Overlay(props) {
|
|
|
1497
1496
|
activeScreenIndexRef.current = nextIndex;
|
|
1498
1497
|
screenActivationTimeRef.current[nextIndex] = Date.now();
|
|
1499
1498
|
// Track screen navigation event
|
|
1500
|
-
const
|
|
1501
|
-
const
|
|
1499
|
+
const fromScreen = props.screens[index];
|
|
1500
|
+
const toScreen = props.screens[nextIndex];
|
|
1501
|
+
const fromScreenName = (fromScreen === null || fromScreen === void 0 ? void 0 : fromScreen.label) || (fromScreen === null || fromScreen === void 0 ? void 0 : fromScreen.id) || null;
|
|
1502
|
+
const toScreenName = (toScreen === null || toScreen === void 0 ? void 0 : toScreen.label) || (toScreen === null || toScreen === void 0 ? void 0 : toScreen.id) || `screen_${nextIndex}`;
|
|
1502
1503
|
const navigationDirection = nextIndex > index ? "forward" : "back";
|
|
1503
|
-
EventManager_1.eventManager.trackScreenNavigated(
|
|
1504
|
+
EventManager_1.eventManager.trackScreenNavigated(fromScreenName, toScreenName, navigationDirection);
|
|
1504
1505
|
// Parse animation type case-insensitively
|
|
1505
1506
|
const animationType = (animation === null || animation === void 0 ? void 0 : animation.toLowerCase()) || "fade";
|
|
1506
1507
|
const currentScreenAnim = screenAnims[index];
|
package/build/types.d.ts
CHANGED
|
@@ -273,10 +273,10 @@ export interface PurchaseRestoredProperties {
|
|
|
273
273
|
originalTransactionId?: string;
|
|
274
274
|
}
|
|
275
275
|
export interface ScreenNavigatedProperties {
|
|
276
|
-
/**
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
|
|
276
|
+
/** Name of the screen navigated from (null if first screen) */
|
|
277
|
+
fromScreenName: string | null;
|
|
278
|
+
/** Name of the screen navigated to */
|
|
279
|
+
toScreenName: string;
|
|
280
280
|
/** Direction of navigation */
|
|
281
281
|
direction: "forward" | "back";
|
|
282
282
|
/** What triggered the navigation */
|
package/package.json
CHANGED