@mixpanel/react-native-session-replay 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/MixpanelReactNativeSessionReplay.podspec +1 -1
  2. package/README.md +2 -0
  3. package/android/build.gradle +1 -1
  4. package/lib/module/index.js +177 -4
  5. package/lib/module/index.js.map +1 -1
  6. package/lib/typescript/src/index.d.ts +102 -1
  7. package/lib/typescript/src/index.d.ts.map +1 -1
  8. package/package.json +2 -24
  9. package/src/index.tsx +194 -3
  10. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeMixpanelReactNativeSessionReplaySpec.java +0 -62
  11. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
  12. package/android/app/build/generated/source/codegen/jni/MixpanelReactNativeSessionReplaySpec-generated.cpp +0 -68
  13. package/android/app/build/generated/source/codegen/jni/MixpanelReactNativeSessionReplaySpec.h +0 -31
  14. package/android/app/build/generated/source/codegen/jni/react/renderer/components/MixpanelReactNativeSessionReplaySpec/MixpanelReactNativeSessionReplaySpecJSI-generated.cpp +0 -67
  15. package/android/app/build/generated/source/codegen/jni/react/renderer/components/MixpanelReactNativeSessionReplaySpec/MixpanelReactNativeSessionReplaySpecJSI.h +0 -125
  16. package/android/generated/java/com/mpsessionreplay/NativeMpSessionReplaySpec.java +0 -49
  17. package/android/generated/jni/CMakeLists.txt +0 -36
  18. package/android/generated/jni/RNMpSessionReplaySpec-generated.cpp +0 -50
  19. package/android/generated/jni/RNMpSessionReplaySpec.h +0 -31
  20. package/android/generated/jni/react/renderer/components/RNMpSessionReplaySpec/RNMpSessionReplaySpecJSI-generated.cpp +0 -51
  21. package/android/generated/jni/react/renderer/components/RNMpSessionReplaySpec/RNMpSessionReplaySpecJSI.h +0 -98
