@datadog/mobile-react-native-session-replay 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/DatadogSDKReactNativeSessionReplay.podspec +11 -8
  2. package/android/build.gradle +9 -1
  3. package/android/gradle.properties +1 -0
  4. package/android/src/main/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyView.kt +59 -0
  5. package/android/src/main/res/values/ids.xml +12 -0
  6. package/android/src/newarch/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyViewManager.kt +50 -0
  7. package/android/src/oldarch/kotlin/com/datadog/reactnative/sessionreplay/views/DdPrivacyViewManager.kt +43 -0
  8. package/android/src/rn76/kotlin/com/datadog/reactnative/sessionreplay/utils/ReactViewBackgroundDrawableUtils.kt +1 -1
  9. package/android/src/{main → rnpost74}/kotlin/com/datadog/reactnative/sessionreplay/DdSDKReactNativeSessionReplayPackage.kt +9 -2
  10. package/android/src/rnpre74/kotlin/com/datadog/reactnative/sessionreplay/DdSDKReactNativeSessionReplayPackage.kt +31 -0
  11. package/ios/Sources/DdPrivacyOverrider.swift +71 -0
  12. package/ios/Sources/DdPrivacyViewFabric.mm +54 -0
  13. package/ios/Sources/DdPrivacyViewPaper.m +58 -0
  14. package/ios/Sources/RCTFabricWrapper.mm +1 -2
  15. package/ios/Sources/RCTTextViewRecorder.swift +20 -5
  16. package/lib/commonjs/components/SessionReplayView/HideView.js +34 -0
  17. package/lib/commonjs/components/SessionReplayView/HideView.js.map +1 -0
  18. package/lib/commonjs/components/SessionReplayView/MaskAllView.js +44 -0
  19. package/lib/commonjs/components/SessionReplayView/MaskAllView.js.map +1 -0
  20. package/lib/commonjs/components/SessionReplayView/MaskNoneView.js +41 -0
  21. package/lib/commonjs/components/SessionReplayView/MaskNoneView.js.map +1 -0
  22. package/lib/commonjs/components/SessionReplayView/PrivacyView.js +46 -0
  23. package/lib/commonjs/components/SessionReplayView/PrivacyView.js.map +1 -0
  24. package/lib/commonjs/components/SessionReplayView/index.js +40 -0
  25. package/lib/commonjs/components/SessionReplayView/index.js.map +1 -0
  26. package/lib/commonjs/index.js +7 -0
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/specs/DdPrivacyView.js +19 -0
  29. package/lib/commonjs/specs/DdPrivacyView.js.map +1 -0
  30. package/lib/commonjs/specs/DdPrivacyViewNativeComponent.js +17 -0
  31. package/lib/commonjs/specs/DdPrivacyViewNativeComponent.js.map +1 -0
  32. package/lib/commonjs/specs/DdPrivacyViewPaper.js +16 -0
  33. package/lib/commonjs/specs/DdPrivacyViewPaper.js.map +1 -0
  34. package/lib/commonjs/types/DdPrivacyView.js +6 -0
  35. package/lib/commonjs/types/DdPrivacyView.js.map +1 -0
  36. package/lib/module/components/SessionReplayView/HideView.js +28 -0
  37. package/lib/module/components/SessionReplayView/HideView.js.map +1 -0
  38. package/lib/module/components/SessionReplayView/MaskAllView.js +37 -0
  39. package/lib/module/components/SessionReplayView/MaskAllView.js.map +1 -0
  40. package/lib/module/components/SessionReplayView/MaskNoneView.js +35 -0
  41. package/lib/module/components/SessionReplayView/MaskNoneView.js.map +1 -0
  42. package/lib/module/components/SessionReplayView/PrivacyView.js +39 -0
  43. package/lib/module/components/SessionReplayView/PrivacyView.js.map +1 -0
  44. package/lib/module/components/SessionReplayView/index.js +35 -0
  45. package/lib/module/components/SessionReplayView/index.js.map +1 -0
  46. package/lib/module/index.js +2 -0
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/specs/DdPrivacyView.js +12 -0
  49. package/lib/module/specs/DdPrivacyView.js.map +1 -0
  50. package/lib/module/specs/DdPrivacyViewNativeComponent.js +11 -0
  51. package/lib/module/specs/DdPrivacyViewNativeComponent.js.map +1 -0
  52. package/lib/module/specs/DdPrivacyViewPaper.js +10 -0
  53. package/lib/module/specs/DdPrivacyViewPaper.js.map +1 -0
  54. package/lib/module/types/DdPrivacyView.js +2 -0
  55. package/lib/module/types/DdPrivacyView.js.map +1 -0
  56. package/lib/typescript/components/SessionReplayView/HideView.d.ts +11 -0
  57. package/lib/typescript/components/SessionReplayView/HideView.d.ts.map +1 -0
  58. package/lib/typescript/components/SessionReplayView/MaskAllView.d.ts +23 -0
  59. package/lib/typescript/components/SessionReplayView/MaskAllView.d.ts.map +1 -0
  60. package/lib/typescript/components/SessionReplayView/MaskNoneView.d.ts +14 -0
  61. package/lib/typescript/components/SessionReplayView/MaskNoneView.d.ts.map +1 -0
  62. package/lib/typescript/components/SessionReplayView/PrivacyView.d.ts +36 -0
  63. package/lib/typescript/components/SessionReplayView/PrivacyView.d.ts.map +1 -0
  64. package/lib/typescript/components/SessionReplayView/index.d.ts +28 -0
  65. package/lib/typescript/components/SessionReplayView/index.d.ts.map +1 -0
  66. package/lib/typescript/index.d.ts +2 -0
  67. package/lib/typescript/index.d.ts.map +1 -1
  68. package/lib/typescript/specs/DdPrivacyView.d.ts +3 -0
  69. package/lib/typescript/specs/DdPrivacyView.d.ts.map +1 -0
  70. package/lib/typescript/specs/DdPrivacyViewNativeComponent.d.ts +10 -0
  71. package/lib/typescript/specs/DdPrivacyViewNativeComponent.d.ts.map +1 -0
  72. package/lib/typescript/specs/DdPrivacyViewPaper.d.ts +4 -0
  73. package/lib/typescript/specs/DdPrivacyViewPaper.d.ts.map +1 -0
  74. package/lib/typescript/types/DdPrivacyView.d.ts +8 -0
  75. package/lib/typescript/types/DdPrivacyView.d.ts.map +1 -0
  76. package/package.json +3 -3
  77. package/src/components/SessionReplayView/HideView.tsx +25 -0
  78. package/src/components/SessionReplayView/MaskAllView.tsx +53 -0
  79. package/src/components/SessionReplayView/MaskNoneView.tsx +40 -0
  80. package/src/components/SessionReplayView/PrivacyView.tsx +67 -0
  81. package/src/components/SessionReplayView/index.ts +34 -0
  82. package/src/index.ts +3 -0
  83. package/src/specs/DdPrivacyView.ts +17 -0
  84. package/src/specs/DdPrivacyViewNativeComponent.ts +19 -0
  85. package/src/specs/DdPrivacyViewPaper.ts +15 -0
  86. package/src/types/DdPrivacyView.ts +14 -0
