@multiplayer-app/session-recorder-react-native 1.0.1-beta.4 → 1.0.1-beta.5
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/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModule.kt +2 -2
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +1 -1
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +1 -1
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +1 -1
- package/lib/module/components/SessionRecorderWidget/icons.js.map +1 -1
- package/lib/module/components/SessionRecorderWidget/styles.js.map +1 -1
- package/lib/module/config/constants.js.map +1 -1
- package/lib/module/config/defaults.js.map +1 -1
- package/lib/module/config/masking.js.map +1 -1
- package/lib/module/config/session-recorder.js.map +1 -1
- package/lib/module/config/validators.js.map +1 -1
- package/lib/module/config/widget.js.map +1 -1
- package/lib/module/context/SessionRecorderStore.js.map +1 -1
- package/lib/module/context/useSessionRecorderStore.js.map +1 -1
- package/lib/module/context/useStoreSelector.js.map +1 -1
- package/lib/module/native/SessionRecorderNative.js.map +1 -1
- package/lib/module/native/index.js.map +1 -1
- package/lib/module/otel/helpers.js +1 -1
- package/lib/module/otel/helpers.js.map +1 -1
- package/lib/module/otel/index.js.map +1 -1
- package/lib/module/otel/instrumentations/index.js.map +1 -1
- package/lib/module/patch/xhr.js.map +1 -1
- package/lib/module/recorder/eventExporter.js.map +1 -1
- package/lib/module/recorder/gestureRecorder.js.map +1 -1
- package/lib/module/recorder/index.js.map +1 -1
- package/lib/module/recorder/navigationTracker.js.map +1 -1
- package/lib/module/recorder/screenRecorder.js.map +1 -1
- package/lib/module/services/api.service.js.map +1 -1
- package/lib/module/services/network.service.js.map +1 -1
- package/lib/module/services/screenMaskingService.js.map +1 -1
- package/lib/module/services/storage.service.js.map +1 -1
- package/lib/module/session-recorder.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/session-recorder.js.map +1 -1
- package/lib/module/utils/app-metadata.js +2 -2
- package/lib/module/utils/constants.optional.js.map +1 -1
- package/lib/module/utils/createStore.js.map +1 -1
- package/lib/module/utils/logger.js +0 -8
- package/lib/module/utils/logger.js.map +1 -1
- package/lib/module/utils/platform.js +1 -1
- package/lib/module/utils/platform.js.map +1 -1
- package/lib/module/utils/rrweb-events.js.map +1 -1
- package/lib/module/utils/session.js.map +1 -1
- package/lib/module/utils/shallowEqual.js.map +1 -1
- package/lib/module/utils/time.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +1 -1
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/config/constants.d.ts.map +1 -1
- package/lib/typescript/src/config/defaults.d.ts.map +1 -1
- package/lib/typescript/src/config/index.d.ts.map +1 -1
- package/lib/typescript/src/config/masking.d.ts.map +1 -1
- package/lib/typescript/src/config/session-recorder.d.ts.map +1 -1
- package/lib/typescript/src/config/validators.d.ts.map +1 -1
- package/lib/typescript/src/config/widget.d.ts +1 -1
- package/lib/typescript/src/config/widget.d.ts.map +1 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +1 -1
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts +3 -3
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +1 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -1
- package/lib/typescript/src/native/index.d.ts +1 -1
- package/lib/typescript/src/native/index.d.ts.map +1 -1
- package/lib/typescript/src/otel/helpers.d.ts.map +1 -1
- package/lib/typescript/src/otel/index.d.ts.map +1 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +1 -1
- package/lib/typescript/src/patch/index.d.ts.map +1 -1
- package/lib/typescript/src/patch/xhr.d.ts.map +1 -1
- package/lib/typescript/src/recorder/eventExporter.d.ts.map +1 -1
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +1 -1
- package/lib/typescript/src/recorder/index.d.ts.map +1 -1
- package/lib/typescript/src/recorder/navigationTracker.d.ts.map +1 -1
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +1 -1
- package/lib/typescript/src/services/api.service.d.ts.map +1 -1
- package/lib/typescript/src/services/network.service.d.ts.map +1 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -1
- package/lib/typescript/src/services/storage.service.d.ts.map +1 -1
- package/lib/typescript/src/session-recorder.d.ts.map +1 -1
- package/lib/typescript/src/types/configs.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/session-recorder.d.ts +4 -4
- package/lib/typescript/src/types/session-recorder.d.ts.map +1 -1
- package/lib/typescript/src/types/session.d.ts.map +1 -1
- package/lib/typescript/src/utils/app-metadata.d.ts.map +1 -1
- package/lib/typescript/src/utils/constants.optional.d.ts.map +1 -1
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +1 -1
- package/lib/typescript/src/utils/createStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/logger.d.ts +1 -1
- package/lib/typescript/src/utils/logger.d.ts.map +1 -1
- package/lib/typescript/src/utils/platform.d.ts.map +1 -1
- package/lib/typescript/src/utils/request-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +1 -1
- package/lib/typescript/src/utils/session.d.ts.map +1 -1
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -1
- package/lib/typescript/src/utils/time.d.ts.map +1 -1
- package/lib/typescript/src/utils/type-utils.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ScreenRecorderView/index.ts +1 -1
- package/src/components/SessionRecorderWidget/ErrorBanner.tsx +14 -14
- package/src/components/SessionRecorderWidget/ModalHeader.tsx +11 -9
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +70 -56
- package/src/components/SessionRecorderWidget/icons.tsx +58 -30
- package/src/components/SessionRecorderWidget/index.ts +1 -1
- package/src/components/SessionRecorderWidget/styles.ts +17 -18
- package/src/components/index.ts +2 -2
- package/src/config/constants.ts +19 -20
- package/src/config/defaults.ts +35 -31
- package/src/config/index.ts +5 -5
- package/src/config/masking.ts +44 -18
- package/src/config/session-recorder.ts +54 -26
- package/src/config/validators.ts +43 -20
- package/src/config/widget.ts +24 -15
- package/src/context/SessionRecorderStore.ts +19 -18
- package/src/context/useSessionRecorderStore.ts +17 -10
- package/src/context/useStoreSelector.ts +20 -18
- package/src/index.ts +7 -7
- package/src/native/SessionRecorderNative.ts +83 -67
- package/src/native/index.ts +5 -1
- package/src/otel/helpers.ts +109 -93
- package/src/otel/index.ts +46 -49
- package/src/otel/instrumentations/index.ts +44 -41
- package/src/patch/index.ts +1 -1
- package/src/patch/xhr.ts +77 -78
- package/src/recorder/eventExporter.ts +63 -68
- package/src/recorder/gestureRecorder.ts +359 -212
- package/src/recorder/index.ts +75 -62
- package/src/recorder/navigationTracker.ts +120 -97
- package/src/recorder/screenRecorder.ts +214 -163
- package/src/services/api.service.ts +49 -48
- package/src/services/network.service.ts +67 -58
- package/src/services/screenMaskingService.ts +81 -50
- package/src/services/storage.service.ts +99 -70
- package/src/session-recorder.ts +270 -214
- package/src/types/configs.ts +53 -31
- package/src/types/expo-constants.d.ts +2 -2
- package/src/types/index.ts +16 -18
- package/src/types/session-recorder.ts +106 -111
- package/src/types/session.ts +45 -45
- package/src/utils/app-metadata.ts +9 -9
- package/src/utils/constants.optional.expo.ts +3 -3
- package/src/utils/constants.optional.ts +14 -12
- package/src/utils/createStore.ts +23 -20
- package/src/utils/index.ts +7 -7
- package/src/utils/logger.ts +87 -58
- package/src/utils/platform.ts +149 -118
- package/src/utils/request-utils.ts +15 -15
- package/src/utils/rrweb-events.ts +47 -34
- package/src/utils/session.ts +15 -12
- package/src/utils/shallowEqual.ts +16 -10
- package/src/utils/time.ts +7 -4
- package/src/utils/type-utils.ts +36 -36
- package/src/version.ts +1 -1
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModuleSpec.kt +0 -51
- package/android/src/main/java/com/xxx/XxxModule.kt +0 -23
- package/ios/Xxx.h +0 -5
- package/ios/Xxx.mm +0 -21
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Text, Pressable, StyleSheet } from 'react-native'
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, Pressable, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
interface ErrorBannerProps {
|
|
5
|
-
error: string
|
|
6
|
-
onDismiss: () => void
|
|
5
|
+
error: string;
|
|
6
|
+
onDismiss: () => void;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const ErrorBanner: React.FC<ErrorBannerProps> = ({ error, onDismiss }) => {
|
|
@@ -16,8 +16,8 @@ const ErrorBanner: React.FC<ErrorBannerProps> = ({ error, onDismiss }) => {
|
|
|
16
16
|
</Pressable>
|
|
17
17
|
</View>
|
|
18
18
|
</View>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
21
|
|
|
22
22
|
const styles = StyleSheet.create({
|
|
23
23
|
container: {
|
|
@@ -26,18 +26,18 @@ const styles = StyleSheet.create({
|
|
|
26
26
|
paddingVertical: 12,
|
|
27
27
|
marginHorizontal: 16,
|
|
28
28
|
marginTop: 8,
|
|
29
|
-
borderRadius: 8
|
|
29
|
+
borderRadius: 8,
|
|
30
30
|
},
|
|
31
31
|
content: {
|
|
32
32
|
flexDirection: 'row',
|
|
33
33
|
alignItems: 'center',
|
|
34
|
-
justifyContent: 'space-between'
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
35
|
},
|
|
36
36
|
errorText: {
|
|
37
37
|
color: 'white',
|
|
38
38
|
fontSize: 14,
|
|
39
39
|
flex: 1,
|
|
40
|
-
marginRight: 8
|
|
40
|
+
marginRight: 8,
|
|
41
41
|
},
|
|
42
42
|
dismissButton: {
|
|
43
43
|
padding: 4,
|
|
@@ -46,13 +46,13 @@ const styles = StyleSheet.create({
|
|
|
46
46
|
width: 24,
|
|
47
47
|
height: 24,
|
|
48
48
|
alignItems: 'center',
|
|
49
|
-
justifyContent: 'center'
|
|
49
|
+
justifyContent: 'center',
|
|
50
50
|
},
|
|
51
51
|
dismissText: {
|
|
52
52
|
color: 'white',
|
|
53
53
|
fontSize: 12,
|
|
54
|
-
fontWeight: 'bold'
|
|
55
|
-
}
|
|
56
|
-
})
|
|
54
|
+
fontWeight: 'bold',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
57
|
|
|
58
|
-
export default ErrorBanner
|
|
58
|
+
export default ErrorBanner;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Pressable, Linking } from 'react-native'
|
|
3
|
-
import { sharedStyles } from './styles'
|
|
4
|
-
import { LogoIcon } from './icons'
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Pressable, Linking } from 'react-native';
|
|
3
|
+
import { sharedStyles } from './styles';
|
|
4
|
+
import { LogoIcon } from './icons';
|
|
5
5
|
|
|
6
6
|
interface ModalHeaderProps {
|
|
7
|
-
children?: React.ReactNode
|
|
7
|
+
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const ModalHeader: React.FC<ModalHeaderProps> = ({ children }) => {
|
|
@@ -12,13 +12,15 @@ const ModalHeader: React.FC<ModalHeaderProps> = ({ children }) => {
|
|
|
12
12
|
<View style={sharedStyles.popoverHeader}>
|
|
13
13
|
<View style={sharedStyles.modalHandle} />
|
|
14
14
|
<View style={sharedStyles.popoverHeaderContent}>
|
|
15
|
-
<Pressable
|
|
15
|
+
<Pressable
|
|
16
|
+
onPress={() => Linking.openURL('https://www.multiplayer.app')}
|
|
17
|
+
>
|
|
16
18
|
<LogoIcon size={42} />
|
|
17
19
|
</Pressable>
|
|
18
20
|
{children}
|
|
19
21
|
</View>
|
|
20
22
|
</View>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
23
25
|
|
|
24
|
-
export default ModalHeader
|
|
26
|
+
export default ModalHeader;
|
|
@@ -1,98 +1,112 @@
|
|
|
1
|
-
import React, { useState, useCallback, memo } from 'react'
|
|
2
|
-
import { View, StyleSheet } from 'react-native'
|
|
3
|
-
import { SessionState } from '../../types'
|
|
4
|
-
import { SessionType } from '@multiplayer-app/session-recorder-common'
|
|
5
|
-
import { useSessionRecorder } from '../../context/SessionRecorderContext'
|
|
1
|
+
import React, { useState, useCallback, memo } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { SessionState } from '../../types';
|
|
4
|
+
import { SessionType } from '@multiplayer-app/session-recorder-common';
|
|
5
|
+
import { useSessionRecorder } from '../../context/SessionRecorderContext';
|
|
6
6
|
|
|
7
|
-
import FinalPopover from './FinalPopover'
|
|
8
|
-
import ModalContainer from './ModalContainer'
|
|
9
|
-
import InitialPopover from './InitialPopover'
|
|
10
|
-
import FloatingButton from './FloatingButton'
|
|
11
|
-
import ErrorBanner from './ErrorBanner'
|
|
12
|
-
import { logger } from '../../utils'
|
|
13
|
-
import { useSessionRecorderStore } from '../../context/useSessionRecorderStore'
|
|
14
|
-
import { sessionRecorderStore } from '../../context/SessionRecorderStore'
|
|
7
|
+
import FinalPopover from './FinalPopover';
|
|
8
|
+
import ModalContainer from './ModalContainer';
|
|
9
|
+
import InitialPopover from './InitialPopover';
|
|
10
|
+
import FloatingButton from './FloatingButton';
|
|
11
|
+
import ErrorBanner from './ErrorBanner';
|
|
12
|
+
import { logger } from '../../utils';
|
|
13
|
+
import { useSessionRecorderStore } from '../../context/useSessionRecorderStore';
|
|
14
|
+
import { sessionRecorderStore } from '../../context/SessionRecorderStore';
|
|
15
15
|
|
|
16
16
|
interface SessionRecorderWidgetProps {}
|
|
17
17
|
|
|
18
18
|
const SessionRecorderWidget: React.FC<SessionRecorderWidgetProps> = memo(() => {
|
|
19
|
-
const { instance, openWidgetModal, closeWidgetModal } = useSessionRecorder()
|
|
20
|
-
const isOnline = useSessionRecorderStore<boolean>((s) => s.isOnline)
|
|
21
|
-
const sessionType = useSessionRecorderStore<SessionType | null>(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
19
|
+
const { instance, openWidgetModal, closeWidgetModal } = useSessionRecorder();
|
|
20
|
+
const isOnline = useSessionRecorderStore<boolean>((s) => s.isOnline);
|
|
21
|
+
const sessionType = useSessionRecorderStore<SessionType | null>(
|
|
22
|
+
(s) => s.sessionType
|
|
23
|
+
);
|
|
24
|
+
const isModalVisible = useSessionRecorderStore<boolean>(
|
|
25
|
+
(s) => s.isWidgetModalVisible
|
|
26
|
+
);
|
|
27
|
+
const sessionState = useSessionRecorderStore<SessionState | null>(
|
|
28
|
+
(s) => s.sessionState
|
|
29
|
+
);
|
|
30
|
+
const error = useSessionRecorderStore<string | null>((s) => s.error);
|
|
31
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
26
32
|
|
|
27
33
|
// Get configuration from instance
|
|
28
|
-
const { widget, showContinuousRecording } = instance.config
|
|
34
|
+
const { widget, showContinuousRecording } = instance.config;
|
|
29
35
|
|
|
30
36
|
const dismissError = useCallback(() => {
|
|
31
|
-
sessionRecorderStore.setState({ error: null })
|
|
32
|
-
}, [])
|
|
37
|
+
sessionRecorderStore.setState({ error: null });
|
|
38
|
+
}, []);
|
|
33
39
|
|
|
34
40
|
const handleError = useCallback((error: any, message: string) => {
|
|
35
|
-
const errorMessage = error instanceof Error ? error.message : message
|
|
36
|
-
logger.error('SessionRecorderWidget', message, error)
|
|
37
|
-
sessionRecorderStore.setState({ error: errorMessage })
|
|
38
|
-
}, [])
|
|
41
|
+
const errorMessage = error instanceof Error ? error.message : message;
|
|
42
|
+
logger.error('SessionRecorderWidget', message, error);
|
|
43
|
+
sessionRecorderStore.setState({ error: errorMessage });
|
|
44
|
+
}, []);
|
|
39
45
|
|
|
40
46
|
const onStartRecording = useCallback(
|
|
41
47
|
async (sessionType: SessionType) => {
|
|
42
48
|
if (!isOnline) {
|
|
43
|
-
handleError(
|
|
44
|
-
|
|
49
|
+
handleError(
|
|
50
|
+
new Error('Cannot start recording while offline'),
|
|
51
|
+
'Cannot start recording while offline'
|
|
52
|
+
);
|
|
53
|
+
return;
|
|
45
54
|
}
|
|
46
55
|
try {
|
|
47
|
-
await instance.start(sessionType)
|
|
48
|
-
closeWidgetModal()
|
|
56
|
+
await instance.start(sessionType);
|
|
57
|
+
closeWidgetModal();
|
|
49
58
|
} catch (error) {
|
|
50
|
-
handleError(error, 'Failed to start recording')
|
|
59
|
+
handleError(error, 'Failed to start recording');
|
|
51
60
|
}
|
|
52
61
|
},
|
|
53
62
|
[isOnline, handleError]
|
|
54
|
-
)
|
|
63
|
+
);
|
|
55
64
|
|
|
56
65
|
const onStopRecording = useCallback(
|
|
57
66
|
async (comment?: string) => {
|
|
58
67
|
try {
|
|
59
|
-
setIsSubmitting(true)
|
|
60
|
-
await instance.stop(comment)
|
|
61
|
-
closeWidgetModal()
|
|
68
|
+
setIsSubmitting(true);
|
|
69
|
+
await instance.stop(comment);
|
|
70
|
+
closeWidgetModal();
|
|
62
71
|
} catch (error) {
|
|
63
|
-
handleError(error, 'Failed to stop recording')
|
|
72
|
+
handleError(error, 'Failed to stop recording');
|
|
64
73
|
} finally {
|
|
65
|
-
setIsSubmitting(false)
|
|
74
|
+
setIsSubmitting(false);
|
|
66
75
|
}
|
|
67
76
|
},
|
|
68
77
|
[handleError]
|
|
69
|
-
)
|
|
78
|
+
);
|
|
70
79
|
|
|
71
80
|
const onCancelSession = useCallback(async () => {
|
|
72
81
|
try {
|
|
73
|
-
await instance.cancel()
|
|
74
|
-
closeWidgetModal()
|
|
82
|
+
await instance.cancel();
|
|
83
|
+
closeWidgetModal();
|
|
75
84
|
} catch (error) {
|
|
76
|
-
handleError(error, 'Failed to cancel session')
|
|
85
|
+
handleError(error, 'Failed to cancel session');
|
|
77
86
|
}
|
|
78
|
-
}, [handleError])
|
|
87
|
+
}, [handleError]);
|
|
79
88
|
|
|
80
89
|
const onSaveContinuousSession = useCallback(async () => {
|
|
81
90
|
try {
|
|
82
|
-
await instance.save()
|
|
91
|
+
await instance.save();
|
|
83
92
|
} catch (error) {
|
|
84
|
-
handleError(error, 'Failed to save continuous session')
|
|
93
|
+
handleError(error, 'Failed to save continuous session');
|
|
85
94
|
}
|
|
86
|
-
}, [handleError])
|
|
95
|
+
}, [handleError]);
|
|
87
96
|
|
|
88
|
-
const isStarted =
|
|
89
|
-
|
|
97
|
+
const isStarted =
|
|
98
|
+
sessionState === SessionState.started ||
|
|
99
|
+
sessionState === SessionState.paused;
|
|
100
|
+
const isContinuous = sessionType === SessionType.CONTINUOUS;
|
|
90
101
|
|
|
91
102
|
return (
|
|
92
103
|
<>
|
|
93
104
|
{widget.button?.visible && (
|
|
94
|
-
<View pointerEvents=
|
|
95
|
-
<FloatingButton
|
|
105
|
+
<View pointerEvents="box-none" style={styles.overlayContainer}>
|
|
106
|
+
<FloatingButton
|
|
107
|
+
sessionState={sessionState}
|
|
108
|
+
onPress={openWidgetModal}
|
|
109
|
+
/>
|
|
96
110
|
</View>
|
|
97
111
|
)}
|
|
98
112
|
<ModalContainer isVisible={isModalVisible} onClose={closeWidgetModal}>
|
|
@@ -124,13 +138,13 @@ const SessionRecorderWidget: React.FC<SessionRecorderWidgetProps> = memo(() => {
|
|
|
124
138
|
)}
|
|
125
139
|
</ModalContainer>
|
|
126
140
|
</>
|
|
127
|
-
)
|
|
128
|
-
})
|
|
141
|
+
);
|
|
142
|
+
});
|
|
129
143
|
|
|
130
|
-
export default SessionRecorderWidget
|
|
144
|
+
export default SessionRecorderWidget;
|
|
131
145
|
|
|
132
146
|
const styles = StyleSheet.create({
|
|
133
147
|
overlayContainer: {
|
|
134
|
-
...StyleSheet.absoluteFillObject
|
|
135
|
-
}
|
|
136
|
-
})
|
|
148
|
+
...StyleSheet.absoluteFillObject,
|
|
149
|
+
},
|
|
150
|
+
});
|
|
@@ -1,52 +1,80 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Svg, { Path, Circle } from 'react-native-svg'
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Svg, { Path, Circle } from 'react-native-svg';
|
|
3
3
|
|
|
4
4
|
interface IconProps {
|
|
5
|
-
size?: number
|
|
6
|
-
color?: string
|
|
5
|
+
size?: number;
|
|
6
|
+
color?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const RecordIcon: React.FC<IconProps> = ({
|
|
10
|
-
|
|
9
|
+
export const RecordIcon: React.FC<IconProps> = ({
|
|
10
|
+
size = 19,
|
|
11
|
+
color = 'white',
|
|
12
|
+
}) => (
|
|
13
|
+
<Svg width={size} height={size} viewBox="0 0 19 19" fill="none">
|
|
11
14
|
<Path
|
|
12
|
-
fillRule=
|
|
13
|
-
clipRule=
|
|
14
|
-
d=
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M6.68926 5.30356C6.56568 5.38721 6.39976 5.37561 6.29459 5.26937L3.58782 2.53477C3.46424 2.40992 3.47196 2.20492 3.60862 2.09483C5.2319 0.786982 7.28494 0 9.51866 0C11.7535 0 13.8066 0.787042 15.4308 2.09586C15.5674 2.20596 15.5752 2.41091 15.4516 2.53577L12.7468 5.26931C12.6416 5.37558 12.4757 5.38719 12.3521 5.30353C11.5393 4.75345 10.571 4.42281 9.52066 4.42281C8.47036 4.42281 7.50203 4.75346 6.68926 5.30356ZM16.4926 3.4303C16.6163 3.30527 16.8197 3.31303 16.9288 3.45121C18.2224 5.08933 19.0001 7.15932 19.0001 9.4116C19.0001 11.6671 18.2204 13.7392 16.9238 15.3785C16.8147 15.5165 16.6114 15.5242 16.4877 15.3992L13.7872 12.6701C13.682 12.5638 13.6708 12.3962 13.7538 12.2716C14.3006 11.451 14.6291 10.4727 14.6291 9.4116C14.6291 8.35454 14.3016 7.37925 13.756 6.56083C13.6728 6.43616 13.6841 6.26857 13.7893 6.16224L16.4926 3.4303ZM5.21676 12.6712C5.322 12.5649 5.3333 12.3974 5.2502 12.2727C4.70331 11.4522 4.374 10.4737 4.374 9.41184C4.374 8.35469 4.70232 7.37949 5.24808 6.56106C5.33123 6.43637 5.31996 6.26872 5.2147 6.16241L2.50855 3.4293C2.38482 3.30434 2.18146 3.31213 2.07236 3.45028C0.77864 5.08841 0 7.15845 0 9.41184C0 11.6684 0.78066 13.7406 2.07831 15.3799C2.18749 15.5178 2.39066 15.5255 2.51429 15.4006L5.21676 12.6712ZM12.3323 13.707C12.4559 13.6231 12.6221 13.6346 12.7273 13.741L15.4277 16.4691C15.5513 16.594 15.5435 16.7991 15.4068 16.9091C13.7837 18.215 11.7327 19 9.49998 19C7.2693 19 5.21837 18.2159 3.59619 16.9102C3.45943 16.8001 3.45169 16.595 3.57533 16.4702L6.27769 13.7409C6.38296 13.6346 6.54906 13.6231 6.67267 13.707C7.48459 14.2577 8.45278 14.5883 9.50198 14.5883C10.5522 14.5883 11.5204 14.2578 12.3323 13.707Z"
|
|
15
18
|
fill={color}
|
|
16
19
|
/>
|
|
17
20
|
</Svg>
|
|
18
|
-
)
|
|
21
|
+
);
|
|
19
22
|
|
|
20
|
-
export const CapturingIcon: React.FC<IconProps> = ({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
export const CapturingIcon: React.FC<IconProps> = ({
|
|
24
|
+
size = 24,
|
|
25
|
+
color = 'white',
|
|
26
|
+
}) => (
|
|
27
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
28
|
+
<Circle cx="12" cy="12" r="4" fill={color} />
|
|
29
|
+
<Circle cx="12" cy="12" r="7.5" stroke={color} strokeWidth="1" />
|
|
30
|
+
<Circle
|
|
31
|
+
cx="12"
|
|
32
|
+
cy="12"
|
|
33
|
+
r="11.5"
|
|
34
|
+
stroke={color}
|
|
35
|
+
strokeWidth="1"
|
|
36
|
+
opacity="0.2"
|
|
37
|
+
/>
|
|
25
38
|
</Svg>
|
|
26
|
-
)
|
|
39
|
+
);
|
|
27
40
|
|
|
28
|
-
export const PausedIcon: React.FC<IconProps> = ({
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
export const PausedIcon: React.FC<IconProps> = ({
|
|
42
|
+
size = 24,
|
|
43
|
+
color = 'white',
|
|
44
|
+
}) => (
|
|
45
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
46
|
+
<Path
|
|
47
|
+
d="M8 5V19M16 5V19"
|
|
48
|
+
stroke={color}
|
|
49
|
+
strokeWidth="2"
|
|
50
|
+
strokeLinecap="round"
|
|
51
|
+
strokeLinejoin="round"
|
|
52
|
+
/>
|
|
31
53
|
</Svg>
|
|
32
|
-
)
|
|
54
|
+
);
|
|
33
55
|
|
|
34
|
-
export const CheckmarkIcon: React.FC<IconProps> = ({
|
|
35
|
-
|
|
56
|
+
export const CheckmarkIcon: React.FC<IconProps> = ({
|
|
57
|
+
size = 24,
|
|
58
|
+
color = 'white',
|
|
59
|
+
}) => (
|
|
60
|
+
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
36
61
|
<Path
|
|
37
|
-
fillRule=
|
|
38
|
-
clipRule=
|
|
39
|
-
d=
|
|
62
|
+
fillRule="evenodd"
|
|
63
|
+
clipRule="evenodd"
|
|
64
|
+
d="M20.0481 6.35147C20.5168 6.8201 20.5168 7.5799 20.0481 8.04853L10.4481 17.6485C9.97951 18.1172 9.21971 18.1172 8.75108 17.6485L3.95108 12.8485C3.48245 12.3799 3.48245 11.6201 3.95108 11.1515C4.41971 10.6828 5.17951 10.6828 5.64814 11.1515L9.59961 15.1029L18.3511 6.35147C18.8197 5.88284 19.5795 5.88284 20.0481 6.35147Z"
|
|
40
65
|
fill={color}
|
|
41
66
|
/>
|
|
42
67
|
</Svg>
|
|
43
|
-
)
|
|
68
|
+
);
|
|
44
69
|
|
|
45
|
-
export const LogoIcon: React.FC<IconProps> = ({
|
|
46
|
-
|
|
70
|
+
export const LogoIcon: React.FC<IconProps> = ({
|
|
71
|
+
size = 30,
|
|
72
|
+
color = '#473CFB',
|
|
73
|
+
}) => (
|
|
74
|
+
<Svg width={size} height={size * 0.8} viewBox="0 0 30 24" fill="none">
|
|
47
75
|
<Path
|
|
48
|
-
d=
|
|
76
|
+
d="M28.8324 8.83643L23.5495 6.85854L21.4856 6.08553L23.6001 0.4375L15 3.65769L6.39963 0.4375L8.51441 6.08585L6.45046 6.85885L1.16757 8.83674L0.625 9.03974L9.10095 12.0981C10.0891 12.4548 10.9201 13.1265 11.4758 13.9952C11.6632 14.2883 11.8194 14.6036 11.9398 14.9369L15 23.4076L18.0602 14.9369C18.1806 14.6036 18.3368 14.288 18.5242 13.9952C19.0802 13.1265 19.9112 12.4545 20.8991 12.0981L29.375 9.03974L28.8324 8.83674V8.83643ZM19.779 10.6434C18.2872 11.1816 17.1126 12.3563 16.5744 13.848L15.014 18.173L11.5182 8.83643L10.7776 6.85854L10.2456 5.43757L9.57367 3.64272L12.3068 4.66612L18.1631 6.85885L20.8233 7.85481L23.4457 8.83674L24.104 9.08308L19.779 10.6438V10.6434Z"
|
|
49
77
|
fill={color}
|
|
50
78
|
/>
|
|
51
79
|
</Svg>
|
|
52
|
-
)
|
|
80
|
+
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native'
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
export const sharedStyles = StyleSheet.create({
|
|
4
4
|
// Popover styles
|
|
5
5
|
popoverContent: {
|
|
6
6
|
flex: 1,
|
|
7
|
-
paddingHorizontal: 0
|
|
7
|
+
paddingHorizontal: 0,
|
|
8
8
|
},
|
|
9
9
|
popoverHeader: {
|
|
10
10
|
flexDirection: 'column',
|
|
@@ -14,7 +14,7 @@ export const sharedStyles = StyleSheet.create({
|
|
|
14
14
|
borderTopRightRadius: 20,
|
|
15
15
|
backgroundColor: '#f4f9ff',
|
|
16
16
|
shadowColor: '#f4f9ff',
|
|
17
|
-
shadowOffset: { width: 0, height: 5
|
|
17
|
+
shadowOffset: { width: 0, height: 5 },
|
|
18
18
|
shadowOpacity: 1,
|
|
19
19
|
shadowRadius: 5,
|
|
20
20
|
elevation: 10,
|
|
@@ -34,7 +34,6 @@ export const sharedStyles = StyleSheet.create({
|
|
|
34
34
|
alignItems: 'flex-start',
|
|
35
35
|
},
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
cancelButton: {
|
|
39
38
|
paddingHorizontal: 12,
|
|
40
39
|
paddingVertical: 6,
|
|
@@ -51,7 +50,7 @@ export const sharedStyles = StyleSheet.create({
|
|
|
51
50
|
cancelButtonText: {
|
|
52
51
|
color: '#374151',
|
|
53
52
|
fontSize: 14,
|
|
54
|
-
fontWeight: '500'
|
|
53
|
+
fontWeight: '500',
|
|
55
54
|
},
|
|
56
55
|
popoverBody: {
|
|
57
56
|
flex: 1,
|
|
@@ -62,27 +61,27 @@ export const sharedStyles = StyleSheet.create({
|
|
|
62
61
|
fontSize: 18,
|
|
63
62
|
fontWeight: '600',
|
|
64
63
|
color: '#2d3748',
|
|
65
|
-
marginBottom: 12
|
|
64
|
+
marginBottom: 12,
|
|
66
65
|
},
|
|
67
66
|
description: {
|
|
68
67
|
fontSize: 14,
|
|
69
68
|
color: '#718096',
|
|
70
|
-
marginBottom: 16
|
|
69
|
+
marginBottom: 16,
|
|
71
70
|
},
|
|
72
71
|
popoverFooter: {
|
|
73
72
|
marginTop: 'auto',
|
|
74
|
-
paddingTop: 16
|
|
73
|
+
paddingTop: 16,
|
|
75
74
|
},
|
|
76
75
|
actionButton: {
|
|
77
76
|
paddingVertical: 16,
|
|
78
77
|
paddingHorizontal: 24,
|
|
79
78
|
borderRadius: 12,
|
|
80
|
-
alignItems: 'center'
|
|
79
|
+
alignItems: 'center',
|
|
81
80
|
},
|
|
82
81
|
actionButtonText: {
|
|
83
82
|
color: 'white',
|
|
84
83
|
fontSize: 16,
|
|
85
|
-
fontWeight: '500'
|
|
84
|
+
fontWeight: '500',
|
|
86
85
|
},
|
|
87
86
|
|
|
88
87
|
// Continuous recording styles
|
|
@@ -107,7 +106,7 @@ export const sharedStyles = StyleSheet.create({
|
|
|
107
106
|
continuousRecordingLabel: {
|
|
108
107
|
fontSize: 16,
|
|
109
108
|
fontWeight: '500',
|
|
110
|
-
color: '#374151'
|
|
109
|
+
color: '#374151',
|
|
111
110
|
},
|
|
112
111
|
|
|
113
112
|
continuousOverlay: {
|
|
@@ -140,7 +139,7 @@ export const sharedStyles = StyleSheet.create({
|
|
|
140
139
|
continuousOverlayDescription: {
|
|
141
140
|
fontSize: 14,
|
|
142
141
|
color: '#718096',
|
|
143
|
-
lineHeight: 20
|
|
142
|
+
lineHeight: 20,
|
|
144
143
|
},
|
|
145
144
|
|
|
146
145
|
// Comment input styles
|
|
@@ -153,17 +152,17 @@ export const sharedStyles = StyleSheet.create({
|
|
|
153
152
|
color: '#374151',
|
|
154
153
|
backgroundColor: '#F9FAFB',
|
|
155
154
|
marginBottom: 24,
|
|
156
|
-
minHeight: 80
|
|
155
|
+
minHeight: 80,
|
|
157
156
|
},
|
|
158
157
|
|
|
159
158
|
// Button color variants
|
|
160
159
|
startButton: {
|
|
161
|
-
backgroundColor: '#473cfb'
|
|
160
|
+
backgroundColor: '#473cfb',
|
|
162
161
|
},
|
|
163
162
|
stopButton: {
|
|
164
|
-
backgroundColor: '#473cfb'
|
|
163
|
+
backgroundColor: '#473cfb',
|
|
165
164
|
},
|
|
166
165
|
saveButton: {
|
|
167
|
-
backgroundColor: '#473cfb'
|
|
168
|
-
}
|
|
169
|
-
})
|
|
166
|
+
backgroundColor: '#473cfb',
|
|
167
|
+
},
|
|
168
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ScreenRecorderView'
|
|
2
|
-
export * from './SessionRecorderWidget'
|
|
1
|
+
export * from './ScreenRecorderView';
|
|
2
|
+
export * from './SessionRecorderWidget';
|
package/src/config/constants.ts
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
|
+
export const OTEL_MP_SAMPLE_TRACE_RATIO = 0.15;
|
|
1
2
|
|
|
2
|
-
export const
|
|
3
|
+
export const SESSION_ID_PROP_NAME = 'multiplayer-session-id';
|
|
3
4
|
|
|
4
|
-
export const
|
|
5
|
+
export const SESSION_SHORT_ID_PROP_NAME = 'multiplayer-session-short-id';
|
|
5
6
|
|
|
6
|
-
export const
|
|
7
|
+
export const SESSION_CONTINUOUS_DEBUGGING_PROP_NAME =
|
|
8
|
+
'multiplayer-session-continuous-debugging';
|
|
7
9
|
|
|
8
|
-
export const
|
|
10
|
+
export const SESSION_STATE_PROP_NAME = 'multiplayer-session-state';
|
|
9
11
|
|
|
10
|
-
export const
|
|
12
|
+
export const SESSION_TYPE_PROP_NAME = 'multiplayer-session-type';
|
|
11
13
|
|
|
12
|
-
export const
|
|
14
|
+
export const SESSION_PROP_NAME = 'multiplayer-session-data';
|
|
13
15
|
|
|
14
|
-
export const
|
|
16
|
+
export const SESSION_STARTED_EVENT = 'debug-session:started';
|
|
15
17
|
|
|
16
|
-
export const
|
|
18
|
+
export const SESSION_STOPPED_EVENT = 'debug-session:stopped';
|
|
17
19
|
|
|
18
|
-
export const
|
|
20
|
+
export const SESSION_SUBSCRIBE_EVENT = 'debug-session:subscribe';
|
|
19
21
|
|
|
20
|
-
export const
|
|
22
|
+
export const SESSION_UNSUBSCRIBE_EVENT = 'debug-session:unsubscribe';
|
|
21
23
|
|
|
22
|
-
export const
|
|
24
|
+
export const SESSION_AUTO_CREATED = 'debug-session:auto-created';
|
|
23
25
|
|
|
24
|
-
export const
|
|
26
|
+
export const SESSION_ADD_EVENT = 'debug-session:rrweb:add-event';
|
|
25
27
|
|
|
26
|
-
export const
|
|
28
|
+
export const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
|
|
27
29
|
|
|
28
|
-
export const
|
|
30
|
+
export const SESSION_RESPONSE = 'multiplayer-debug-session-response';
|
|
29
31
|
|
|
30
|
-
export const
|
|
32
|
+
export const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
31
33
|
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
export const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30 // TODO: move to shared config otel core
|
|
34
|
+
export const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
35
35
|
|
|
36
36
|
// // Package version - injected by webpack during build
|
|
37
37
|
// declare const PACKAGE_VERSION: string
|
|
38
38
|
// export const PACKAGE_VERSION_EXPORT = PACKAGE_VERSION || '1.0.0'
|
|
39
39
|
|
|
40
|
-
|
|
41
40
|
// Regex patterns for OpenTelemetry ignore URLs
|
|
42
41
|
export const OTEL_IGNORE_URLS = [
|
|
43
42
|
// Traces endpoint
|
|
@@ -65,4 +64,4 @@ export const OTEL_IGNORE_URLS = [
|
|
|
65
64
|
|
|
66
65
|
// Or use a more general pattern to catch all radar API endpoints
|
|
67
66
|
// /.*\/v0\/radar\/.*/
|
|
68
|
-
]
|
|
67
|
+
];
|