@amplitude/session-replay-react-native 0.1.0-beta.0 → 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.
Files changed (84) hide show
  1. package/AmplitudeSessionReplayReactNative.podspec +43 -2
  2. package/README.md +125 -0
  3. package/android/build.gradle +145 -5
  4. package/android/src/androidTest/java/com/amplitude/sessionreplayreactnative/SRMaskViewTest.kt +459 -0
  5. package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRDefaultMaskingPrimitive.kt +36 -0
  6. package/android/src/main/java/com/amplitude/sessionreplayreactnative/SRMaskingPrimitive.kt +84 -0
  7. package/android/src/main/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeModule.kt +51 -16
  8. package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativePackage.kt +41 -0
  9. package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeSpec.kt +7 -0
  10. package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskView.kt +174 -0
  11. package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewManager.kt +44 -0
  12. package/android/src/newarch/java/com/amplitude/sessionreplayreactnative/fabric/SRMaskViewPointerEvents.java +36 -0
  13. package/android/src/{main → oldarch}/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativePackage.kt +2 -1
  14. package/android/src/oldarch/java/com/amplitude/sessionreplayreactnative/SessionReplayReactNativeSpec.kt +20 -0
  15. package/cpp/SRMaskViewComponentDescriptor.h +20 -0
  16. package/cpp/SRMaskViewShadowNode.cpp +54 -0
  17. package/cpp/SRMaskViewShadowNode.h +56 -0
  18. package/ios/AMPNativeSessionReplay.mm +20 -0
  19. package/ios/NativeSessionReplay.swift +29 -8
  20. package/ios/SRDefaultMaskingPrimitive.swift +34 -0
  21. package/ios/SRMaskingPrimitive.h +26 -0
  22. package/ios/SRMaskingRegistry.m +105 -0
  23. package/ios/fabric/SRMaskView.h +10 -0
  24. package/ios/fabric/SRMaskView.mm +178 -0
  25. package/lib/commonjs/Mask.types.js +29 -0
  26. package/lib/commonjs/Mask.types.js.map +1 -0
  27. package/lib/commonjs/fabric/MaskFabric.js +92 -0
  28. package/lib/commonjs/fabric/MaskFabric.js.map +1 -0
  29. package/lib/commonjs/index.js +19 -0
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/mask-fallback.js +53 -0
  32. package/lib/commonjs/mask-fallback.js.map +1 -0
  33. package/lib/commonjs/native-module.js +10 -1
  34. package/lib/commonjs/native-module.js.map +1 -1
  35. package/lib/commonjs/paper/MaskPaper.js +27 -0
  36. package/lib/commonjs/paper/MaskPaper.js.map +1 -0
  37. package/lib/commonjs/specs/NativeAmpSessionReplay.js +22 -0
  38. package/lib/commonjs/specs/NativeAmpSessionReplay.js.map +1 -0
  39. package/lib/commonjs/specs/SRMaskViewNativeComponent.js +11 -0
  40. package/lib/commonjs/specs/SRMaskViewNativeComponent.js.map +1 -0
  41. package/lib/commonjs/version.js +1 -1
  42. package/lib/module/Mask.types.js +23 -0
  43. package/lib/module/Mask.types.js.map +1 -0
  44. package/lib/module/fabric/MaskFabric.js +85 -0
  45. package/lib/module/fabric/MaskFabric.js.map +1 -0
  46. package/lib/module/index.js +15 -0
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/mask-fallback.js +45 -0
  49. package/lib/module/mask-fallback.js.map +1 -0
  50. package/lib/module/native-module.js +10 -2
  51. package/lib/module/native-module.js.map +1 -1
  52. package/lib/module/paper/MaskPaper.js +21 -0
  53. package/lib/module/paper/MaskPaper.js.map +1 -0
  54. package/lib/module/specs/NativeAmpSessionReplay.js +18 -0
  55. package/lib/module/specs/NativeAmpSessionReplay.js.map +1 -0
  56. package/lib/module/specs/SRMaskViewNativeComponent.js +5 -0
  57. package/lib/module/specs/SRMaskViewNativeComponent.js.map +1 -0
  58. package/lib/module/version.js +1 -1
  59. package/lib/typescript/Mask.types.d.ts +38 -0
  60. package/lib/typescript/Mask.types.d.ts.map +1 -0
  61. package/lib/typescript/fabric/MaskFabric.d.ts +8 -0
  62. package/lib/typescript/fabric/MaskFabric.d.ts.map +1 -0
  63. package/lib/typescript/index.d.ts +11 -0
  64. package/lib/typescript/index.d.ts.map +1 -1
  65. package/lib/typescript/mask-fallback.d.ts +27 -0
  66. package/lib/typescript/mask-fallback.d.ts.map +1 -0
  67. package/lib/typescript/native-module.d.ts.map +1 -1
  68. package/lib/typescript/paper/MaskPaper.d.ts +10 -0
  69. package/lib/typescript/paper/MaskPaper.d.ts.map +1 -0
  70. package/lib/typescript/specs/NativeAmpSessionReplay.d.ts +15 -0
  71. package/lib/typescript/specs/NativeAmpSessionReplay.d.ts.map +1 -0
  72. package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts +11 -0
  73. package/lib/typescript/specs/SRMaskViewNativeComponent.d.ts.map +1 -0
  74. package/lib/typescript/version.d.ts +1 -1
  75. package/package.json +19 -6
  76. package/src/Mask.types.ts +45 -0
  77. package/src/fabric/MaskFabric.tsx +73 -0
  78. package/src/index.tsx +18 -0
  79. package/src/mask-fallback.tsx +60 -0
  80. package/src/native-module.ts +16 -10
  81. package/src/paper/MaskPaper.tsx +24 -0
  82. package/src/specs/NativeAmpSessionReplay.ts +29 -0
  83. package/src/specs/SRMaskViewNativeComponent.ts +12 -0
  84. package/src/version.ts +1 -1
