@multiplayer-app/session-recorder-react-native 1.3.37 → 2.0.17-alpha.9
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/package.json +4 -4
- package/src/NativeSessionRecorderModule.ts +4 -2
- package/src/NativeSessionRecorderModuleSpec.ts +4 -2
- package/src/NativeSessionRecorderNative.ts +1 -1
- package/src/index.ts +0 -1
- package/src/otel/instrumentations/index.ts +22 -22
- package/src/session-recorder.ts +4 -0
- package/src/types/configs.ts +1 -2
- package/lib/module/NativeSessionRecorderModule.js +0 -5
- package/lib/module/NativeSessionRecorderModule.js.map +0 -1
- package/lib/module/NativeSessionRecorderModuleSpec.js +0 -5
- package/lib/module/NativeSessionRecorderModuleSpec.js.map +0 -1
- package/lib/module/NativeSessionRecorderNative.js +0 -5
- package/lib/module/NativeSessionRecorderNative.js.map +0 -1
- package/lib/module/components/ErrorBoundary.js +0 -32
- package/lib/module/components/ErrorBoundary.js.map +0 -1
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +0 -23
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
- package/lib/module/components/ScreenRecorderView/index.js +0 -4
- package/lib/module/components/ScreenRecorderView/index.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +0 -64
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js +0 -74
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js +0 -191
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js +0 -138
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js +0 -177
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js +0 -27
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -133
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/icons.js +0 -93
- package/lib/module/components/SessionRecorderWidget/icons.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/index.js +0 -5
- package/lib/module/components/SessionRecorderWidget/index.js.map +0 -1
- package/lib/module/components/SessionRecorderWidget/styles.js +0 -173
- package/lib/module/components/SessionRecorderWidget/styles.js.map +0 -1
- package/lib/module/components/index.js +0 -6
- package/lib/module/components/index.js.map +0 -1
- package/lib/module/config/constants.js +0 -47
- package/lib/module/config/constants.js.map +0 -1
- package/lib/module/config/defaults.js +0 -87
- package/lib/module/config/defaults.js.map +0 -1
- package/lib/module/config/index.js +0 -9
- package/lib/module/config/index.js.map +0 -1
- package/lib/module/config/masking.js +0 -35
- package/lib/module/config/masking.js.map +0 -1
- package/lib/module/config/session-recorder.js +0 -50
- package/lib/module/config/session-recorder.js.map +0 -1
- package/lib/module/config/validators.js +0 -28
- package/lib/module/config/validators.js.map +0 -1
- package/lib/module/config/widget.js +0 -35
- package/lib/module/config/widget.js.map +0 -1
- package/lib/module/context/SessionRecorderContext.js +0 -100
- package/lib/module/context/SessionRecorderContext.js.map +0 -1
- package/lib/module/context/SessionRecorderStore.js +0 -12
- package/lib/module/context/SessionRecorderStore.js.map +0 -1
- package/lib/module/context/createStore.js +0 -27
- package/lib/module/context/createStore.js.map +0 -1
- package/lib/module/context/useSessionRecorderStore.js +0 -45
- package/lib/module/context/useSessionRecorderStore.js.map +0 -1
- package/lib/module/context/useStoreSelector.js +0 -27
- package/lib/module/context/useStoreSelector.js.map +0 -1
- package/lib/module/index.js +0 -14
- package/lib/module/index.js.map +0 -1
- package/lib/module/native/SessionRecorderNative.js +0 -76
- package/lib/module/native/SessionRecorderNative.js.map +0 -1
- package/lib/module/native/index.js +0 -4
- package/lib/module/native/index.js.map +0 -1
- package/lib/module/otel/CrashBufferSpanProcessor.js +0 -42
- package/lib/module/otel/CrashBufferSpanProcessor.js.map +0 -1
- package/lib/module/otel/helpers.js +0 -218
- package/lib/module/otel/helpers.js.map +0 -1
- package/lib/module/otel/index.js +0 -202
- package/lib/module/otel/index.js.map +0 -1
- package/lib/module/otel/instrumentations/index.js +0 -122
- package/lib/module/otel/instrumentations/index.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/patch/configs.js +0 -18
- package/lib/module/patch/configs.js.map +0 -1
- package/lib/module/patch/fetch.js +0 -222
- package/lib/module/patch/fetch.js.map +0 -1
- package/lib/module/patch/index.js +0 -6
- package/lib/module/patch/index.js.map +0 -1
- package/lib/module/patch/xhr.js +0 -100
- package/lib/module/patch/xhr.js.map +0 -1
- package/lib/module/recorder/gestureRecorder.js +0 -641
- package/lib/module/recorder/gestureRecorder.js.map +0 -1
- package/lib/module/recorder/index.js +0 -176
- package/lib/module/recorder/index.js.map +0 -1
- package/lib/module/recorder/navigationRecorder.js +0 -238
- package/lib/module/recorder/navigationRecorder.js.map +0 -1
- package/lib/module/recorder/screenRecorder.js +0 -527
- package/lib/module/recorder/screenRecorder.js.map +0 -1
- package/lib/module/services/api.service.js +0 -166
- package/lib/module/services/api.service.js.map +0 -1
- package/lib/module/services/crashBuffer.service.js +0 -280
- package/lib/module/services/crashBuffer.service.js.map +0 -1
- package/lib/module/services/network.service.js +0 -178
- package/lib/module/services/network.service.js.map +0 -1
- package/lib/module/services/screenRecordingService.js +0 -107
- package/lib/module/services/screenRecordingService.js.map +0 -1
- package/lib/module/services/socket.service.js +0 -186
- package/lib/module/services/socket.service.js.map +0 -1
- package/lib/module/services/storage.service.js +0 -178
- package/lib/module/services/storage.service.js.map +0 -1
- package/lib/module/session-recorder.js +0 -750
- package/lib/module/session-recorder.js.map +0 -1
- package/lib/module/types/configs.js +0 -4
- package/lib/module/types/configs.js.map +0 -1
- package/lib/module/types/expo-constants.d.js +0 -2
- package/lib/module/types/expo-constants.d.js.map +0 -1
- package/lib/module/types/index.js +0 -10
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/session-recorder.js +0 -68
- package/lib/module/types/session-recorder.js.map +0 -1
- package/lib/module/utils/app-metadata.js +0 -28
- package/lib/module/utils/app-metadata.js.map +0 -1
- package/lib/module/utils/constants.optional.expo.js +0 -6
- package/lib/module/utils/constants.optional.expo.js.map +0 -1
- package/lib/module/utils/constants.optional.js +0 -8
- package/lib/module/utils/constants.optional.js.map +0 -1
- package/lib/module/utils/index.js +0 -11
- package/lib/module/utils/index.js.map +0 -1
- package/lib/module/utils/logger.js +0 -185
- package/lib/module/utils/logger.js.map +0 -1
- package/lib/module/utils/platform.js +0 -340
- package/lib/module/utils/platform.js.map +0 -1
- package/lib/module/utils/request-utils.js +0 -58
- package/lib/module/utils/request-utils.js.map +0 -1
- package/lib/module/utils/rrweb-events.js +0 -276
- package/lib/module/utils/rrweb-events.js.map +0 -1
- package/lib/module/utils/session.js +0 -21
- package/lib/module/utils/session.js.map +0 -1
- package/lib/module/utils/shallowEqual.js +0 -17
- package/lib/module/utils/shallowEqual.js.map +0 -1
- package/lib/module/utils/time.js +0 -17
- package/lib/module/utils/time.js.map +0 -1
- package/lib/module/utils/type-utils.js +0 -69
- package/lib/module/utils/type-utils.js.map +0 -1
- package/lib/module/version.js +0 -4
- package/lib/module/version.js.map +0 -1
- package/lib/typescript/package.json +0 -1
- package/lib/typescript/src/NativeSessionRecorderModule.d.ts +0 -25
- package/lib/typescript/src/NativeSessionRecorderModule.d.ts.map +0 -1
- package/lib/typescript/src/NativeSessionRecorderModuleSpec.d.ts +0 -25
- package/lib/typescript/src/NativeSessionRecorderModuleSpec.d.ts.map +0 -1
- package/lib/typescript/src/NativeSessionRecorderNative.d.ts +0 -25
- package/lib/typescript/src/NativeSessionRecorderNative.d.ts.map +0 -1
- package/lib/typescript/src/components/ErrorBoundary.d.ts +0 -16
- package/lib/typescript/src/components/ErrorBoundary.d.ts.map +0 -1
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -6
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +0 -1
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +0 -2
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts +0 -8
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts +0 -13
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts +0 -9
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts +0 -17
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts +0 -9
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts +0 -7
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +0 -6
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts +0 -12
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +0 -3
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +0 -1
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts +0 -166
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +0 -1
- package/lib/typescript/src/components/index.d.ts +0 -4
- package/lib/typescript/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/config/constants.d.ts +0 -22
- package/lib/typescript/src/config/constants.d.ts.map +0 -1
- package/lib/typescript/src/config/defaults.d.ts +0 -5
- package/lib/typescript/src/config/defaults.d.ts.map +0 -1
- package/lib/typescript/src/config/index.d.ts +0 -6
- package/lib/typescript/src/config/index.d.ts.map +0 -1
- package/lib/typescript/src/config/masking.d.ts +0 -3
- package/lib/typescript/src/config/masking.d.ts.map +0 -1
- package/lib/typescript/src/config/session-recorder.d.ts +0 -3
- package/lib/typescript/src/config/session-recorder.d.ts.map +0 -1
- package/lib/typescript/src/config/validators.d.ts +0 -11
- package/lib/typescript/src/config/validators.d.ts.map +0 -1
- package/lib/typescript/src/config/widget.d.ts +0 -10
- package/lib/typescript/src/config/widget.d.ts.map +0 -1
- package/lib/typescript/src/context/SessionRecorderContext.d.ts +0 -22
- package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +0 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts +0 -13
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +0 -1
- package/lib/typescript/src/context/createStore.d.ts +0 -9
- package/lib/typescript/src/context/createStore.d.ts.map +0 -1
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts +0 -29
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +0 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts +0 -5
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -9
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/native/SessionRecorderNative.d.ts +0 -29
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +0 -1
- package/lib/typescript/src/native/index.d.ts +0 -2
- package/lib/typescript/src/native/index.d.ts.map +0 -1
- package/lib/typescript/src/otel/CrashBufferSpanProcessor.d.ts +0 -17
- package/lib/typescript/src/otel/CrashBufferSpanProcessor.d.ts.map +0 -1
- package/lib/typescript/src/otel/helpers.d.ts +0 -46
- package/lib/typescript/src/otel/helpers.d.ts.map +0 -1
- package/lib/typescript/src/otel/index.d.ts +0 -33
- package/lib/typescript/src/otel/index.d.ts.map +0 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts +0 -5
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +0 -1
- package/lib/typescript/src/patch/configs.d.ts +0 -9
- package/lib/typescript/src/patch/configs.d.ts.map +0 -1
- package/lib/typescript/src/patch/fetch.d.ts +0 -2
- package/lib/typescript/src/patch/fetch.d.ts.map +0 -1
- package/lib/typescript/src/patch/index.d.ts +0 -4
- package/lib/typescript/src/patch/index.d.ts.map +0 -1
- package/lib/typescript/src/patch/xhr.d.ts +0 -2
- package/lib/typescript/src/patch/xhr.d.ts.map +0 -1
- package/lib/typescript/src/recorder/gestureRecorder.d.ts +0 -66
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +0 -1
- package/lib/typescript/src/recorder/index.d.ts +0 -79
- package/lib/typescript/src/recorder/index.d.ts.map +0 -1
- package/lib/typescript/src/recorder/navigationRecorder.d.ts +0 -29
- package/lib/typescript/src/recorder/navigationRecorder.d.ts.map +0 -1
- package/lib/typescript/src/recorder/screenRecorder.d.ts +0 -127
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +0 -1
- package/lib/typescript/src/services/api.service.d.ts +0 -116
- package/lib/typescript/src/services/api.service.d.ts.map +0 -1
- package/lib/typescript/src/services/crashBuffer.service.d.ts +0 -27
- package/lib/typescript/src/services/crashBuffer.service.d.ts.map +0 -1
- package/lib/typescript/src/services/network.service.d.ts +0 -47
- package/lib/typescript/src/services/network.service.d.ts.map +0 -1
- package/lib/typescript/src/services/screenRecordingService.d.ts +0 -48
- package/lib/typescript/src/services/screenRecordingService.d.ts.map +0 -1
- package/lib/typescript/src/services/socket.service.d.ts +0 -44
- package/lib/typescript/src/services/socket.service.d.ts.map +0 -1
- package/lib/typescript/src/services/storage.service.d.ts +0 -47
- package/lib/typescript/src/services/storage.service.d.ts.map +0 -1
- package/lib/typescript/src/session-recorder.d.ts +0 -191
- package/lib/typescript/src/session-recorder.d.ts.map +0 -1
- package/lib/typescript/src/types/configs.d.ts +0 -92
- package/lib/typescript/src/types/configs.d.ts.map +0 -1
- package/lib/typescript/src/types/index.d.ts +0 -21
- package/lib/typescript/src/types/index.d.ts.map +0 -1
- package/lib/typescript/src/types/session-recorder.d.ts +0 -367
- package/lib/typescript/src/types/session-recorder.d.ts.map +0 -1
- package/lib/typescript/src/utils/app-metadata.d.ts +0 -17
- package/lib/typescript/src/utils/app-metadata.d.ts.map +0 -1
- package/lib/typescript/src/utils/constants.optional.d.ts +0 -22
- package/lib/typescript/src/utils/constants.optional.d.ts.map +0 -1
- package/lib/typescript/src/utils/constants.optional.expo.d.ts +0 -4
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +0 -1
- package/lib/typescript/src/utils/index.d.ts +0 -8
- package/lib/typescript/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/logger.d.ts +0 -108
- package/lib/typescript/src/utils/logger.d.ts.map +0 -1
- package/lib/typescript/src/utils/platform.d.ts +0 -58
- package/lib/typescript/src/utils/platform.d.ts.map +0 -1
- package/lib/typescript/src/utils/request-utils.d.ts +0 -22
- package/lib/typescript/src/utils/request-utils.d.ts.map +0 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts +0 -67
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +0 -1
- package/lib/typescript/src/utils/session.d.ts +0 -7
- package/lib/typescript/src/utils/session.d.ts.map +0 -1
- package/lib/typescript/src/utils/shallowEqual.d.ts +0 -2
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +0 -1
- package/lib/typescript/src/utils/time.d.ts +0 -5
- package/lib/typescript/src/utils/time.d.ts.map +0 -1
- package/lib/typescript/src/utils/type-utils.d.ts +0 -17
- package/lib/typescript/src/utils/type-utils.d.ts.map +0 -1
- package/lib/typescript/src/version.d.ts +0 -2
- package/lib/typescript/src/version.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplayer-app/session-recorder-react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.17-alpha.9",
|
|
4
4
|
"description": "Multiplayer Fullstack Session Recorder for React Native",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Multiplayer Software, Inc.",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"test": "jest",
|
|
58
58
|
"typecheck": "tsc",
|
|
59
|
-
"lint": "eslint src/**/*.{ts,tsx} --config eslint.config.mjs",
|
|
59
|
+
"lint": "eslint 'src/**/*.{ts,tsx}' --config eslint.config.mjs",
|
|
60
60
|
"build": "bob build",
|
|
61
61
|
"prepublishOnly": "npm run build",
|
|
62
62
|
"release": "release-it --only-version"
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"eslint-config-prettier": "^10.1.8",
|
|
104
104
|
"eslint-plugin-prettier": "^5.5.4",
|
|
105
105
|
"jest": "^29.7.0",
|
|
106
|
-
"prettier": "
|
|
106
|
+
"prettier": "3.8.1",
|
|
107
107
|
"react": "19.2.4",
|
|
108
108
|
"react-native": "0.81.1",
|
|
109
109
|
"react-native-builder-bob": "^0.40.13",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"typescript": "^5.9.2"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@multiplayer-app/session-recorder-common": "
|
|
116
|
+
"@multiplayer-app/session-recorder-common": "2.0.17-alpha.9",
|
|
117
117
|
"@opentelemetry/core": "2.0.1",
|
|
118
118
|
"@opentelemetry/exporter-trace-otlp-http": "0.203.0",
|
|
119
119
|
"@opentelemetry/instrumentation": "0.203.0",
|
|
@@ -24,10 +24,12 @@ export interface Spec extends TurboModule {
|
|
|
24
24
|
x: number,
|
|
25
25
|
y: number,
|
|
26
26
|
target?: string,
|
|
27
|
-
metadata?:
|
|
27
|
+
metadata?: object
|
|
28
28
|
): void;
|
|
29
29
|
addListener(eventName: string): void;
|
|
30
30
|
removeListeners(count: number): void;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
33
|
+
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
34
|
+
'SessionRecorderNative'
|
|
35
|
+
) as Spec;
|
|
@@ -24,10 +24,12 @@ export interface Spec extends TurboModule {
|
|
|
24
24
|
x: number,
|
|
25
25
|
y: number,
|
|
26
26
|
target?: string,
|
|
27
|
-
metadata?:
|
|
27
|
+
metadata?: object
|
|
28
28
|
): void;
|
|
29
29
|
addListener(eventName: string): void;
|
|
30
30
|
removeListeners(count: number): void;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
33
|
+
export default TurboModuleRegistry.getEnforcing<Spec>(
|
|
34
|
+
'SessionRecorderNative'
|
|
35
|
+
) as Spec;
|
package/src/index.ts
CHANGED
|
@@ -32,29 +32,29 @@ export function getInstrumentations(config: TracerReactNativeConfig) {
|
|
|
32
32
|
|
|
33
33
|
// Try to get data from our fetch wrapper first
|
|
34
34
|
// @ts-ignore
|
|
35
|
-
const networkRequest = response?.networkRequest
|
|
35
|
+
const networkRequest = response?.networkRequest;
|
|
36
36
|
|
|
37
|
-
let requestBody: any = null
|
|
38
|
-
let responseBody: string | null = null
|
|
39
|
-
let requestHeaders: Record<string, string> = {}
|
|
40
|
-
let responseHeaders: Record<string, string> = {}
|
|
37
|
+
let requestBody: any = null;
|
|
38
|
+
let responseBody: string | null = null;
|
|
39
|
+
let requestHeaders: Record<string, string> = {};
|
|
40
|
+
let responseHeaders: Record<string, string> = {};
|
|
41
41
|
|
|
42
42
|
if (networkRequest) {
|
|
43
43
|
// Use data captured by our fetch wrapper
|
|
44
|
-
requestBody = networkRequest.requestBody
|
|
45
|
-
responseBody = networkRequest.responseBody
|
|
46
|
-
requestHeaders = networkRequest.requestHeaders || {}
|
|
47
|
-
responseHeaders = networkRequest.responseHeaders || {}
|
|
44
|
+
requestBody = networkRequest.requestBody;
|
|
45
|
+
responseBody = networkRequest.responseBody;
|
|
46
|
+
requestHeaders = networkRequest.requestHeaders || {};
|
|
47
|
+
responseHeaders = networkRequest.responseHeaders || {};
|
|
48
48
|
} else {
|
|
49
49
|
// Fallback to original OpenTelemetry approach
|
|
50
|
-
requestBody = request.body
|
|
51
|
-
requestHeaders = headersToObject(request.headers)
|
|
50
|
+
requestBody = request.body;
|
|
51
|
+
requestHeaders = headersToObject(request.headers);
|
|
52
52
|
responseHeaders = headersToObject(
|
|
53
53
|
response instanceof Response ? response.headers : undefined
|
|
54
|
-
)
|
|
54
|
+
);
|
|
55
55
|
|
|
56
56
|
if (response instanceof Response && response.body) {
|
|
57
|
-
responseBody = await extractResponseBody(response)
|
|
57
|
+
responseBody = await extractResponseBody(response);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -94,17 +94,17 @@ export function getInstrumentations(config: TracerReactNativeConfig) {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// @ts-ignore
|
|
97
|
-
const networkRequest = xhr.networkRequest
|
|
98
|
-
let requestBody: any = null
|
|
99
|
-
let responseBody: string | null = null
|
|
100
|
-
let requestHeaders: Record<string, string> = {}
|
|
101
|
-
let responseHeaders: Record<string, string> = {}
|
|
97
|
+
const networkRequest = xhr.networkRequest;
|
|
98
|
+
let requestBody: any = null;
|
|
99
|
+
let responseBody: string | null = null;
|
|
100
|
+
let requestHeaders: Record<string, string> = {};
|
|
101
|
+
let responseHeaders: Record<string, string> = {};
|
|
102
102
|
|
|
103
103
|
if (networkRequest) {
|
|
104
|
-
requestBody = networkRequest.requestBody
|
|
105
|
-
responseBody = networkRequest.responseBody
|
|
106
|
-
requestHeaders = networkRequest.requestHeaders || {}
|
|
107
|
-
responseHeaders = networkRequest.responseHeaders || {}
|
|
104
|
+
requestBody = networkRequest.requestBody;
|
|
105
|
+
responseBody = networkRequest.responseBody;
|
|
106
|
+
requestHeaders = networkRequest.requestHeaders || {};
|
|
107
|
+
responseHeaders = networkRequest.responseHeaders || {};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
const payload = {
|
package/src/session-recorder.ts
CHANGED
|
@@ -355,6 +355,7 @@ class SessionRecorder
|
|
|
355
355
|
// Start capturing events without an active debug session id.
|
|
356
356
|
try {
|
|
357
357
|
this._recorder.stop();
|
|
358
|
+
// eslint-disable-next-line no-empty
|
|
358
359
|
} catch (_e) {}
|
|
359
360
|
this._recorder.start(null, SessionType.MANUAL);
|
|
360
361
|
}
|
|
@@ -657,12 +658,14 @@ class SessionRecorder
|
|
|
657
658
|
*/
|
|
658
659
|
private _start(): void {
|
|
659
660
|
this.sessionState = SessionState.started;
|
|
661
|
+
// eslint-disable-next-line no-self-assign
|
|
660
662
|
this.sessionType = this.sessionType;
|
|
661
663
|
|
|
662
664
|
if (this.sessionId) {
|
|
663
665
|
// Switch from buffer-only recording to session recording cleanly.
|
|
664
666
|
try {
|
|
665
667
|
this._recorder.stop();
|
|
668
|
+
// eslint-disable-next-line no-empty
|
|
666
669
|
} catch (_e) {}
|
|
667
670
|
this._tracer.start(this.sessionId, this.sessionType);
|
|
668
671
|
this._recorder.start(this.sessionId, this.sessionType);
|
|
@@ -700,6 +703,7 @@ class SessionRecorder
|
|
|
700
703
|
this._tracer.start(this.sessionId, this.sessionType);
|
|
701
704
|
try {
|
|
702
705
|
this._recorder.stop();
|
|
706
|
+
// eslint-disable-next-line no-empty
|
|
703
707
|
} catch (_e) {}
|
|
704
708
|
this._recorder.start(this.sessionId, this.sessionType);
|
|
705
709
|
}
|
package/src/types/configs.ts
CHANGED
|
@@ -22,8 +22,7 @@ export type DeepRequired<T> = T extends Function
|
|
|
22
22
|
* Fully resolved configuration interface
|
|
23
23
|
* All optional properties from SessionRecorderOptions are now required
|
|
24
24
|
*/
|
|
25
|
-
export interface SessionRecorderConfigs
|
|
26
|
-
extends DeepRequired<SessionRecorderOptions> {}
|
|
25
|
+
export interface SessionRecorderConfigs extends DeepRequired<SessionRecorderOptions> {}
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Base configuration interface with common properties
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderModuleSpec.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSessionRecorderNative.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import SessionRecorder from "../session-recorder.js";
|
|
5
|
-
export class ErrorBoundary extends React.Component {
|
|
6
|
-
constructor(props) {
|
|
7
|
-
super(props);
|
|
8
|
-
this.state = {
|
|
9
|
-
hasError: false
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
static getDerivedStateFromError() {
|
|
13
|
-
return {
|
|
14
|
-
hasError: true
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
componentDidCatch(error) {
|
|
18
|
-
try {
|
|
19
|
-
SessionRecorder.captureException(error);
|
|
20
|
-
} catch (_e) {
|
|
21
|
-
// ignore
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
if (this.state.hasError) {
|
|
26
|
-
return this.props.fallback ?? null;
|
|
27
|
-
}
|
|
28
|
-
return this.props.children;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export default ErrorBoundary;
|
|
32
|
-
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","SessionRecorder","ErrorBoundary","Component","constructor","props","state","hasError","getDerivedStateFromError","componentDidCatch","error","captureException","_e","render","fallback","children"],"sourceRoot":"../../../src","sources":["components/ErrorBoundary.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,MAAM,wBAAqB;AASjD,OAAO,MAAMC,aAAa,SAASF,KAAK,CAACG,SAAS,CAA4B;EAC5EC,WAAWA,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;EAClC;EAEA,OAAOC,wBAAwBA,CAAA,EAAU;IACvC,OAAO;MAAED,QAAQ,EAAE;IAAK,CAAC;EAC3B;EAEAE,iBAAiBA,CAACC,KAAc,EAAQ;IACtC,IAAI;MACFT,eAAe,CAACU,gBAAgB,CAACD,KAAY,CAAC;IAChD,CAAC,CAAC,OAAOE,EAAE,EAAE;MACX;IAAA;EAEJ;EAEAC,MAAMA,CAAA,EAAoB;IACxB,IAAI,IAAI,CAACP,KAAK,CAACC,QAAQ,EAAE;MACvB,OAAO,IAAI,CAACF,KAAK,CAACS,QAAQ,IAAI,IAAI;IACpC;IACA,OAAO,IAAI,CAACT,KAAK,CAACU,QAAQ;EAC5B;AACF;AAEA,eAAeb,aAAa","ignoreList":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import SessionRecorder from '@multiplayer-app/session-recorder-react-native';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
export const ScreenRecorderView = ({
|
|
7
|
-
children
|
|
8
|
-
}) => {
|
|
9
|
-
// Callback ref to set the viewshot ref immediately when available
|
|
10
|
-
const setViewShotRef = ref => {
|
|
11
|
-
if (ref) {
|
|
12
|
-
SessionRecorder.setViewShotRef?.(ref);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
return /*#__PURE__*/_jsx(View, {
|
|
16
|
-
ref: setViewShotRef,
|
|
17
|
-
style: {
|
|
18
|
-
flex: 1
|
|
19
|
-
},
|
|
20
|
-
children: children
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=ScreenRecorderView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SessionRecorder","View","jsx","_jsx","ScreenRecorderView","children","setViewShotRef","ref","style","flex"],"sourceRoot":"../../../../src","sources":["components/ScreenRecorderView/ScreenRecorderView.tsx"],"mappings":";;AAAA,OAAOA,eAAe,MAAM,gDAAgD;AAE5E,SAASC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIpC,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAAEC;AAAkC,CAAC,KAAK;EAC3E;EACA,MAAMC,cAAc,GAAIC,GAAoB,IAAK;IAC/C,IAAIA,GAAG,EAAE;MACPP,eAAe,CAACM,cAAc,GAAGC,GAAG,CAAC;IACvC;EACF,CAAC;EAED,oBACEJ,IAAA,CAACF,IAAI;IAACM,GAAG,EAAED,cAAe;IAACE,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAE;IAAAJ,QAAA,EAC3CA;EAAQ,CACL,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/ScreenRecorderView/index.ts"],"mappings":";;AAAA,cAAc,yBAAsB","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
const ErrorBanner = ({
|
|
7
|
-
error,
|
|
8
|
-
onDismiss
|
|
9
|
-
}) => {
|
|
10
|
-
return /*#__PURE__*/_jsx(View, {
|
|
11
|
-
style: styles.container,
|
|
12
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
13
|
-
style: styles.content,
|
|
14
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
15
|
-
style: styles.errorText,
|
|
16
|
-
children: error
|
|
17
|
-
}), /*#__PURE__*/_jsx(Pressable, {
|
|
18
|
-
onPress: onDismiss,
|
|
19
|
-
style: styles.dismissButton,
|
|
20
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
21
|
-
style: styles.dismissText,
|
|
22
|
-
children: "\u2715"
|
|
23
|
-
})
|
|
24
|
-
})]
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
const styles = StyleSheet.create({
|
|
29
|
-
container: {
|
|
30
|
-
backgroundColor: '#ff4444',
|
|
31
|
-
paddingHorizontal: 16,
|
|
32
|
-
paddingVertical: 12,
|
|
33
|
-
marginHorizontal: 16,
|
|
34
|
-
marginTop: 8,
|
|
35
|
-
borderRadius: 8
|
|
36
|
-
},
|
|
37
|
-
content: {
|
|
38
|
-
flexDirection: 'row',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
justifyContent: 'space-between'
|
|
41
|
-
},
|
|
42
|
-
errorText: {
|
|
43
|
-
color: 'white',
|
|
44
|
-
fontSize: 14,
|
|
45
|
-
flex: 1,
|
|
46
|
-
marginRight: 8
|
|
47
|
-
},
|
|
48
|
-
dismissButton: {
|
|
49
|
-
padding: 4,
|
|
50
|
-
borderRadius: 12,
|
|
51
|
-
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
|
52
|
-
width: 24,
|
|
53
|
-
height: 24,
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
justifyContent: 'center'
|
|
56
|
-
},
|
|
57
|
-
dismissText: {
|
|
58
|
-
color: 'white',
|
|
59
|
-
fontSize: 12,
|
|
60
|
-
fontWeight: 'bold'
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
export default ErrorBanner;
|
|
64
|
-
//# sourceMappingURL=ErrorBanner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","Pressable","StyleSheet","jsx","_jsx","jsxs","_jsxs","ErrorBanner","error","onDismiss","style","styles","container","children","content","errorText","onPress","dismissButton","dismissText","create","backgroundColor","paddingHorizontal","paddingVertical","marginHorizontal","marginTop","borderRadius","flexDirection","alignItems","justifyContent","color","fontSize","flex","marginRight","padding","width","height","fontWeight"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/ErrorBanner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOjE,MAAMC,WAAuC,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAU,CAAC,KAAK;EACxE,oBACEL,IAAA,CAACL,IAAI;IAACW,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,eAC5BP,KAAA,CAACP,IAAI;MAACW,KAAK,EAAEC,MAAM,CAACG,OAAQ;MAAAD,QAAA,gBAC1BT,IAAA,CAACJ,IAAI;QAACU,KAAK,EAAEC,MAAM,CAACI,SAAU;QAAAF,QAAA,EAAEL;MAAK,CAAO,CAAC,eAC7CJ,IAAA,CAACH,SAAS;QAACe,OAAO,EAAEP,SAAU;QAACC,KAAK,EAAEC,MAAM,CAACM,aAAc;QAAAJ,QAAA,eACzDT,IAAA,CAACJ,IAAI;UAACU,KAAK,EAAEC,MAAM,CAACO,WAAY;UAAAL,QAAA,EAAC;QAAC,CAAM;MAAC,CAChC,CAAC;IAAA,CACR;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMF,MAAM,GAAGT,UAAU,CAACiB,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,eAAe,EAAE,SAAS;IAC1BC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,gBAAgB,EAAE,EAAE;IACpBC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE;EAChB,CAAC;EACDX,OAAO,EAAE;IACPY,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDb,SAAS,EAAE;IACTc,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,EAAE;IACZC,IAAI,EAAE,CAAC;IACPC,WAAW,EAAE;EACf,CAAC;EACDf,aAAa,EAAE;IACbgB,OAAO,EAAE,CAAC;IACVR,YAAY,EAAE,EAAE;IAChBL,eAAe,EAAE,0BAA0B;IAC3Cc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVR,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDV,WAAW,EAAE;IACXW,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAe7B,WAAW","ignoreList":[]}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { View, Text, Pressable, TextInput, ScrollView, Keyboard } from 'react-native';
|
|
5
|
-
import { sharedStyles } from "./styles.js";
|
|
6
|
-
import ModalHeader from "./ModalHeader.js";
|
|
7
|
-
import { logger } from "../../utils/index.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const FinalPopover = ({
|
|
10
|
-
isOnline,
|
|
11
|
-
textOverrides,
|
|
12
|
-
onStopRecording,
|
|
13
|
-
onCancelSession,
|
|
14
|
-
isSubmitting,
|
|
15
|
-
children
|
|
16
|
-
}) => {
|
|
17
|
-
const [comment, setComment] = useState('');
|
|
18
|
-
const handleStopRecording = async () => {
|
|
19
|
-
try {
|
|
20
|
-
await onStopRecording(comment);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
logger.error('FinalPopover', 'Failed to save session', error);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
26
|
-
style: sharedStyles.popoverContent,
|
|
27
|
-
children: [/*#__PURE__*/_jsx(ModalHeader, {
|
|
28
|
-
children: /*#__PURE__*/_jsx(Pressable, {
|
|
29
|
-
onPress: onCancelSession,
|
|
30
|
-
disabled: !isOnline,
|
|
31
|
-
style: sharedStyles.cancelButton,
|
|
32
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
33
|
-
style: sharedStyles.cancelButtonText,
|
|
34
|
-
children: textOverrides.cancelButtonText
|
|
35
|
-
})
|
|
36
|
-
})
|
|
37
|
-
}), /*#__PURE__*/_jsxs(ScrollView, {
|
|
38
|
-
style: sharedStyles.popoverBody,
|
|
39
|
-
keyboardShouldPersistTaps: "handled",
|
|
40
|
-
contentInsetAdjustmentBehavior: "automatic",
|
|
41
|
-
children: [children, /*#__PURE__*/_jsx(Text, {
|
|
42
|
-
style: sharedStyles.title,
|
|
43
|
-
children: textOverrides.finalTitle
|
|
44
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
45
|
-
style: sharedStyles.description,
|
|
46
|
-
children: textOverrides.finalDescription
|
|
47
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
48
|
-
style: sharedStyles.commentInput,
|
|
49
|
-
placeholder: textOverrides.commentPlaceholder,
|
|
50
|
-
placeholderTextColor: '#9CA3AF',
|
|
51
|
-
value: comment,
|
|
52
|
-
onChangeText: setComment,
|
|
53
|
-
multiline: true,
|
|
54
|
-
numberOfLines: 3,
|
|
55
|
-
returnKeyType: "done",
|
|
56
|
-
blurOnSubmit: true,
|
|
57
|
-
onSubmitEditing: () => Keyboard.dismiss()
|
|
58
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
59
|
-
style: sharedStyles.popoverFooter,
|
|
60
|
-
children: /*#__PURE__*/_jsx(Pressable, {
|
|
61
|
-
disabled: isSubmitting || !isOnline,
|
|
62
|
-
style: [sharedStyles.actionButton, sharedStyles.stopButton],
|
|
63
|
-
onPress: handleStopRecording,
|
|
64
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
65
|
-
style: sharedStyles.actionButtonText,
|
|
66
|
-
children: isSubmitting ? 'Saving...' : textOverrides.saveButtonText
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
})]
|
|
70
|
-
})]
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
export default FinalPopover;
|
|
74
|
-
//# sourceMappingURL=FinalPopover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","Text","Pressable","TextInput","ScrollView","Keyboard","sharedStyles","ModalHeader","logger","jsx","_jsx","jsxs","_jsxs","FinalPopover","isOnline","textOverrides","onStopRecording","onCancelSession","isSubmitting","children","comment","setComment","handleStopRecording","error","style","popoverContent","onPress","disabled","cancelButton","cancelButtonText","popoverBody","keyboardShouldPersistTaps","contentInsetAdjustmentBehavior","title","finalTitle","description","finalDescription","commentInput","placeholder","commentPlaceholder","placeholderTextColor","value","onChangeText","multiline","numberOfLines","returnKeyType","blurOnSubmit","onSubmitEditing","dismiss","popoverFooter","actionButton","stopButton","actionButtonText","saveButtonText"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/FinalPopover.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useEffect, useMemo } from 'react';
|
|
4
|
-
import { StyleSheet, Platform, Animated, PanResponder, View, Dimensions } from 'react-native';
|
|
5
|
-
import { SessionState } from "../../types/index.js";
|
|
6
|
-
import { StorageService } from "../../services/storage.service.js";
|
|
7
|
-
import { RecordIcon, CapturingIcon, PausedIcon } from "./icons.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const buttonSize = 52;
|
|
10
|
-
const rightOffset = 20;
|
|
11
|
-
const topOffset = Platform.OS === 'ios' ? 60 : 40;
|
|
12
|
-
const FloatingButton = ({
|
|
13
|
-
sessionState,
|
|
14
|
-
onPress
|
|
15
|
-
}) => {
|
|
16
|
-
const position = useRef(new Animated.ValueXY({
|
|
17
|
-
x: 0,
|
|
18
|
-
y: 0
|
|
19
|
-
})).current;
|
|
20
|
-
const lastPosition = useRef({
|
|
21
|
-
top: topOffset,
|
|
22
|
-
right: rightOffset
|
|
23
|
-
});
|
|
24
|
-
const storageService = useRef(StorageService.getInstance()).current;
|
|
25
|
-
const screenBounds = useMemo(() => {
|
|
26
|
-
const {
|
|
27
|
-
width,
|
|
28
|
-
height
|
|
29
|
-
} = Dimensions.get('window');
|
|
30
|
-
return {
|
|
31
|
-
minTop: topOffset,
|
|
32
|
-
maxTop: height - buttonSize,
|
|
33
|
-
minRight: 0,
|
|
34
|
-
maxRight: width - buttonSize
|
|
35
|
-
};
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
// Load saved position on component mount
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
const savedPosition = storageService.getFloatingButtonPosition();
|
|
41
|
-
if (savedPosition) {
|
|
42
|
-
const {
|
|
43
|
-
width
|
|
44
|
-
} = Dimensions.get('window');
|
|
45
|
-
const top = savedPosition.y;
|
|
46
|
-
const right = width - savedPosition.x - buttonSize;
|
|
47
|
-
lastPosition.current = {
|
|
48
|
-
top,
|
|
49
|
-
right
|
|
50
|
-
};
|
|
51
|
-
position.setValue({
|
|
52
|
-
x: right,
|
|
53
|
-
y: top
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
position.setValue({
|
|
57
|
-
x: lastPosition.current.right,
|
|
58
|
-
y: lastPosition.current.top
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}, []);
|
|
62
|
-
const panResponder = useRef(PanResponder.create({
|
|
63
|
-
onStartShouldSetPanResponder: () => true,
|
|
64
|
-
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
65
|
-
const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
|
|
66
|
-
return distance > 5;
|
|
67
|
-
},
|
|
68
|
-
onPanResponderGrant: () => {
|
|
69
|
-
// Set the initial position for this gesture
|
|
70
|
-
position.setValue({
|
|
71
|
-
x: lastPosition.current.right,
|
|
72
|
-
y: lastPosition.current.top
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
onPanResponderMove: (_, gestureState) => {
|
|
76
|
-
// Calculate new position based on gesture movement
|
|
77
|
-
const newTop = lastPosition.current.top + gestureState.dy;
|
|
78
|
-
const newRight = lastPosition.current.right - gestureState.dx;
|
|
79
|
-
|
|
80
|
-
// Update position during drag
|
|
81
|
-
position.setValue({
|
|
82
|
-
x: newRight,
|
|
83
|
-
y: newTop
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
onPanResponderRelease: (_, gestureState) => {
|
|
87
|
-
// Check if this was actually a drag (significant movement)
|
|
88
|
-
const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
|
|
89
|
-
|
|
90
|
-
// If it was a tap (no significant movement), trigger onPress
|
|
91
|
-
if (distance <= 5) {
|
|
92
|
-
onPress();
|
|
93
|
-
} else {
|
|
94
|
-
// Calculate new position after dragging
|
|
95
|
-
const newTop = lastPosition.current.top + gestureState.dy;
|
|
96
|
-
const newRight = lastPosition.current.right - gestureState.dx;
|
|
97
|
-
|
|
98
|
-
// Clamp to screen bounds
|
|
99
|
-
const clampedTop = Math.max(screenBounds.minTop, Math.min(screenBounds.maxTop, newTop));
|
|
100
|
-
const clampedRight = Math.max(screenBounds.minRight, Math.min(screenBounds.maxRight, newRight));
|
|
101
|
-
|
|
102
|
-
// Update position
|
|
103
|
-
lastPosition.current = {
|
|
104
|
-
top: clampedTop,
|
|
105
|
-
right: clampedRight
|
|
106
|
-
};
|
|
107
|
-
position.setValue({
|
|
108
|
-
x: clampedRight,
|
|
109
|
-
y: clampedTop
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// Convert back to x,y coordinates for storage
|
|
113
|
-
const {
|
|
114
|
-
width
|
|
115
|
-
} = Dimensions.get('window');
|
|
116
|
-
const storagePosition = {
|
|
117
|
-
x: width - clampedRight - buttonSize,
|
|
118
|
-
y: clampedTop
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// Persist position to AsyncStorage (debounced)
|
|
122
|
-
storageService.saveFloatingButtonPosition(storagePosition);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
})).current;
|
|
126
|
-
|
|
127
|
-
// Memoized button icon and color for performance
|
|
128
|
-
const content = useMemo(() => {
|
|
129
|
-
switch (sessionState) {
|
|
130
|
-
case SessionState.started:
|
|
131
|
-
return {
|
|
132
|
-
icon: /*#__PURE__*/_jsx(CapturingIcon, {
|
|
133
|
-
size: 28,
|
|
134
|
-
color: "white"
|
|
135
|
-
}),
|
|
136
|
-
color: '#FF4444'
|
|
137
|
-
};
|
|
138
|
-
case SessionState.paused:
|
|
139
|
-
return {
|
|
140
|
-
icon: /*#__PURE__*/_jsx(PausedIcon, {
|
|
141
|
-
size: 28,
|
|
142
|
-
color: "white"
|
|
143
|
-
}),
|
|
144
|
-
color: '#FFA500'
|
|
145
|
-
};
|
|
146
|
-
default:
|
|
147
|
-
return {
|
|
148
|
-
icon: /*#__PURE__*/_jsx(RecordIcon, {
|
|
149
|
-
size: 28,
|
|
150
|
-
color: "#718096"
|
|
151
|
-
}),
|
|
152
|
-
color: '#ffffff'
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}, [sessionState]);
|
|
156
|
-
return /*#__PURE__*/_jsx(Animated.View, {
|
|
157
|
-
style: [styles.draggableButton, {
|
|
158
|
-
top: position.y,
|
|
159
|
-
right: position.x
|
|
160
|
-
}],
|
|
161
|
-
...panResponder.panHandlers,
|
|
162
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
163
|
-
style: [styles.floatingButton, {
|
|
164
|
-
backgroundColor: content.color
|
|
165
|
-
}],
|
|
166
|
-
children: content.icon
|
|
167
|
-
})
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
const styles = StyleSheet.create({
|
|
171
|
-
draggableButton: {
|
|
172
|
-
position: 'absolute'
|
|
173
|
-
},
|
|
174
|
-
floatingButton: {
|
|
175
|
-
elevation: 8,
|
|
176
|
-
shadowRadius: 4,
|
|
177
|
-
width: buttonSize,
|
|
178
|
-
shadowColor: '#000',
|
|
179
|
-
height: buttonSize,
|
|
180
|
-
shadowOpacity: 0.25,
|
|
181
|
-
alignItems: 'center',
|
|
182
|
-
justifyContent: 'center',
|
|
183
|
-
borderRadius: buttonSize / 2,
|
|
184
|
-
shadowOffset: {
|
|
185
|
-
width: 0,
|
|
186
|
-
height: 2
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
export default FloatingButton;
|
|
191
|
-
//# sourceMappingURL=FloatingButton.js.map
|