@multiplayer-app/session-recorder-react-native 1.0.1-beta.5 → 1.0.1-beta.6
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/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/{multiplayer/sessionrecordernative → sessionrecordernative}/SessionRecorderNativeConfig.kt +1 -1
- package/android/src/main/java/com/{multiplayer/sessionrecordernative → sessionrecordernative}/SessionRecorderNativeModule.kt +7 -7
- package/android/src/main/java/com/{multiplayer/sessionrecordernative → sessionrecordernative}/SessionRecorderNativePackage.kt +2 -2
- package/android/src/main/java/com/{multiplayer/sessionrecordernative → sessionrecordernative}/model/TargetInfo.kt +1 -1
- package/android/src/main/java/com/{multiplayer/sessionrecordernative → sessionrecordernative}/util/ViewUtils.kt +2 -2
- package/lib/module/SessionRecorderNativeSpec.js +5 -0
- package/lib/module/SessionRecorderNativeSpec.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +16 -11
- package/lib/module/native/SessionRecorderNative.js.map +1 -1
- package/lib/module/services/screenMaskingService.js +1 -1
- package/lib/module/services/screenMaskingService.js.map +1 -1
- package/lib/typescript/src/SessionRecorderNativeSpec.d.ts +42 -0
- package/lib/typescript/src/SessionRecorderNativeSpec.d.ts.map +1 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts +3 -54
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts +1 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/SessionRecorderNativeSpec.ts +53 -0
- package/src/native/SessionRecorderNative.ts +27 -87
- package/src/services/screenMaskingService.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sessionrecordernative">
|
|
2
|
+
</manifest>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.sessionrecordernative
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.app.Activity
|
|
@@ -15,7 +15,7 @@ import android.webkit.WebView
|
|
|
15
15
|
import android.widget.*
|
|
16
16
|
import com.facebook.react.bridge.*
|
|
17
17
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
18
|
-
import com.
|
|
18
|
+
import com.sessionrecordernative.util.ViewUtils
|
|
19
19
|
import java.io.ByteArrayOutputStream
|
|
20
20
|
import java.util.concurrent.CountDownLatch
|
|
21
21
|
import java.util.concurrent.TimeUnit
|
|
@@ -210,7 +210,7 @@ class SessionRecorderNativeModule(reactContext: ReactApplicationContext) :
|
|
|
210
210
|
|
|
211
211
|
private fun handleTouchDown(
|
|
212
212
|
event: android.view.MotionEvent,
|
|
213
|
-
target: com.
|
|
213
|
+
target: com.sessionrecordernative.model.TargetInfo
|
|
214
214
|
) {
|
|
215
215
|
val dp = getScreenDpPoint(event)
|
|
216
216
|
initialTouchTime = System.currentTimeMillis()
|
|
@@ -233,7 +233,7 @@ class SessionRecorderNativeModule(reactContext: ReactApplicationContext) :
|
|
|
233
233
|
|
|
234
234
|
private fun handleTouchMove(
|
|
235
235
|
event: android.view.MotionEvent,
|
|
236
|
-
target: com.
|
|
236
|
+
target: com.sessionrecordernative.model.TargetInfo
|
|
237
237
|
) {
|
|
238
238
|
val dp = getScreenDpPoint(event)
|
|
239
239
|
val deltaX = dp.x - initialTouchX
|
|
@@ -256,7 +256,7 @@ class SessionRecorderNativeModule(reactContext: ReactApplicationContext) :
|
|
|
256
256
|
|
|
257
257
|
private fun handleTouchUp(
|
|
258
258
|
event: android.view.MotionEvent,
|
|
259
|
-
target: com.
|
|
259
|
+
target: com.sessionrecordernative.model.TargetInfo
|
|
260
260
|
) {
|
|
261
261
|
val dp = getScreenDpPoint(event)
|
|
262
262
|
val touchDuration = System.currentTimeMillis() - initialTouchTime
|
|
@@ -282,7 +282,7 @@ class SessionRecorderNativeModule(reactContext: ReactApplicationContext) :
|
|
|
282
282
|
|
|
283
283
|
private fun handleTouchCancel(
|
|
284
284
|
event: android.view.MotionEvent,
|
|
285
|
-
target: com.
|
|
285
|
+
target: com.sessionrecordernative.model.TargetInfo
|
|
286
286
|
) {
|
|
287
287
|
// Cancel long press
|
|
288
288
|
longPressRunnable?.let { handler?.removeCallbacks(it) }
|
|
@@ -308,7 +308,7 @@ class SessionRecorderNativeModule(reactContext: ReactApplicationContext) :
|
|
|
308
308
|
gestureType: String,
|
|
309
309
|
x: Float,
|
|
310
310
|
y: Float,
|
|
311
|
-
target: com.
|
|
311
|
+
target: com.sessionrecordernative.model.TargetInfo,
|
|
312
312
|
metadata: WritableMap
|
|
313
313
|
) {
|
|
314
314
|
val targetInfo =
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.sessionrecordernative
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.BaseReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
@@ -10,7 +10,7 @@ import java.util.HashMap
|
|
|
10
10
|
class SessionRecorderNativePackage : BaseReactPackage() {
|
|
11
11
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
12
12
|
return if (name == SessionRecorderNativeModule.NAME) {
|
|
13
|
-
SessionRecorderNativeModule(reactContext)
|
|
13
|
+
SessionRecorderNativeModule(reactContext) as NativeModule
|
|
14
14
|
} else {
|
|
15
15
|
null
|
|
16
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.sessionrecordernative.util
|
|
2
2
|
|
|
3
3
|
import android.graphics.PointF
|
|
4
4
|
import android.view.View
|
|
5
5
|
import android.view.ViewGroup
|
|
6
6
|
import android.widget.*
|
|
7
|
-
import com.
|
|
7
|
+
import com.sessionrecordernative.model.TargetInfo
|
|
8
8
|
|
|
9
9
|
object ViewUtils {
|
|
10
10
|
fun findTargetView(point: PointF, rootView: ViewGroup?): TargetInfo {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["SessionRecorderNativeSpec.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAmDlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Platform, NativeEventEmitter } from 'react-native';
|
|
4
|
+
import SessionRecorderNative from "../SessionRecorderNativeSpec.js";
|
|
5
|
+
|
|
4
6
|
// Check if we're on web platform
|
|
5
7
|
const isWeb = Platform.OS === 'web';
|
|
6
8
|
|
|
7
9
|
// Get the Turbo Module
|
|
8
|
-
let
|
|
9
|
-
let eventEmitter = null;
|
|
10
|
-
if (!isWeb) {
|
|
11
|
-
try {
|
|
12
|
-
SessionRecorderNative = TurboModuleRegistry.getEnforcing('SessionRecorderNative');
|
|
13
|
-
eventEmitter = new NativeEventEmitter(SessionRecorderNative);
|
|
14
|
-
} catch (error) {
|
|
15
|
-
console.warn('Failed to access SessionRecorderNative Turbo Module:', error);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
10
|
+
let eventEmitter = new NativeEventEmitter(SessionRecorderNative);
|
|
18
11
|
|
|
19
12
|
// Validate that the native module is available
|
|
20
13
|
if (!SessionRecorderNative && !isWeb) {
|
|
@@ -65,6 +58,18 @@ const SafeSessionRecorderNative = {
|
|
|
65
58
|
} catch {}
|
|
66
59
|
eventEmitter?.removeAllListeners('onGestureDetected');
|
|
67
60
|
eventEmitter?.addListener('onGestureDetected', callback);
|
|
61
|
+
},
|
|
62
|
+
recordGesture(gestureType, x, y, target, metadata) {
|
|
63
|
+
if (isWeb || !SessionRecorderNative) {
|
|
64
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
65
|
+
}
|
|
66
|
+
SessionRecorderNative.recordGesture(gestureType, x, y, target, metadata);
|
|
67
|
+
},
|
|
68
|
+
addListener(_eventName) {
|
|
69
|
+
// Required for RN event emitter contracts
|
|
70
|
+
},
|
|
71
|
+
removeListeners(_count) {
|
|
72
|
+
// Required for RN event emitter contracts
|
|
68
73
|
}
|
|
69
74
|
};
|
|
70
75
|
export default SafeSessionRecorderNative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Platform","NativeEventEmitter","SessionRecorderNative","isWeb","OS","eventEmitter","console","warn","info","SafeSessionRecorderNative","captureAndMask","Error","captureAndMaskWithOptions","options","startGestureRecording","stopGestureRecording","isGestureRecordingActive","setGestureCallback","callback","removeAllListeners","addListener","recordGesture","gestureType","x","y","target","metadata","_eventName","removeListeners","_count","gestureEventEmitter"],"sourceRoot":"../../../src","sources":["native/SessionRecorderNative.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,kBAAkB,QAAQ,cAAc;AAC3D,OAAOC,qBAAqB,MAA0C,iCAA8B;;AAGpG;AACA,MAAMC,KAAK,GAAGH,QAAQ,CAACI,EAAE,KAAK,KAAK;;AAEnC;AACA,IAAIC,YAAY,GAAG,IAAIJ,kBAAkB,CAACC,qBAA4B,CAAC;;AAGvE;AACA,IAAI,CAACA,qBAAqB,IAAI,CAACC,KAAK,EAAE;EACpCG,OAAO,CAACC,IAAI,CACV,+FACF,CAAC;AACH,CAAC,MAAM,IAAIJ,KAAK,EAAE;EAChBG,OAAO,CAACE,IAAI,CACV,wEACF,CAAC;AACH;;AAEA;AACA,MAAMC,yBAA+B,GAAG;EACtC,MAAMC,cAAcA,CAAA,EAAoB;IACtC,IAAIP,KAAK,IAAI,CAACD,qBAAqB,EAAE;MACnC,MAAM,IAAIS,KAAK,CAAC,wDAAwD,CAAC;IAC3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C,CAAS,EAAEC,CAAS,EAAEC,MAAe,EAAEC,QAAc,EAAQ;IAC9F,IAAIvB,KAAK,IAAI,CAACD,qBAAqB,EAAE;MACnC,MAAM,IAAIS,KAAK,CAAC,wDAAwD,CAAC;IAC3E;IACAT,qBAAqB,CAACmB,aAAa,CAACC,WAAW,EAAEC,CAAC,EAAEC,CAAC,EAAEC,MAAM,EAAEC,QAAQ,CAAC;EAC1E,CAAC;EAEDN,WAAWA,CAACO,UAAkB,EAAQ;IACpC;EAAA,CACD;EAEDC,eAAeA,CAACC,MAAc,EAAQ;IACpC;EAAA;AAEJ,CAAC;AA+BD,eAAepB,yBAAyB;;AAExC;AACA,OAAO,MAAMqB,mBAAmB,GAAGzB,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionRecorderNative","logger","ScreenMaskingService","isAvailable","constructor","config","enabled","maskTextInputs","maskImages","maskButtons","maskLabels","maskWebViews","maskSandboxedViews","checkAvailability","captureAndMask","info","warn","error","captureMaskedScreen","options","maskingOptions","maskedImageBase64","captureAndMaskWithOptions","captureMaskedScreenBasic","updateConfig","isScreenMaskingAvailable","getConfig","screenMaskingService"],"sourceRoot":"../../../src","sources":["services/screenMaskingService.ts"],"mappings":";;AAAA,OAAOA,qBAAqB,MAErB,
|
|
1
|
+
{"version":3,"names":["SessionRecorderNative","logger","ScreenMaskingService","isAvailable","constructor","config","enabled","maskTextInputs","maskImages","maskButtons","maskLabels","maskWebViews","maskSandboxedViews","checkAvailability","captureAndMask","info","warn","error","captureMaskedScreen","options","maskingOptions","maskedImageBase64","captureAndMaskWithOptions","captureMaskedScreenBasic","updateConfig","isScreenMaskingAvailable","getConfig","screenMaskingService"],"sourceRoot":"../../../src","sources":["services/screenMaskingService.ts"],"mappings":";;AAAA,OAAOA,qBAAqB,MAErB,iCAA8B;AACrC,SAASC,MAAM,QAAQ,mBAAU;AAmBjC,OAAO,MAAMC,oBAAoB,CAAC;EAExBC,WAAW,GA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AC,CAAC,OAAOJ,KAAK,EAAE;MACdhB,MAAM,CAACgB,KAAK,CACV,sBAAsB,EACtB,kCAAkC,EAClCA,KACF,CAAC;MACD,OAAO,IAAI;IACb;EACF;;EAEA;AACF;AACA;EACE,MAAMM,wBAAwBA,CAAA,EAA2B;IACvD,IAAI,CAAC,IAAI,CAACpB,WAAW,IAAI,CAAC,IAAI,CAACE,MAAM,CAACC,OAAO,EAAE;MAC7CL,MAAM,CAACe,IAAI,CACT,sBAAsB,EACtB,6CACF,CAAC;MACD,OAAO,IAAI;IACb;IAEA,IAAI;MACF,MAAMK,iBAAiB,GAAG,MAAMrB,qBAAqB,CAACc,cAAc,CAAC,CAAC;MACtE,OAAOO,iBAAiB;IAC1B,CAAC,CAAC,OAAOJ,KAAK,EAAE;MACdhB,MAAM,CAACgB,KAAK,CACV,sBAAsB,EACtB,0CAA0C,EAC1CA,KACF,CAAC;MACD,OAAO,IAAI;IACb;EACF;;EAEA;AACF;AACA;EACEO,YAAYA,CAACnB,MAAoC,EAAQ;IACvD,IAAI,CAACA,MAAM,GAAG;MAAE,GAAG,IAAI,CAACA,MAAM;MAAE,GAAGA;IAAO,CAAC;IAC3CJ,MAAM,CAACc,IAAI,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;EAC7E;;EAEA;AACF;AACA;EACEU,wBAAwBA,CAAA,EAAY;IAClC,OAAO,IAAI,CAACtB,WAAW,IAAI,IAAI,CAACE,MAAM,CAACC,OAAO;EAChD;;EAEA;AACF;AACA;EACEoB,SAASA,CAAA,EAAwB;IAC/B,OAAO;MAAE,GAAG,IAAI,CAACrB;IAAO,CAAC;EAC3B;AACF;;AAEA;AACA,OAAO,MAAMsB,oBAAoB,GAAG,IAAIzB,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
/**
|
|
4
|
+
* Capture the current screen and apply masking to sensitive elements
|
|
5
|
+
* @returns Promise that resolves to base64 encoded image
|
|
6
|
+
*/
|
|
7
|
+
captureAndMask(): Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Capture the current screen and apply masking with custom options
|
|
10
|
+
* @param options Custom masking options
|
|
11
|
+
* @returns Promise that resolves to base64 encoded image
|
|
12
|
+
*/
|
|
13
|
+
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
14
|
+
startGestureRecording(): Promise<void>;
|
|
15
|
+
stopGestureRecording(): Promise<void>;
|
|
16
|
+
isGestureRecordingActive(): Promise<boolean>;
|
|
17
|
+
setGestureCallback(callback: (event: any) => void): void;
|
|
18
|
+
recordGesture(gestureType: string, x: number, y: number, target?: string, metadata?: any): void;
|
|
19
|
+
addListener(eventName: string): void;
|
|
20
|
+
removeListeners(count: number): void;
|
|
21
|
+
}
|
|
22
|
+
export interface MaskingOptions {
|
|
23
|
+
/** Quality of the captured image (0.1 to 1.0, default: 0.3 for smaller file size) */
|
|
24
|
+
quality?: number;
|
|
25
|
+
/** Scale of the captured image (0.1 to 1.0, default: 1.0) */
|
|
26
|
+
scale?: number;
|
|
27
|
+
/** Whether to mask text inputs (UITextField, UITextView, React Native text components) */
|
|
28
|
+
maskTextInputs?: boolean;
|
|
29
|
+
/** Whether to mask images (UIImageView, React Native Image components) */
|
|
30
|
+
maskImages?: boolean;
|
|
31
|
+
/** Whether to mask buttons (UIButton) */
|
|
32
|
+
maskButtons?: boolean;
|
|
33
|
+
/** Whether to mask labels (UILabel) */
|
|
34
|
+
maskLabels?: boolean;
|
|
35
|
+
/** Whether to mask web views (WKWebView) */
|
|
36
|
+
maskWebViews?: boolean;
|
|
37
|
+
/** Whether to mask sandboxed views (system views that don't belong to current process) */
|
|
38
|
+
maskSandboxedViews?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare const _default: Spec;
|
|
41
|
+
export default _default;
|
|
42
|
+
//# sourceMappingURL=SessionRecorderNativeSpec.d.ts.map
|
|
@@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CAAC,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;;AAED,wBAA+E"}
|
|
@@ -1,56 +1,5 @@
|
|
|
1
|
-
import { NativeEventEmitter
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Capture the current screen and apply masking to sensitive elements
|
|
5
|
-
* @returns Promise that resolves to base64 encoded image
|
|
6
|
-
*/
|
|
7
|
-
captureAndMask(): Promise<string>;
|
|
8
|
-
/**
|
|
9
|
-
* Capture the current screen and apply masking with custom options
|
|
10
|
-
* @param options Custom masking options
|
|
11
|
-
* @returns Promise that resolves to base64 encoded image
|
|
12
|
-
*/
|
|
13
|
-
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
14
|
-
startGestureRecording(): Promise<void>;
|
|
15
|
-
stopGestureRecording(): Promise<void>;
|
|
16
|
-
isGestureRecordingActive(): Promise<boolean>;
|
|
17
|
-
setGestureCallback(callback: (event: any) => void): void;
|
|
18
|
-
}
|
|
19
|
-
export interface MaskingOptions {
|
|
20
|
-
/** Quality of the captured image (0.1 to 1.0, default: 0.3 for smaller file size) */
|
|
21
|
-
quality?: number;
|
|
22
|
-
/** Scale of the captured image (0.1 to 1.0, default: 1.0) */
|
|
23
|
-
scale?: number;
|
|
24
|
-
/** Whether to mask text inputs (UITextField, UITextView, React Native text components) */
|
|
25
|
-
maskTextInputs?: boolean;
|
|
26
|
-
/** Whether to mask images (UIImageView, React Native Image components) */
|
|
27
|
-
maskImages?: boolean;
|
|
28
|
-
/** Whether to mask buttons (UIButton) */
|
|
29
|
-
maskButtons?: boolean;
|
|
30
|
-
/** Whether to mask labels (UILabel) */
|
|
31
|
-
maskLabels?: boolean;
|
|
32
|
-
/** Whether to mask web views (WKWebView) */
|
|
33
|
-
maskWebViews?: boolean;
|
|
34
|
-
/** Whether to mask sandboxed views (system views that don't belong to current process) */
|
|
35
|
-
maskSandboxedViews?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface SessionRecorderNativeModule {
|
|
38
|
-
/**
|
|
39
|
-
* Capture the current screen and apply masking to sensitive elements
|
|
40
|
-
* @returns Promise that resolves to base64 encoded image
|
|
41
|
-
*/
|
|
42
|
-
captureAndMask(): Promise<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Capture the current screen and apply masking with custom options
|
|
45
|
-
* @param options Custom masking options
|
|
46
|
-
* @returns Promise that resolves to base64 encoded image
|
|
47
|
-
*/
|
|
48
|
-
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
49
|
-
startGestureRecording(): Promise<void>;
|
|
50
|
-
stopGestureRecording(): Promise<void>;
|
|
51
|
-
isGestureRecordingActive(): Promise<boolean>;
|
|
52
|
-
setGestureCallback(callback: (event: any) => void): void;
|
|
53
|
-
}
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
|
+
import { type Spec } from '../SessionRecorderNativeSpec';
|
|
54
3
|
declare const SafeSessionRecorderNative: Spec;
|
|
55
4
|
export interface NativeGestureEvent {
|
|
56
5
|
type: 'tap' | 'pan_start' | 'pan_move' | 'pan_end' | 'long_press' | 'pinch' | 'swipe';
|
|
@@ -74,5 +23,5 @@ export interface NativeGestureEvent {
|
|
|
74
23
|
};
|
|
75
24
|
}
|
|
76
25
|
export default SafeSessionRecorderNative;
|
|
77
|
-
export declare const gestureEventEmitter: NativeEventEmitter<Readonly<Record<string, readonly Object[]
|
|
26
|
+
export declare const gestureEventEmitter: NativeEventEmitter<Readonly<Record<string, readonly Object[]>>>;
|
|
78
27
|
//# sourceMappingURL=SessionRecorderNative.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecorderNative.d.ts","sourceRoot":"","sources":["../../../../src/native/SessionRecorderNative.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionRecorderNative.d.ts","sourceRoot":"","sources":["../../../../src/native/SessionRecorderNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAA8B,EAAuB,KAAK,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAsBrG,QAAA,MAAM,yBAAyB,EAAE,IA8DhC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EACF,KAAK,GACL,WAAW,GACX,UAAU,GACV,SAAS,GACT,YAAY,GACZ,OAAO,GACP,OAAO,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QACX,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,eAAe,yBAAyB,CAAC;AAGzC,eAAO,MAAM,mBAAmB,iEAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenMaskingService.d.ts","sourceRoot":"","sources":["../../../../src/services/screenMaskingService.ts"],"names":[],"mappings":"AAAA,OAA8B,EAC5B,KAAK,cAAc,EACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"screenMaskingService.d.ts","sourceRoot":"","sources":["../../../../src/services/screenMaskingService.ts"],"names":[],"mappings":"AAAA,OAA8B,EAC5B,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,WAAW,CAAkB;gBAGnC,MAAM,GAAE,mBAQP;IAMH;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA2B1E;;OAEG;IACG,wBAAwB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAsBxD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI;IAKxD;;OAEG;IACH,wBAAwB,IAAI,OAAO;IAInC;;OAEG;IACH,SAAS,IAAI,mBAAmB;CAGjC;AAGD,eAAO,MAAM,oBAAoB,sBAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplayer-app/session-recorder-react-native",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.6",
|
|
4
4
|
"description": "Multiplayer Fullstack Session Recorder for React Native",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Multiplayer Software, Inc.",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"type": "modules",
|
|
188
188
|
"jsSrcsDir": "src",
|
|
189
189
|
"android": {
|
|
190
|
-
"javaPackageName": "com.
|
|
190
|
+
"javaPackageName": "com.sessionrecordernative"
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
193
|
"create-react-native-library": {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
/**
|
|
6
|
+
* Capture the current screen and apply masking to sensitive elements
|
|
7
|
+
* @returns Promise that resolves to base64 encoded image
|
|
8
|
+
*/
|
|
9
|
+
captureAndMask(): Promise<string>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Capture the current screen and apply masking with custom options
|
|
13
|
+
* @param options Custom masking options
|
|
14
|
+
* @returns Promise that resolves to base64 encoded image
|
|
15
|
+
*/
|
|
16
|
+
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
17
|
+
|
|
18
|
+
// Gesture recording APIs
|
|
19
|
+
startGestureRecording(): Promise<void>;
|
|
20
|
+
stopGestureRecording(): Promise<void>;
|
|
21
|
+
isGestureRecordingActive(): Promise<boolean>;
|
|
22
|
+
setGestureCallback(callback: (event: any) => void): void;
|
|
23
|
+
recordGesture(
|
|
24
|
+
gestureType: string,
|
|
25
|
+
x: number,
|
|
26
|
+
y: number,
|
|
27
|
+
target?: string,
|
|
28
|
+
metadata?: any
|
|
29
|
+
): void;
|
|
30
|
+
addListener(eventName: string): void;
|
|
31
|
+
removeListeners(count: number): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface MaskingOptions {
|
|
35
|
+
/** Quality of the captured image (0.1 to 1.0, default: 0.3 for smaller file size) */
|
|
36
|
+
quality?: number;
|
|
37
|
+
/** Scale of the captured image (0.1 to 1.0, default: 1.0) */
|
|
38
|
+
scale?: number;
|
|
39
|
+
/** Whether to mask text inputs (UITextField, UITextView, React Native text components) */
|
|
40
|
+
maskTextInputs?: boolean;
|
|
41
|
+
/** Whether to mask images (UIImageView, React Native Image components) */
|
|
42
|
+
maskImages?: boolean;
|
|
43
|
+
/** Whether to mask buttons (UIButton) */
|
|
44
|
+
maskButtons?: boolean;
|
|
45
|
+
/** Whether to mask labels (UILabel) */
|
|
46
|
+
maskLabels?: boolean;
|
|
47
|
+
/** Whether to mask web views (WKWebView) */
|
|
48
|
+
maskWebViews?: boolean;
|
|
49
|
+
/** Whether to mask sandboxed views (system views that don't belong to current process) */
|
|
50
|
+
maskSandboxedViews?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('SessionRecorderNative');
|
|
@@ -1,88 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Platform,
|
|
4
|
-
TurboModuleRegistry,
|
|
5
|
-
type TurboModule,
|
|
6
|
-
} from 'react-native';
|
|
7
|
-
|
|
8
|
-
export interface Spec extends TurboModule {
|
|
9
|
-
/**
|
|
10
|
-
* Capture the current screen and apply masking to sensitive elements
|
|
11
|
-
* @returns Promise that resolves to base64 encoded image
|
|
12
|
-
*/
|
|
13
|
-
captureAndMask(): Promise<string>;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Capture the current screen and apply masking with custom options
|
|
17
|
-
* @param options Custom masking options
|
|
18
|
-
* @returns Promise that resolves to base64 encoded image
|
|
19
|
-
*/
|
|
20
|
-
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
21
|
-
|
|
22
|
-
// Gesture recording APIs
|
|
23
|
-
startGestureRecording(): Promise<void>;
|
|
24
|
-
stopGestureRecording(): Promise<void>;
|
|
25
|
-
isGestureRecordingActive(): Promise<boolean>;
|
|
26
|
-
setGestureCallback(callback: (event: any) => void): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface MaskingOptions {
|
|
30
|
-
/** Quality of the captured image (0.1 to 1.0, default: 0.3 for smaller file size) */
|
|
31
|
-
quality?: number;
|
|
32
|
-
/** Scale of the captured image (0.1 to 1.0, default: 1.0) */
|
|
33
|
-
scale?: number;
|
|
34
|
-
/** Whether to mask text inputs (UITextField, UITextView, React Native text components) */
|
|
35
|
-
maskTextInputs?: boolean;
|
|
36
|
-
/** Whether to mask images (UIImageView, React Native Image components) */
|
|
37
|
-
maskImages?: boolean;
|
|
38
|
-
/** Whether to mask buttons (UIButton) */
|
|
39
|
-
maskButtons?: boolean;
|
|
40
|
-
/** Whether to mask labels (UILabel) */
|
|
41
|
-
maskLabels?: boolean;
|
|
42
|
-
/** Whether to mask web views (WKWebView) */
|
|
43
|
-
maskWebViews?: boolean;
|
|
44
|
-
/** Whether to mask sandboxed views (system views that don't belong to current process) */
|
|
45
|
-
maskSandboxedViews?: boolean;
|
|
46
|
-
}
|
|
1
|
+
import { Platform, NativeEventEmitter } from 'react-native';
|
|
2
|
+
import SessionRecorderNative, { type MaskingOptions, type Spec } from '../SessionRecorderNativeSpec';
|
|
47
3
|
|
|
48
|
-
export interface SessionRecorderNativeModule {
|
|
49
|
-
/**
|
|
50
|
-
* Capture the current screen and apply masking to sensitive elements
|
|
51
|
-
* @returns Promise that resolves to base64 encoded image
|
|
52
|
-
*/
|
|
53
|
-
captureAndMask(): Promise<string>;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Capture the current screen and apply masking with custom options
|
|
57
|
-
* @param options Custom masking options
|
|
58
|
-
* @returns Promise that resolves to base64 encoded image
|
|
59
|
-
*/
|
|
60
|
-
captureAndMaskWithOptions(options: MaskingOptions): Promise<string>;
|
|
61
|
-
|
|
62
|
-
// Gesture recording APIs
|
|
63
|
-
startGestureRecording(): Promise<void>;
|
|
64
|
-
stopGestureRecording(): Promise<void>;
|
|
65
|
-
isGestureRecordingActive(): Promise<boolean>;
|
|
66
|
-
setGestureCallback(callback: (event: any) => void): void;
|
|
67
|
-
}
|
|
68
4
|
|
|
69
5
|
// Check if we're on web platform
|
|
70
6
|
const isWeb = Platform.OS === 'web';
|
|
71
7
|
|
|
72
8
|
// Get the Turbo Module
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!isWeb) {
|
|
77
|
-
try {
|
|
78
|
-
SessionRecorderNative = TurboModuleRegistry.getEnforcing<Spec>(
|
|
79
|
-
'SessionRecorderNative'
|
|
80
|
-
);
|
|
81
|
-
eventEmitter = new NativeEventEmitter(SessionRecorderNative as any);
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.warn('Failed to access SessionRecorderNative Turbo Module:', error);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
9
|
+
let eventEmitter = new NativeEventEmitter(SessionRecorderNative as any);
|
|
10
|
+
|
|
86
11
|
|
|
87
12
|
// Validate that the native module is available
|
|
88
13
|
if (!SessionRecorderNative && !isWeb) {
|
|
@@ -139,21 +64,36 @@ const SafeSessionRecorderNative: Spec = {
|
|
|
139
64
|
// Native side will also invoke callback if provided; also subscribe to events here
|
|
140
65
|
try {
|
|
141
66
|
SessionRecorderNative.setGestureCallback(callback as any);
|
|
142
|
-
} catch {}
|
|
67
|
+
} catch { }
|
|
143
68
|
eventEmitter?.removeAllListeners('onGestureDetected');
|
|
144
69
|
eventEmitter?.addListener('onGestureDetected', callback);
|
|
145
70
|
},
|
|
71
|
+
|
|
72
|
+
recordGesture(gestureType: string, x: number, y: number, target?: string, metadata?: any): void {
|
|
73
|
+
if (isWeb || !SessionRecorderNative) {
|
|
74
|
+
throw new Error('SessionRecorderNative is not available on web platform');
|
|
75
|
+
}
|
|
76
|
+
SessionRecorderNative.recordGesture(gestureType, x, y, target, metadata);
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
addListener(_eventName: string): void {
|
|
80
|
+
// Required for RN event emitter contracts
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
removeListeners(_count: number): void {
|
|
84
|
+
// Required for RN event emitter contracts
|
|
85
|
+
},
|
|
146
86
|
};
|
|
147
87
|
|
|
148
88
|
export interface NativeGestureEvent {
|
|
149
89
|
type:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
90
|
+
| 'tap'
|
|
91
|
+
| 'pan_start'
|
|
92
|
+
| 'pan_move'
|
|
93
|
+
| 'pan_end'
|
|
94
|
+
| 'long_press'
|
|
95
|
+
| 'pinch'
|
|
96
|
+
| 'swipe';
|
|
157
97
|
timestamp: number;
|
|
158
98
|
x: number;
|
|
159
99
|
y: number;
|