@@ -5,11 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.NativeSessionReplay = void 0;
7
7
  var _reactNative = require("react-native");
8
+ var _NativeAmpSessionReplay = _interopRequireDefault(require("./specs/NativeAmpSessionReplay"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
10
  const LINKING_ERROR = `The package '@amplitude/session-replay-react-native' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
9
11
  ios: "- You have run 'pod install'\n",
10
12
  default: ''
11
13
  }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
12
- const NativeSessionReplay = exports.NativeSessionReplay = _reactNative.NativeModules.AMPNativeSessionReplay ? _reactNative.NativeModules.AMPNativeSessionReplay : new Proxy({}, {
14
+
15
+ // JS callers use the rich, hand-written types below for full type safety; the
16
+ // codegen `Spec` is intentionally loose (`UnsafeObject`) at the native boundary.
17
+ // The spec resolves the native module via `TurboModuleRegistry.get` (both
18
+ // architectures). When the module isn't linked it resolves to null, so we fall
19
+ // back to a proxy that throws a descriptive linking error on first use rather
20
+ // than crashing app startup at import time.
21
+ const NativeSessionReplay = exports.NativeSessionReplay = _NativeAmpSessionReplay.default ?? new Proxy({}, {
13
22
  get() {
14
23
  throw new Error(LINKING_ERROR);
15
24
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","NativeSessionReplay","exports","NativeModules","AMPNativeSessionReplay","Proxy","get","Error"],"sourceRoot":"../../src","sources":["native-module.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,iGAAiG,GACjGC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAE1B,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,0BAAa,CAACC,sBAAsB,GAClED,0BAAa,CAACC,sBAAsB,GACpC,IAAIC,KAAK,CACR,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACX,aAAa,CAAC;EAChC;AACF,CACF,CAA6B;;AAEjC;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_NativeAmpSessionReplay","_interopRequireDefault","e","__esModule","default","LINKING_ERROR","Platform","select","ios","NativeSessionReplay","exports","SessionReplaySpec","Proxy","get","Error"],"sourceRoot":"../../src","sources":["native-module.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA+D,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/D,MAAMG,aAAa,GACjB,iGAAiG,GACjGC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEJ,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMK,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAIE,+BAAiB,IACnD,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAwC;;AAE1C;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AmpUnmask = exports.AmpMask = void 0;
7
+ var _maskFallback = require("../mask-fallback");
8
+ const MSG = '<AmpMask> requires the New Architecture. Use <AmpMaskView> on the Old Architecture.';
9
+ const WARNING = '[AmpMask] Old Architecture detected — falling back to AmpMaskView (layout-unsafe). Use <AmpMaskView> on Old Arch.';
10
+
11
+ /**
12
+ * Old-Architecture guard: dev builds throw (the developer is using an
13
+ * unsupported component); production falls back to `<AmpMaskView>` —
14
+ * privacy-safe but layout-unsafe. `enabled` is ignored: the fallback fails
15
+ * toward privacy.
16
+ */
17
+ const AmpMask = exports.AmpMask = (0, _maskFallback.createAmpMaskViewFallback)({
18
+ mask: 'from-maskLevel',
19
+ warning: WARNING,
20
+ devThrowMessage: MSG
21
+ });
22
+ const AmpUnmask = exports.AmpUnmask = (0, _maskFallback.createAmpMaskViewFallback)({
23
+ mask: 'amp-unmask',
24
+ warning: WARNING,
25
+ devThrowMessage: MSG
26
+ });
27
+ //# sourceMappingURL=MaskPaper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_maskFallback","require","MSG","WARNING","AmpMask","exports","createAmpMaskViewFallback","mask","warning","devThrowMessage","AmpUnmask"],"sourceRoot":"../../../src","sources":["paper/MaskPaper.tsx"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAGA,MAAMC,GAAG,GAAG,qFAAqF;AACjG,MAAMC,OAAO,GACX,mHAAmH;;AAErH;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,IAAAE,uCAAyB,EAAY;EAC1DC,IAAI,EAAE,gBAAgB;EACtBC,OAAO,EAAEL,OAAO;EAChBM,eAAe,EAAEP;AACnB,CAAC,CAAC;AAEK,MAAMQ,SAAS,GAAAL,OAAA,CAAAK,SAAA,GAAG,IAAAJ,uCAAyB,EAAc;EAC9DC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAEL,OAAO;EAChBM,eAAe,EAAEP;AACnB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ // The codegen types live in a Flow-typed file that eslint-plugin-import cannot parse.
9
+ // eslint-disable-next-line import/namespace
10
+ // Codegen TurboModule spec for the imperative Session Replay module.
11
+ //
12
+ // The config crosses the bridge as an untyped object: the native side already
13
+ // reads a ReadableMap / NSDictionary, and app-boundary type safety lives in the
14
+ // public `SessionReplayConfig`. See native-module.ts for the typed facade that
15
+ // JS callers actually use.
16
+ // Use non-enforcing `get` (returns null when the native module isn't linked)
17
+ // so importing the package never crashes app startup. The typed facade in
18
+ // native-module.ts throws a friendly linking error lazily on first use instead.
19
+ // Works on both architectures: JSI on the New Architecture, legacy NativeModules
20
+ // fallback on the old one.
21
+ var _default = exports.default = _reactNative.TurboModuleRegistry.get('AMPNativeSessionReplay');
22
+ //# sourceMappingURL=NativeAmpSessionReplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeAmpSessionReplay.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAYA;AACA;AACA;AACA;AACA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,gCAAmB,CAACC,GAAG,CAAO,wBAAwB,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /* eslint-disable import/namespace, import/default, import/no-named-as-default, import/no-named-as-default-member */
10
+ var _default = exports.default = (0, _codegenNativeComponent.default)('SRMaskView');
11
+ //# sourceMappingURL=SRMaskViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/SRMaskViewNativeComponent.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;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAWe,IAAAG,+BAAsB,EAAc,YAAY,CAAC","ignoreList":[]}
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- const VERSION = exports.VERSION = '0.1.0-beta.0';
7
+ const VERSION = exports.VERSION = '0.1.0-beta.2';
8
8
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,23 @@
1
+ /** Masking level for `<AmpMask>`. See {@link MaskProps.maskLevel}. */
2
+
3
+ /**
4
+ * Props for `<AmpMask>`, which masks its children in Session Replay
5
+ * recordings without affecting their layout.
6
+ *
7
+ * `style` is not supported: the wrapper is layout-transparent and never
8
+ * carries a layout box of its own, so styles would have no effect.
9
+ */
10
+
11
+ /**
12
+ * Props for `<AmpUnmask>`, which exempts its children from masking inside a
13
+ * masked region, without affecting their layout.
14
+ *
15
+ * `style` is not supported: the wrapper is layout-transparent and never
16
+ * carries a layout box of its own, so styles would have no effect.
17
+ */
18
+
19
+ /** Maps the public {@link AmpMaskLevel} to the `<AmpMaskView>` `mask` prop value. */
20
+ export function ampMaskViewMaskProp(level) {
21
+ return level === 'block' ? 'amp-block' : 'amp-mask';
22
+ }
23
+ //# sourceMappingURL=Mask.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ampMaskViewMaskProp","level"],"sourceRoot":"../../src","sources":["Mask.types.ts"],"mappings":"AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA,OAAO,SAASA,mBAAmBA,CAACC,KAAoB,EAA4B;EAClF,OAAOA,KAAK,KAAK,OAAO,GAAG,WAAW,GAAG,UAAU;AACrD","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ var _UIManager$hasViewMan, _UIManager$hasViewMan2, _TurboModuleRegistry$;
2
+ 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); }
3
+ import React from 'react';
4
+ import { NativeModules, TurboModuleRegistry, UIManager } from 'react-native';
5
+ import SRMaskViewNative from '../specs/SRMaskViewNativeComponent';
6
+ import { createAmpMaskViewFallback, warnOnce } from '../mask-fallback';
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$hasViewMan = UIManager.hasViewManagerConfig) === null || _UIManager$hasViewMan === void 0 ? void 0 : _UIManager$hasViewMan.call(UIManager, 'SRMaskView')) ?? false;
15
+ const PAPER_MASK_AVAILABLE = ((_UIManager$hasViewMan2 = UIManager.hasViewManagerConfig) === null || _UIManager$hasViewMan2 === void 0 ? void 0 : _UIManager$hasViewMan2.call(UIManager, '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 = ((TurboModuleRegistry === null || TurboModuleRegistry === void 0 || (_TurboModuleRegistry$ = TurboModuleRegistry.get) === null || _TurboModuleRegistry$ === void 0 ? void 0 : _TurboModuleRegistry$.call(TurboModuleRegistry, 'AMPNativeSessionReplay')) ?? (NativeModules === null || NativeModules === void 0 ? void 0 : NativeModules.AMPNativeSessionReplay)) != null;
21
+ const contents = {
22
+ display: 'contents'
23
+ }; // zero-box hint; C++ adopt() is authoritative
24
+
25
+ function MaskImpl({
26
+ enabled = true,
27
+ maskLevel = 'mask',
28
+ children,
29
+ ...vp
30
+ }) {
31
+ return /*#__PURE__*/React.createElement(SRMaskViewNative, _extends({}, vp, {
32
+ enabled: enabled,
33
+ unmask: false,
34
+ maskLevel: maskLevel,
35
+ style: contents
36
+ }), children);
37
+ }
38
+ function UnmaskImpl({
39
+ children,
40
+ ...vp
41
+ }) {
42
+ return /*#__PURE__*/React.createElement(SRMaskViewNative, _extends({}, vp, {
43
+ enabled: true,
44
+ unmask: true,
45
+ maskLevel: "mask",
46
+ style: contents
47
+ }), children);
48
+ }
49
+
50
+ // Tier 2: masked but not layout-transparent. `enabled` is intentionally
51
+ // ignored (over-mask), matching the Old-Arch prod fallback in MaskPaper.
52
+ const FALLBACK_WARNING = '[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.';
53
+ const FallbackMask = createAmpMaskViewFallback({
54
+ mask: 'from-maskLevel',
55
+ warning: FALLBACK_WARNING
56
+ });
57
+ const FallbackUnmask = createAmpMaskViewFallback({
58
+ mask: 'amp-unmask',
59
+ warning: FALLBACK_WARNING
60
+ });
61
+
62
+ // Tier 3: no masking-capable native view exists, so children render directly.
63
+ // Safe only when the recorder is absent too (nothing can be captured); when
64
+ // the recorder IS present this is a build error we must not infer our way
65
+ // past — throw in dev, warn loudly in prod.
66
+ const UNMASKED_WARNING = '[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.';
67
+ const UNMASKABLE_MSG = '<AmpMask> cannot mask: the Session Replay native module is present but neither SRMaskView nor AMPMaskComponentView is registered. Fix the build before shipping.';
68
+ const UNMASKABLE_WARNING = '[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.';
69
+ function createPassthrough(warning, devThrowMessage) {
70
+ return function PassthroughChildren({
71
+ children
72
+ }) {
73
+ if (devThrowMessage !== undefined && __DEV__) {
74
+ throw new Error(devThrowMessage);
75
+ }
76
+ warnOnce(warning);
77
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children);
78
+ };
79
+ }
80
+ const Passthrough = createPassthrough(UNMASKED_WARNING);
81
+ const UnmaskableGuard = createPassthrough(UNMASKABLE_WARNING, UNMASKABLE_MSG);
82
+ const NeitherAvailable = RECORDER_PRESENT ? UnmaskableGuard : Passthrough;
83
+ export const AmpMask = FABRIC_AVAILABLE ? MaskImpl : PAPER_MASK_AVAILABLE ? FallbackMask : NeitherAvailable;
84
+ export const AmpUnmask = FABRIC_AVAILABLE ? UnmaskImpl : PAPER_MASK_AVAILABLE ? FallbackUnmask : NeitherAvailable;
85
+ //# sourceMappingURL=MaskFabric.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","NativeModules","TurboModuleRegistry","UIManager","SRMaskViewNative","createAmpMaskViewFallback","warnOnce","FABRIC_AVAILABLE","_UIManager$hasViewMan","hasViewManagerConfig","call","PAPER_MASK_AVAILABLE","_UIManager$hasViewMan2","RECORDER_PRESENT","_TurboModuleRegistry$","get","AMPNativeSessionReplay","contents","display","MaskImpl","enabled","maskLevel","children","vp","createElement","_extends","unmask","style","UnmaskImpl","FALLBACK_WARNING","FallbackMask","mask","warning","FallbackUnmask","UNMASKED_WARNING","UNMASKABLE_MSG","UNMASKABLE_WARNING","createPassthrough","devThrowMessage","PassthroughChildren","undefined","__DEV__","Error","Fragment","Passthrough","UnmaskableGuard","NeitherAvailable","AmpMask","AmpUnmask"],"sourceRoot":"../../../src","sources":["fabric/MaskFabric.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,EAAEC,mBAAmB,EAAEC,SAAS,QAAQ,c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zC,gBAAgB,GAAGqB,UAAU,GAAGjB,oBAAoB,GAAGsB,cAAc,GAAGa,gBAAgB","ignoreList":[]}
@@ -1,4 +1,19 @@
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'.
4
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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,QAAQ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["init","setSessionId","getSessionId","getSessionReplayProperties","flush","start","stop","setDeviceId","SessionReplayPlugin","AmpMaskView","g","global","isNewArch","RN$Bridgeless","nativeFabricUIManager","AmpMask","AmpUnmask","require"],"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,QAAQ,iBAAiB;AAK7C,MAAMC,CAAC,GAAGC,MAAiF;AAC3F,MAAMC,SAAS,GAAGF,CAAC,CAACG,aAAa,KAAK,IAAI,IAAIH,CAAC,CAACI,qBAAqB,IAAI,IAAI;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM;EAAEC,OAAO;EAAEC;AAAwF,CAAC,GAC/GJ,SAAS,GAAGK,OAAO,CAAC,qBAAqB,CAAC,GAAGA,OAAO,CAAC,mBAAmB,CAAC;AAC3E","ignoreList":[]}
@@ -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":[]}
@@ -1,9 +1,17 @@
1
- import { NativeModules, Platform } from 'react-native';
1
+ import { Platform } from 'react-native';
2
+ import SessionReplaySpec from './specs/NativeAmpSessionReplay';
2
3
  const LINKING_ERROR = `The package '@amplitude/session-replay-react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
4
  ios: "- You have run 'pod install'\n",
4
5
  default: ''
5
6
  }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
6
- export const NativeSessionReplay = NativeModules.AMPNativeSessionReplay ? NativeModules.AMPNativeSessionReplay : new Proxy({}, {
7
+
8
+ // JS callers use the rich, hand-written types below for full type safety; the
9
+ // codegen `Spec` is intentionally loose (`UnsafeObject`) at the native boundary.
10
+ // The spec resolves the native module via `TurboModuleRegistry.get` (both
11
+ // architectures). When the module isn't linked it resolves to null, so we fall
12
+ // back to a proxy that throws a descriptive linking error on first use rather
13
+ // than crashing app startup at import time.
14
+ export const NativeSessionReplay = SessionReplaySpec ?? new Proxy({}, {
7
15
  get() {
8
16
  throw new Error(LINKING_ERROR);
9
17
  }
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","NativeSessionReplay","AMPNativeSessionReplay","Proxy","get","Error"],"sourceRoot":"../../src","sources":["native-module.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,iGAAiG,GACjGD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,OAAO,MAAMC,mBAAmB,GAAGN,aAAa,CAACO,sBAAsB,GAClEP,aAAa,CAACO,sBAAsB,GACpC,IAAIC,KAAK,CACR,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAA6B;;AAEjC;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["Platform","SessionReplaySpec","LINKING_ERROR","select","ios","default","NativeSessionReplay","Proxy","get","Error"],"sourceRoot":"../../src","sources":["native-module.ts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,iBAAiB,MAAM,gCAAgC;AAE9D,MAAMC,aAAa,GACjB,iGAAiG,GACjGF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAIL,iBAAiB,IACnD,IAAIM,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAwC;;AAE1C;AACA;AACA;AACA;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","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,18 @@
1
+ import { TurboModuleRegistry } from 'react-native';
2
+ // The codegen types live in a Flow-typed file that eslint-plugin-import cannot parse.
3
+ // eslint-disable-next-line import/namespace
4
+
5
+ // Codegen TurboModule spec for the imperative Session Replay module.
6
+ //
7
+ // The config crosses the bridge as an untyped object: the native side already
8
+ // reads a ReadableMap / NSDictionary, and app-boundary type safety lives in the
9
+ // public `SessionReplayConfig`. See native-module.ts for the typed facade that
10
+ // JS callers actually use.
11
+
12
+ // Use non-enforcing `get` (returns null when the native module isn't linked)
13
+ // so importing the package never crashes app startup. The typed facade in
14
+ // native-module.ts throws a friendly linking error lazily on first use instead.
15
+ // Works on both architectures: JSI on the New Architecture, legacy NativeModules
16
+ // fallback on the old one.
17
+ export default TurboModuleRegistry.get('AMPNativeSessionReplay');
18
+ //# sourceMappingURL=NativeAmpSessionReplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../src","sources":["specs/NativeAmpSessionReplay.ts"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAc;AAClD;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,wBAAwB,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":[]}
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.0-beta.0';
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"native-module.d.ts","sourceRoot":"","sources":["../../src/native-module.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,yBASC,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,0EAA0E;IAC1E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,kEAAkE;IAClE,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC;IAC/C,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,wEAAwE;IACxE,SAAS,EA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E;IAClE,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC;IAC/C,iEAAiE;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,6BAA6B;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;OAIG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhC;;;;;OAKG;IACH,0BAA0B,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAErE;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
@@ -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,15 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
3
+ export interface Spec extends TurboModule {
4
+ setup(config: UnsafeObject): Promise<void>;
5
+ setSessionId(sessionId: number): Promise<void>;
6
+ setDeviceId(deviceId: string | null): Promise<void>;
7
+ getSessionId(): Promise<number>;
8
+ getSessionReplayProperties(): Promise<UnsafeObject>;
9
+ start(): Promise<void>;
10
+ stop(): Promise<void>;
11
+ flush(): Promise<void>;
12
+ }
13
+ declare const _default: Spec | null;
14
+ export default _default;
15
+ //# sourceMappingURL=NativeAmpSessionReplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeAmpSessionReplay.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeAmpSessionReplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAQ9E,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,0BAA0B,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;;AAOD,wBAAuE"}
@@ -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.0";
1
+ export declare const VERSION = "0.1.0-beta.2";
2
2
  //# sourceMappingURL=version.d.ts.map