@@ -1,36 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and affiliates.
2
- #
3
- # This source code is licensed under the MIT license found in the
4
- # LICENSE file in the root directory of this source tree.
5
-
6
- cmake_minimum_required(VERSION 3.13)
7
- set(CMAKE_VERBOSE_MAKEFILE on)
8
-
9
- file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNMpSessionReplaySpec/*.cpp)
10
-
11
- add_library(
12
- react_codegen_RNMpSessionReplaySpec
13
- OBJECT
14
- ${react_codegen_SRCS}
15
- )
16
-
17
- target_include_directories(react_codegen_RNMpSessionReplaySpec PUBLIC . react/renderer/components/RNMpSessionReplaySpec)
18
-
19
- target_link_libraries(
20
- react_codegen_RNMpSessionReplaySpec
21
- fbjni
22
- jsi
23
- # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
- # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
- reactnative
26
- )
27
-
28
- target_compile_options(
29
- react_codegen_RNMpSessionReplaySpec
30
- PRIVATE
31
- -DLOG_TAG=\"ReactNative\"
32
- -fexceptions
33
- -frtti
34
- -std=c++20
35
- -Wall
36
- )
@@ -1,50 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJniCpp.js
9
- */
10
-
11
- #include "RNMpSessionReplaySpec.h"
12
-
13
- namespace facebook::react {
14
-
15
- static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_startRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
- static jmethodID cachedMethodId = nullptr;
17
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "startRecording", "()V", args, count, cachedMethodId);
18
- }
19
-
20
- static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_stopRecording(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
- static jmethodID cachedMethodId = nullptr;
22
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "stopRecording", "()V", args, count, cachedMethodId);
23
- }
24
-
25
- static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
26
- static jmethodID cachedMethodId = nullptr;
27
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "initialize", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
28
- }
29
-
30
- static facebook::jsi::Value __hostFunction_NativeMpSessionReplaySpecJSI_captureScreenshot(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
- static jmethodID cachedMethodId = nullptr;
32
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "captureScreenshot", "()V", args, count, cachedMethodId);
33
- }
34
-
35
- NativeMpSessionReplaySpecJSI::NativeMpSessionReplaySpecJSI(const JavaTurboModule::InitParams &params)
36
- : JavaTurboModule(params) {
37
- methodMap_["startRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_startRecording};
38
- methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_stopRecording};
39
- methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMpSessionReplaySpecJSI_initialize};
40
- methodMap_["captureScreenshot"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplaySpecJSI_captureScreenshot};
41
- }
42
-
43
- std::shared_ptr<TurboModule> RNMpSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
44
- if (moduleName == "MpSessionReplay") {
45
- return std::make_shared<NativeMpSessionReplaySpecJSI>(params);
46
- }
47
- return nullptr;
48
- }
49
-
50
- } // namespace facebook::react
@@ -1,31 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJniH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <ReactCommon/JavaTurboModule.h>
14
- #include <ReactCommon/TurboModule.h>
15
- #include <jsi/jsi.h>
16
-
17
- namespace facebook::react {
18
-
19
- /**
20
- * JNI C++ class for module 'NativeMpSessionReplay'
21
- */
22
- class JSI_EXPORT NativeMpSessionReplaySpecJSI : public JavaTurboModule {
23
- public:
24
- NativeMpSessionReplaySpecJSI(const JavaTurboModule::InitParams &params);
25
- };
26
-
27
-
28
- JSI_EXPORT
29
- std::shared_ptr<TurboModule> RNMpSessionReplaySpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
-
31
- } // namespace facebook::react
@@ -1,51 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleCpp.js
8
- */
9
-
10
- #include "RNMpSessionReplaySpecJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
- static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_startRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->startRecording(
16
- rt
17
- );
18
- return jsi::Value::undefined();
19
- }
20
- static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_stopRecording(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
21
- static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->stopRecording(
22
- rt
23
- );
24
- return jsi::Value::undefined();
25
- }
26
- static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
27
- static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->initialize(
28
- rt,
29
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
30
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
31
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
32
- );
33
- return jsi::Value::undefined();
34
- }
35
- static jsi::Value __hostFunction_NativeMpSessionReplayCxxSpecJSI_captureScreenshot(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
- static_cast<NativeMpSessionReplayCxxSpecJSI *>(&turboModule)->captureScreenshot(
37
- rt
38
- );
39
- return jsi::Value::undefined();
40
- }
41
-
42
- NativeMpSessionReplayCxxSpecJSI::NativeMpSessionReplayCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
43
- : TurboModule("MpSessionReplay", jsInvoker) {
44
- methodMap_["startRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_startRecording};
45
- methodMap_["stopRecording"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_stopRecording};
46
- methodMap_["initialize"] = MethodMetadata {3, __hostFunction_NativeMpSessionReplayCxxSpecJSI_initialize};
47
- methodMap_["captureScreenshot"] = MethodMetadata {0, __hostFunction_NativeMpSessionReplayCxxSpecJSI_captureScreenshot};
48
- }
49
-
50
-
51
- } // namespace facebook::react
@@ -1,98 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
- class JSI_EXPORT NativeMpSessionReplayCxxSpecJSI : public TurboModule {
19
- protected:
20
- NativeMpSessionReplayCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
-
22
- public:
23
- virtual void startRecording(jsi::Runtime &rt) = 0;
24
- virtual void stopRecording(jsi::Runtime &rt) = 0;
25
- virtual void initialize(jsi::Runtime &rt, jsi::String token, jsi::String distinctId, jsi::String configJSON) = 0;
26
- virtual void captureScreenshot(jsi::Runtime &rt) = 0;
27
-
28
- };
29
-
30
- template <typename T>
31
- class JSI_EXPORT NativeMpSessionReplayCxxSpec : public TurboModule {
32
- public:
33
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
34
- return delegate_.create(rt, propName);
35
- }
36
-
37
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
38
- return delegate_.getPropertyNames(runtime);
39
- }
40
-
41
- static constexpr std::string_view kModuleName = "MpSessionReplay";
42
-
43
- protected:
44
- NativeMpSessionReplayCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
45
- : TurboModule(std::string{NativeMpSessionReplayCxxSpec::kModuleName}, jsInvoker),
46
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
47
-
48
-
49
- private:
50
- class Delegate : public NativeMpSessionReplayCxxSpecJSI {
51
- public:
52
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
53
- NativeMpSessionReplayCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
54
-
55
- }
56
-
57
- void startRecording(jsi::Runtime &rt) override {
58
- static_assert(
59
- bridging::getParameterCount(&T::startRecording) == 1,
60
- "Expected startRecording(...) to have 1 parameters");
61
-
62
- return bridging::callFromJs<void>(
63
- rt, &T::startRecording, jsInvoker_, instance_);
64
- }
65
- void stopRecording(jsi::Runtime &rt) override {
66
- static_assert(
67
- bridging::getParameterCount(&T::stopRecording) == 1,
68
- "Expected stopRecording(...) to have 1 parameters");
69
-
70
- return bridging::callFromJs<void>(
71
- rt, &T::stopRecording, jsInvoker_, instance_);
72
- }
73
- void initialize(jsi::Runtime &rt, jsi::String token, jsi::String distinctId, jsi::String configJSON) override {
74
- static_assert(
75
- bridging::getParameterCount(&T::initialize) == 4,
76
- "Expected initialize(...) to have 4 parameters");
77
-
78
- return bridging::callFromJs<void>(
79
- rt, &T::initialize, jsInvoker_, instance_, std::move(token), std::move(distinctId), std::move(configJSON));
80
- }
81
- void captureScreenshot(jsi::Runtime &rt) override {
82
- static_assert(
83
- bridging::getParameterCount(&T::captureScreenshot) == 1,
84
- "Expected captureScreenshot(...) to have 1 parameters");
85
-
86
- return bridging::callFromJs<void>(
87
- rt, &T::captureScreenshot, jsInvoker_, instance_);
88
- }
89
-
90
- private:
91
- friend class NativeMpSessionReplayCxxSpec;
92
- T *instance_;
93
- };
94
-
95
- Delegate delegate_;
96
- };
97
-
98
- } // namespace facebook::react