@amplitude/session-replay-react-native 0.1.0-beta.1 → 0.1.0-beta.2
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 +43 -2
- package/README.md +112 -0
- package/android/build.gradle +127 -9
- package/android/src/androidTest/java/com/amplitude/sessionreplayreactnative/SRMaskViewTest.kt +459 -0
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRDefaultMaskingPrimitive.kt +36 -0
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRMaskingPrimitive.kt +84 -0
- package/android/src/main/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeModule.kt +35 -5
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativePackage.kt +2 -1
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskView.kt +174 -0
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewManager.kt +44 -0
- package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewPointerEvents.java +36 -0
- package/cpp/SRMaskViewComponentDescriptor.h +20 -0
- package/cpp/SRMaskViewShadowNode.cpp +54 -0
- package/cpp/SRMaskViewShadowNode.h +56 -0
- package/ios/NativeSessionReplay.swift +29 -8
- package/ios/SRDefaultMaskingPrimitive.swift +34 -0
- package/ios/SRMaskingPrimitive.h +26 -0
- package/ios/SRMaskingRegistry.m +105 -0
- package/ios/fabric/SRMaskView.h +10 -0
- package/ios/fabric/SRMaskView.mm +178 -0
- package/lib/commonjs/Mask.types.js +29 -0
- package/lib/commonjs/Mask.types.js.map +1 -0
- package/lib/commonjs/fabric/MaskFabric.js +92 -0
- package/lib/commonjs/fabric/MaskFabric.js.map +1 -0
- package/lib/commonjs/index.js +19 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mask-fallback.js +53 -0
- package/lib/commonjs/mask-fallback.js.map +1 -0
- package/lib/commonjs/paper/MaskPaper.js +27 -0
- package/lib/commonjs/paper/MaskPaper.js.map +1 -0
- package/lib/commonjs/specs/SRMaskViewNativeComponent.js +11 -0
- package/lib/commonjs/specs/SRMaskViewNativeComponent.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/Mask.types.js +23 -0
- package/lib/module/Mask.types.js.map +1 -0
- package/lib/module/fabric/MaskFabric.js +85 -0
- package/lib/module/fabric/MaskFabric.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mask-fallback.js +45 -0
- package/lib/module/mask-fallback.js.map +1 -0
- package/lib/module/paper/MaskPaper.js +21 -0
- package/lib/module/paper/MaskPaper.js.map +1 -0
- package/lib/module/specs/SRMaskViewNativeComponent.js +5 -0
- package/lib/module/specs/SRMaskViewNativeComponent.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/Mask.types.d.ts +38 -0
- package/lib/typescript/Mask.types.d.ts.map +1 -0
- package/lib/typescript/fabric/MaskFabric.d.ts +8 -0
- package/lib/typescript/fabric/MaskFabric.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +11 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/mask-fallback.d.ts +27 -0
- package/lib/typescript/mask-fallback.d.ts.map +1 -0
- package/lib/typescript/paper/MaskPaper.d.ts +10 -0
- package/lib/typescript/paper/MaskPaper.d.ts.map +1 -0
- package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts +11 -0
- package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +11 -6
- package/src/Mask.types.ts +45 -0
- package/src/fabric/MaskFabric.tsx +73 -0
- package/src/index.tsx +18 -0
- package/src/mask-fallback.tsx +60 -0
- package/src/paper/MaskPaper.tsx +24 -0
- package/src/specs/SRMaskViewNativeComponent.ts +12 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AmpMaskView } from './amp-mask-view';
|
|
4
|
+
import { ampMaskViewMaskProp } from './Mask.types';
|
|
5
|
+
let warned = false;
|
|
6
|
+
|
|
7
|
+
/** Logs at most one degraded-masking error per app session, across all fallback paths. */
|
|
8
|
+
export function warnOnce(message) {
|
|
9
|
+
if (!warned) {
|
|
10
|
+
warned = true;
|
|
11
|
+
console.error(message);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds an `<AmpMask>`/`<AmpUnmask>` stand-in that renders through the Paper
|
|
16
|
+
* `<AmpMaskView>`: privacy-safe (content stays masked) but not
|
|
17
|
+
* layout-transparent. Used when the Fabric `SRMaskView` isn't available —
|
|
18
|
+
* Old-Architecture apps and New-Architecture build misconfigurations.
|
|
19
|
+
*
|
|
20
|
+
* Fail-closed rules, enforced at runtime because untyped callers can spread
|
|
21
|
+
* arbitrary props even though the public types omit them:
|
|
22
|
+
* `style`/`enabled`/`mask` are stripped, and the forced `mask` value is
|
|
23
|
+
* applied after the caller's props so it can never be overridden.
|
|
24
|
+
*/
|
|
25
|
+
export function createAmpMaskViewFallback(options) {
|
|
26
|
+
return function AmpMaskViewFallback(props) {
|
|
27
|
+
if (options.devThrowMessage !== undefined && __DEV__) {
|
|
28
|
+
throw new Error(options.devThrowMessage);
|
|
29
|
+
}
|
|
30
|
+
warnOnce(options.warning);
|
|
31
|
+
const {
|
|
32
|
+
children,
|
|
33
|
+
maskLevel,
|
|
34
|
+
style: _style,
|
|
35
|
+
enabled: _enabled,
|
|
36
|
+
mask: _mask,
|
|
37
|
+
...safeProps
|
|
38
|
+
} = props;
|
|
39
|
+
const mask = options.mask === 'amp-unmask' ? 'amp-unmask' : ampMaskViewMaskProp(maskLevel);
|
|
40
|
+
return /*#__PURE__*/React.createElement(AmpMaskView, _extends({}, safeProps, {
|
|
41
|
+
mask: mask
|
|
42
|
+
}), children);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=mask-fallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AmpMaskView","ampMaskViewMaskProp","warned","warnOnce","message","console","error","createAmpMaskViewFallback","options","AmpMaskViewFallback","props","devThrowMessage","undefined","__DEV__","Error","warning","children","maskLevel","style","_style","enabled","_enabled","mask","_mask","safeProps","createElement","_extends"],"sourceRoot":"../../src","sources":["mask-fallback.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,mBAAmB,QAAQ,cAAc;AAGlD,IAAIC,MAAM,GAAG,KAAK;;AAElB;AACA,OAAO,SAASC,QAAQA,CAACC,OAAe,EAAE;EACxC,IAAI,CAACF,MAAM,EAAE;IACXA,MAAM,GAAG,IAAI;IACbG,OAAO,CAACC,KAAK,CAACF,OAAO,CAAC;EACxB;AACF;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,yBAAyBA,CACvCC,OAAwB,EACI;EAC5B,OAAO,SAASC,mBAAmBA,CAACC,KAAQ,EAAE;IAC5C,IAAIF,OAAO,CAACG,eAAe,KAAKC,SAAS,IAAIC,OAAO,EAAE;MACpD,MAAM,IAAIC,KAAK,CAACN,OAAO,CAACG,eAAe,CAAC;IAC1C;IACAR,QAAQ,CAACK,OAAO,CAACO,OAAO,CAAC;IACzB,MAAM;MACJC,QAAQ;MACRC,SAAS;MACTC,KAAK,EAAEC,MAAM;MACbC,OAAO,EAAEC,QAAQ;MACjBC,IAAI,EAAEC,KAAK;MACX,GAAGC;IACL,CAAC,GAAGd,KAA6F;IACjG,MAAMY,IAAI,GAAGd,OAAO,CAACc,IAAI,KAAK,YAAY,GAAG,YAAY,GAAGrB,mBAAmB,CAACgB,SAAS,CAAC;IAC1F,oBACElB,KAAA,CAAA0B,aAAA,CAACzB,WAAW,EAAA0B,QAAA,KAAKF,SAAS;MAAEF,IAAI,EAAEA;IAAK,IACpCN,QACU,CAAC;EAElB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createAmpMaskViewFallback } from '../mask-fallback';
|
|
2
|
+
const MSG = '<AmpMask> requires the New Architecture. Use <AmpMaskView> on the Old Architecture.';
|
|
3
|
+
const WARNING = '[AmpMask] Old Architecture detected — falling back to AmpMaskView (layout-unsafe). Use <AmpMaskView> on Old Arch.';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Old-Architecture guard: dev builds throw (the developer is using an
|
|
7
|
+
* unsupported component); production falls back to `<AmpMaskView>` —
|
|
8
|
+
* privacy-safe but layout-unsafe. `enabled` is ignored: the fallback fails
|
|
9
|
+
* toward privacy.
|
|
10
|
+
*/
|
|
11
|
+
export const AmpMask = createAmpMaskViewFallback({
|
|
12
|
+
mask: 'from-maskLevel',
|
|
13
|
+
warning: WARNING,
|
|
14
|
+
devThrowMessage: MSG
|
|
15
|
+
});
|
|
16
|
+
export const AmpUnmask = createAmpMaskViewFallback({
|
|
17
|
+
mask: 'amp-unmask',
|
|
18
|
+
warning: WARNING,
|
|
19
|
+
devThrowMessage: MSG
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=MaskPaper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAmpMaskViewFallback","MSG","WARNING","AmpMask","mask","warning","devThrowMessage","AmpUnmask"],"sourceRoot":"../../../src","sources":["paper/MaskPaper.tsx"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,kBAAkB;AAG5D,MAAMC,GAAG,GAAG,qFAAqF;AACjG,MAAMC,OAAO,GACX,mHAAmH;;AAErH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,GAAGH,yBAAyB,CAAY;EAC1DI,IAAI,EAAE,gBAAgB;EACtBC,OAAO,EAAEH,OAAO;EAChBI,eAAe,EAAEL;AACnB,CAAC,CAAC;AAEF,OAAO,MAAMM,SAAS,GAAGP,yBAAyB,CAAc;EAC9DI,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAEH,OAAO;EAChBI,eAAe,EAAEL;AACnB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default codegenNativeComponent('SRMaskView');
|
|
5
|
+
//# sourceMappingURL=SRMaskViewNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/SRMaskViewNativeComponent.ts"],"mappings":"AAAA;;AAGA,OAAOA,sBAAsB,MAAM,yDAAyD;AAQ5F,eAAeA,sBAAsB,CAAc,YAAY,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.2';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/** Masking level for `<AmpMask>`. See {@link MaskProps.maskLevel}. */
|
|
4
|
+
export type AmpMaskLevel = 'mask' | 'block';
|
|
5
|
+
/**
|
|
6
|
+
* Props for `<AmpMask>`, which masks its children in Session Replay
|
|
7
|
+
* recordings without affecting their layout.
|
|
8
|
+
*
|
|
9
|
+
* `style` is not supported: the wrapper is layout-transparent and never
|
|
10
|
+
* carries a layout box of its own, so styles would have no effect.
|
|
11
|
+
*/
|
|
12
|
+
export interface MaskProps extends Omit<ViewProps, 'style'> {
|
|
13
|
+
/**
|
|
14
|
+
* When false, children are rendered without masking.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Masking level applied to children. On iOS, 'mask' and 'block' currently
|
|
20
|
+
* behave identically (both fully block).
|
|
21
|
+
* @default 'mask'
|
|
22
|
+
*/
|
|
23
|
+
maskLevel?: AmpMaskLevel;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for `<AmpUnmask>`, which exempts its children from masking inside a
|
|
28
|
+
* masked region, without affecting their layout.
|
|
29
|
+
*
|
|
30
|
+
* `style` is not supported: the wrapper is layout-transparent and never
|
|
31
|
+
* carries a layout box of its own, so styles would have no effect.
|
|
32
|
+
*/
|
|
33
|
+
export interface UnmaskProps extends Omit<ViewProps, 'style'> {
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/** Maps the public {@link AmpMaskLevel} to the `<AmpMaskView>` `mask` prop value. */
|
|
37
|
+
export declare function ampMaskViewMaskProp(level?: AmpMaskLevel): 'amp-mask' | 'amp-block';
|
|
38
|
+
//# sourceMappingURL=Mask.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mask.types.d.ts","sourceRoot":"","sources":["../../src/Mask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;IACzD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC;IAC3D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,WAAW,CAElF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MaskProps, UnmaskProps } from '../Mask.types';
|
|
3
|
+
declare function MaskImpl({ enabled, maskLevel, children, ...vp }: MaskProps): React.JSX.Element;
|
|
4
|
+
declare function UnmaskImpl({ children, ...vp }: UnmaskProps): React.JSX.Element;
|
|
5
|
+
export declare const AmpMask: typeof MaskImpl;
|
|
6
|
+
export declare const AmpUnmask: typeof UnmaskImpl;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=MaskFabric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaskFabric.d.ts","sourceRoot":"","sources":["../../../src/fabric/MaskFabric.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAoB5D,iBAAS,QAAQ,CAAC,EAAE,OAAc,EAAE,SAAkB,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,qBAMnF;AACD,iBAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,WAAW,qBAMnD;AAkCD,eAAO,MAAM,OAAO,iBAAuF,CAAC;AAC5G,eAAO,MAAM,SAAS,mBAA2F,CAAC"}
|
|
@@ -3,4 +3,15 @@ export { type SessionReplayConfig, type MaskLevel, type PrivacyConfig } from './
|
|
|
3
3
|
export { SessionReplayPlugin } from './plugin-session-replay';
|
|
4
4
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
5
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';
|
|
6
17
|
//# 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,MAAM,iBAAiB,CAAC"}
|
|
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,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3D;;;;;;GAMG;AAEH,eAAO,MAAQ,OAAO,4BAAE,SAAS,4BAC0C,CAAC;AAE5E,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** Logs at most one degraded-masking error per app session, across all fallback paths. */
|
|
3
|
+
export declare function warnOnce(message: string): void;
|
|
4
|
+
interface FallbackOptions {
|
|
5
|
+
/** `mask` value forced onto `<AmpMaskView>`; 'from-maskLevel' derives it from the caller's `maskLevel` prop. */
|
|
6
|
+
mask: 'amp-unmask' | 'from-maskLevel';
|
|
7
|
+
/** Passed to {@link warnOnce} on every render. */
|
|
8
|
+
warning: string;
|
|
9
|
+
/** When set, dev builds throw this instead of rendering the fallback. */
|
|
10
|
+
devThrowMessage?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds an `<AmpMask>`/`<AmpUnmask>` stand-in that renders through the Paper
|
|
14
|
+
* `<AmpMaskView>`: privacy-safe (content stays masked) but not
|
|
15
|
+
* layout-transparent. Used when the Fabric `SRMaskView` isn't available —
|
|
16
|
+
* Old-Architecture apps and New-Architecture build misconfigurations.
|
|
17
|
+
*
|
|
18
|
+
* Fail-closed rules, enforced at runtime because untyped callers can spread
|
|
19
|
+
* arbitrary props even though the public types omit them:
|
|
20
|
+
* `style`/`enabled`/`mask` are stripped, and the forced `mask` value is
|
|
21
|
+
* applied after the caller's props so it can never be overridden.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createAmpMaskViewFallback<P extends {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}>(options: FallbackOptions): (props: P) => ReactElement;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=mask-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-fallback.d.ts","sourceRoot":"","sources":["../../src/mask-fallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrD,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,QAKvC;AAED,UAAU,eAAe;IACvB,gHAAgH;IAChH,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAAC;IACtC,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,EAC1E,OAAO,EAAE,eAAe,GACvB,CAAC,KAAK,EAAE,CAAC,KAAK,YAAY,CAqB5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaskProps, UnmaskProps } from '../Mask.types';
|
|
2
|
+
/**
|
|
3
|
+
* Old-Architecture guard: dev builds throw (the developer is using an
|
|
4
|
+
* unsupported component); production falls back to `<AmpMaskView>` —
|
|
5
|
+
* privacy-safe but layout-unsafe. `enabled` is ignored: the fallback fails
|
|
6
|
+
* toward privacy.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AmpMask: (props: MaskProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
9
|
+
export declare const AmpUnmask: (props: UnmaskProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
+
//# sourceMappingURL=MaskPaper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaskPaper.d.ts","sourceRoot":"","sources":["../../../src/paper/MaskPaper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5D;;;;;GAKG;AACH,eAAO,MAAM,OAAO,8GAIlB,CAAC;AAEH,eAAO,MAAM,SAAS,gHAIpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react-native/types/modules/Codegen" />
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export interface NativeProps extends ViewProps {
|
|
5
|
+
enabled?: WithDefault<boolean, true>;
|
|
6
|
+
unmask?: WithDefault<boolean, false>;
|
|
7
|
+
maskLevel?: WithDefault<string, 'mask'>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=SRMaskViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SRMaskViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/SRMaskViewNativeComponent.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;IAC5C,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;;AAED,wBAAiE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-beta.
|
|
1
|
+
export declare const VERSION = "0.1.0-beta.2";
|
|
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.2",
|
|
4
4
|
"description": "Amplitude Session Replay for React Native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analytics",
|
|
@@ -63,10 +63,15 @@
|
|
|
63
63
|
},
|
|
64
64
|
"codegenConfig": {
|
|
65
65
|
"name": "AmpSessionReplaySpec",
|
|
66
|
-
"type": "
|
|
66
|
+
"type": "all",
|
|
67
67
|
"jsSrcsDir": "src/specs",
|
|
68
68
|
"android": {
|
|
69
69
|
"javaPackageName": "com.amplitude.sessionreplayreactnative"
|
|
70
|
+
},
|
|
71
|
+
"ios": {
|
|
72
|
+
"componentProvider": {
|
|
73
|
+
"SRMaskView": "SRMaskView"
|
|
74
|
+
}
|
|
70
75
|
}
|
|
71
76
|
},
|
|
72
77
|
"react-native-builder-bob": {
|
|
@@ -87,11 +92,11 @@
|
|
|
87
92
|
"build": "bob build",
|
|
88
93
|
"clean": "rimraf node_modules lib coverage",
|
|
89
94
|
"fix": "pnpm fix:eslint & pnpm fix:prettier",
|
|
90
|
-
"fix:eslint": "eslint '{src,test}/**/*.ts' --fix",
|
|
91
|
-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
|
|
95
|
+
"fix:eslint": "eslint '{src,test}/**/*.{ts,tsx}' --fix",
|
|
96
|
+
"fix:prettier": "prettier --write \"{src,test}/**/*.{ts,tsx}\"",
|
|
92
97
|
"lint": "pnpm lint:prettier && pnpm lint:eslint",
|
|
93
|
-
"lint:eslint": "eslint '{src,test}/**/*.ts'",
|
|
94
|
-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
|
|
98
|
+
"lint:eslint": "eslint '{src,test}/**/*.{ts,tsx}'",
|
|
99
|
+
"lint:prettier": "prettier --check \"{src,test}/**/*.{ts,tsx}\"",
|
|
95
100
|
"test": "jest",
|
|
96
101
|
"typecheck": "tsc -p ./tsconfig.json --noEmit",
|
|
97
102
|
"version": "pnpm version-file && pnpm build",
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Masking level for `<AmpMask>`. See {@link MaskProps.maskLevel}. */
|
|
5
|
+
export type AmpMaskLevel = 'mask' | 'block';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for `<AmpMask>`, which masks its children in Session Replay
|
|
9
|
+
* recordings without affecting their layout.
|
|
10
|
+
*
|
|
11
|
+
* `style` is not supported: the wrapper is layout-transparent and never
|
|
12
|
+
* carries a layout box of its own, so styles would have no effect.
|
|
13
|
+
*/
|
|
14
|
+
export interface MaskProps extends Omit<ViewProps, 'style'> {
|
|
15
|
+
/**
|
|
16
|
+
* When false, children are rendered without masking.
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Masking level applied to children. On iOS, 'mask' and 'block' currently
|
|
23
|
+
* behave identically (both fully block).
|
|
24
|
+
* @default 'mask'
|
|
25
|
+
*/
|
|
26
|
+
maskLevel?: AmpMaskLevel;
|
|
27
|
+
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Props for `<AmpUnmask>`, which exempts its children from masking inside a
|
|
33
|
+
* masked region, without affecting their layout.
|
|
34
|
+
*
|
|
35
|
+
* `style` is not supported: the wrapper is layout-transparent and never
|
|
36
|
+
* carries a layout box of its own, so styles would have no effect.
|
|
37
|
+
*/
|
|
38
|
+
export interface UnmaskProps extends Omit<ViewProps, 'style'> {
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Maps the public {@link AmpMaskLevel} to the `<AmpMaskView>` `mask` prop value. */
|
|
43
|
+
export function ampMaskViewMaskProp(level?: AmpMaskLevel): 'amp-mask' | 'amp-block' {
|
|
44
|
+
return level === 'block' ? 'amp-block' : 'amp-mask';
|
|
45
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NativeModules, TurboModuleRegistry, UIManager } from 'react-native';
|
|
3
|
+
import SRMaskViewNative from '../specs/SRMaskViewNativeComponent';
|
|
4
|
+
import { createAmpMaskViewFallback, warnOnce } from '../mask-fallback';
|
|
5
|
+
import type { MaskProps, UnmaskProps } from '../Mask.types';
|
|
6
|
+
|
|
7
|
+
// Three-tier fail-closed probe. We never fall open (unmasked) unless the
|
|
8
|
+
// package's native code is entirely absent — i.e. the recorder itself cannot
|
|
9
|
+
// run and nothing can be captured:
|
|
10
|
+
// 1. SRMaskView registered -> use it directly, layout-transparent.
|
|
11
|
+
// 2. Only the Paper AMPMaskComponentView registered (Fabric sources not
|
|
12
|
+
// built) -> render through <AmpMaskView>: masked, layout-unsafe.
|
|
13
|
+
// 3. Neither registered -> behavior depends on RECORDER_PRESENT below.
|
|
14
|
+
const FABRIC_AVAILABLE = UIManager.hasViewManagerConfig?.('SRMaskView') ?? false;
|
|
15
|
+
const PAPER_MASK_AVAILABLE = UIManager.hasViewManagerConfig?.('AMPMaskComponentView') ?? false;
|
|
16
|
+
// Whether the Session Replay native module is linked. Must be resolved the
|
|
17
|
+
// same way src/native-module.ts resolves it (TurboModuleRegistry.get, then the
|
|
18
|
+
// legacy NativeModules interop proxy) so this gate can never disagree with the
|
|
19
|
+
// recorder's actual availability.
|
|
20
|
+
const RECORDER_PRESENT =
|
|
21
|
+
(TurboModuleRegistry?.get?.('AMPNativeSessionReplay') ?? NativeModules?.AMPNativeSessionReplay) != null;
|
|
22
|
+
|
|
23
|
+
const contents = { display: 'contents' as unknown as 'flex' }; // zero-box hint; C++ adopt() is authoritative
|
|
24
|
+
|
|
25
|
+
function MaskImpl({ enabled = true, maskLevel = 'mask', children, ...vp }: MaskProps) {
|
|
26
|
+
return (
|
|
27
|
+
<SRMaskViewNative {...vp} enabled={enabled} unmask={false} maskLevel={maskLevel} style={contents}>
|
|
28
|
+
{children}
|
|
29
|
+
</SRMaskViewNative>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function UnmaskImpl({ children, ...vp }: UnmaskProps) {
|
|
33
|
+
return (
|
|
34
|
+
<SRMaskViewNative {...vp} enabled unmask maskLevel="mask" style={contents}>
|
|
35
|
+
{children}
|
|
36
|
+
</SRMaskViewNative>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Tier 2: masked but not layout-transparent. `enabled` is intentionally
|
|
41
|
+
// ignored (over-mask), matching the Old-Arch prod fallback in MaskPaper.
|
|
42
|
+
const FALLBACK_WARNING =
|
|
43
|
+
'[AmpMask] New Architecture detected but the native SRMaskView component is unavailable — falling back to <AmpMaskView> (content stays MASKED but layout transparency is lost). Verify the Fabric masking sources were built (new architecture + RN >= 0.77) and codegen ran. Note: Fabric without bridgeless (bridge mode) cannot detect SRMaskView on iOS and always uses this fallback.';
|
|
44
|
+
const FallbackMask = createAmpMaskViewFallback<MaskProps>({ mask: 'from-maskLevel', warning: FALLBACK_WARNING });
|
|
45
|
+
const FallbackUnmask = createAmpMaskViewFallback<UnmaskProps>({ mask: 'amp-unmask', warning: FALLBACK_WARNING });
|
|
46
|
+
|
|
47
|
+
// Tier 3: no masking-capable native view exists, so children render directly.
|
|
48
|
+
// Safe only when the recorder is absent too (nothing can be captured); when
|
|
49
|
+
// the recorder IS present this is a build error we must not infer our way
|
|
50
|
+
// past — throw in dev, warn loudly in prod.
|
|
51
|
+
const UNMASKED_WARNING =
|
|
52
|
+
'[AmpMask] New Architecture detected but the native SRMaskView component is unavailable — <AmpMask>/<AmpUnmask> render children UNMASKED. Verify the Fabric masking sources were built (new architecture + RN >= 0.77) and codegen ran.';
|
|
53
|
+
const UNMASKABLE_MSG =
|
|
54
|
+
'<AmpMask> cannot mask: the Session Replay native module is present but neither SRMaskView nor AMPMaskComponentView is registered. Fix the build before shipping.';
|
|
55
|
+
const UNMASKABLE_WARNING =
|
|
56
|
+
'[AmpMask] The Session Replay native module is present but neither SRMaskView nor AMPMaskComponentView is registered — <AmpMask>/<AmpUnmask> render children UNMASKED. This is a build error (not an expected environment) — fix the build before shipping.';
|
|
57
|
+
|
|
58
|
+
function createPassthrough(warning: string, devThrowMessage?: string) {
|
|
59
|
+
return function PassthroughChildren({ children }: { children?: React.ReactNode }) {
|
|
60
|
+
if (devThrowMessage !== undefined && __DEV__) {
|
|
61
|
+
throw new Error(devThrowMessage);
|
|
62
|
+
}
|
|
63
|
+
warnOnce(warning);
|
|
64
|
+
return <>{children}</>;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const Passthrough = createPassthrough(UNMASKED_WARNING);
|
|
68
|
+
const UnmaskableGuard = createPassthrough(UNMASKABLE_WARNING, UNMASKABLE_MSG);
|
|
69
|
+
|
|
70
|
+
const NeitherAvailable = RECORDER_PRESENT ? UnmaskableGuard : Passthrough;
|
|
71
|
+
|
|
72
|
+
export const AmpMask = FABRIC_AVAILABLE ? MaskImpl : PAPER_MASK_AVAILABLE ? FallbackMask : NeitherAvailable;
|
|
73
|
+
export const AmpUnmask = FABRIC_AVAILABLE ? UnmaskImpl : PAPER_MASK_AVAILABLE ? FallbackUnmask : NeitherAvailable;
|
package/src/index.tsx
CHANGED
|
@@ -14,3 +14,21 @@ export { SessionReplayPlugin } from './plugin-session-replay';
|
|
|
14
14
|
export type { SessionReplayPluginConfig } from './plugin-session-replay-config';
|
|
15
15
|
|
|
16
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';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { AmpMaskView } from './amp-mask-view';
|
|
4
|
+
import { ampMaskViewMaskProp } from './Mask.types';
|
|
5
|
+
import type { AmpMaskLevel } from './Mask.types';
|
|
6
|
+
|
|
7
|
+
let warned = false;
|
|
8
|
+
|
|
9
|
+
/** Logs at most one degraded-masking error per app session, across all fallback paths. */
|
|
10
|
+
export function warnOnce(message: string) {
|
|
11
|
+
if (!warned) {
|
|
12
|
+
warned = true;
|
|
13
|
+
console.error(message);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface FallbackOptions {
|
|
18
|
+
/** `mask` value forced onto `<AmpMaskView>`; 'from-maskLevel' derives it from the caller's `maskLevel` prop. */
|
|
19
|
+
mask: 'amp-unmask' | 'from-maskLevel';
|
|
20
|
+
/** Passed to {@link warnOnce} on every render. */
|
|
21
|
+
warning: string;
|
|
22
|
+
/** When set, dev builds throw this instead of rendering the fallback. */
|
|
23
|
+
devThrowMessage?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Builds an `<AmpMask>`/`<AmpUnmask>` stand-in that renders through the Paper
|
|
28
|
+
* `<AmpMaskView>`: privacy-safe (content stays masked) but not
|
|
29
|
+
* layout-transparent. Used when the Fabric `SRMaskView` isn't available —
|
|
30
|
+
* Old-Architecture apps and New-Architecture build misconfigurations.
|
|
31
|
+
*
|
|
32
|
+
* Fail-closed rules, enforced at runtime because untyped callers can spread
|
|
33
|
+
* arbitrary props even though the public types omit them:
|
|
34
|
+
* `style`/`enabled`/`mask` are stripped, and the forced `mask` value is
|
|
35
|
+
* applied after the caller's props so it can never be overridden.
|
|
36
|
+
*/
|
|
37
|
+
export function createAmpMaskViewFallback<P extends { children?: ReactNode }>(
|
|
38
|
+
options: FallbackOptions,
|
|
39
|
+
): (props: P) => ReactElement {
|
|
40
|
+
return function AmpMaskViewFallback(props: P) {
|
|
41
|
+
if (options.devThrowMessage !== undefined && __DEV__) {
|
|
42
|
+
throw new Error(options.devThrowMessage);
|
|
43
|
+
}
|
|
44
|
+
warnOnce(options.warning);
|
|
45
|
+
const {
|
|
46
|
+
children,
|
|
47
|
+
maskLevel,
|
|
48
|
+
style: _style,
|
|
49
|
+
enabled: _enabled,
|
|
50
|
+
mask: _mask,
|
|
51
|
+
...safeProps
|
|
52
|
+
} = props as P & { maskLevel?: AmpMaskLevel; style?: unknown; enabled?: boolean; mask?: unknown };
|
|
53
|
+
const mask = options.mask === 'amp-unmask' ? 'amp-unmask' : ampMaskViewMaskProp(maskLevel);
|
|
54
|
+
return (
|
|
55
|
+
<AmpMaskView {...safeProps} mask={mask}>
|
|
56
|
+
{children}
|
|
57
|
+
</AmpMaskView>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createAmpMaskViewFallback } from '../mask-fallback';
|
|
2
|
+
import type { MaskProps, UnmaskProps } from '../Mask.types';
|
|
3
|
+
|
|
4
|
+
const MSG = '<AmpMask> requires the New Architecture. Use <AmpMaskView> on the Old Architecture.';
|
|
5
|
+
const WARNING =
|
|
6
|
+
'[AmpMask] Old Architecture detected — falling back to AmpMaskView (layout-unsafe). Use <AmpMaskView> on Old Arch.';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Old-Architecture guard: dev builds throw (the developer is using an
|
|
10
|
+
* unsupported component); production falls back to `<AmpMaskView>` —
|
|
11
|
+
* privacy-safe but layout-unsafe. `enabled` is ignored: the fallback fails
|
|
12
|
+
* toward privacy.
|
|
13
|
+
*/
|
|
14
|
+
export const AmpMask = createAmpMaskViewFallback<MaskProps>({
|
|
15
|
+
mask: 'from-maskLevel',
|
|
16
|
+
warning: WARNING,
|
|
17
|
+
devThrowMessage: MSG,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const AmpUnmask = createAmpMaskViewFallback<UnmaskProps>({
|
|
21
|
+
mask: 'amp-unmask',
|
|
22
|
+
warning: WARNING,
|
|
23
|
+
devThrowMessage: MSG,
|
|
24
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
enabled?: WithDefault<boolean, true>;
|
|
8
|
+
unmask?: WithDefault<boolean, false>;
|
|
9
|
+
maskLevel?: WithDefault<string, 'mask'>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default codegenNativeComponent<NativeProps>('SRMaskView');
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-beta.
|
|
1
|
+
export const VERSION = '0.1.0-beta.2';
|