@datadog/mobile-react-native-session-replay 2.6.3 → 2.6.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/DatadogSDKReactNativeSessionReplay.podspec +1 -1
- package/android/build.gradle +4 -2
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/DdSessionReplayImplementation.kt +6 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeInternalCallback.kt +23 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupport.kt +3 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ShadowNodeWrapper.kt +1 -1
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/DefaultMapper.kt +65 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactEditTextMapper.kt +4 -1
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactTextMapper.kt +4 -1
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewGroupMapper.kt +1 -53
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactViewModalMapper.kt +16 -0
- package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/utils/text/LegacyTextViewUtils.kt +1 -2
- package/android/src/rn69/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +86 -0
- package/android/src/rn75/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +13 -14
- package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +13 -14
- package/android/src/rnlegacy/kotlin/com.datadog.reactnative.sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +38 -15
- package/android/src/test/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeSessionReplayExtensionSupportTest.kt +5 -1
- package/lib/commonjs/SessionReplay.js +26 -0
- package/lib/commonjs/SessionReplay.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSessionReplay.js +1 -1
- package/lib/module/SessionReplay.js +26 -0
- package/lib/module/SessionReplay.js.map +1 -1
- package/lib/module/specs/NativeDdSessionReplay.js +1 -1
- package/package.json +2 -2
- package/src/specs/NativeDdSessionReplay.ts +1 -1
|
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
20
|
|
|
21
21
|
# /!\ Remember to keep the version in sync with DatadogSDKReactNative.podspec
|
|
22
|
-
s.dependency 'DatadogSessionReplay', '~> 2.
|
|
22
|
+
s.dependency 'DatadogSessionReplay', '~> 2.25.0'
|
|
23
23
|
s.dependency 'DatadogSDKReactNative'
|
|
24
24
|
|
|
25
25
|
s.test_spec 'Tests' do |test_spec|
|
package/android/build.gradle
CHANGED
|
@@ -139,6 +139,8 @@ android {
|
|
|
139
139
|
java.srcDirs += ['src/rn76/kotlin']
|
|
140
140
|
} else if (reactNativeMinorVersion >= 75) {
|
|
141
141
|
java.srcDirs += ['src/rn75/kotlin']
|
|
142
|
+
} else if (reactNativeMinorVersion >= 69) {
|
|
143
|
+
java.srcDirs += ['src/rn69/kotlin']
|
|
142
144
|
} else {
|
|
143
145
|
java.srcDirs += ['src/rnlegacy/kotlin']
|
|
144
146
|
}
|
|
@@ -197,8 +199,8 @@ dependencies {
|
|
|
197
199
|
api "com.facebook.react:react-android:$reactNativeVersion"
|
|
198
200
|
}
|
|
199
201
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
200
|
-
implementation "com.datadoghq:dd-sdk-android-session-replay:2.
|
|
201
|
-
implementation "com.datadoghq:dd-sdk-android-internal:2.
|
|
202
|
+
implementation "com.datadoghq:dd-sdk-android-session-replay:2.19.2"
|
|
203
|
+
implementation "com.datadoghq:dd-sdk-android-internal:2.19.2"
|
|
202
204
|
implementation project(path: ':datadog_mobile-react-native')
|
|
203
205
|
|
|
204
206
|
testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
|
|
@@ -9,6 +9,7 @@ package com.datadog.reactnative.sessionreplay
|
|
|
9
9
|
import android.annotation.SuppressLint
|
|
10
10
|
import com.datadog.android.api.feature.FeatureSdkCore
|
|
11
11
|
import com.datadog.android.sessionreplay.SessionReplayConfiguration
|
|
12
|
+
import com.datadog.android.sessionreplay._SessionReplayInternalProxy
|
|
12
13
|
import com.datadog.reactnative.DatadogSDKWrapperStorage
|
|
13
14
|
import com.datadog.reactnative.sessionreplay.utils.text.TextViewUtils
|
|
14
15
|
import com.facebook.react.bridge.Promise
|
|
@@ -42,12 +43,17 @@ class DdSessionReplayImplementation(
|
|
|
42
43
|
val sdkCore = DatadogSDKWrapperStorage.getSdkCore() as FeatureSdkCore
|
|
43
44
|
val logger = sdkCore.internalLogger
|
|
44
45
|
val textViewUtils = TextViewUtils.create(reactContext, logger)
|
|
46
|
+
val internalCallback = ReactNativeInternalCallback(reactContext)
|
|
45
47
|
val configuration = SessionReplayConfiguration.Builder(replaySampleRate.toFloat())
|
|
46
48
|
.startRecordingImmediately(startRecordingImmediately)
|
|
47
49
|
.setImagePrivacy(privacySettings.imagePrivacyLevel)
|
|
48
50
|
.setTouchPrivacy(privacySettings.touchPrivacyLevel)
|
|
49
51
|
.setTextAndInputPrivacy(privacySettings.textAndInputPrivacyLevel)
|
|
50
52
|
.addExtensionSupport(ReactNativeSessionReplayExtensionSupport(textViewUtils))
|
|
53
|
+
.let {
|
|
54
|
+
_SessionReplayInternalProxy(it).setInternalCallback(internalCallback)
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
|
|
52
58
|
if (customEndpoint != "") {
|
|
53
59
|
configuration.useCustomEndpoint(customEndpoint)
|
package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/ReactNativeInternalCallback.kt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
package com.datadog.reactnative.sessionreplay
|
|
8
|
+
|
|
9
|
+
import android.app.Activity
|
|
10
|
+
import com.datadog.android.sessionreplay.SessionReplayInternalCallback
|
|
11
|
+
import com.facebook.react.bridge.ReactContext
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Responsible for defining the internal callback implementation for react-native that will allow
|
|
15
|
+
* overriding specific parts of the session replay android sdk.
|
|
16
|
+
*/
|
|
17
|
+
class ReactNativeInternalCallback(
|
|
18
|
+
private val reactContext: ReactContext,
|
|
19
|
+
) : SessionReplayInternalCallback {
|
|
20
|
+
override fun getCurrentActivity(): Activity? {
|
|
21
|
+
return reactContext.currentActivity
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -14,8 +14,10 @@ import com.datadog.reactnative.sessionreplay.mappers.ReactEditTextMapper
|
|
|
14
14
|
import com.datadog.reactnative.sessionreplay.mappers.ReactNativeImageViewMapper
|
|
15
15
|
import com.datadog.reactnative.sessionreplay.mappers.ReactTextMapper
|
|
16
16
|
import com.datadog.reactnative.sessionreplay.mappers.ReactViewGroupMapper
|
|
17
|
+
import com.datadog.reactnative.sessionreplay.mappers.ReactViewModalMapper
|
|
17
18
|
import com.datadog.reactnative.sessionreplay.utils.text.TextViewUtils
|
|
18
19
|
import com.facebook.react.views.image.ReactImageView
|
|
20
|
+
import com.facebook.react.views.modal.ReactModalHostView
|
|
19
21
|
import com.facebook.react.views.text.ReactTextView
|
|
20
22
|
import com.facebook.react.views.textinput.ReactEditText
|
|
21
23
|
import com.facebook.react.views.view.ReactViewGroup
|
|
@@ -34,6 +36,7 @@ internal class ReactNativeSessionReplayExtensionSupport(
|
|
|
34
36
|
MapperTypeWrapper(ReactViewGroup::class.java, ReactViewGroupMapper()),
|
|
35
37
|
MapperTypeWrapper(ReactTextView::class.java, ReactTextMapper(textViewUtils)),
|
|
36
38
|
MapperTypeWrapper(ReactEditText::class.java, ReactEditTextMapper(textViewUtils)),
|
|
39
|
+
MapperTypeWrapper(ReactModalHostView::class.java, ReactViewModalMapper()),
|
|
37
40
|
)
|
|
38
41
|
}
|
|
39
42
|
|
|
@@ -60,7 +60,7 @@ internal class ShadowNodeWrapper(
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
private fun resolveShadowNode(reflectionUtils: ReflectionUtils, uiManagerModule: UIManagerModule, tag: Int): ReactShadowNode<out ReactShadowNode<*>>? {
|
|
63
|
-
val uiManagerImplementation = reflectionUtils.getDeclaredField(uiManagerModule, UI_IMPLEMENTATION_FIELD_NAME) as UIImplementation
|
|
63
|
+
val uiManagerImplementation = reflectionUtils.getDeclaredField(uiManagerModule, UI_IMPLEMENTATION_FIELD_NAME) as? UIImplementation
|
|
64
64
|
return uiManagerImplementation?.resolveShadowNode(tag)
|
|
65
65
|
}
|
|
66
66
|
|
package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/DefaultMapper.kt
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
package com.datadog.reactnative.sessionreplay.mappers
|
|
8
|
+
|
|
9
|
+
import ReactViewBackgroundDrawableUtils
|
|
10
|
+
import android.view.View
|
|
11
|
+
import com.datadog.android.api.InternalLogger
|
|
12
|
+
import com.datadog.android.sessionreplay.model.MobileSegment
|
|
13
|
+
import com.datadog.android.sessionreplay.recorder.MappingContext
|
|
14
|
+
import com.datadog.android.sessionreplay.recorder.mapper.BaseWireframeMapper
|
|
15
|
+
import com.datadog.android.sessionreplay.utils.AsyncJobStatusCallback
|
|
16
|
+
import com.datadog.android.sessionreplay.utils.DefaultColorStringFormatter
|
|
17
|
+
import com.datadog.android.sessionreplay.utils.DefaultViewBoundsResolver
|
|
18
|
+
import com.datadog.android.sessionreplay.utils.DefaultViewBoundsResolver.resolveViewGlobalBounds
|
|
19
|
+
import com.datadog.android.sessionreplay.utils.DefaultViewIdentifierResolver
|
|
20
|
+
import com.datadog.android.sessionreplay.utils.DrawableToColorMapper
|
|
21
|
+
import com.datadog.reactnative.sessionreplay.utils.DrawableUtils
|
|
22
|
+
|
|
23
|
+
internal open class DefaultMapper<T: View>(
|
|
24
|
+
private val drawableUtils: DrawableUtils =
|
|
25
|
+
ReactViewBackgroundDrawableUtils()
|
|
26
|
+
): BaseWireframeMapper<T>(
|
|
27
|
+
viewIdentifierResolver = DefaultViewIdentifierResolver,
|
|
28
|
+
colorStringFormatter = DefaultColorStringFormatter,
|
|
29
|
+
viewBoundsResolver = DefaultViewBoundsResolver,
|
|
30
|
+
drawableToColorMapper = DrawableToColorMapper.getDefault()
|
|
31
|
+
) {
|
|
32
|
+
override fun map(
|
|
33
|
+
view: T,
|
|
34
|
+
mappingContext: MappingContext,
|
|
35
|
+
asyncJobStatusCallback: AsyncJobStatusCallback,
|
|
36
|
+
internalLogger: InternalLogger
|
|
37
|
+
): List<MobileSegment.Wireframe> {
|
|
38
|
+
val pixelDensity = mappingContext.systemInformation.screenDensity
|
|
39
|
+
val viewGlobalBounds = resolveViewGlobalBounds(view, pixelDensity)
|
|
40
|
+
val backgroundDrawable = drawableUtils.getReactBackgroundFromDrawable(view.background)
|
|
41
|
+
|
|
42
|
+
// view.alpha is the value of the opacity prop on the js side
|
|
43
|
+
val opacity = view.alpha
|
|
44
|
+
|
|
45
|
+
val (shapeStyle, border) =
|
|
46
|
+
if (backgroundDrawable != null) {
|
|
47
|
+
drawableUtils
|
|
48
|
+
.resolveShapeAndBorder(backgroundDrawable, opacity, pixelDensity)
|
|
49
|
+
} else {
|
|
50
|
+
null to null
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return listOf(
|
|
54
|
+
MobileSegment.Wireframe.ShapeWireframe(
|
|
55
|
+
resolveViewId(view),
|
|
56
|
+
viewGlobalBounds.x,
|
|
57
|
+
viewGlobalBounds.y,
|
|
58
|
+
viewGlobalBounds.width,
|
|
59
|
+
viewGlobalBounds.height,
|
|
60
|
+
shapeStyle = shapeStyle,
|
|
61
|
+
border = border
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}
|
package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/mappers/ReactEditTextMapper.kt
CHANGED
|
@@ -61,7 +61,10 @@ internal class ReactEditTextMapper(
|
|
|
61
61
|
mappingContext = mappingContext,
|
|
62
62
|
asyncJobStatusCallback = asyncJobStatusCallback,
|
|
63
63
|
internalLogger = internalLogger
|
|
64
|
-
).filterNot {
|
|
64
|
+
).filterNot {
|
|
65
|
+
it is MobileSegment.Wireframe.ImageWireframe ||
|
|
66
|
+
it is MobileSegment.Wireframe.PlaceholderWireframe
|
|
67
|
+
}
|
|
65
68
|
|
|
66
69
|
return textViewUtils.mapTextViewToWireframes(
|
|
67
70
|
wireframes = backgroundWireframes,
|
|
@@ -7,63 +7,11 @@
|
|
|
7
7
|
package com.datadog.reactnative.sessionreplay.mappers
|
|
8
8
|
|
|
9
9
|
import ReactViewBackgroundDrawableUtils
|
|
10
|
-
import com.datadog.android.api.InternalLogger
|
|
11
|
-
import com.datadog.android.sessionreplay.model.MobileSegment
|
|
12
|
-
import com.datadog.android.sessionreplay.recorder.MappingContext
|
|
13
|
-
import com.datadog.android.sessionreplay.recorder.mapper.BaseWireframeMapper
|
|
14
10
|
import com.datadog.android.sessionreplay.recorder.mapper.TraverseAllChildrenMapper
|
|
15
|
-
import com.datadog.android.sessionreplay.utils.AsyncJobStatusCallback
|
|
16
|
-
import com.datadog.android.sessionreplay.utils.DefaultColorStringFormatter
|
|
17
|
-
import com.datadog.android.sessionreplay.utils.DefaultViewBoundsResolver
|
|
18
|
-
import com.datadog.android.sessionreplay.utils.DefaultViewBoundsResolver.resolveViewGlobalBounds
|
|
19
|
-
import com.datadog.android.sessionreplay.utils.DefaultViewIdentifierResolver
|
|
20
|
-
import com.datadog.android.sessionreplay.utils.DrawableToColorMapper
|
|
21
11
|
import com.datadog.reactnative.sessionreplay.utils.DrawableUtils
|
|
22
12
|
import com.facebook.react.views.view.ReactViewGroup
|
|
23
13
|
|
|
24
14
|
internal class ReactViewGroupMapper(
|
|
25
15
|
private val drawableUtils: DrawableUtils =
|
|
26
16
|
ReactViewBackgroundDrawableUtils()
|
|
27
|
-
) :
|
|
28
|
-
BaseWireframeMapper<ReactViewGroup>(
|
|
29
|
-
viewIdentifierResolver = DefaultViewIdentifierResolver,
|
|
30
|
-
colorStringFormatter = DefaultColorStringFormatter,
|
|
31
|
-
viewBoundsResolver = DefaultViewBoundsResolver,
|
|
32
|
-
drawableToColorMapper = DrawableToColorMapper.getDefault()
|
|
33
|
-
),
|
|
34
|
-
TraverseAllChildrenMapper<ReactViewGroup> {
|
|
35
|
-
|
|
36
|
-
override fun map(
|
|
37
|
-
view: ReactViewGroup,
|
|
38
|
-
mappingContext: MappingContext,
|
|
39
|
-
asyncJobStatusCallback: AsyncJobStatusCallback,
|
|
40
|
-
internalLogger: InternalLogger
|
|
41
|
-
): List<MobileSegment.Wireframe> {
|
|
42
|
-
val pixelDensity = mappingContext.systemInformation.screenDensity
|
|
43
|
-
val viewGlobalBounds = resolveViewGlobalBounds(view, pixelDensity)
|
|
44
|
-
val backgroundDrawable = drawableUtils.getReactBackgroundFromDrawable(view.background)
|
|
45
|
-
|
|
46
|
-
// view.alpha is the value of the opacity prop on the js side
|
|
47
|
-
val opacity = view.alpha
|
|
48
|
-
|
|
49
|
-
val (shapeStyle, border) =
|
|
50
|
-
if (backgroundDrawable != null) {
|
|
51
|
-
drawableUtils
|
|
52
|
-
.resolveShapeAndBorder(backgroundDrawable, opacity, pixelDensity)
|
|
53
|
-
} else {
|
|
54
|
-
null to null
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return listOf(
|
|
58
|
-
MobileSegment.Wireframe.ShapeWireframe(
|
|
59
|
-
resolveViewId(view),
|
|
60
|
-
viewGlobalBounds.x,
|
|
61
|
-
viewGlobalBounds.y,
|
|
62
|
-
viewGlobalBounds.width,
|
|
63
|
-
viewGlobalBounds.height,
|
|
64
|
-
shapeStyle = shapeStyle,
|
|
65
|
-
border = border
|
|
66
|
-
)
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
17
|
+
) : DefaultMapper<ReactViewGroup>(drawableUtils), TraverseAllChildrenMapper<ReactViewGroup>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
package com.datadog.reactnative.sessionreplay.mappers
|
|
8
|
+
|
|
9
|
+
import ReactViewBackgroundDrawableUtils
|
|
10
|
+
import com.datadog.reactnative.sessionreplay.utils.DrawableUtils
|
|
11
|
+
import com.facebook.react.views.modal.ReactModalHostView
|
|
12
|
+
|
|
13
|
+
internal class ReactViewModalMapper(
|
|
14
|
+
private val drawableUtils: DrawableUtils =
|
|
15
|
+
ReactViewBackgroundDrawableUtils()
|
|
16
|
+
) : DefaultMapper<ReactModalHostView>(drawableUtils)
|
|
@@ -64,7 +64,7 @@ internal class LegacyTextViewUtils(
|
|
|
64
64
|
}
|
|
65
65
|
val resolvedColor =
|
|
66
66
|
shadowNodeWrapper
|
|
67
|
-
.getDeclaredShadowNodeField(COLOR_FIELD_NAME) as Int
|
|
67
|
+
.getDeclaredShadowNodeField(COLOR_FIELD_NAME) as? Int
|
|
68
68
|
if (resolvedColor != null) {
|
|
69
69
|
return formatAsRgba(resolvedColor)
|
|
70
70
|
}
|
|
@@ -115,4 +115,3 @@ internal class LegacyTextViewUtils(
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
3
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
4
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
5
|
+
*/
|
|
6
|
+
import android.graphics.drawable.Drawable
|
|
7
|
+
import android.graphics.drawable.InsetDrawable
|
|
8
|
+
import android.graphics.drawable.LayerDrawable
|
|
9
|
+
import com.datadog.android.sessionreplay.model.MobileSegment
|
|
10
|
+
import com.datadog.reactnative.sessionreplay.utils.DrawableUtils
|
|
11
|
+
import com.datadog.reactnative.sessionreplay.utils.formatAsRgba
|
|
12
|
+
import com.facebook.react.uimanager.Spacing
|
|
13
|
+
import com.facebook.react.views.view.ReactViewBackgroundDrawable
|
|
14
|
+
|
|
15
|
+
internal class ReactViewBackgroundDrawableUtils() : DrawableUtils() {
|
|
16
|
+
override fun resolveShapeAndBorder(
|
|
17
|
+
drawable: Drawable,
|
|
18
|
+
opacity: Float,
|
|
19
|
+
pixelDensity: Float
|
|
20
|
+
): Pair<MobileSegment.ShapeStyle?, MobileSegment.ShapeBorder?> {
|
|
21
|
+
if (drawable !is ReactViewBackgroundDrawable) {
|
|
22
|
+
return null to null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
val borderProps = resolveBorder(drawable, pixelDensity)
|
|
26
|
+
val cornerRadius = (drawable.fullBorderRadius / pixelDensity).toLong()
|
|
27
|
+
|
|
28
|
+
val backgroundColor = getBackgroundColor(drawable)
|
|
29
|
+
val colorHexString = if (backgroundColor != null) {
|
|
30
|
+
formatAsRgba(backgroundColor)
|
|
31
|
+
} else {
|
|
32
|
+
return null to borderProps
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return MobileSegment.ShapeStyle(
|
|
36
|
+
colorHexString,
|
|
37
|
+
opacity,
|
|
38
|
+
cornerRadius
|
|
39
|
+
) to borderProps
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override fun getReactBackgroundFromDrawable(drawable: Drawable?): Drawable? {
|
|
43
|
+
return when (drawable) {
|
|
44
|
+
is ReactViewBackgroundDrawable -> drawable
|
|
45
|
+
is InsetDrawable -> getReactBackgroundFromDrawable(drawable.drawable)
|
|
46
|
+
is LayerDrawable -> getDrawableFromLayerDrawable(drawable)
|
|
47
|
+
else -> null
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private fun getDrawableFromLayerDrawable(layerDrawable: LayerDrawable): Drawable? {
|
|
52
|
+
for (layerNumber in 0 until layerDrawable.numberOfLayers) {
|
|
53
|
+
val layer = layerDrawable.getDrawable(layerNumber)
|
|
54
|
+
if (layer is ReactViewBackgroundDrawable) {
|
|
55
|
+
return layer
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private fun resolveBorder(
|
|
62
|
+
backgroundDrawable: ReactViewBackgroundDrawable,
|
|
63
|
+
pixelDensity: Float
|
|
64
|
+
): MobileSegment.ShapeBorder {
|
|
65
|
+
val borderWidth = (backgroundDrawable.fullBorderWidth / pixelDensity).toLong()
|
|
66
|
+
val borderColor = formatAsRgba(backgroundDrawable.getBorderColor(Spacing.ALL))
|
|
67
|
+
|
|
68
|
+
return MobileSegment.ShapeBorder(
|
|
69
|
+
color = borderColor,
|
|
70
|
+
width = borderWidth
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private fun getBackgroundColor(
|
|
75
|
+
backgroundDrawable: ReactViewBackgroundDrawable
|
|
76
|
+
): Int? {
|
|
77
|
+
return reflectionUtils.getDeclaredField(
|
|
78
|
+
backgroundDrawable,
|
|
79
|
+
COLOR_FIELD_NAME
|
|
80
|
+
) as? Int
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private companion object {
|
|
84
|
+
private const val COLOR_FIELD_NAME = "mColor"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -42,23 +42,22 @@ internal class ReactViewBackgroundDrawableUtils : DrawableUtils() {
|
|
|
42
42
|
|
|
43
43
|
@OptIn(UnstableReactNativeAPI::class)
|
|
44
44
|
override fun getReactBackgroundFromDrawable(drawable: Drawable?): Drawable? {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return getReactBackgroundFromDrawable(drawable.drawable)
|
|
45
|
+
return when(drawable) {
|
|
46
|
+
is CSSBackgroundDrawable -> drawable
|
|
47
|
+
is InsetDrawable -> getReactBackgroundFromDrawable(drawable.drawable)
|
|
48
|
+
is LayerDrawable -> getDrawableFromLayerDrawable(drawable)
|
|
49
|
+
else -> null
|
|
51
50
|
}
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
@OptIn(UnstableReactNativeAPI::class)
|
|
54
|
+
private fun getDrawableFromLayerDrawable(layerDrawable: LayerDrawable): Drawable? {
|
|
55
|
+
for (layerNumber in 0 until layerDrawable.numberOfLayers) {
|
|
56
|
+
val layer = layerDrawable.getDrawable(layerNumber)
|
|
57
|
+
if (layer is CSSBackgroundDrawable) {
|
|
58
|
+
return layer
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
61
|
return null
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -76,7 +75,7 @@ internal class ReactViewBackgroundDrawableUtils : DrawableUtils() {
|
|
|
76
75
|
return reflectionUtils.getDeclaredField(
|
|
77
76
|
backgroundDrawable,
|
|
78
77
|
COLOR_FIELD_NAME
|
|
79
|
-
) as Int
|
|
78
|
+
) as? Int
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
@OptIn(UnstableReactNativeAPI::class)
|
|
@@ -42,23 +42,22 @@ internal class ReactViewBackgroundDrawableUtils : DrawableUtils() {
|
|
|
42
42
|
|
|
43
43
|
@OptIn(UnstableReactNativeAPI::class)
|
|
44
44
|
override fun getReactBackgroundFromDrawable(drawable: Drawable?): Drawable? {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return getReactBackgroundFromDrawable(drawable.drawable)
|
|
45
|
+
return when(drawable) {
|
|
46
|
+
is CSSBackgroundDrawable -> drawable
|
|
47
|
+
is InsetDrawable -> getReactBackgroundFromDrawable(drawable.drawable)
|
|
48
|
+
is LayerDrawable -> getDrawableFromLayerDrawable(drawable)
|
|
49
|
+
else -> null
|
|
51
50
|
}
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
@OptIn(UnstableReactNativeAPI::class)
|
|
54
|
+
private fun getDrawableFromLayerDrawable(layerDrawable: LayerDrawable): Drawable? {
|
|
55
|
+
for (layerNumber in 0 until layerDrawable.numberOfLayers) {
|
|
56
|
+
val layer = layerDrawable.getDrawable(layerNumber)
|
|
57
|
+
if (layer is CSSBackgroundDrawable) {
|
|
58
|
+
return layer
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
61
|
return null
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -76,7 +75,7 @@ internal class ReactViewBackgroundDrawableUtils : DrawableUtils() {
|
|
|
76
75
|
return reflectionUtils.getDeclaredField(
|
|
77
76
|
backgroundDrawable,
|
|
78
77
|
COLOR_FIELD_NAME
|
|
79
|
-
) as Int
|
|
78
|
+
) as? Int
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
@OptIn(UnstableReactNativeAPI::class)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import android.graphics.Color
|
|
1
2
|
import android.graphics.drawable.Drawable
|
|
2
3
|
import android.graphics.drawable.InsetDrawable
|
|
3
4
|
import android.graphics.drawable.LayerDrawable
|
|
@@ -35,23 +36,21 @@ internal class ReactViewBackgroundDrawableUtils() : DrawableUtils() {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
override fun getReactBackgroundFromDrawable(drawable: Drawable?): Drawable? {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return getReactBackgroundFromDrawable(drawable.drawable)
|
|
39
|
+
return when(drawable) {
|
|
40
|
+
is ReactViewBackgroundDrawable -> drawable
|
|
41
|
+
is InsetDrawable -> getReactBackgroundFromDrawable(drawable.drawable)
|
|
42
|
+
is LayerDrawable -> getDrawableFromLayerDrawable(drawable)
|
|
43
|
+
else -> null
|
|
44
44
|
}
|
|
45
|
+
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
47
|
+
private fun getDrawableFromLayerDrawable(layerDrawable: LayerDrawable): Drawable? {
|
|
48
|
+
for (layerNumber in 0 until layerDrawable.numberOfLayers) {
|
|
49
|
+
val layer = layerDrawable.getDrawable(layerNumber)
|
|
50
|
+
if (layer is ReactViewBackgroundDrawable) {
|
|
51
|
+
return layer
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
54
|
return null
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -60,7 +59,7 @@ internal class ReactViewBackgroundDrawableUtils() : DrawableUtils() {
|
|
|
60
59
|
pixelDensity: Float
|
|
61
60
|
): MobileSegment.ShapeBorder {
|
|
62
61
|
val borderWidth = (backgroundDrawable.fullBorderWidth / pixelDensity).toLong()
|
|
63
|
-
val borderColor = formatAsRgba(
|
|
62
|
+
val borderColor = formatAsRgba(getBorderColor(backgroundDrawable))
|
|
64
63
|
|
|
65
64
|
return MobileSegment.ShapeBorder(
|
|
66
65
|
color = borderColor,
|
|
@@ -68,16 +67,40 @@ internal class ReactViewBackgroundDrawableUtils() : DrawableUtils() {
|
|
|
68
67
|
)
|
|
69
68
|
}
|
|
70
69
|
|
|
70
|
+
private fun getBorderColor(backgroundDrawable: ReactViewBackgroundDrawable): Int {
|
|
71
|
+
val borderRgb = reflectionUtils.getDeclaredField(
|
|
72
|
+
backgroundDrawable,
|
|
73
|
+
BORDER_RGB_FIELD_NAME
|
|
74
|
+
) as? Spacing
|
|
75
|
+
|
|
76
|
+
val borderAlpha = reflectionUtils.getDeclaredField(
|
|
77
|
+
backgroundDrawable,
|
|
78
|
+
BORDER_ALPHA_FIELD_NAME
|
|
79
|
+
) as? Spacing
|
|
80
|
+
|
|
81
|
+
val rgb = borderRgb?.get(Spacing.ALL) ?: DEFAULT_BORDER_RGB
|
|
82
|
+
val alpha = borderAlpha?.get(Spacing.ALL) ?: DEFAULT_BORDER_ALPHA
|
|
83
|
+
|
|
84
|
+
val rgbComponent = 0x00FFFFFF and rgb.toInt()
|
|
85
|
+
val alphaComponent = -0x1000000 and ((alpha.toInt()) shl 24)
|
|
86
|
+
|
|
87
|
+
return rgbComponent or alphaComponent
|
|
88
|
+
}
|
|
89
|
+
|
|
71
90
|
private fun getBackgroundColor(
|
|
72
91
|
backgroundDrawable: ReactViewBackgroundDrawable
|
|
73
92
|
): Int? {
|
|
74
93
|
return reflectionUtils.getDeclaredField(
|
|
75
94
|
backgroundDrawable,
|
|
76
95
|
COLOR_FIELD_NAME
|
|
77
|
-
) as Int
|
|
96
|
+
) as? Int
|
|
78
97
|
}
|
|
79
98
|
|
|
80
99
|
private companion object {
|
|
81
100
|
private const val COLOR_FIELD_NAME = "mColor"
|
|
101
|
+
private const val BORDER_RGB_FIELD_NAME = "mBorderRGB"
|
|
102
|
+
private const val BORDER_ALPHA_FIELD_NAME = "mBorderAlpha"
|
|
103
|
+
private const val DEFAULT_BORDER_RGB: Int = 0x00FFFFFF and Color.BLACK
|
|
104
|
+
private const val DEFAULT_BORDER_ALPHA: Int = -0x1000000 and Color.BLACK
|
|
82
105
|
}
|
|
83
106
|
}
|
|
@@ -11,6 +11,7 @@ import com.datadog.reactnative.sessionreplay.mappers.ReactEditTextMapper
|
|
|
11
11
|
import com.datadog.reactnative.sessionreplay.mappers.ReactNativeImageViewMapper
|
|
12
12
|
import com.datadog.reactnative.sessionreplay.mappers.ReactTextMapper
|
|
13
13
|
import com.datadog.reactnative.sessionreplay.mappers.ReactViewGroupMapper
|
|
14
|
+
import com.datadog.reactnative.sessionreplay.mappers.ReactViewModalMapper
|
|
14
15
|
import com.datadog.reactnative.sessionreplay.utils.text.TextViewUtils
|
|
15
16
|
import com.facebook.react.bridge.NativeModule
|
|
16
17
|
import com.facebook.react.bridge.ReactContext
|
|
@@ -62,7 +63,7 @@ internal class ReactNativeSessionReplayExtensionSupportTest {
|
|
|
62
63
|
val customViewMappers = testedExtensionSupport.getCustomViewMappers()
|
|
63
64
|
|
|
64
65
|
// Then
|
|
65
|
-
assertThat(customViewMappers).hasSize(
|
|
66
|
+
assertThat(customViewMappers).hasSize(5)
|
|
66
67
|
|
|
67
68
|
assertThat(customViewMappers[0].getUnsafeMapper())
|
|
68
69
|
.isInstanceOf(ReactNativeImageViewMapper::class.java)
|
|
@@ -75,5 +76,8 @@ internal class ReactNativeSessionReplayExtensionSupportTest {
|
|
|
75
76
|
|
|
76
77
|
assertThat(customViewMappers[3].getUnsafeMapper())
|
|
77
78
|
.isInstanceOf(ReactEditTextMapper::class.java)
|
|
79
|
+
|
|
80
|
+
assertThat(customViewMappers[4].getUnsafeMapper())
|
|
81
|
+
.isInstanceOf(ReactViewModalMapper::class.java)
|
|
78
82
|
}
|
|
79
83
|
}
|
|
@@ -16,19 +16,45 @@ let SessionReplayPrivacy = exports.SessionReplayPrivacy = /*#__PURE__*/function
|
|
|
16
16
|
return SessionReplayPrivacy;
|
|
17
17
|
}({});
|
|
18
18
|
let ImagePrivacyLevel = exports.ImagePrivacyLevel = /*#__PURE__*/function (ImagePrivacyLevel) {
|
|
19
|
+
/**
|
|
20
|
+
* Only images that are bundled within the application will be recorded.
|
|
21
|
+
*
|
|
22
|
+
* On Android, all images larger than 100x100 dp will be masked, as we consider them non-bundled images.
|
|
23
|
+
*/
|
|
19
24
|
ImagePrivacyLevel["MASK_NON_BUNDLED_ONLY"] = "MASK_NON_BUNDLED_ONLY";
|
|
25
|
+
/**
|
|
26
|
+
* No images will be recorded.
|
|
27
|
+
*/
|
|
20
28
|
ImagePrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
29
|
+
/**
|
|
30
|
+
* All images will be recorded, including the ones downloaded from the Internet or generated during the app runtime.
|
|
31
|
+
*/
|
|
21
32
|
ImagePrivacyLevel["MASK_NONE"] = "MASK_NONE";
|
|
22
33
|
return ImagePrivacyLevel;
|
|
23
34
|
}({});
|
|
24
35
|
let TouchPrivacyLevel = exports.TouchPrivacyLevel = /*#__PURE__*/function (TouchPrivacyLevel) {
|
|
36
|
+
/**
|
|
37
|
+
* Show all user touches.
|
|
38
|
+
*/
|
|
25
39
|
TouchPrivacyLevel["SHOW"] = "SHOW";
|
|
40
|
+
/**
|
|
41
|
+
* Hide all user touches.
|
|
42
|
+
*/
|
|
26
43
|
TouchPrivacyLevel["HIDE"] = "HIDE";
|
|
27
44
|
return TouchPrivacyLevel;
|
|
28
45
|
}({});
|
|
29
46
|
let TextAndInputPrivacyLevel = exports.TextAndInputPrivacyLevel = /*#__PURE__*/function (TextAndInputPrivacyLevel) {
|
|
47
|
+
/**
|
|
48
|
+
* Show all texts except sensitive inputs (e.g password fields).
|
|
49
|
+
*/
|
|
30
50
|
TextAndInputPrivacyLevel["MASK_SENSITIVE_INPUTS"] = "MASK_SENSITIVE_INPUTS";
|
|
51
|
+
/**
|
|
52
|
+
* Mask all input fields (e.g text fields, switches, checkboxes).
|
|
53
|
+
*/
|
|
31
54
|
TextAndInputPrivacyLevel["MASK_ALL_INPUTS"] = "MASK_ALL_INPUTS";
|
|
55
|
+
/**
|
|
56
|
+
* Mask all texts and inputs (e.g labels).
|
|
57
|
+
*/
|
|
32
58
|
TextAndInputPrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
33
59
|
return TextAndInputPrivacyLevel;
|
|
34
60
|
}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionReplayPrivacy","exports","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","stopRecording","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAJA,IAQYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAAA,IAMpBE,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,0BAAjBA,iBAAiB;
|
|
1
|
+
{"version":3,"names":["SessionReplayPrivacy","exports","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","stopRecording","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings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,CAACZ,iBAAiB,GAAGT,iBAAiB,CAAC0B,IAAI;UACxDL,aAAa,CAACV,wBAAwB,GAClCV,wBAAwB,CAAC0B,qBAAqB;UAClD;MACR;IACJ;IAEA,OAAO;MAAE,GAAGR,UAAU;MAAE,GAAGE;IAAc,CAAC;EAC9C,CAAC;;EAED;AACJ;AACA;AACA;EACIO,MAAM,GAAIV,aAA0C,IAAoB;IACpE,MAAM;MACFf,gBAAgB;MAChBG,cAAc;MACdC,iBAAiB;MACjBE,iBAAiB;MACjBE,wBAAwB;MACxBC;IACJ,CAAC,GAAG,IAAI,CAACK,kBAAkB,CAACC,aAAa,CAAC;IAE1C,OAAO,IAAI,CAACJ,mBAAmB,CAACc,MAAM,CAClCzB,gBAAgB,EAChBG,cAAc,EACdC,iBAAiB,EACjBE,iBAAiB,EACjBE,wBAAwB,EACxBC,yBACJ,CAAC;EACL,CAAC;;EAED;AACJ;AACA;EACIiB,cAAc,GAAGA,CAAA,KAAqB;IAClC,OAAO,IAAI,CAACf,mBAAmB,CAACe,cAAc,CAAC,CAAC;EACpD,CAAC;;EAED;AACJ;AACA;EACIC,aAAa,GAAGA,CAAA,KAAqB;IACjC,OAAO,IAAI,CAAChB,mBAAmB,CAACgB,aAAa,CAAC,CAAC;EACnD,CAAC;AACL;AAAChC,OAAA,CAAAe,oBAAA,GAAAA,oBAAA;AAEM,MAAMkB,aAAa,GAAAjC,OAAA,CAAAiC,aAAA,GAAG,IAAIlB,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@ var _reactNative = require("react-native");
|
|
|
14
14
|
/**
|
|
15
15
|
* Do not import this Spec directly, use NativeSessionReplayType instead.
|
|
16
16
|
*/
|
|
17
|
-
// eslint-disable-next-line
|
|
17
|
+
// eslint-disable-next-line import/no-default-export
|
|
18
18
|
var _default = exports.default = _reactNative.TurboModuleRegistry.get('DdSessionReplay');
|
|
19
19
|
//# sourceMappingURL=NativeDdSessionReplay.js.map
|
|
@@ -11,19 +11,45 @@ export let SessionReplayPrivacy = /*#__PURE__*/function (SessionReplayPrivacy) {
|
|
|
11
11
|
return SessionReplayPrivacy;
|
|
12
12
|
}({});
|
|
13
13
|
export let ImagePrivacyLevel = /*#__PURE__*/function (ImagePrivacyLevel) {
|
|
14
|
+
/**
|
|
15
|
+
* Only images that are bundled within the application will be recorded.
|
|
16
|
+
*
|
|
17
|
+
* On Android, all images larger than 100x100 dp will be masked, as we consider them non-bundled images.
|
|
18
|
+
*/
|
|
14
19
|
ImagePrivacyLevel["MASK_NON_BUNDLED_ONLY"] = "MASK_NON_BUNDLED_ONLY";
|
|
20
|
+
/**
|
|
21
|
+
* No images will be recorded.
|
|
22
|
+
*/
|
|
15
23
|
ImagePrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
24
|
+
/**
|
|
25
|
+
* All images will be recorded, including the ones downloaded from the Internet or generated during the app runtime.
|
|
26
|
+
*/
|
|
16
27
|
ImagePrivacyLevel["MASK_NONE"] = "MASK_NONE";
|
|
17
28
|
return ImagePrivacyLevel;
|
|
18
29
|
}({});
|
|
19
30
|
export let TouchPrivacyLevel = /*#__PURE__*/function (TouchPrivacyLevel) {
|
|
31
|
+
/**
|
|
32
|
+
* Show all user touches.
|
|
33
|
+
*/
|
|
20
34
|
TouchPrivacyLevel["SHOW"] = "SHOW";
|
|
35
|
+
/**
|
|
36
|
+
* Hide all user touches.
|
|
37
|
+
*/
|
|
21
38
|
TouchPrivacyLevel["HIDE"] = "HIDE";
|
|
22
39
|
return TouchPrivacyLevel;
|
|
23
40
|
}({});
|
|
24
41
|
export let TextAndInputPrivacyLevel = /*#__PURE__*/function (TextAndInputPrivacyLevel) {
|
|
42
|
+
/**
|
|
43
|
+
* Show all texts except sensitive inputs (e.g password fields).
|
|
44
|
+
*/
|
|
25
45
|
TextAndInputPrivacyLevel["MASK_SENSITIVE_INPUTS"] = "MASK_SENSITIVE_INPUTS";
|
|
46
|
+
/**
|
|
47
|
+
* Mask all input fields (e.g text fields, switches, checkboxes).
|
|
48
|
+
*/
|
|
26
49
|
TextAndInputPrivacyLevel["MASK_ALL_INPUTS"] = "MASK_ALL_INPUTS";
|
|
50
|
+
/**
|
|
51
|
+
* Mask all texts and inputs (e.g labels).
|
|
52
|
+
*/
|
|
27
53
|
TextAndInputPrivacyLevel["MASK_ALL"] = "MASK_ALL";
|
|
28
54
|
return TextAndInputPrivacyLevel;
|
|
29
55
|
}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SessionReplayPrivacy","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","stopRecording","SessionReplay"],"sourceRoot":"../../src","sources":["SessionReplay.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAIA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;AAMhC,WAAYC,iBAAiB,0BAAjBA,iBAAiB;
|
|
1
|
+
{"version":3,"names":["SessionReplayPrivacy","ImagePrivacyLevel","TouchPrivacyLevel","TextAndInputPrivacyLevel","DEFAULTS","replaySampleRate","defaultPrivacyLevel","MASK","customEndpoint","imagePrivacyLevel","MASK_ALL","touchPrivacyLevel","HIDE","textAndInputPrivacyLevel","startRecordingImmediately","SessionReplayWrapper","nativeSessionReplay","require","default","buildConfiguration","configuration","baseConfig","undefined","privacyConfig","MASK_USER_INPUT","MASK_NONE","MASK_ALL_INPUTS","ALLOW","SHOW","MASK_SENSITIVE_INPUTS","enable","startRecording","st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Aa,CAACV,wBAAwB,GAClCV,wBAAwB,CAAC0B,qBAAqB;UAClD;MACR;IACJ;IAEA,OAAO;MAAE,GAAGR,UAAU;MAAE,GAAGE;IAAc,CAAC;EAC9C,CAAC;;EAED;AACJ;AACA;AACA;EACIO,MAAM,GAAIV,aAA0C,IAAoB;IACpE,MAAM;MACFf,gBAAgB;MAChBG,cAAc;MACdC,iBAAiB;MACjBE,iBAAiB;MACjBE,wBAAwB;MACxBC;IACJ,CAAC,GAAG,IAAI,CAACK,kBAAkB,CAACC,aAAa,CAAC;IAE1C,OAAO,IAAI,CAACJ,mBAAmB,CAACc,MAAM,CAClCzB,gBAAgB,EAChBG,cAAc,EACdC,iBAAiB,EACjBE,iBAAiB,EACjBE,wBAAwB,EACxBC,yBACJ,CAAC;EACL,CAAC;;EAED;AACJ;AACA;EACIiB,cAAc,GAAGA,CAAA,KAAqB;IAClC,OAAO,IAAI,CAACf,mBAAmB,CAACe,cAAc,CAAC,CAAC;EACpD,CAAC;;EAED;AACJ;AACA;EACIC,aAAa,GAAGA,CAAA,KAAqB;IACjC,OAAO,IAAI,CAAChB,mBAAmB,CAACgB,aAAa,CAAC,CAAC;EACnD,CAAC;AACL;AAEA,OAAO,MAAMC,aAAa,GAAG,IAAIlB,oBAAoB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,6 +12,6 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
12
12
|
* Do not import this Spec directly, use NativeSessionReplayType instead.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
// eslint-disable-next-line
|
|
15
|
+
// eslint-disable-next-line import/no-default-export
|
|
16
16
|
export default TurboModuleRegistry.get('DdSessionReplay');
|
|
17
17
|
//# sourceMappingURL=NativeDdSessionReplay.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/mobile-react-native-session-replay",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "A client-side React Native module to enable session replay with Datadog",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datadog",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"javaPackageName": "com.datadog.reactnative.sessionreplay"
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "1f3d75abb1851875b133c8e4d6cf7b54e57b0aa3"
|
|
94
94
|
}
|