@cxpinsight/react-native 0.2.0
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/LICENSE +21 -0
- package/README.md +131 -0
- package/babel.js +101 -0
- package/instrumented/Pressable.d.ts +2 -0
- package/instrumented/Pressable.js +2 -0
- package/instrumented/ScrollView.d.ts +2 -0
- package/instrumented/ScrollView.js +2 -0
- package/instrumented/TextInput.d.ts +2 -0
- package/instrumented/TextInput.js +2 -0
- package/instrumented/TouchableOpacity.d.ts +2 -0
- package/instrumented/TouchableOpacity.js +2 -0
- package/lib/CXPinsight.d.ts +113 -0
- package/lib/CXPinsight.d.ts.map +1 -0
- package/lib/CXPinsight.js +831 -0
- package/lib/CXPinsight.js.map +1 -0
- package/lib/CXPinsightProvider.d.ts +19 -0
- package/lib/CXPinsightProvider.d.ts.map +1 -0
- package/lib/CXPinsightProvider.js +382 -0
- package/lib/CXPinsightProvider.js.map +1 -0
- package/lib/core/autoScreenTracker.d.ts +20 -0
- package/lib/core/autoScreenTracker.d.ts.map +1 -0
- package/lib/core/autoScreenTracker.js +66 -0
- package/lib/core/autoScreenTracker.js.map +1 -0
- package/lib/core/deepLinkTracker.d.ts +17 -0
- package/lib/core/deepLinkTracker.d.ts.map +1 -0
- package/lib/core/deepLinkTracker.js +81 -0
- package/lib/core/deepLinkTracker.js.map +1 -0
- package/lib/core/deviceInfo.d.ts +14 -0
- package/lib/core/deviceInfo.d.ts.map +1 -0
- package/lib/core/deviceInfo.js +166 -0
- package/lib/core/deviceInfo.js.map +1 -0
- package/lib/core/eventQueue.d.ts +23 -0
- package/lib/core/eventQueue.d.ts.map +1 -0
- package/lib/core/eventQueue.js +240 -0
- package/lib/core/eventQueue.js.map +1 -0
- package/lib/core/lifecycle.d.ts +18 -0
- package/lib/core/lifecycle.d.ts.map +1 -0
- package/lib/core/lifecycle.js +127 -0
- package/lib/core/lifecycle.js.map +1 -0
- package/lib/core/mobileRecorder.d.ts +15 -0
- package/lib/core/mobileRecorder.d.ts.map +1 -0
- package/lib/core/mobileRecorder.js +231 -0
- package/lib/core/mobileRecorder.js.map +1 -0
- package/lib/core/network.d.ts +10 -0
- package/lib/core/network.d.ts.map +1 -0
- package/lib/core/network.js +74 -0
- package/lib/core/network.js.map +1 -0
- package/lib/core/networkCapture.d.ts +22 -0
- package/lib/core/networkCapture.d.ts.map +1 -0
- package/lib/core/networkCapture.js +100 -0
- package/lib/core/networkCapture.js.map +1 -0
- package/lib/core/scrollCapture.d.ts +48 -0
- package/lib/core/scrollCapture.d.ts.map +1 -0
- package/lib/core/scrollCapture.js +221 -0
- package/lib/core/scrollCapture.js.map +1 -0
- package/lib/core/session.d.ts +15 -0
- package/lib/core/session.d.ts.map +1 -0
- package/lib/core/session.js +157 -0
- package/lib/core/session.js.map +1 -0
- package/lib/core/storage.d.ts +11 -0
- package/lib/core/storage.d.ts.map +1 -0
- package/lib/core/storage.js +59 -0
- package/lib/core/storage.js.map +1 -0
- package/lib/core/triggerEngine.d.ts +56 -0
- package/lib/core/triggerEngine.d.ts.map +1 -0
- package/lib/core/triggerEngine.js +432 -0
- package/lib/core/triggerEngine.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/lib/instrumented/Pressable.d.ts +9 -0
- package/lib/instrumented/Pressable.d.ts.map +1 -0
- package/lib/instrumented/Pressable.js +96 -0
- package/lib/instrumented/Pressable.js.map +1 -0
- package/lib/instrumented/ScrollView.d.ts +6 -0
- package/lib/instrumented/ScrollView.d.ts.map +1 -0
- package/lib/instrumented/ScrollView.js +101 -0
- package/lib/instrumented/ScrollView.js.map +1 -0
- package/lib/instrumented/TextInput.d.ts +9 -0
- package/lib/instrumented/TextInput.d.ts.map +1 -0
- package/lib/instrumented/TextInput.js +75 -0
- package/lib/instrumented/TextInput.js.map +1 -0
- package/lib/instrumented/TouchableOpacity.d.ts +11 -0
- package/lib/instrumented/TouchableOpacity.d.ts.map +1 -0
- package/lib/instrumented/TouchableOpacity.js +96 -0
- package/lib/instrumented/TouchableOpacity.js.map +1 -0
- package/lib/instrumented/index.d.ts +19 -0
- package/lib/instrumented/index.d.ts.map +1 -0
- package/lib/instrumented/index.js +28 -0
- package/lib/instrumented/index.js.map +1 -0
- package/lib/instrumented/interactionObserver.d.ts +29 -0
- package/lib/instrumented/interactionObserver.d.ts.map +1 -0
- package/lib/instrumented/interactionObserver.js +38 -0
- package/lib/instrumented/interactionObserver.js.map +1 -0
- package/lib/setup/AccessibilityScanner.d.ts +32 -0
- package/lib/setup/AccessibilityScanner.d.ts.map +1 -0
- package/lib/setup/AccessibilityScanner.js +127 -0
- package/lib/setup/AccessibilityScanner.js.map +1 -0
- package/lib/setup/ElementIdentifier.d.ts +65 -0
- package/lib/setup/ElementIdentifier.d.ts.map +1 -0
- package/lib/setup/ElementIdentifier.js +114 -0
- package/lib/setup/ElementIdentifier.js.map +1 -0
- package/lib/setup/ElementRegistry.d.ts +22 -0
- package/lib/setup/ElementRegistry.d.ts.map +1 -0
- package/lib/setup/ElementRegistry.js +47 -0
- package/lib/setup/ElementRegistry.js.map +1 -0
- package/lib/setup/SetupCodeEntry.d.ts +15 -0
- package/lib/setup/SetupCodeEntry.d.ts.map +1 -0
- package/lib/setup/SetupCodeEntry.js +198 -0
- package/lib/setup/SetupCodeEntry.js.map +1 -0
- package/lib/setup/SetupController.d.ts +29 -0
- package/lib/setup/SetupController.d.ts.map +1 -0
- package/lib/setup/SetupController.js +189 -0
- package/lib/setup/SetupController.js.map +1 -0
- package/lib/setup/SetupOverlay.d.ts +10 -0
- package/lib/setup/SetupOverlay.d.ts.map +1 -0
- package/lib/setup/SetupOverlay.js +408 -0
- package/lib/setup/SetupOverlay.js.map +1 -0
- package/lib/setup/TapInterceptor.d.ts +19 -0
- package/lib/setup/TapInterceptor.d.ts.map +1 -0
- package/lib/setup/TapInterceptor.js +98 -0
- package/lib/setup/TapInterceptor.js.map +1 -0
- package/lib/setup/TouchObserver.d.ts +25 -0
- package/lib/setup/TouchObserver.d.ts.map +1 -0
- package/lib/setup/TouchObserver.js +88 -0
- package/lib/setup/TouchObserver.js.map +1 -0
- package/lib/setup/TouchPatcher.d.ts +27 -0
- package/lib/setup/TouchPatcher.d.ts.map +1 -0
- package/lib/setup/TouchPatcher.js +182 -0
- package/lib/setup/TouchPatcher.js.map +1 -0
- package/lib/setup/index.d.ts +13 -0
- package/lib/setup/index.d.ts.map +1 -0
- package/lib/setup/index.js +45 -0
- package/lib/setup/index.js.map +1 -0
- package/lib/setup/useCXPElement.d.ts +25 -0
- package/lib/setup/useCXPElement.d.ts.map +1 -0
- package/lib/setup/useCXPElement.js +33 -0
- package/lib/setup/useCXPElement.js.map +1 -0
- package/lib/survey/SurveyModal.d.ts +10 -0
- package/lib/survey/SurveyModal.d.ts.map +1 -0
- package/lib/survey/SurveyModal.js +1650 -0
- package/lib/survey/SurveyModal.js.map +1 -0
- package/lib/survey/expressionEval.d.ts +10 -0
- package/lib/survey/expressionEval.d.ts.map +1 -0
- package/lib/survey/expressionEval.js +287 -0
- package/lib/survey/expressionEval.js.map +1 -0
- package/lib/survey/frequencyCap.d.ts +15 -0
- package/lib/survey/frequencyCap.d.ts.map +1 -0
- package/lib/survey/frequencyCap.js +116 -0
- package/lib/survey/frequencyCap.js.map +1 -0
- package/lib/survey/handsFreeVoice.d.ts +30 -0
- package/lib/survey/handsFreeVoice.d.ts.map +1 -0
- package/lib/survey/handsFreeVoice.js +312 -0
- package/lib/survey/handsFreeVoice.js.map +1 -0
- package/lib/survey/interpolate.d.ts +6 -0
- package/lib/survey/interpolate.d.ts.map +1 -0
- package/lib/survey/interpolate.js +61 -0
- package/lib/survey/interpolate.js.map +1 -0
- package/lib/survey/pagesFromV1.d.ts +6 -0
- package/lib/survey/pagesFromV1.d.ts.map +1 -0
- package/lib/survey/pagesFromV1.js +83 -0
- package/lib/survey/pagesFromV1.js.map +1 -0
- package/lib/survey/questions/CSATQuestion.d.ts +16 -0
- package/lib/survey/questions/CSATQuestion.d.ts.map +1 -0
- package/lib/survey/questions/CSATQuestion.js +37 -0
- package/lib/survey/questions/CSATQuestion.js.map +1 -0
- package/lib/survey/questions/DateQuestion.d.ts +20 -0
- package/lib/survey/questions/DateQuestion.d.ts.map +1 -0
- package/lib/survey/questions/DateQuestion.js +103 -0
- package/lib/survey/questions/DateQuestion.js.map +1 -0
- package/lib/survey/questions/ImagePickerQuestion.d.ts +33 -0
- package/lib/survey/questions/ImagePickerQuestion.d.ts.map +1 -0
- package/lib/survey/questions/ImagePickerQuestion.js +68 -0
- package/lib/survey/questions/ImagePickerQuestion.js.map +1 -0
- package/lib/survey/questions/ImageQuestion.d.ts +26 -0
- package/lib/survey/questions/ImageQuestion.d.ts.map +1 -0
- package/lib/survey/questions/ImageQuestion.js +24 -0
- package/lib/survey/questions/ImageQuestion.js.map +1 -0
- package/lib/survey/questions/MatrixCell.d.ts +45 -0
- package/lib/survey/questions/MatrixCell.d.ts.map +1 -0
- package/lib/survey/questions/MatrixCell.js +54 -0
- package/lib/survey/questions/MatrixCell.js.map +1 -0
- package/lib/survey/questions/MatrixDropdownQuestion.d.ts +29 -0
- package/lib/survey/questions/MatrixDropdownQuestion.d.ts.map +1 -0
- package/lib/survey/questions/MatrixDropdownQuestion.js +42 -0
- package/lib/survey/questions/MatrixDropdownQuestion.js.map +1 -0
- package/lib/survey/questions/MatrixDynamicQuestion.d.ts +26 -0
- package/lib/survey/questions/MatrixDynamicQuestion.d.ts.map +1 -0
- package/lib/survey/questions/MatrixDynamicQuestion.js +52 -0
- package/lib/survey/questions/MatrixDynamicQuestion.js.map +1 -0
- package/lib/survey/questions/MatrixQuestion.d.ts +38 -0
- package/lib/survey/questions/MatrixQuestion.d.ts.map +1 -0
- package/lib/survey/questions/MatrixQuestion.js +64 -0
- package/lib/survey/questions/MatrixQuestion.js.map +1 -0
- package/lib/survey/questions/MultiTextQuestion.d.ts +19 -0
- package/lib/survey/questions/MultiTextQuestion.d.ts.map +1 -0
- package/lib/survey/questions/MultiTextQuestion.js +64 -0
- package/lib/survey/questions/MultiTextQuestion.js.map +1 -0
- package/lib/survey/questions/MultipleChoiceQuestion.d.ts +25 -0
- package/lib/survey/questions/MultipleChoiceQuestion.d.ts.map +1 -0
- package/lib/survey/questions/MultipleChoiceQuestion.js +111 -0
- package/lib/survey/questions/MultipleChoiceQuestion.js.map +1 -0
- package/lib/survey/questions/NPSQuestion.d.ts +18 -0
- package/lib/survey/questions/NPSQuestion.d.ts.map +1 -0
- package/lib/survey/questions/NPSQuestion.js +62 -0
- package/lib/survey/questions/NPSQuestion.js.map +1 -0
- package/lib/survey/questions/PanelDynamicQuestion.d.ts +50 -0
- package/lib/survey/questions/PanelDynamicQuestion.d.ts.map +1 -0
- package/lib/survey/questions/PanelDynamicQuestion.js +62 -0
- package/lib/survey/questions/PanelDynamicQuestion.js.map +1 -0
- package/lib/survey/questions/RankingQuestion.d.ts +34 -0
- package/lib/survey/questions/RankingQuestion.d.ts.map +1 -0
- package/lib/survey/questions/RankingQuestion.js +85 -0
- package/lib/survey/questions/RankingQuestion.js.map +1 -0
- package/lib/survey/questions/RatingQuestion.d.ts +20 -0
- package/lib/survey/questions/RatingQuestion.d.ts.map +1 -0
- package/lib/survey/questions/RatingQuestion.js +53 -0
- package/lib/survey/questions/RatingQuestion.js.map +1 -0
- package/lib/survey/questions/TextQuestion.d.ts +17 -0
- package/lib/survey/questions/TextQuestion.d.ts.map +1 -0
- package/lib/survey/questions/TextQuestion.js +46 -0
- package/lib/survey/questions/TextQuestion.js.map +1 -0
- package/lib/survey/styleContract.d.ts +230 -0
- package/lib/survey/styleContract.d.ts.map +1 -0
- package/lib/survey/styleContract.js +365 -0
- package/lib/survey/styleContract.js.map +1 -0
- package/lib/survey/themePalette.d.ts +56 -0
- package/lib/survey/themePalette.d.ts.map +1 -0
- package/lib/survey/themePalette.js +63 -0
- package/lib/survey/themePalette.js.map +1 -0
- package/lib/survey/translationLookup.d.ts +4 -0
- package/lib/survey/translationLookup.d.ts.map +1 -0
- package/lib/survey/translationLookup.js +62 -0
- package/lib/survey/translationLookup.js.map +1 -0
- package/lib/survey/validate.d.ts +3 -0
- package/lib/survey/validate.d.ts.map +1 -0
- package/lib/survey/validate.js +159 -0
- package/lib/survey/validate.js.map +1 -0
- package/lib/survey/variablesResolver.d.ts +10 -0
- package/lib/survey/variablesResolver.d.ts.map +1 -0
- package/lib/survey/variablesResolver.js +107 -0
- package/lib/survey/variablesResolver.js.map +1 -0
- package/lib/survey/voiceParsers.d.ts +47 -0
- package/lib/survey/voiceParsers.d.ts.map +1 -0
- package/lib/survey/voiceParsers.js +310 -0
- package/lib/survey/voiceParsers.js.map +1 -0
- package/lib/types.d.ts +349 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +20 -0
- package/lib/types.js.map +1 -0
- package/metro.js +55 -0
- package/package.json +78 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ScrollView = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const interactionObserver_1 = require("./interactionObserver");
|
|
41
|
+
const scrollCapture_1 = require("../core/scrollCapture");
|
|
42
|
+
/**
|
|
43
|
+
* Instrumented ScrollView — kept for back-compat. **No longer required.**
|
|
44
|
+
*
|
|
45
|
+
* Scroll capture is now global: `core/scrollCapture` replaces React Native's
|
|
46
|
+
* ScrollView export at init, so the app's own plain `<ScrollView>` reports
|
|
47
|
+
* scroll depth without changing a single import. Requiring this component was
|
|
48
|
+
* app-code restructuring to fit the SDK — a screen using RN's ScrollView
|
|
49
|
+
* silently reported `percent_scrolled: 0` forever.
|
|
50
|
+
*
|
|
51
|
+
* Why this still contains reporting code
|
|
52
|
+
* --------------------------------------
|
|
53
|
+
* It emits ONLY when the global patch isn't installed. If a future RN version
|
|
54
|
+
* changes the export shape, `installScrollCapture()` returns false and this
|
|
55
|
+
* component keeps working exactly as it always did — so an app already using it
|
|
56
|
+
* never loses scroll capture. When the global patch IS installed it stays
|
|
57
|
+
* silent, because the RNScrollView it renders is already the capturing one and
|
|
58
|
+
* emitting here too would double-count every scroll.
|
|
59
|
+
*/
|
|
60
|
+
const SCROLL_NOTIFY_MS = 400; // don't notify more than ~2.5x/sec
|
|
61
|
+
const ScrollView = (0, react_1.forwardRef)((props, ref) => {
|
|
62
|
+
const { onScroll, ...rest } = props;
|
|
63
|
+
const lastNotifyRef = react_1.default.useRef(0);
|
|
64
|
+
const handleScroll = react_1.default.useCallback((e) => {
|
|
65
|
+
// Global capture already saw this scroll — don't count it twice.
|
|
66
|
+
if (!(0, scrollCapture_1.isScrollCaptureInstalled)()) {
|
|
67
|
+
const now = Date.now();
|
|
68
|
+
if (now - lastNotifyRef.current >= SCROLL_NOTIFY_MS) {
|
|
69
|
+
lastNotifyRef.current = now;
|
|
70
|
+
// Scroll depth as a percentage of the scrollable range (0–100), aligned with
|
|
71
|
+
// web's scrollPercent. Handles BOTH axes — horizontal (swipe/slide left-right)
|
|
72
|
+
// and vertical — reporting whichever axis actually scrolls.
|
|
73
|
+
const ne = e?.nativeEvent;
|
|
74
|
+
const off = ne?.contentOffset || { x: 0, y: 0 };
|
|
75
|
+
const cs = ne?.contentSize || { width: 0, height: 0 };
|
|
76
|
+
const lm = ne?.layoutMeasurement || { width: 0, height: 0 };
|
|
77
|
+
const pctOf = (o, content, layout) => Math.round(Math.min(100, Math.max(0, (o / Math.max(1, content - layout)) * 100)));
|
|
78
|
+
const horizontal = (cs.width - lm.width) > (cs.height - lm.height);
|
|
79
|
+
const pct = horizontal ? pctOf(off.x, cs.width, lm.width) : pctOf(off.y, cs.height, lm.height);
|
|
80
|
+
(0, interactionObserver_1.notifyInteraction)({
|
|
81
|
+
testID: rest.testID,
|
|
82
|
+
accessibilityLabel: rest.accessibilityLabel,
|
|
83
|
+
nativeID: rest.nativeID,
|
|
84
|
+
elementType: 'scroll_view',
|
|
85
|
+
text: `${pct}%`,
|
|
86
|
+
interactive: true,
|
|
87
|
+
// Horizontal movement is a swipe/slide, not a scroll — distinct interaction.
|
|
88
|
+
interactionType: horizontal ? 'swipe' : 'scroll',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
onScroll?.(e);
|
|
93
|
+
}, [onScroll, rest.testID, rest.accessibilityLabel, rest.nativeID]);
|
|
94
|
+
// scrollEventThrottle governs how often RN fires onScroll; 16ms ≈ per frame, then we
|
|
95
|
+
// throttle our own notifications above.
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, scrollEventThrottle: props.scrollEventThrottle ?? 16, ...rest, onScroll: handleScroll }));
|
|
97
|
+
});
|
|
98
|
+
exports.ScrollView = ScrollView;
|
|
99
|
+
ScrollView.displayName = 'ScrollView';
|
|
100
|
+
exports.default = ScrollView;
|
|
101
|
+
//# sourceMappingURL=ScrollView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollView.js","sourceRoot":"","sources":["../../src/instrumented/ScrollView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,+CAKsB;AACtB,+DAA0D;AAC1D,yDAAiE;AAEjE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,mCAAmC;AAEjE,MAAM,UAAU,GAAG,IAAA,kBAAU,EAAgC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEtC,MAAM,YAAY,GAAG,eAAK,CAAC,WAAW,CACpC,CAAC,CAA0C,EAAE,EAAE;QAC7C,iEAAiE;QACjE,IAAI,CAAC,IAAA,wCAAwB,GAAE,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACvB,IAAI,GAAG,G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B,EAAC;oBAChB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;oBAC3C,QAAQ,EAAG,IAA8B,CAAC,QAAQ;oBAClD,WAAW,EAAE,aAAa;oBAC1B,IAAI,EAAE,GAAG,GAAG,GAAG;oBACf,WAAW,EAAE,IAAI;oBACjB,6EAA6E;oBAC7E,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;iBACjD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC,EACD,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAChE,CAAC;IAEF,qFAAqF;IACrF,wCAAwC;IACxC,OAAO,CACL,uBAAC,yBAAY,IACX,GAAG,EAAE,GAAG,EACR,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,IAAI,EAAE,KAChD,IAAI,EACR,QAAQ,EAAE,YAAY,GACtB,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;QAKM,UAAU;AAHnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;kBAEvB,UAAU"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextInput as RNTextInput, type TextInputProps } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Instrumented TextInput — drop-in replacement.
|
|
5
|
+
*/
|
|
6
|
+
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<RNTextInput>>;
|
|
7
|
+
export default TextInput;
|
|
8
|
+
export { TextInput };
|
|
9
|
+
//# sourceMappingURL=TextInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/instrumented/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,SAAS,IAAI,WAAW,EACxB,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,QAAA,MAAM,SAAS,oFA6Cd,CAAC;eAIa,SAAS;AACxB,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TextInput = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const interactionObserver_1 = require("./interactionObserver");
|
|
41
|
+
/**
|
|
42
|
+
* Instrumented TextInput — drop-in replacement.
|
|
43
|
+
*/
|
|
44
|
+
const TextInput = (0, react_1.forwardRef)((props, ref) => {
|
|
45
|
+
const { onFocus, onBlur, ...rest } = props;
|
|
46
|
+
const handleFocus = react_1.default.useCallback((e) => {
|
|
47
|
+
(0, interactionObserver_1.notifyInteraction)({
|
|
48
|
+
testID: rest.testID,
|
|
49
|
+
accessibilityLabel: rest.accessibilityLabel,
|
|
50
|
+
nativeID: rest.nativeID,
|
|
51
|
+
elementType: 'text_input',
|
|
52
|
+
text: rest.placeholder || rest.accessibilityLabel || '',
|
|
53
|
+
interactive: true,
|
|
54
|
+
interactionType: 'focus',
|
|
55
|
+
});
|
|
56
|
+
onFocus?.(e);
|
|
57
|
+
}, [onFocus, rest.testID, rest.accessibilityLabel, rest.nativeID, rest.placeholder]);
|
|
58
|
+
const handleBlur = react_1.default.useCallback((e) => {
|
|
59
|
+
(0, interactionObserver_1.notifyInteraction)({
|
|
60
|
+
testID: rest.testID,
|
|
61
|
+
accessibilityLabel: rest.accessibilityLabel,
|
|
62
|
+
nativeID: rest.nativeID,
|
|
63
|
+
elementType: 'text_input',
|
|
64
|
+
text: rest.placeholder || rest.accessibilityLabel || '',
|
|
65
|
+
interactive: true,
|
|
66
|
+
interactionType: 'blur',
|
|
67
|
+
});
|
|
68
|
+
onBlur?.(e);
|
|
69
|
+
}, [onBlur, rest.testID, rest.accessibilityLabel, rest.nativeID, rest.placeholder]);
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, ...rest, onFocus: handleFocus, onBlur: handleBlur }));
|
|
71
|
+
});
|
|
72
|
+
exports.TextInput = TextInput;
|
|
73
|
+
TextInput.displayName = 'TextInput';
|
|
74
|
+
exports.default = TextInput;
|
|
75
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/instrumented/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,+CAGsB;AACtB,+DAA0D;AAE1D;;GAEG;AACH,MAAM,SAAS,GAAG,IAAA,kBAAU,EAC1B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAE3C,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CACnC,CAAC,CAAM,EAAE,EAAE;QACT,IAAA,uCAAiB,EAAC;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,QAAQ,EAAG,IAA8B,CAAC,QAAQ;YAClD,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,IAAI,EAAE;YACvD,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,OAAO;SACzB,CAAC,CAAC;QACH,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,CAAC,EACD,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CACjF,CAAC;IAEF,MAAM,UAAU,GAAG,eAAK,CAAC,WAAW,CAClC,CAAC,CAAM,EAAE,EAAE;QACT,IAAA,uCAAiB,EAAC;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,QAAQ,EAAG,IAA8B,CAAC,QAAQ;YAClD,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,IAAI,EAAE;YACvD,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,MAAM;SACxB,CAAC,CAAC;QACH,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IACd,CAAC,EACD,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAChF,CAAC;IAEF,OAAO,CACL,uBAAC,wBAAW,IACV,GAAG,EAAE,GAAG,KACJ,IAAI,EACR,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,GAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;QAKO,SAAS;AAHlB,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;kBAErB,SAAS"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity as RNTouchableOpacity, type TouchableOpacityProps } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Instrumented TouchableOpacity — drop-in replacement that notifies
|
|
5
|
+
* the CXP SDK of every press while forwarding all props and behavior
|
|
6
|
+
* to the original component. Identical API, zero behavior change.
|
|
7
|
+
*/
|
|
8
|
+
declare const TouchableOpacity: React.ForwardRefExoticComponent<TouchableOpacityProps & React.RefAttributes<RNTouchableOpacity>>;
|
|
9
|
+
export default TouchableOpacity;
|
|
10
|
+
export { TouchableOpacity };
|
|
11
|
+
//# sourceMappingURL=TouchableOpacity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TouchableOpacity.d.ts","sourceRoot":"","sources":["../../src/instrumented/TouchableOpacity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,gBAAgB,IAAI,kBAAkB,EACtC,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AAGtB;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,kGAiDrB,CAAC;eAIa,gBAAgB;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TouchableOpacity = void 0;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const interactionObserver_1 = require("./interactionObserver");
|
|
41
|
+
/**
|
|
42
|
+
* Instrumented TouchableOpacity — drop-in replacement that notifies
|
|
43
|
+
* the CXP SDK of every press while forwarding all props and behavior
|
|
44
|
+
* to the original component. Identical API, zero behavior change.
|
|
45
|
+
*/
|
|
46
|
+
const TouchableOpacity = (0, react_1.forwardRef)((props, ref) => {
|
|
47
|
+
const { onPress, onLongPress, children, ...rest } = props;
|
|
48
|
+
const handlePress = react_1.default.useCallback((e) => {
|
|
49
|
+
(0, interactionObserver_1.notifyInteraction)({
|
|
50
|
+
testID: rest.testID,
|
|
51
|
+
accessibilityLabel: rest.accessibilityLabel,
|
|
52
|
+
nativeID: rest.nativeID,
|
|
53
|
+
accessibilityRole: rest.accessibilityRole,
|
|
54
|
+
elementType: 'button',
|
|
55
|
+
text: extractText(children),
|
|
56
|
+
interactive: true,
|
|
57
|
+
interactionType: 'tap',
|
|
58
|
+
});
|
|
59
|
+
onPress?.(e);
|
|
60
|
+
}, [onPress, rest.testID, rest.accessibilityLabel, rest.nativeID, rest.accessibilityRole, children]);
|
|
61
|
+
const handleLongPress = react_1.default.useCallback((e) => {
|
|
62
|
+
(0, interactionObserver_1.notifyInteraction)({
|
|
63
|
+
testID: rest.testID,
|
|
64
|
+
accessibilityLabel: rest.accessibilityLabel,
|
|
65
|
+
nativeID: rest.nativeID,
|
|
66
|
+
accessibilityRole: rest.accessibilityRole,
|
|
67
|
+
elementType: 'button',
|
|
68
|
+
text: extractText(children),
|
|
69
|
+
interactive: true,
|
|
70
|
+
interactionType: 'long_press',
|
|
71
|
+
});
|
|
72
|
+
onLongPress?.(e);
|
|
73
|
+
}, [onLongPress, rest.testID, rest.accessibilityLabel, rest.nativeID, rest.accessibilityRole, children]);
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { ref: ref, ...rest, onPress: onPress ? handlePress : undefined, onLongPress: onLongPress ? handleLongPress : undefined, children: children }));
|
|
75
|
+
});
|
|
76
|
+
exports.TouchableOpacity = TouchableOpacity;
|
|
77
|
+
TouchableOpacity.displayName = 'TouchableOpacity';
|
|
78
|
+
exports.default = TouchableOpacity;
|
|
79
|
+
function extractText(children) {
|
|
80
|
+
if (typeof children === 'string')
|
|
81
|
+
return children.slice(0, 80);
|
|
82
|
+
if (typeof children === 'number')
|
|
83
|
+
return String(children);
|
|
84
|
+
if (Array.isArray(children)) {
|
|
85
|
+
for (const child of children) {
|
|
86
|
+
const t = extractText(child);
|
|
87
|
+
if (t)
|
|
88
|
+
return t;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (children && typeof children === 'object' && 'props' in children) {
|
|
92
|
+
return extractText(children.props?.children);
|
|
93
|
+
}
|
|
94
|
+
return '';
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=TouchableOpacity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TouchableOpacity.js","sourceRoot":"","sources":["../../src/instrumented/TouchableOpacity.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,+CAGsB;AACtB,+DAA0D;AAE1D;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EACjC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAA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AAC;IAEF,OAAO,CACL,uBAAC,+BAAkB,IACjB,GAAG,EAAE,GAAG,KACJ,IAAI,EACR,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC1C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,YAErD,QAAQ,GACU,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;QAKO,gBAAgB;AAHzB,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;kBAEnC,gBAAgB;AAG/B,SAAS,WAAW,CAAC,QAAyB;IAC5C,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/D,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,CAAC;gBAAE,OAAO,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACpE,OAAO,WAAW,CAAE,QAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instrumented React Native components for CXP engagement tracking.
|
|
3
|
+
*
|
|
4
|
+
* These are drop-in replacements for React Native's touch components.
|
|
5
|
+
* They forward all props and behavior to the originals, and additionally
|
|
6
|
+
* notify the CXP SDK of every user interaction.
|
|
7
|
+
*
|
|
8
|
+
* Enable by adding to metro.config.js:
|
|
9
|
+
*
|
|
10
|
+
* const { withCXPInstrumentation } = require('@cxpinsight/react-native/metro');
|
|
11
|
+
* module.exports = withCXPInstrumentation(getDefaultConfig(__dirname));
|
|
12
|
+
*/
|
|
13
|
+
export { TouchableOpacity } from './TouchableOpacity';
|
|
14
|
+
export { Pressable } from './Pressable';
|
|
15
|
+
export { TextInput } from './TextInput';
|
|
16
|
+
export { ScrollView } from './ScrollView';
|
|
17
|
+
export { notifyInteraction, setInteractionListener, hasInteractionListener } from './interactionObserver';
|
|
18
|
+
export type { InteractionEvent } from './interactionObserver';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/instrumented/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC1G,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Instrumented React Native components for CXP engagement tracking.
|
|
4
|
+
*
|
|
5
|
+
* These are drop-in replacements for React Native's touch components.
|
|
6
|
+
* They forward all props and behavior to the originals, and additionally
|
|
7
|
+
* notify the CXP SDK of every user interaction.
|
|
8
|
+
*
|
|
9
|
+
* Enable by adding to metro.config.js:
|
|
10
|
+
*
|
|
11
|
+
* const { withCXPInstrumentation } = require('@cxpinsight/react-native/metro');
|
|
12
|
+
* module.exports = withCXPInstrumentation(getDefaultConfig(__dirname));
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.hasInteractionListener = exports.setInteractionListener = exports.notifyInteraction = exports.ScrollView = exports.TextInput = exports.Pressable = exports.TouchableOpacity = void 0;
|
|
16
|
+
var TouchableOpacity_1 = require("./TouchableOpacity");
|
|
17
|
+
Object.defineProperty(exports, "TouchableOpacity", { enumerable: true, get: function () { return TouchableOpacity_1.TouchableOpacity; } });
|
|
18
|
+
var Pressable_1 = require("./Pressable");
|
|
19
|
+
Object.defineProperty(exports, "Pressable", { enumerable: true, get: function () { return Pressable_1.Pressable; } });
|
|
20
|
+
var TextInput_1 = require("./TextInput");
|
|
21
|
+
Object.defineProperty(exports, "TextInput", { enumerable: true, get: function () { return TextInput_1.TextInput; } });
|
|
22
|
+
var ScrollView_1 = require("./ScrollView");
|
|
23
|
+
Object.defineProperty(exports, "ScrollView", { enumerable: true, get: function () { return ScrollView_1.ScrollView; } });
|
|
24
|
+
var interactionObserver_1 = require("./interactionObserver");
|
|
25
|
+
Object.defineProperty(exports, "notifyInteraction", { enumerable: true, get: function () { return interactionObserver_1.notifyInteraction; } });
|
|
26
|
+
Object.defineProperty(exports, "setInteractionListener", { enumerable: true, get: function () { return interactionObserver_1.setInteractionListener; } });
|
|
27
|
+
Object.defineProperty(exports, "hasInteractionListener", { enumerable: true, get: function () { return interactionObserver_1.hasInteractionListener; } });
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/instrumented/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,6DAA0G;AAAjG,wHAAA,iBAAiB,OAAA;AAAE,6HAAA,sBAAsB,OAAA;AAAE,6HAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ElementInfo } from '../setup/ElementIdentifier';
|
|
2
|
+
/**
|
|
3
|
+
* InteractionObserver — central hub that receives notifications from
|
|
4
|
+
* instrumented components (TouchableOpacity, Pressable, TextInput, etc.)
|
|
5
|
+
*
|
|
6
|
+
* In normal mode: does nothing (zero overhead).
|
|
7
|
+
* In setup mode: forwards interaction to the SetupOverlay's tapped history.
|
|
8
|
+
* In tracking mode: matches against configured events and fires them.
|
|
9
|
+
*/
|
|
10
|
+
export interface InteractionEvent extends ElementInfo {
|
|
11
|
+
interactionType: 'tap' | 'long_press' | 'focus' | 'blur' | 'value_change' | 'scroll' | 'swipe';
|
|
12
|
+
}
|
|
13
|
+
type InteractionListener = (event: InteractionEvent) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Called by instrumented components on every interaction.
|
|
16
|
+
* If no listeners are registered (normal mode), this is effectively a no-op.
|
|
17
|
+
*/
|
|
18
|
+
export declare function notifyInteraction(event: InteractionEvent): void;
|
|
19
|
+
/**
|
|
20
|
+
* Subscribe to interactions. Additive — multiple subscribers coexist.
|
|
21
|
+
* Returns an unsubscribe function that removes only this subscriber.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setInteractionListener(fn: InteractionListener): () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether any subscriber is active (for debugging / overhead checks).
|
|
26
|
+
*/
|
|
27
|
+
export declare function hasInteractionListener(): boolean;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=interactionObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionObserver.d.ts","sourceRoot":"","sources":["../../src/instrumented/interactionObserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;;;GAOG;AAEH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,eAAe,EAAE,KAAK,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;CAChG;AAED,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAQ7D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAK/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAG1E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notifyInteraction = notifyInteraction;
|
|
4
|
+
exports.setInteractionListener = setInteractionListener;
|
|
5
|
+
exports.hasInteractionListener = hasInteractionListener;
|
|
6
|
+
// Fan-out to MULTIPLE subscribers. Previously a single slot, which meant whoever
|
|
7
|
+
// registered last silently stole the stream — e.g. the session recorder captured
|
|
8
|
+
// zero interactions whenever setup/tracking also listened. A Set lets the recorder,
|
|
9
|
+
// setup overlay, and tracking engine all observe the same interactions independently.
|
|
10
|
+
const listeners = new Set();
|
|
11
|
+
/**
|
|
12
|
+
* Called by instrumented components on every interaction.
|
|
13
|
+
* If no listeners are registered (normal mode), this is effectively a no-op.
|
|
14
|
+
*/
|
|
15
|
+
function notifyInteraction(event) {
|
|
16
|
+
// Copy so a listener that unsubscribes during dispatch can't mutate mid-iteration.
|
|
17
|
+
for (const fn of Array.from(listeners)) {
|
|
18
|
+
try {
|
|
19
|
+
fn(event);
|
|
20
|
+
}
|
|
21
|
+
catch { /* one bad subscriber must not break the others */ }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to interactions. Additive — multiple subscribers coexist.
|
|
26
|
+
* Returns an unsubscribe function that removes only this subscriber.
|
|
27
|
+
*/
|
|
28
|
+
function setInteractionListener(fn) {
|
|
29
|
+
listeners.add(fn);
|
|
30
|
+
return () => { listeners.delete(fn); };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether any subscriber is active (for debugging / overhead checks).
|
|
34
|
+
*/
|
|
35
|
+
function hasInteractionListener() {
|
|
36
|
+
return listeners.size > 0;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=interactionObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionObserver.js","sourceRoot":"","sources":["../../src/instrumented/interactionObserver.ts"],"names":[],"mappings":";;;;;AAiBA,iFAAiF;AACjF,iFAAiF;AACjF,oFAAoF;AACpF,sFAAsF;AACtF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEjD;;;GAGG;AACH,2BAAkC,KAAuB;IACvD,mFAAmF;IACnF,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC;YAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,kDAAkD,CAAC,CAAC;IACjF,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,gCAAuC,EAAuB;IAC5D,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH;IACE,OAAO,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { ElementInfo } from './ElementIdentifier';
|
|
3
|
+
export declare function setDebugMode(debug: boolean): void;
|
|
4
|
+
/**
|
|
5
|
+
* Get all discoverable interactive elements for the current screen.
|
|
6
|
+
* Combines registry-based and native-view-based scanning.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getInteractiveElements(screenName: string): ElementInfo[];
|
|
9
|
+
/**
|
|
10
|
+
* Scan a native view ref for interactive children.
|
|
11
|
+
* Uses UIManager to find views with testID or accessibility props.
|
|
12
|
+
*
|
|
13
|
+
* @param rootRef - React ref to the screen's root View
|
|
14
|
+
* @param screenName - Name of the current screen
|
|
15
|
+
*/
|
|
16
|
+
export declare function scanNativeViewHierarchy(rootRef: React.RefObject<any>, screenName: string): Promise<ElementInfo[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Build elements from a list of known testIDs.
|
|
19
|
+
* Useful when the app developer provides a manifest of trackable elements.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildElementsFromTestIDs(testIDs: Array<{
|
|
22
|
+
testID: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
type?: ElementInfo['elementType'];
|
|
25
|
+
role?: string;
|
|
26
|
+
}>): ElementInfo[];
|
|
27
|
+
/**
|
|
28
|
+
* Upload the scanned element tree to the server as a screen snapshot.
|
|
29
|
+
*/
|
|
30
|
+
export declare function uploadScreenSnapshot(siteId: string, screenName: string, elements: ElementInfo[], deviceId?: string): Promise<void>;
|
|
31
|
+
export declare function scanReactTree(_children: React.ReactNode, screenName: string, _path?: string): ElementInfo[];
|
|
32
|
+
//# sourceMappingURL=AccessibilityScanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessibilityScanner.d.ts","sourceRoot":"","sources":["../../src/setup/AccessibilityScanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAuBvD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,EAAE,CAgBxE;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAC7B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC,CA0BxB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,GACD,WAAW,EAAE,CASf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,WAAW,EAAE,EACvB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAsBf;AAGD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,WAAW,EAAE,CAEf"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setDebugMode = setDebugMode;
|
|
4
|
+
exports.getInteractiveElements = getInteractiveElements;
|
|
5
|
+
exports.scanNativeViewHierarchy = scanNativeViewHierarchy;
|
|
6
|
+
exports.buildElementsFromTestIDs = buildElementsFromTestIDs;
|
|
7
|
+
exports.uploadScreenSnapshot = uploadScreenSnapshot;
|
|
8
|
+
exports.scanReactTree = scanReactTree;
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const network_1 = require("../core/network");
|
|
11
|
+
const ElementIdentifier_1 = require("./ElementIdentifier");
|
|
12
|
+
const ElementRegistry_1 = require("./ElementRegistry");
|
|
13
|
+
/**
|
|
14
|
+
* AccessibilityScanner — discovers interactive elements on the current screen.
|
|
15
|
+
*
|
|
16
|
+
* Uses multiple strategies:
|
|
17
|
+
* 1. ElementRegistry — elements registered via useCXPElement() hook (most reliable)
|
|
18
|
+
* 2. testID scan — finds all native views with testID props
|
|
19
|
+
* 3. Native view hierarchy — walks UIManager tree for interactive views
|
|
20
|
+
*
|
|
21
|
+
* The React virtual tree approach (scanning props.children) does NOT work
|
|
22
|
+
* because Provider-level children are just top-level components, not the
|
|
23
|
+
* deeply nested rendered output.
|
|
24
|
+
*/
|
|
25
|
+
let debugMode = false;
|
|
26
|
+
function log(...args) {
|
|
27
|
+
if (debugMode)
|
|
28
|
+
console.log('[CXPinsight:Scanner]', ...args);
|
|
29
|
+
}
|
|
30
|
+
function setDebugMode(debug) {
|
|
31
|
+
debugMode = debug;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get all discoverable interactive elements for the current screen.
|
|
35
|
+
* Combines registry-based and native-view-based scanning.
|
|
36
|
+
*/
|
|
37
|
+
function getInteractiveElements(screenName) {
|
|
38
|
+
const elements = [];
|
|
39
|
+
const seen = new Set();
|
|
40
|
+
// Strategy 1: Elements registered via useCXPElement() hook
|
|
41
|
+
const registered = (0, ElementRegistry_1.getRegisteredElements)(screenName);
|
|
42
|
+
for (const el of registered) {
|
|
43
|
+
const key = el.testID || el.accessibilityLabel || el.nativeID || el.text || '';
|
|
44
|
+
if (key && !seen.has(key)) {
|
|
45
|
+
seen.add(key);
|
|
46
|
+
elements.push(el);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
log(`Found ${elements.length} elements (${registered.length} from registry) on "${screenName}"`);
|
|
50
|
+
return elements;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Scan a native view ref for interactive children.
|
|
54
|
+
* Uses UIManager to find views with testID or accessibility props.
|
|
55
|
+
*
|
|
56
|
+
* @param rootRef - React ref to the screen's root View
|
|
57
|
+
* @param screenName - Name of the current screen
|
|
58
|
+
*/
|
|
59
|
+
async function scanNativeViewHierarchy(rootRef, screenName) {
|
|
60
|
+
const elements = [];
|
|
61
|
+
if (!rootRef.current) {
|
|
62
|
+
log('No root ref for scanning');
|
|
63
|
+
return elements;
|
|
64
|
+
}
|
|
65
|
+
const nodeHandle = (0, react_native_1.findNodeHandle)(rootRef.current);
|
|
66
|
+
if (!nodeHandle) {
|
|
67
|
+
log('Could not get node handle');
|
|
68
|
+
return elements;
|
|
69
|
+
}
|
|
70
|
+
// Merge with registry elements
|
|
71
|
+
const registryElements = (0, ElementRegistry_1.getRegisteredElements)(screenName);
|
|
72
|
+
const seen = new Set();
|
|
73
|
+
for (const el of registryElements) {
|
|
74
|
+
const key = el.testID || el.accessibilityLabel || '';
|
|
75
|
+
if (key)
|
|
76
|
+
seen.add(key);
|
|
77
|
+
elements.push(el);
|
|
78
|
+
}
|
|
79
|
+
log(`Scanned ${elements.length} elements on "${screenName}"`);
|
|
80
|
+
return elements;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Build elements from a list of known testIDs.
|
|
84
|
+
* Useful when the app developer provides a manifest of trackable elements.
|
|
85
|
+
*/
|
|
86
|
+
function buildElementsFromTestIDs(testIDs) {
|
|
87
|
+
return testIDs.map(({ testID, label, type, role }) => ({
|
|
88
|
+
testID,
|
|
89
|
+
accessibilityLabel: label,
|
|
90
|
+
accessibilityRole: role,
|
|
91
|
+
elementType: type || (0, ElementIdentifier_1.inferElementType)(role),
|
|
92
|
+
text: label || testID.replace(/[-_]/g, ' '),
|
|
93
|
+
interactive: true,
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Upload the scanned element tree to the server as a screen snapshot.
|
|
98
|
+
*/
|
|
99
|
+
async function uploadScreenSnapshot(siteId, screenName, elements, deviceId) {
|
|
100
|
+
try {
|
|
101
|
+
await (0, network_1.sdkFetch)('POST', '/api/engagement/setup/mobile-screen-snapshot', {
|
|
102
|
+
siteId,
|
|
103
|
+
screenName,
|
|
104
|
+
elements: elements.map(e => ({
|
|
105
|
+
testID: e.testID || null,
|
|
106
|
+
accessibilityLabel: e.accessibilityLabel || null,
|
|
107
|
+
nativeID: e.nativeID || null,
|
|
108
|
+
accessibilityRole: e.accessibilityRole || null,
|
|
109
|
+
hierarchyPath: e.hierarchyPath || null,
|
|
110
|
+
text: e.text || null,
|
|
111
|
+
elementType: e.elementType,
|
|
112
|
+
bounds: e.bounds || null,
|
|
113
|
+
interactive: e.interactive,
|
|
114
|
+
})),
|
|
115
|
+
deviceId,
|
|
116
|
+
});
|
|
117
|
+
log(`Uploaded snapshot for "${screenName}" (${elements.length} elements)`);
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
console.warn('[CXPinsight:Scanner] Failed to upload screen snapshot:', err);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Kept for backwards compatibility but now delegates to getInteractiveElements
|
|
124
|
+
function scanReactTree(_children, screenName, _path) {
|
|
125
|
+
return getInteractiveElements(screenName);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=AccessibilityScanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessibilityScanner.js","sourceRoot":"","sources":["../../src/setup/AccessibilityScanner.ts"],"names":[],"mappings":";;;;;;;;AACA,+CAAsF;AACtF,6CAA2C;AAE3C,2DAAuD;AACvD,uDAA0D;AAE1D;;;;;;;;;;;GAWG;AAEH,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,GAAG,CAAC,GAAG,IAAe;IAC7B,IAAI,SAAS;QAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,GAAG,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,sBAA6B,KAAc;IACzC,SAAS,GAAG,KAAK,CAAC;AACpB,CAAC;AAED;;;G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