@@ -0,0 +1,28 @@
1
+ import { HideView } from './HideView';
2
+ import { MaskAllView } from './MaskAllView';
3
+ import { MaskNoneView } from './MaskNoneView';
4
+ import { PrivacyView } from './PrivacyView';
5
+ /**
6
+ * A collection of preconfigured React components for controlling privacy in Datadog Session Replay.
7
+ *
8
+ * These components can be used to control how different parts of the UI appear in session recordings:
9
+ *
10
+ * - `SessionReplayView.MaskAll`: Masks all text, inputs, and images. Hides touch interactions by default.
11
+ * Use for highly sensitive sections.
12
+ *
13
+ * - `SessionReplayView.MaskNone`: Displays most content as-is, except for sensitive inputs which are still masked.
14
+ * Use when visibility is safe and desired.
15
+ *
16
+ * - `SessionReplayView.Hide`: Completely hides the view and its children from session replays.
17
+ * Use for content that should not appear at all in recordings.
18
+ *
19
+ * - `SessionReplayView.Privacy`: A low-level configurable component for fine-tuned privacy control.
20
+ * Use this if none of the presets meet your needs.
21
+ */
22
+ export declare const SessionReplayView: {
23
+ Privacy: typeof PrivacyView;
24
+ MaskAll: typeof MaskAllView;
25
+ MaskNone: typeof MaskNoneView;
26
+ Hide: typeof HideView;
27
+ };
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionReplayView/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB;;;;;CAK7B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import type { SessionReplayConfiguration } from './SessionReplay';
2
2
  import { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel } from './SessionReplay';
