@amplitude/session-replay-react-native 0.1.0-beta.2 → 0.1.0-beta.3
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/AmplitudeSessionReplayReactNative.podspec +2 -43
- package/README.md +3 -113
- package/android/build.gradle +19 -127
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeModule.kt +5 -35
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativePackage.kt +4 -2
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/AmpMaskViewManager.kt +48 -0
- package/ios/AmpMaskApplier.h +22 -0
- package/ios/AmpMaskApplier.m +21 -0
- package/ios/NativeSessionReplay.swift +8 -29
- package/ios/fabric/AMPMaskComponentView.h +17 -0
- package/ios/fabric/AMPMaskComponentView.mm +78 -0
- package/lib/commonjs/amp-mask-view.js +9 -2
- package/lib/commonjs/amp-mask-view.js.map +1 -1
- package/lib/commonjs/index.js +0 -19
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/{SRMaskViewNativeComponent.js → AmpMaskViewNativeComponent.js} +7 -2
- package/lib/commonjs/specs/AmpMaskViewNativeComponent.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/amp-mask-view.js +8 -2
- package/lib/module/amp-mask-view.js.map +1 -1
- package/lib/module/index.js +0 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/AmpMaskViewNativeComponent.js +10 -0
- package/lib/module/specs/AmpMaskViewNativeComponent.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/amp-mask-view.d.ts +4 -4
- package/lib/typescript/amp-mask-view.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -12
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/specs/{SRMaskViewNativeComponent.d.ts → AmpMaskViewNativeComponent.d.ts} +2 -4
- package/lib/typescript/specs/AmpMaskViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/amp-mask-view.tsx +11 -3
- package/src/index.tsx +1 -19
- package/src/specs/AmpMaskViewNativeComponent.ts +17 -0
- package/src/version.ts +1 -1
- package/android/src/androidTest/java/com/amplitude/sessionreplayreactnative/SRMaskViewTest.kt +0 -459
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRDefaultMaskingPrimitive.kt +0 -36
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRMaskingPrimitive.kt +0 -84
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskView.kt +0 -174
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewManager.kt +0 -44
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewPointerEvents.java +0 -36
- package/cpp/SRMaskViewComponentDescriptor.h +0 -20
- package/cpp/SRMaskViewShadowNode.cpp +0 -54
- package/cpp/SRMaskViewShadowNode.h +0 -56
- package/ios/SRDefaultMaskingPrimitive.swift +0 -34
- package/ios/SRMaskingPrimitive.h +0 -26
- package/ios/SRMaskingRegistry.m +0 -105
- package/ios/fabric/SRMaskView.h +0 -10
- package/ios/fabric/SRMaskView.mm +0 -178
- package/lib/commonjs/Mask.types.js +0 -29
- package/lib/commonjs/Mask.types.js.map +0 -1
- package/lib/commonjs/fabric/MaskFabric.js +0 -92
- package/lib/commonjs/fabric/MaskFabric.js.map +0 -1
- package/lib/commonjs/mask-fallback.js +0 -53
- package/lib/commonjs/mask-fallback.js.map +0 -1
- package/lib/commonjs/paper/MaskPaper.js +0 -27
- package/lib/commonjs/paper/MaskPaper.js.map +0 -1
- package/lib/commonjs/specs/SRMaskViewNativeComponent.js.map +0 -1
- package/lib/module/Mask.types.js +0 -23
- package/lib/module/Mask.types.js.map +0 -1
- package/lib/module/fabric/MaskFabric.js +0 -85
- package/lib/module/fabric/MaskFabric.js.map +0 -1
- package/lib/module/mask-fallback.js +0 -45
- package/lib/module/mask-fallback.js.map +0 -1
- package/lib/module/paper/MaskPaper.js +0 -21
- package/lib/module/paper/MaskPaper.js.map +0 -1
- package/lib/module/specs/SRMaskViewNativeComponent.js +0 -5
- package/lib/module/specs/SRMaskViewNativeComponent.js.map +0 -1
- package/lib/typescript/Mask.types.d.ts +0 -38
- package/lib/typescript/Mask.types.d.ts.map +0 -1
- package/lib/typescript/fabric/MaskFabric.d.ts +0 -8
- package/lib/typescript/fabric/MaskFabric.d.ts.map +0 -1
- package/lib/typescript/mask-fallback.d.ts +0 -27
- package/lib/typescript/mask-fallback.d.ts.map +0 -1
- package/lib/typescript/paper/MaskPaper.d.ts +0 -10
- package/lib/typescript/paper/MaskPaper.d.ts.map +0 -1
- package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts.map +0 -1
- package/src/Mask.types.ts +0 -45
- package/src/fabric/MaskFabric.tsx +0 -73
- package/src/mask-fallback.tsx +0 -60
- package/src/paper/MaskPaper.tsx +0 -24
- package/src/specs/SRMaskViewNativeComponent.ts +0 -12
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Guard first (before any #import): the podspec compiles ios/** on both
|
|
2
|
+
// architectures and this file must be a no-op on old-arch installs.
|
|
3
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
+
|
|
5
|
+
#import "AMPMaskComponentView.h"
|
|
6
|
+
|
|
7
|
+
#import "../AmpMaskApplier.h"
|
|
8
|
+
|
|
9
|
+
#import <React/RCTComponentViewFactory.h>
|
|
10
|
+
#import <react/renderer/components/AmpSessionReplaySpec/ComponentDescriptors.h>
|
|
11
|
+
#import <react/renderer/components/AmpSessionReplaySpec/Props.h>
|
|
12
|
+
#import <react/renderer/components/AmpSessionReplaySpec/RCTComponentViewHelpers.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
// Fabric host view for `<AmpMaskView>` (native name AMPMaskComponentView) on
|
|
17
|
+
// the New Architecture. A NORMAL layout node: default RCTViewComponentView
|
|
18
|
+
// layout, codegen-generated ComponentDescriptor (plain Yoga, no custom
|
|
19
|
+
// ShadowNode). Its only job is to tag ITSELF for the Session Replay recorder —
|
|
20
|
+
// the same self-tagging model as the legacy Paper manager
|
|
21
|
+
// (RCTAmpMaskViewManager.m), which keeps serving old-architecture apps under
|
|
22
|
+
// the same component name. Registering this class makes Fabric resolve the
|
|
23
|
+
// name here instead of falling back to the legacy-interop shim, whose
|
|
24
|
+
// out-of-band re-parenting mis-renders nested mask/unmask subtrees.
|
|
25
|
+
@interface AMPMaskComponentView () <RCTAMPMaskComponentViewViewProtocol>
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
@implementation AMPMaskComponentView
|
|
29
|
+
|
|
30
|
+
+ (void)load
|
|
31
|
+
{
|
|
32
|
+
[RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:self];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
36
|
+
{
|
|
37
|
+
if (self = [super initWithFrame:frame]) {
|
|
38
|
+
static const auto defaultProps = std::make_shared<const AMPMaskComponentViewProps>();
|
|
39
|
+
_props = defaultProps;
|
|
40
|
+
}
|
|
41
|
+
return self;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
45
|
+
{
|
|
46
|
+
return concreteComponentDescriptorProvider<AMPMaskComponentViewComponentDescriptor>();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
|
|
50
|
+
{
|
|
51
|
+
const auto &newViewProps = *std::static_pointer_cast<const AMPMaskComponentViewProps>(props);
|
|
52
|
+
[super updateProps:props oldProps:oldProps];
|
|
53
|
+
// Applied unconditionally (not diffed): a recycled instance is reset in
|
|
54
|
+
// prepareForRecycle and must be re-tagged on every (re)mount.
|
|
55
|
+
[AmpMaskApplier applyMask:[NSString stringWithUTF8String:newViewProps.mask.c_str()] toView:self];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void)prepareForRecycle
|
|
59
|
+
{
|
|
60
|
+
// Fabric reuses component-view instances under new tags; reset to the
|
|
61
|
+
// masked (fail-closed) state so a recycled view never inherits a stale
|
|
62
|
+
// UNMASKED marker before updateProps re-applies its real mask value.
|
|
63
|
+
[AmpMaskApplier resetView:self];
|
|
64
|
+
[super prepareForRecycle];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@end
|
|
68
|
+
|
|
69
|
+
// extern "C": RN <= 0.76 generates RCTThirdPartyFabricComponentsProvider.mm
|
|
70
|
+
// declaring this lookup function with C linkage; without it the app link on
|
|
71
|
+
// those versions fails with "Undefined symbols: _AMPMaskComponentViewCls".
|
|
72
|
+
// RN >= 0.77 resolves the class by name (NSClassFromString) and ignores this.
|
|
73
|
+
extern "C" Class AMPMaskComponentViewCls(void)
|
|
74
|
+
{
|
|
75
|
+
return AMPMaskComponentView.class;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.AmpMaskView = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var _AmpMaskViewNativeComponent = _interopRequireDefault(require("./specs/AmpMaskViewNativeComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// A normal layout node (lays out exactly like a plain <View>) that tags itself
|
|
10
|
+
// for the Session Replay recorder. On the New Architecture it is a real Fabric
|
|
11
|
+
// component, so it does not go through React Native's legacy-interop layer
|
|
12
|
+
// (whose out-of-band re-parenting mis-renders nested mask/unmask subtrees).
|
|
13
|
+
// The spec widens `mask` to string for codegen; the public prop stays required
|
|
14
|
+
// and union-typed.
|
|
15
|
+
const AmpMaskView = exports.AmpMaskView = _AmpMaskViewNativeComponent.default;
|
|
9
16
|
//# sourceMappingURL=amp-mask-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_AmpMaskViewNativeComponent","_interopRequireDefault","require","e","__esModule","default","AmpMaskView","exports","NativeAmpMaskView"],"sourceRoot":"../../src","sources":["amp-mask-view.tsx"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmE,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMnE;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,mCAAoD","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.AmpMask = void 0;
|
|
7
6
|
Object.defineProperty(exports, "AmpMaskView", {
|
|
8
7
|
enumerable: true,
|
|
9
8
|
get: function () {
|
|
10
9
|
return _ampMaskView.AmpMaskView;
|
|
11
10
|
}
|
|
12
11
|
});
|
|
13
|
-
exports.AmpUnmask = void 0;
|
|
14
12
|
Object.defineProperty(exports, "SessionReplayPlugin", {
|
|
15
13
|
enumerable: true,
|
|
16
14
|
get: function () {
|
|
@@ -68,21 +66,4 @@ Object.defineProperty(exports, "stop", {
|
|
|
68
66
|
var _sessionReplay = require("./session-replay");
|
|
69
67
|
var _pluginSessionReplay = require("./plugin-session-replay");
|
|
70
68
|
var _ampMaskView = require("./amp-mask-view");
|
|
71
|
-
const g = global;
|
|
72
|
-
const isNewArch = g.RN$Bridgeless === true || g.nativeFabricUIManager != null;
|
|
73
|
-
/**
|
|
74
|
-
* Layout-transparent Session Replay masking.
|
|
75
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
76
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
77
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
78
|
-
* @experimental Subject to change while experimental.
|
|
79
|
-
*/
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
|
81
|
-
const {
|
|
82
|
-
AmpMask,
|
|
83
|
-
AmpUnmask
|
|
84
|
-
} = isNewArch ? require('./fabric/MaskFabric') : require('./paper/MaskPaper');
|
|
85
|
-
// Named AmpMaskLevel because `MaskLevel` is already exported from './session-replay-config'.
|
|
86
|
-
exports.AmpUnmask = AmpUnmask;
|
|
87
|
-
exports.AmpMask = AmpMask;
|
|
88
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sessionReplay","require","_pluginSessionReplay","_ampMaskView"
|
|
1
|
+
{"version":3,"names":["_sessionReplay","require","_pluginSessionReplay","_ampMaskView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAYA,IAAAC,oBAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAF,OAAA","ignoreList":[]}
|
|
@@ -7,5 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member */
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
// Same native name on both architectures: on the New Architecture this resolves
|
|
11
|
+
// to the Fabric AMPMaskComponentView (ios/fabric, android/src/newarch); on the
|
|
12
|
+
// old architecture codegenNativeComponent falls back to
|
|
13
|
+
// requireNativeComponent('AMPMaskComponentView'), which resolves to the
|
|
14
|
+
// unchanged legacy Paper view managers.
|
|
15
|
+
var _default = exports.default = (0, _codegenNativeComponent.default)('AMPMaskComponentView');
|
|
16
|
+
//# sourceMappingURL=AmpMaskViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/AmpMaskViewNativeComponent.ts"],"mappings":";;;;;;AAGA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH7F;AAWA;AACA;AACA;AACA;AACA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GACe,IAAAG,+BAAsB,EAAc,sBAAsB,CAAC","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import NativeAmpMaskView from './specs/AmpMaskViewNativeComponent';
|
|
2
|
+
// A normal layout node (lays out exactly like a plain <View>) that tags itself
|
|
3
|
+
// for the Session Replay recorder. On the New Architecture it is a real Fabric
|
|
4
|
+
// component, so it does not go through React Native's legacy-interop layer
|
|
5
|
+
// (whose out-of-band re-parenting mis-renders nested mask/unmask subtrees).
|
|
6
|
+
// The spec widens `mask` to string for codegen; the public prop stays required
|
|
7
|
+
// and union-typed.
|
|
8
|
+
export const AmpMaskView = NativeAmpMaskView;
|
|
3
9
|
//# sourceMappingURL=amp-mask-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NativeAmpMaskView","AmpMaskView"],"sourceRoot":"../../src","sources":["amp-mask-view.tsx"],"mappings":"AAEA,OAAOA,iBAAiB,MAAM,oCAAoC;AAMlE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGD,iBAAoD","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
export { init, setSessionId, getSessionId, getSessionReplayProperties, flush, start, stop, setDeviceId } from './session-replay';
|
|
2
2
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
3
3
|
export { AmpMaskView } from './amp-mask-view';
|
|
4
|
-
const g = global;
|
|
5
|
-
const isNewArch = g.RN$Bridgeless === true || g.nativeFabricUIManager != null;
|
|
6
|
-
/**
|
|
7
|
-
* Layout-transparent Session Replay masking.
|
|
8
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
9
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
10
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
11
|
-
* @experimental Subject to change while experimental.
|
|
12
|
-
*/
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
|
14
|
-
export const {
|
|
15
|
-
AmpMask,
|
|
16
|
-
AmpUnmask
|
|
17
|
-
} = isNewArch ? require('./fabric/MaskFabric') : require('./paper/MaskPaper');
|
|
18
|
-
// Named AmpMaskLevel because `MaskLevel` is already exported from './session-replay-config'.
|
|
19
4
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["init","setSessionId","getSessionId","getSessionReplayProperties","flush","start","stop","setDeviceId","SessionReplayPlugin","AmpMaskView"
|
|
1
|
+
{"version":3,"names":["init","setSessionId","getSessionId","getSessionReplayProperties","flush","start","stop","setDeviceId","SessionReplayPlugin","AmpMaskView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SACEA,IAAI,EACJC,YAAY,EACZC,YAAY,EACZC,0BAA0B,EAC1BC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,WAAW,QACN,kBAAkB;AAGzB,SAASC,mBAAmB,QAAQ,yBAAyB;AAG7D,SAASC,WAAW,QAA+B,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member */
|
|
2
|
+
|
|
3
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
4
|
+
// Same native name on both architectures: on the New Architecture this resolves
|
|
5
|
+
// to the Fabric AMPMaskComponentView (ios/fabric, android/src/newarch); on the
|
|
6
|
+
// old architecture codegenNativeComponent falls back to
|
|
7
|
+
// requireNativeComponent('AMPMaskComponentView'), which resolves to the
|
|
8
|
+
// unchanged legacy Paper view managers.
|
|
9
|
+
export default codegenNativeComponent('AMPMaskComponentView');
|
|
10
|
+
//# sourceMappingURL=AmpMaskViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/AmpMaskViewNativeComponent.ts"],"mappings":"AAAA;;AAGA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F;AACA;AACA;AACA;AACA;AACA,eAAeA,sBAAsB,CAAc,sBAAsB,CAAC","ignoreList":[]}
|
package/lib/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.3';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
export interface AmpMaskViewProps extends ViewProps {
|
|
3
4
|
mask: 'amp-mask' | 'amp-unmask' | 'amp-block';
|
|
4
5
|
}
|
|
5
|
-
export declare const AmpMaskView:
|
|
6
|
-
export {};
|
|
6
|
+
export declare const AmpMaskView: ComponentType<AmpMaskViewProps>;
|
|
7
7
|
//# sourceMappingURL=amp-mask-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amp-mask-view.d.ts","sourceRoot":"","sources":["../../src/amp-mask-view.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"amp-mask-view.d.ts","sourceRoot":"","sources":["../../src/amp-mask-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;CAC/C;AAQD,eAAO,MAAM,WAAW,iCAAuD,CAAC"}
|
|
@@ -2,16 +2,5 @@ export { init, setSessionId, getSessionId, getSessionReplayProperties, flush, st
|
|
|
2
2
|
export { type SessionReplayConfig, type MaskLevel, type PrivacyConfig } from './session-replay-config';
|
|
3
3
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
4
4
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
5
|
-
export { AmpMaskView } from './amp-mask-view';
|
|
6
|
-
import type { ComponentType } from 'react';
|
|
7
|
-
import type { MaskProps, UnmaskProps } from './Mask.types';
|
|
8
|
-
/**
|
|
9
|
-
* Layout-transparent Session Replay masking.
|
|
10
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
11
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
12
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
13
|
-
* @experimental Subject to change while experimental.
|
|
14
|
-
*/
|
|
15
|
-
export declare const AmpMask: ComponentType<MaskProps>, AmpUnmask: ComponentType<UnmaskProps>;
|
|
16
|
-
export type { MaskProps, UnmaskProps, AmpMaskLevel } from './Mask.types';
|
|
5
|
+
export { AmpMaskView, type AmpMaskViewProps } from './amp-mask-view';
|
|
17
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/lib/typescript/specs/{SRMaskViewNativeComponent.d.ts → AmpMaskViewNativeComponent.d.ts}
RENAMED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
4
|
export interface NativeProps extends ViewProps {
|
|
5
|
-
|
|
6
|
-
unmask?: WithDefault<boolean, false>;
|
|
7
|
-
maskLevel?: WithDefault<string, 'mask'>;
|
|
5
|
+
mask?: WithDefault<string, 'amp-mask'>;
|
|
8
6
|
}
|
|
9
7
|
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
10
8
|
export default _default;
|
|
11
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=AmpMaskViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmpMaskViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/AmpMaskViewNativeComponent.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAG5C,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACxC;;AAOD,wBAA2E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/session-replay-react-native",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"description": "Amplitude Session Replay for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"ios": {
|
|
72
72
|
"componentProvider": {
|
|
73
|
-
"
|
|
73
|
+
"AMPMaskComponentView": "AMPMaskComponentView"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
},
|
package/src/amp-mask-view.tsx
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import NativeAmpMaskView from './specs/AmpMaskViewNativeComponent';
|
|
2
4
|
|
|
3
|
-
interface AmpMaskViewProps extends ViewProps {
|
|
5
|
+
export interface AmpMaskViewProps extends ViewProps {
|
|
4
6
|
mask: 'amp-mask' | 'amp-unmask' | 'amp-block';
|
|
5
7
|
}
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
// A normal layout node (lays out exactly like a plain <View>) that tags itself
|
|
10
|
+
// for the Session Replay recorder. On the New Architecture it is a real Fabric
|
|
11
|
+
// component, so it does not go through React Native's legacy-interop layer
|
|
12
|
+
// (whose out-of-band re-parenting mis-renders nested mask/unmask subtrees).
|
|
13
|
+
// The spec widens `mask` to string for codegen; the public prop stays required
|
|
14
|
+
// and union-typed.
|
|
15
|
+
export const AmpMaskView = NativeAmpMaskView as ComponentType<AmpMaskViewProps>;
|
package/src/index.tsx
CHANGED
|
@@ -13,22 +13,4 @@ export { type SessionReplayConfig, type MaskLevel, type PrivacyConfig } from './
|
|
|
13
13
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
14
14
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
15
15
|
|
|
16
|
-
export { AmpMaskView } from './amp-mask-view';
|
|
17
|
-
|
|
18
|
-
import type { ComponentType } from 'react';
|
|
19
|
-
import type { MaskProps, UnmaskProps } from './Mask.types';
|
|
20
|
-
|
|
21
|
-
const g = global as unknown as { RN$Bridgeless?: boolean; nativeFabricUIManager?: unknown };
|
|
22
|
-
const isNewArch = g.RN$Bridgeless === true || g.nativeFabricUIManager != null;
|
|
23
|
-
/**
|
|
24
|
-
* Layout-transparent Session Replay masking.
|
|
25
|
-
* `<AmpMask>` masks its children; `<AmpUnmask>` exempts children inside a masked region.
|
|
26
|
-
* Requires the New Architecture (React Native >= 0.77). On the Old Architecture:
|
|
27
|
-
* throws in dev, falls back to `<AmpMaskView>` (masked but layout-unsafe) in prod.
|
|
28
|
-
* @experimental Subject to change while experimental.
|
|
29
|
-
*/
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
|
31
|
-
export const { AmpMask, AmpUnmask }: { AmpMask: ComponentType<MaskProps>; AmpUnmask: ComponentType<UnmaskProps> } =
|
|
32
|
-
isNewArch ? require('./fabric/MaskFabric') : require('./paper/MaskPaper');
|
|
33
|
-
// Named AmpMaskLevel because `MaskLevel` is already exported from './session-replay-config'.
|
|
34
|
-
export type { MaskProps, UnmaskProps, AmpMaskLevel } from './Mask.types';
|
|
16
|
+
export { AmpMaskView, type AmpMaskViewProps } from './amp-mask-view';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member */
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
5
|
+
|
|
6
|
+
export interface NativeProps extends ViewProps {
|
|
7
|
+
// 'amp-mask' | 'amp-unmask' | 'amp-block' as a codegen-compatible string;
|
|
8
|
+
// unknown values fail safe to masking.
|
|
9
|
+
mask?: WithDefault<string, 'amp-mask'>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Same native name on both architectures: on the New Architecture this resolves
|
|
13
|
+
// to the Fabric AMPMaskComponentView (ios/fabric, android/src/newarch); on the
|
|
14
|
+
// old architecture codegenNativeComponent falls back to
|
|
15
|
+
// requireNativeComponent('AMPMaskComponentView'), which resolves to the
|
|
16
|
+
// unchanged legacy Paper view managers.
|
|
17
|
+
export default codegenNativeComponent<NativeProps>('AMPMaskComponentView');
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.3';
|