3
+ import { SessionReplayView } from './components/SessionReplayView';
3
4
  export { SessionReplay, SessionReplayPrivacy, ImagePrivacyLevel, TouchPrivacyLevel, TextAndInputPrivacyLevel };
5
+ export { SessionReplayView };
4
6
  export type { SessionReplayConfiguration };
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,CAAC;AAEF,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const NativeComponent: any;
2
+ export default NativeComponent;
3
+ //# sourceMappingURL=DdPrivacyView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DdPrivacyView.d.ts","sourceRoot":"","sources":["../../../src/specs/DdPrivacyView.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,eAAe,KAEwB,CAAC;AAE9C,eAAe,eAAe,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ interface DdPrivacyViewProps extends ViewProps {
3
+ textAndInputPrivacy: string;
4
+ imagePrivacy: string;
5
+ touchPrivacy: string;
6
+ hide: boolean;
7
+ }
8
+ declare const _default: HostComponent<DdPrivacyViewProps>;
9
+ export default _default;
10
+ //# sourceMappingURL=DdPrivacyViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DdPrivacyViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/DdPrivacyViewNativeComponent.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,UAAU,kBAAmB,SAAQ,SAAS;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACjB;;AAED,wBAEwC"}
@@ -0,0 +1,4 @@
1
+ import type { DdPrivacyViewProps } from '../types/DdPrivacyView';
2
+ declare const DdPrivacyView: import("react-native").HostComponent<DdPrivacyViewProps>;
3
+ export default DdPrivacyView;
4
+ //# sourceMappingURL=DdPrivacyViewPaper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DdPrivacyViewPaper.d.ts","sourceRoot":"","sources":["../../../src/specs/DdPrivacyViewPaper.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,QAAA,MAAM,aAAa,0DAElB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ViewProps } from 'react-native';
2
+ export interface DdPrivacyViewProps extends ViewProps {
3
+ textAndInputPrivacy: string;
4
+ imagePrivacy: string;
5
+ touchPrivacy: string;
6
+ hide: boolean;
7
+ }
8
+ //# sourceMappingURL=DdPrivacyView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DdPrivacyView.d.ts","sourceRoot":"","sources":["../../../src/types/DdPrivacyView.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACjD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/mobile-react-native-session-replay",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "A client-side React Native module to enable session replay with Datadog",
5
5
  "keywords": [
6
6
  "datadog",
@@ -84,11 +84,11 @@
84
84
  },
85
85
  "codegenConfig": {
86
86
  "name": "DdSDKReactNativeSessionReplay",
87
- "type": "modules",
87
+ "type": "all",
88
88
  "jsSrcsDir": "./src/specs",
89
89
  "android": {
90
90
  "javaPackageName": "com.datadog.reactnative.sessionreplay"
91
91
  }
92
92
  },
93
- "gitHead": "a0d4f136f343b5d72ab7f79f442a6d75294e26c1"
93
+ "gitHead": "55a6d45ea4a84149093f52f1d14329d17031709e"
94
94
  }
@@ -0,0 +1,25 @@
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
+ import type { ViewProps } from 'react-native';
8
+ import React from 'react';
9
+
10
+ import { PrivacyView } from './PrivacyView';
11
+
12
+ /**
13
+ * A wrapper component that hides all of its content from session replays.
14
+ *
15
+ * When used, none of the children within this view will appear in the replay recording.
16
+ * This is useful for UI areas that contain sensitive or confidential information that should
17
+ * be completely excluded from visibility, not just masked.
18
+ */
19
+ export function HideView({ children, ...props }: ViewProps) {
20
+ return (
21
+ <PrivacyView {...props} hide={true}>
22
+ {children}
23
+ </PrivacyView>
24
+ );
25
+ }
@@ -0,0 +1,53 @@
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
+ import type { ViewProps } from 'react-native';
8
+ import React from 'react';
9
+
10
+ import {
11
+ ImagePrivacyLevel,
12
+ TextAndInputPrivacyLevel,
13
+ TouchPrivacyLevel
14
+ } from '../../SessionReplay';
15
+
16
+ import { PrivacyView } from './PrivacyView';
17
+
18
+ type Props = ViewProps & {
19
+ /**
20
+ * When true, allows touch interactions to be recorded.
21
+ * When false (default), touch interactions are hidden.
22
+ */
23
+ showTouch?: boolean;
24
+ };
25
+
26
+ /**
27
+ * A wrapper component that enforces full masking on all content within it.
28
+ *
29
+ * This includes:
30
+ * - Masking all text and input values (e.g., replacing them with asterisks)
31
+ * - Masking all images
32
+ * - Hiding or optionally showing touch interactions, depending on `showTouch`
33
+ *
34
+ * This component is useful for marking sensitive UI sections that should not be visible
35
+ * in session replays.
36
+ */
37
+ export function MaskAllView({ children, showTouch, ...props }: Props) {
38
+ const touchPrivacy = showTouch
39
+ ? TouchPrivacyLevel.SHOW
40
+ : TouchPrivacyLevel.HIDE;
41
+
42
+ return (
43
+ <PrivacyView
44
+ {...props}
45
+ textAndInputPrivacy={TextAndInputPrivacyLevel.MASK_ALL}
46
+ imagePrivacy={ImagePrivacyLevel.MASK_ALL}
47
+ touchPrivacy={touchPrivacy}
48
+ hide={false}
49
+ >
50
+ {children}
51
+ </PrivacyView>
52
+ );
53
+ }
@@ -0,0 +1,40 @@
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
+ import type { ViewProps } from 'react-native';
8
+ import React from 'react';
9
+
10
+ import {
11
+ ImagePrivacyLevel,
12
+ TextAndInputPrivacyLevel,
13
+ TouchPrivacyLevel
14
+ } from '../../SessionReplay';
15
+
16
+ import { PrivacyView } from './PrivacyView';
17
+
18
+ /**
19
+ * A wrapper component that applies minimal masking, allowing most content to appear as-is in session replays.
20
+ *
21
+ * Specifically:
22
+ * - Text and inputs are shown, except for sensitive fields (e.g., password fields), which are still masked.
23
+ * - Images are fully visible.
24
+ * - Touch interactions are recorded and visible.
25
+ *
26
+ * Use this component for UI areas where full visibility is acceptable and privacy concerns are minimal.
27
+ */
28
+ export function MaskNoneView({ children, ...props }: ViewProps) {
29
+ return (
30
+ <PrivacyView
31
+ {...props}
32
+ textAndInputPrivacy={TextAndInputPrivacyLevel.MASK_SENSITIVE_INPUTS}
33
+ imagePrivacy={ImagePrivacyLevel.MASK_NONE}
34
+ touchPrivacy={TouchPrivacyLevel.SHOW}
35
+ hide={false}
36
+ >
37
+ {children}
38
+ </PrivacyView>
39
+ );
40
+ }
@@ -0,0 +1,67 @@
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
+ import type { ViewProps } from 'react-native';
8
+ import React from 'react';
9
+
10
+ import type {
11
+ ImagePrivacyLevel,
12
+ TextAndInputPrivacyLevel,
13
+ TouchPrivacyLevel
14
+ } from '../../SessionReplay';
15
+ import View from '../../specs/DdPrivacyView';
16
+
17
+ type Props = ViewProps & {
18
+ /**
19
+ * Controls how text and input fields are masked in session replays.
20
+ */
21
+ textAndInputPrivacy?: TextAndInputPrivacyLevel;
22
+ /**
23
+ * Controls how images are masked in session replays.
24
+ */
25
+ imagePrivacy?: ImagePrivacyLevel;
26
+ /**
27
+ * Controls whether touch interactions are shown or hidden in session replays.
28
+ */
29
+ touchPrivacy?: TouchPrivacyLevel;
30
+ /**
31
+ * When true, completely hides this view and its children from session replays.
32
+ */
33
+ hide?: boolean;
34
+ };
35
+
36
+ /**
37
+ * A low-level component for configuring session replay privacy behavior with more granular control over the properties.
38
+ *
39
+ * Use this when none of the high-level components (`MaskAllView`, `MaskNoneView`, `HideView`)
40
+ * provide the level of customization you need.
41
+ *
42
+ * You can individually configure:
43
+ * - How text and inputs are masked
44
+ * - Whether images are shown or masked
45
+ * - Whether touch interactions are visible
46
+ * - Whether the entire view should be hidden from replays
47
+ */
48
+ export function PrivacyView({
49
+ children,
50
+ textAndInputPrivacy,
51
+ imagePrivacy,
52
+ touchPrivacy,
53
+ hide = false,
54
+ ...props
55
+ }: Props) {
56
+ return (
57
+ <View
58
+ {...props}
59
+ textAndInputPrivacy={textAndInputPrivacy as string}
60
+ imagePrivacy={imagePrivacy as string}
61
+ touchPrivacy={touchPrivacy as string}
62
+ hide={hide || false}
63
+ >
64
+ {children}
65
+ </View>
66
+ );
67
+ }
@@ -0,0 +1,34 @@
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
+ import { HideView } from './HideView';
8
+ import { MaskAllView } from './MaskAllView';
9
+ import { MaskNoneView } from './MaskNoneView';
10
+ import { PrivacyView } from './PrivacyView';
11
+
12
+ /**
13
+ * A collection of preconfigured React components for controlling privacy in Datadog Session Replay.
14
+ *
15
+ * These components can be used to control how different parts of the UI appear in session recordings:
16
+ *
17
+ * - `SessionReplayView.MaskAll`: Masks all text, inputs, and images. Hides touch interactions by default.
18
+ * Use for highly sensitive sections.
19
+ *
20
+ * - `SessionReplayView.MaskNone`: Displays most content as-is, except for sensitive inputs which are still masked.
21
+ * Use when visibility is safe and desired.
22
+ *
23
+ * - `SessionReplayView.Hide`: Completely hides the view and its children from session replays.
24
+ * Use for content that should not appear at all in recordings.
25
+ *
26
+ * - `SessionReplayView.Privacy`: A low-level configurable component for fine-tuned privacy control.
27
+ * Use this if none of the presets meet your needs.
28
+ */
29
+ export const SessionReplayView = {
30
+ Privacy: PrivacyView,
31
+ MaskAll: MaskAllView,
32
+ MaskNone: MaskNoneView,
33
+ Hide: HideView
34
+ };
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  TouchPrivacyLevel,
13
13
  TextAndInputPrivacyLevel
14
14
  } from './SessionReplay';
15
+ import { SessionReplayView } from './components/SessionReplayView';
15
16
 
16
17
  export {
17
18
  SessionReplay,
@@ -21,4 +22,6 @@ export {
21
22
  TextAndInputPrivacyLevel
22
23
  };
23
24
 
25
+ export { SessionReplayView };
26
+
24
27
  export type { SessionReplayConfiguration };
@@ -0,0 +1,17 @@
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
+ /* eslint-disable @typescript-eslint/no-var-requires */
8
+ import { UIManager } from 'react-native';
9
+
10
+ const isNewArch =
11
+ UIManager.getViewManagerConfig?.('DdPrivacyView') === undefined;
12
+
13
+ const NativeComponent = isNewArch
14
+ ? require('./DdPrivacyViewNativeComponent').default
15
+ : require('./DdPrivacyViewPaper').default;
16
+
17
+ export default NativeComponent;
@@ -0,0 +1,19 @@
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
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
8
+ import type { HostComponent, ViewProps } from 'react-native';
9
+
10
+ interface DdPrivacyViewProps extends ViewProps {
11
+ textAndInputPrivacy: string;
12
+ imagePrivacy: string;
13
+ touchPrivacy: string;
14
+ hide: boolean;
15
+ }
16
+
17
+ export default codegenNativeComponent<DdPrivacyViewProps>('DdPrivacyView', {
18
+ paperComponentName: 'DdPrivacyView'
19
+ }) as HostComponent<DdPrivacyViewProps>;
@@ -0,0 +1,15 @@
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
+ import { requireNativeComponent } from 'react-native';
8
+
9
+ import type { DdPrivacyViewProps } from '../types/DdPrivacyView';
10
+
11
+ const DdPrivacyView = requireNativeComponent<DdPrivacyViewProps>(
12
+ 'DdPrivacyView'
13
+ );
14
+
15
+ export default DdPrivacyView;
@@ -0,0 +1,14 @@
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
+ import type { ViewProps } from 'react-native';
8
+
9
+ export interface DdPrivacyViewProps extends ViewProps {
10
+ textAndInputPrivacy: string;
11
+ imagePrivacy: string;
12
+ touchPrivacy: string;
13
+ hide: boolean;
14
+ }