react-native-mparticle 2.7.12 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/SECURITY.md +9 -0
  2. package/android/build.gradle +65 -10
  3. package/android/src/main/AndroidManifestNew.xml +3 -0
  4. package/android/src/main/java/com/mparticle/react/MParticleModule.kt +976 -0
  5. package/android/src/main/java/com/mparticle/react/MParticlePackage.kt +68 -0
  6. package/android/src/main/java/com/mparticle/react/rokt/MPRoktModuleImpl.kt +251 -0
  7. package/android/src/main/java/com/mparticle/react/rokt/RoktLayoutViewManagerImpl.kt +79 -0
  8. package/android/src/newarch/java/com/mparticle/react/rokt/MPRoktModule.kt +130 -0
  9. package/android/src/newarch/java/com/mparticle/react/rokt/RoktLayoutViewManager.kt +22 -0
  10. package/android/src/oldarch/java/com/mparticle/react/NativeMPRoktSpec.kt +29 -0
  11. package/android/src/oldarch/java/com/mparticle/react/NativeMParticleSpec.kt +153 -0
  12. package/android/src/oldarch/java/com/mparticle/react/rokt/MPRoktModule.kt +79 -0
  13. package/android/src/oldarch/java/com/mparticle/react/rokt/RoktLayoutViewManager.kt +34 -0
  14. package/ios/RNMParticle/RNMPRokt.h +15 -0
  15. package/ios/RNMParticle/RNMPRokt.mm +247 -0
  16. package/ios/RNMParticle/RNMParticle.h +6 -1
  17. package/ios/RNMParticle/RNMParticle.mm +1199 -0
  18. package/ios/RNMParticle/RoktEventManager.h +16 -0
  19. package/ios/RNMParticle/RoktEventManager.m +174 -0
  20. package/ios/RNMParticle/RoktLayoutManager.m +22 -0
  21. package/ios/RNMParticle/RoktNativeLayoutComponentView.h +18 -0
  22. package/ios/RNMParticle/RoktNativeLayoutComponentView.mm +50 -0
  23. package/ios/RNMParticle.xcodeproj/project.pbxproj +29 -6
  24. package/js/codegenSpecs/NativeMParticle.ts +214 -0
  25. package/js/codegenSpecs/rokt/NativeMPRokt.ts +32 -0
  26. package/js/codegenSpecs/rokt/RoktLayoutNativeComponent.ts +29 -0
  27. package/js/index.tsx +940 -0
  28. package/js/rokt/rokt-layout-view.android.tsx +133 -0
  29. package/js/rokt/rokt-layout-view.ios.tsx +121 -0
  30. package/js/rokt/rokt-layout-view.tsx +15 -0
  31. package/js/rokt/rokt.ts +87 -0
  32. package/js/utils/architecture.ts +22 -0
  33. package/lib/codegenSpecs/NativeMParticle.d.ts +148 -0
  34. package/lib/codegenSpecs/NativeMParticle.js +5 -0
  35. package/lib/codegenSpecs/NativeMParticle.js.map +1 -0
  36. package/lib/codegenSpecs/rokt/NativeMPRokt.d.ts +24 -0
  37. package/lib/codegenSpecs/rokt/NativeMPRokt.js +5 -0
  38. package/lib/codegenSpecs/rokt/NativeMPRokt.js.map +1 -0
  39. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.d.ts +18 -0
  40. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.js +8 -0
  41. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.js.map +1 -0
  42. package/lib/index.d.ts +410 -0
  43. package/lib/index.js +645 -0
  44. package/lib/index.js.map +1 -0
  45. package/lib/rokt/rokt-layout-view.android.d.ts +39 -0
  46. package/lib/rokt/rokt-layout-view.android.js +109 -0
  47. package/lib/rokt/rokt-layout-view.android.js.map +1 -0
  48. package/lib/rokt/rokt-layout-view.d.ts +5 -0
  49. package/lib/rokt/rokt-layout-view.ios.d.ts +32 -0
  50. package/lib/rokt/rokt-layout-view.ios.js +84 -0
  51. package/lib/rokt/rokt-layout-view.ios.js.map +1 -0
  52. package/lib/rokt/rokt-layout-view.js +12 -0
  53. package/lib/rokt/rokt-layout-view.js.map +1 -0
  54. package/lib/rokt/rokt.d.ts +40 -0
  55. package/lib/rokt/rokt.js +54 -0
  56. package/lib/rokt/rokt.js.map +1 -0
  57. package/lib/utils/architecture.d.ts +9 -0
  58. package/lib/utils/architecture.js +19 -0
  59. package/lib/utils/architecture.js.map +1 -0
  60. package/package.json +32 -10
  61. package/react-native-mparticle.podspec +7 -6
  62. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  63. package/.github/dependabot.yml +0 -12
  64. package/.github/workflows/daily.yml +0 -19
  65. package/.github/workflows/dependabot-automerge.yml +0 -12
  66. package/.github/workflows/pull-request.yml +0 -60
  67. package/.github/workflows/release.yml +0 -60
  68. package/.github/workflows/sonarcloud.yml +0 -16
  69. package/android/.classpath +0 -6
  70. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  71. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  72. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  73. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  74. package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
  75. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  76. package/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  77. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  78. package/android/.gradle/7.5.1/gc.properties +0 -0
  79. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  80. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  81. package/android/.gradle/vcs-1/gc.properties +0 -0
  82. package/android/.project +0 -34
  83. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  84. package/android/.settings/org.eclipse.jdt.core.prefs +0 -4
  85. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  86. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  87. package/android/gradle.properties +0 -53
  88. package/android/gradlew +0 -160
  89. package/android/gradlew.bat +0 -90
  90. package/android/libs/java-json.jar +0 -0
  91. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar +0 -0
  92. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.md5 +0 -1
  93. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha1 +0 -1
  94. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha256 +0 -1
  95. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha512 +0 -1
  96. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar +0 -0
  97. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.md5 +0 -1
  98. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha1 +0 -1
  99. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha256 +0 -1
  100. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha512 +0 -1
  101. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar +0 -0
  102. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.md5 +0 -1
  103. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha1 +0 -1
  104. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha256 +0 -1
  105. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha512 +0 -1
  106. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar +0 -0
  107. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.md5 +0 -1
  108. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha1 +0 -1
  109. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha256 +0 -1
  110. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha512 +0 -1
  111. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module +0 -204
  112. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.md5 +0 -1
  113. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha1 +0 -1
  114. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha256 +0 -1
  115. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha512 +0 -1
  116. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom +0 -44
  117. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.md5 +0 -1
  118. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha1 +0 -1
  119. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha256 +0 -1
  120. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha512 +0 -1
  121. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml +0 -13
  122. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +0 -1
  123. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +0 -1
  124. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +0 -1
  125. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +0 -1
  126. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar +0 -0
  127. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.md5 +0 -1
  128. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha1 +0 -1
  129. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha256 +0 -1
  130. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha512 +0 -1
  131. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar +0 -0
  132. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.md5 +0 -1
  133. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha1 +0 -1
  134. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha256 +0 -1
  135. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha512 +0 -1
  136. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar +0 -0
  137. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.md5 +0 -1
  138. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha1 +0 -1
  139. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha256 +0 -1
  140. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha512 +0 -1
  141. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar +0 -0
  142. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.md5 +0 -1
  143. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha1 +0 -1
  144. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha256 +0 -1
  145. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha512 +0 -1
  146. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module +0 -628
  147. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.md5 +0 -1
  148. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha1 +0 -1
  149. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha256 +0 -1
  150. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha512 +0 -1
  151. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom +0 -156
  152. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.md5 +0 -1
  153. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha1 +0 -1
  154. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha256 +0 -1
  155. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha512 +0 -1
  156. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml +0 -13
  157. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.md5 +0 -1
  158. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha1 +0 -1
  159. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha256 +0 -1
  160. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha512 +0 -1
  161. package/android/src/main/java/com/mparticle/react/MParticleModule.java +0 -987
  162. package/android/src/main/java/com/mparticle/react/MParticlePackage.java +0 -34
  163. package/android/src/test/java/com/mparticle/react/IdentityApiTest.java +0 -230
  164. package/android/src/test/java/com/mparticle/react/MParticleUserTest.java +0 -233
  165. package/android/src/test/java/com/mparticle/react/testutils/MockMParticleUser.java +0 -103
  166. package/android/src/test/java/com/mparticle/react/testutils/MockMap.java +0 -169
  167. package/android/src/test/java/com/mparticle/react/testutils/MockReadableArray.java +0 -53
  168. package/android/src/test/java/com/mparticle/react/testutils/MockWritableMap.java +0 -4
  169. package/android/src/test/java/com/mparticle/react/testutils/Mutable.java +0 -13
  170. package/ios/RNMParticle/RNMParticle.m +0 -671
  171. package/ios/RNMParticle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  172. package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  173. package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcuserdata/bstalnaker.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  174. package/ios/RNMParticle.xcodeproj/xcuserdata/bstalnaker.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  175. package/ios/RNMParticle.xcodeproj/xcuserdata/bstalnaker.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  176. package/js/index.js +0 -697
  177. package/release.sh +0 -6
@@ -0,0 +1,39 @@
1
+ import React, { Component } from 'react';
2
+ /**
3
+ * PUBLIC API: Props that users of RoktLayoutView can set
4
+ */
5
+ export interface RoktLayoutViewProps {
6
+ placeholderName: string;
7
+ }
8
+ /**
9
+ * INTERNAL: State managed by the component to handle native events
10
+ */
11
+ export interface RoktLayoutViewState {
12
+ height: number;
13
+ placeholderName: string;
14
+ marginTop: number;
15
+ marginRight: number;
16
+ marginLeft: number;
17
+ marginBottom: number;
18
+ }
19
+ /**
20
+ * RoktEmbeddedView is a wrapper component for the native RoktNativeWidget.
21
+ * It handles the native events internally and provides a simpler API for React Native apps.
22
+ *
23
+ * This component only exposes the placeholderName prop to users, hiding all the internal complexity.
24
+ */
25
+ export declare class RoktLayoutView extends Component<RoktLayoutViewProps, RoktLayoutViewState> {
26
+ constructor(props: RoktLayoutViewProps);
27
+ /**
28
+ * Handles the height changed event from the native component
29
+ * This is an internal implementation detail not exposed to users
30
+ */
31
+ private handleHeightChanged;
32
+ /**
33
+ * Handles the margin changed event from the native component
34
+ * This is an internal implementation detail not exposed to users
35
+ */
36
+ private handleMarginChanged;
37
+ render(): React.JSX.Element | null;
38
+ }
39
+ export default RoktLayoutView;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.RoktLayoutView = void 0;
30
+ const react_native_1 = require("react-native");
31
+ const react_1 = __importStar(require("react"));
32
+ const RoktLayoutNativeComponent_1 = __importDefault(require("../codegenSpecs/rokt/RoktLayoutNativeComponent"));
33
+ const styles = react_native_1.StyleSheet.create({
34
+ widget: {
35
+ flex: 1,
36
+ backgroundColor: 'transparent',
37
+ },
38
+ });
39
+ /**
40
+ * RoktEmbeddedView is a wrapper component for the native RoktNativeWidget.
41
+ * It handles the native events internally and provides a simpler API for React Native apps.
42
+ *
43
+ * This component only exposes the placeholderName prop to users, hiding all the internal complexity.
44
+ */
45
+ class RoktLayoutView extends react_1.Component {
46
+ constructor(props) {
47
+ super(props);
48
+ /**
49
+ * Handles the height changed event from the native component
50
+ * This is an internal implementation detail not exposed to users
51
+ */
52
+ this.handleHeightChanged = (event) => {
53
+ if (event && event.nativeEvent && event.nativeEvent.height) {
54
+ this.setState({ height: parseInt(event.nativeEvent.height) });
55
+ }
56
+ };
57
+ /**
58
+ * Handles the margin changed event from the native component
59
+ * This is an internal implementation detail not exposed to users
60
+ */
61
+ this.handleMarginChanged = (event) => {
62
+ if (event && event.nativeEvent) {
63
+ const { marginTop, marginLeft, marginRight, marginBottom } = event.nativeEvent;
64
+ this.setState({
65
+ marginTop: parseInt(marginTop || '0'),
66
+ marginLeft: parseInt(marginLeft || '0'),
67
+ marginRight: parseInt(marginRight || '0'),
68
+ marginBottom: parseInt(marginBottom || '0'),
69
+ });
70
+ }
71
+ };
72
+ this.state = {
73
+ height: 0,
74
+ placeholderName: this.props.placeholderName,
75
+ marginTop: 0,
76
+ marginRight: 0,
77
+ marginLeft: 0,
78
+ marginBottom: 0,
79
+ };
80
+ }
81
+ render() {
82
+ try {
83
+ // Get the placeholderName from props
84
+ const { placeholderName } = this.props;
85
+ // Return the native component with the props
86
+ // Cast to React.ComponentType to make it compatible with JSX
87
+ const RoktComponent =
88
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
+ RoktLayoutNativeComponent_1.default;
90
+ return (<RoktComponent placeholderName={placeholderName} style={[
91
+ styles.widget,
92
+ {
93
+ height: this.state.height,
94
+ marginTop: this.state.marginTop,
95
+ marginLeft: this.state.marginLeft,
96
+ marginRight: this.state.marginRight,
97
+ marginBottom: this.state.marginBottom,
98
+ },
99
+ ]} onLayoutHeightChanged={this.handleHeightChanged} onLayoutMarginChanged={this.handleMarginChanged}/>);
100
+ }
101
+ catch (error) {
102
+ console.error('[ROKT] Error rendering RoktEmbeddedView:', error);
103
+ return null;
104
+ }
105
+ }
106
+ }
107
+ exports.RoktLayoutView = RoktLayoutView;
108
+ exports.default = RoktLayoutView;
109
+ //# sourceMappingURL=rokt-layout-view.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rokt-layout-view.android.js","sourceRoot":"","sources":["../../js/rokt/rokt-layout-view.android.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,+CAAyC;AACzC,+GAAuF;AAwCvF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAa,cAAe,SAAQ,iBAGnC;IACC,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QAWf;;;WAGG;QACK,wBAAmB,GAAG,CAAC,KAAyB,EAAE,EAAE;YAC1D,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE;gBAC1D,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aAC/D;QACH,CAAC,CAAC;QAEF;;;WAGG;QACK,wBAAmB,GAAG,CAAC,KAAyB,EAAE,EAAE;YAC1D,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW,EAAE;gBAC9B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,GACxD,KAAK,CAAC,WAAW,CAAC;gBACpB,IAAI,CAAC,QAAQ,CAAC;oBACZ,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,GAAG,CAAC;oBACrC,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC;oBACvC,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,GAAG,CAAC;oBACzC,YAAY,EAAE,QAAQ,CAAC,YAAY,IAAI,GAAG,CAAC;iBAC5C,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QAnCA,IAAI,CAAC,KAAK,GAAG;YACX,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe;YAC3C,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,CAAC;SAChB,CAAC;IACJ,CAAC;IA6BQ,MAAM;QACb,IAAI;YACF,qCAAqC;YACrC,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAEvC,6CAA6C;YAC7C,6DAA6D;YAC7D,MAAM,aAAa;YACjB,8DAA8D;YAC9D,mCAAqD,CAAC;YACxD,OAAO,CACL,CAAC,aAAa,CACZ,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,KAAK,CAAC,CAAC;oBACL,MAAM,CAAC,MAAM;oBACb;wBACE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;wBACzB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;wBAC/B,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;wBACjC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;wBACnC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY;qBACtC;iBACF,CAAC,CACF,qBAAqB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAChD,qBAAqB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAChD,CACH,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF;AA3ED,wCA2EC;AAED,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { RoktLayoutView as RoktLayoutViewIOS } from './rokt-layout-view.ios';
2
+ import { RoktLayoutView as RoktLayoutViewAndroid } from './rokt-layout-view.android';
3
+ export type { RoktLayoutViewProps } from './rokt-layout-view.ios';
4
+ export declare const RoktLayoutView: typeof RoktLayoutViewIOS | typeof RoktLayoutViewAndroid;
5
+ export default RoktLayoutView;
@@ -0,0 +1,32 @@
1
+ import React, { Component } from 'react';
2
+ export interface HeightChangedEvent extends Event {
3
+ height: string;
4
+ }
5
+ export interface MarginChangedEvent extends Event {
6
+ marginTop: string;
7
+ marginRight: string;
8
+ marginLeft: string;
9
+ marginBottom: string;
10
+ }
11
+ export interface WidgetChangeEvent {
12
+ selectedPlacement: string;
13
+ height: string;
14
+ }
15
+ export interface RoktLayoutViewProps {
16
+ placeholderName: string;
17
+ }
18
+ export interface RoktLayoutViewState {
19
+ height: number;
20
+ placeholderName: string;
21
+ marginTop: number;
22
+ marginRight: number;
23
+ marginLeft: number;
24
+ marginBottom: number;
25
+ }
26
+ export declare class RoktLayoutView extends Component<RoktLayoutViewProps, RoktLayoutViewState> {
27
+ subscription: import("react-native").EmitterSubscription;
28
+ constructor(props: RoktLayoutViewProps);
29
+ render(): React.JSX.Element;
30
+ componentWillUnmount(): void;
31
+ }
32
+ export default RoktLayoutView;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.RoktLayoutView = void 0;
30
+ const react_native_1 = require("react-native");
31
+ const react_1 = __importStar(require("react"));
32
+ const architecture_1 = require("../utils/architecture");
33
+ const RoktLayoutNativeComponent_1 = __importDefault(require("../codegenSpecs/rokt/RoktLayoutNativeComponent"));
34
+ const RoktEventManager = react_native_1.NativeModules.RoktEventManager;
35
+ // Use the appropriate component based on architecture
36
+ const LayoutNativeComponent = (architecture_1.isFabricEnabled
37
+ ? RoktLayoutNativeComponent_1.default
38
+ : (0, react_native_1.requireNativeComponent)('RoktLegacyLayout'));
39
+ const eventManagerEmitter = new react_native_1.NativeEventEmitter(RoktEventManager);
40
+ class RoktLayoutView extends react_1.Component {
41
+ constructor(props) {
42
+ super(props);
43
+ this.subscription = eventManagerEmitter.addListener('LayoutHeightChanges', (widgetChanges) => {
44
+ if (widgetChanges.selectedPlacement == this.state.placeholderName) {
45
+ this.setState({ height: parseInt(widgetChanges.height) });
46
+ }
47
+ });
48
+ this.state = {
49
+ height: 0,
50
+ placeholderName: this.props.placeholderName,
51
+ marginTop: 0,
52
+ marginRight: 0,
53
+ marginLeft: 0,
54
+ marginBottom: 0,
55
+ };
56
+ }
57
+ render() {
58
+ return (<LayoutNativeComponent style={[styles.widget, { height: this.state.height }]} placeholderName={this.state.placeholderName} onLayoutHeightChanged={(event) => {
59
+ if (event.height) {
60
+ this.setState({ height: parseInt(event.height) });
61
+ }
62
+ }} onLayoutMarginChanged={(event) => {
63
+ this.setState({
64
+ marginTop: parseInt(event.marginTop || '0'),
65
+ marginRight: parseInt(event.marginRight || '0'),
66
+ marginLeft: parseInt(event.marginLeft || '0'),
67
+ marginBottom: parseInt(event.marginBottom || '0'),
68
+ });
69
+ }}/>);
70
+ }
71
+ componentWillUnmount() {
72
+ this.subscription.remove();
73
+ }
74
+ }
75
+ exports.RoktLayoutView = RoktLayoutView;
76
+ const styles = react_native_1.StyleSheet.create({
77
+ widget: {
78
+ flex: 1,
79
+ backgroundColor: 'transparent',
80
+ overflow: 'hidden',
81
+ },
82
+ });
83
+ exports.default = RoktLayoutView;
84
+ //# sourceMappingURL=rokt-layout-view.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rokt-layout-view.ios.js","sourceRoot":"","sources":["../../js/rokt/rokt-layout-view.ios.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOsB;AACtB,+CAAyC;AACzC,wDAAwD;AACxD,+GAAuF;AAEvF,MAAM,gBAAgB,GAAG,4BAAa,CAAC,gBAAgC,CAAC;AAsCxE,sDAAsD;AACtD,MAAM,qBAAqB,GAAG,CAC5B,8BAAe;IACb,CAAC,CAAC,mCAAyB;IAC3B,CAAC,CAAC,IAAA,qCAAsB,EAAwB,kBAAkB,CAAC,CAC/D,CAAC;AAET,MAAM,mBAAmB,GAAG,IAAI,iCAAkB,CAAC,gBAAgB,CAAC,CAAC;AAErE,MAAa,cAAe,SAAQ,iBAGnC;IAUC,YAAY,KAA0B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QAVf,iBAAY,GAAG,mBAAmB,CAAC,WAAW,CAC5C,qBAAqB,EACrB,CAAC,aAAgC,EAAE,EAAE;YACnC,IAAI,aAAa,CAAC,iBAAiB,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;gBACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aAC3D;QACH,CAAC,CACF,CAAC;QAKA,IAAI,CAAC,KAAK,GAAG;YACX,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe;YAC3C,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,CAAC;YACb,YAAY,EAAE,CAAC;SAChB,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,CACL,CAAC,qBAAqB,CACpB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CACtD,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAC5C,qBAAqB,CAAC,CAAC,CAAC,KAAyB,EAAE,EAAE;gBACnD,IAAI,KAAK,CAAC,MAAM,EAAE;oBAChB,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;iBACnD;YACH,CAAC,CAAC,CACF,qBAAqB,CAAC,CAAC,CAAC,KAAyB,EAAE,EAAE;gBACnD,IAAI,CAAC,QAAQ,CAAC;oBACZ,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,IAAI,GAAG,CAAC;oBAC3C,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,GAAG,CAAC;oBAC/C,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,IAAI,GAAG,CAAC;oBAC7C,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,GAAG,CAAC;iBAClD,CAAC,CAAC;YACL,CAAC,CAAC,EACF,CACH,CAAC;IACJ,CAAC;IAEQ,oBAAoB;QAC3B,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;CACF;AAnDD,wCAmDC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,aAAa;QAC9B,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CAAC;AAEH,kBAAe,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoktLayoutView = void 0;
4
+ const react_native_1 = require("react-native");
5
+ // Import both implementations
6
+ const rokt_layout_view_ios_1 = require("./rokt-layout-view.ios");
7
+ const rokt_layout_view_android_1 = require("./rokt-layout-view.android");
8
+ // Export the appropriate component based on platform
9
+ exports.RoktLayoutView = react_native_1.Platform.OS === 'ios' ? rokt_layout_view_ios_1.RoktLayoutView : rokt_layout_view_android_1.RoktLayoutView;
10
+ // Default export
11
+ exports.default = exports.RoktLayoutView;
12
+ //# sourceMappingURL=rokt-layout-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rokt-layout-view.js","sourceRoot":"","sources":["../../js/rokt/rokt-layout-view.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,8BAA8B;AAC9B,iEAA6E;AAC7E,yEAAqF;AAKrF,qDAAqD;AACxC,QAAA,cAAc,GACzB,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,qCAAiB,CAAC,CAAC,CAAC,yCAAqB,CAAC;AAEpE,iBAAiB;AACjB,kBAAe,sBAAc,CAAC"}
@@ -0,0 +1,40 @@
1
+ export declare abstract class Rokt {
2
+ /**
3
+ * Selects placements with a [identifier], [attributes], optional [placeholders], optional [roktConfig], and optional [fontFilePathMap].
4
+ *
5
+ * @param {string} identifier - The page identifier for the placement.
6
+ * @param {Record<string, string>} attributes - Attributes to be associated with the placement.
7
+ * @param {Record<string, number | null>} [placeholders] - Optional placeholders for dynamic content.
8
+ * @param {IRoktConfig} [roktConfig] - Optional configuration settings for Rokt.
9
+ * @param {Record<string, string>} [fontFilesMap] - Optional mapping of font files.
10
+ * @returns {Promise<void>} A promise that resolves when the placement request is sent.
11
+ */
12
+ static selectPlacements(identifier: string, attributes: Record<string, string>, placeholders?: Record<string, number | null>, roktConfig?: IRoktConfig, fontFilesMap?: Record<string, string>): Promise<void>;
13
+ static purchaseFinalized(placementId: string, catalogItemId: string, success: boolean): Promise<void>;
14
+ static createRoktConfig(colorMode?: ColorMode, cacheConfig?: CacheConfig): RoktConfig;
15
+ static createCacheConfig(cacheDurationInSeconds: number, cacheAttributes: Record<string, string>): CacheConfig;
16
+ }
17
+ export interface IRoktConfig {
18
+ readonly colorMode?: ColorMode;
19
+ readonly cacheConfig?: CacheConfig;
20
+ }
21
+ /**
22
+ * Cache configuration for Rokt SDK
23
+ */
24
+ export declare class CacheConfig {
25
+ readonly cacheDurationInSeconds?: number | undefined;
26
+ readonly cacheAttributes?: Record<string, string> | undefined;
27
+ /**
28
+ * @param cacheDurationInSeconds - The duration in seconds for which the Rokt SDK should cache the experience. Default is 90 minutes
29
+ * @param cacheAttributes - optional attributes to be used as cache key. If null, all the attributes will be used as the cache key
30
+ */
31
+ constructor(cacheDurationInSeconds?: number | undefined, cacheAttributes?: Record<string, string> | undefined);
32
+ }
33
+ declare class RoktConfig implements IRoktConfig {
34
+ readonly colorMode: ColorMode;
35
+ readonly cacheConfig?: CacheConfig;
36
+ constructor(colorMode: ColorMode, cacheConfig?: CacheConfig);
37
+ }
38
+ declare const RoktEventManager: any;
39
+ export { RoktEventManager };
40
+ export type ColorMode = 'light' | 'dark' | 'system';
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoktEventManager = exports.CacheConfig = exports.Rokt = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const architecture_1 = require("../utils/architecture");
6
+ const MPRokt = (0, architecture_1.getNativeModule)('RNMPRokt');
7
+ class Rokt {
8
+ /**
9
+ * Selects placements with a [identifier], [attributes], optional [placeholders], optional [roktConfig], and optional [fontFilePathMap].
10
+ *
11
+ * @param {string} identifier - The page identifier for the placement.
12
+ * @param {Record<string, string>} attributes - Attributes to be associated with the placement.
13
+ * @param {Record<string, number | null>} [placeholders] - Optional placeholders for dynamic content.
14
+ * @param {IRoktConfig} [roktConfig] - Optional configuration settings for Rokt.
15
+ * @param {Record<string, string>} [fontFilesMap] - Optional mapping of font files.
16
+ * @returns {Promise<void>} A promise that resolves when the placement request is sent.
17
+ */
18
+ static async selectPlacements(identifier, attributes, placeholders, roktConfig, fontFilesMap) {
19
+ MPRokt.selectPlacements(identifier, attributes, placeholders, roktConfig, fontFilesMap);
20
+ }
21
+ static async purchaseFinalized(placementId, catalogItemId, success) {
22
+ MPRokt.purchaseFinalized(placementId, catalogItemId, success);
23
+ }
24
+ static createRoktConfig(colorMode, cacheConfig) {
25
+ return new RoktConfig(colorMode !== null && colorMode !== void 0 ? colorMode : 'system', cacheConfig);
26
+ }
27
+ static createCacheConfig(cacheDurationInSeconds, cacheAttributes) {
28
+ return new CacheConfig(cacheDurationInSeconds, cacheAttributes);
29
+ }
30
+ }
31
+ exports.Rokt = Rokt;
32
+ /**
33
+ * Cache configuration for Rokt SDK
34
+ */
35
+ class CacheConfig {
36
+ /**
37
+ * @param cacheDurationInSeconds - The duration in seconds for which the Rokt SDK should cache the experience. Default is 90 minutes
38
+ * @param cacheAttributes - optional attributes to be used as cache key. If null, all the attributes will be used as the cache key
39
+ */
40
+ constructor(cacheDurationInSeconds, cacheAttributes) {
41
+ this.cacheDurationInSeconds = cacheDurationInSeconds;
42
+ this.cacheAttributes = cacheAttributes;
43
+ }
44
+ }
45
+ exports.CacheConfig = CacheConfig;
46
+ class RoktConfig {
47
+ constructor(colorMode, cacheConfig) {
48
+ this.colorMode = colorMode;
49
+ this.cacheConfig = cacheConfig;
50
+ }
51
+ }
52
+ const { RoktEventManager } = react_native_1.NativeModules;
53
+ exports.RoktEventManager = RoktEventManager;
54
+ //# sourceMappingURL=rokt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rokt.js","sourceRoot":"","sources":["../../js/rokt/rokt.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAC7C,wDAAwD;AAGxD,MAAM,MAAM,GAAG,IAAA,8BAAe,EAAwB,UAAU,CAAC,CAAC;AAElE,MAAsB,IAAI;IACxB;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,UAAkB,EAClB,UAAkC,EAClC,YAA4C,EAC5C,UAAwB,EACxB,YAAqC;QAErC,MAAM,CAAC,gBAAgB,CACrB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,YAAY,CACb,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAC5B,WAAmB,EACnB,aAAqB,EACrB,OAAgB;QAEhB,MAAM,CAAC,iBAAiB,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAqB,EAAE,WAAyB;QACtE,OAAO,IAAI,UAAU,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,QAAQ,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,iBAAiB,CACtB,sBAA8B,EAC9B,eAAuC;QAEvC,OAAO,IAAI,WAAW,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;IAClE,CAAC;CACF;AA7CD,oBA6CC;AAQD;;GAEG;AACH,MAAa,WAAW;IACtB;;;OAGG;IACH,YACkB,sBAA+B,EAC/B,eAAwC;QADxC,2BAAsB,GAAtB,sBAAsB,CAAS;QAC/B,oBAAe,GAAf,eAAe,CAAyB;IACvD,CAAC;CACL;AATD,kCASC;AAED,MAAM,UAAU;IAId,YAAY,SAAoB,EAAE,WAAyB;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AACD,MAAM,EAAE,gBAAgB,EAAE,GAAG,4BAAa,CAAC;AAElC,4CAAgB"}
@@ -0,0 +1,9 @@
1
+ import { TurboModule } from 'react-native';
2
+ export declare const isNewArchitecture: boolean;
3
+ export declare const isFabricEnabled: boolean;
4
+ /**
5
+ * Gets the native module for both old and new architectures
6
+ * @param moduleName The name of the module
7
+ * @returns The native module
8
+ */
9
+ export declare function getNativeModule<T extends TurboModule>(moduleName: string): T;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNativeModule = exports.isFabricEnabled = exports.isNewArchitecture = void 0;
4
+ const react_native_1 = require("react-native");
5
+ exports.isNewArchitecture = global.__turboModuleProxy != null;
6
+ exports.isFabricEnabled = global.nativeFabricUIManager != null;
7
+ /**
8
+ * Gets the native module for both old and new architectures
9
+ * @param moduleName The name of the module
10
+ * @returns The native module
11
+ */
12
+ function getNativeModule(moduleName) {
13
+ if (exports.isNewArchitecture) {
14
+ return react_native_1.TurboModuleRegistry.getEnforcing(moduleName);
15
+ }
16
+ return react_native_1.NativeModules[moduleName];
17
+ }
18
+ exports.getNativeModule = getNativeModule;
19
+ //# sourceMappingURL=architecture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"architecture.js","sourceRoot":"","sources":["../../js/utils/architecture.ts"],"names":[],"mappings":";;;AAAA,+CAA+E;AAOlE,QAAA,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,IAAI,IAAI,CAAC;AAEtD,QAAA,eAAe,GAAG,MAAM,CAAC,qBAAqB,IAAI,IAAI,CAAC;AAEpE;;;;GAIG;AACH,SAAgB,eAAe,CAAwB,UAAkB;IACvE,IAAI,yBAAiB,EAAE;QACrB,OAAO,kCAAmB,CAAC,YAAY,CAAI,UAAU,CAAC,CAAC;KACxD;IACD,OAAO,4BAAa,CAAC,UAAU,CAAM,CAAC;AACxC,CAAC;AALD,0CAKC"}
package/package.json CHANGED
@@ -4,16 +4,19 @@
4
4
  "homepage": "https://www.mparticle.com",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "mParticle/react-native-mparticle",
7
- "version": "2.7.12",
8
- "main": "js/index.js",
7
+ "version": "2.8.0",
8
+ "main": "lib/index.js",
9
+ "types": "lib/index.d.ts",
10
+ "react-native": "js/index",
9
11
  "scripts": {
10
- "test": "./node_modules/standard/bin/cmd.js",
11
- "fix": "./node_modules/standard/bin/cmd.js --fix"
12
- },
13
- "standard": {
14
- "ignore": [
15
- "/sample"
16
- ]
12
+ "build": "tsc",
13
+ "clean": "rm -rf lib",
14
+ "prepare": "yarn clean && yarn build",
15
+ "dev:pack": "yarn build && yarn pack --filename react-native-mparticle-latest.tgz",
16
+ "dev:link": "./dev-link.sh",
17
+ "lint": "eslint '{js,lib}/**/*.{ts,tsx}' --fix",
18
+ "format": "prettier --write '{js,lib}/**/*.{ts,tsx}'",
19
+ "test": "npm run lint"
17
20
  },
18
21
  "dependencies": {},
19
22
  "peerDependencies": {
@@ -21,6 +24,25 @@
21
24
  "react-native": ">= 0.45.0"
22
25
  },
23
26
  "devDependencies": {
24
- "standard": "^8.6.0"
27
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
28
+ "@typescript-eslint/parser": "^5.62.0",
29
+ "eslint": "^8.45.0",
30
+ "eslint-config-prettier": "^8.10.0",
31
+ "eslint-plugin-prettier": "^4.2.1",
32
+ "prettier": "^2.8.8",
33
+ "@types/react": "^18.0.0",
34
+ "@types/react-native": "^0.70.0",
35
+ "typescript": "5.0.4"
36
+ },
37
+ "codegenConfig": {
38
+ "name": "RNMParticle",
39
+ "type": "all",
40
+ "jsSrcsDir": "js/codegenSpecs",
41
+ "android": {
42
+ "javaPackageName": "com.mparticle.react"
43
+ },
44
+ "ios": {
45
+ "RoktNativeLayout": "RoktNativeLayoutComponentView"
46
+ }
25
47
  }
26
48
  }
@@ -17,12 +17,13 @@ Pod::Spec.new do |s|
17
17
  s.platforms = { :ios => ios_platform, :tvos => "9.2" }
18
18
 
19
19
  s.source = { :git => "https://github.com/mParticle/react-native-mparticle.git", :tag => "#{s.version}" }
20
- s.source_files = "ios/**/*.{h,m}"
21
-
22
- if defined?(install_modules_dependencies()) != nil
23
- install_modules_dependencies(s);
20
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
21
+
22
+ if respond_to?(:install_modules_dependencies, true)
23
+ install_modules_dependencies(s)
24
24
  else
25
- s.dependency 'React'
25
+ s.dependency "React-Core"
26
26
  end
27
- s.dependency 'mParticle-Apple-SDK', '~> 8.0'
27
+
28
+ s.dependency 'mParticle-Apple-SDK', '~> 8.0'
28
29
  end
@@ -1,8 +0,0 @@
1
- ## Summary
2
- {provide a thorough description of the changes}
3
-
4
- ## Testing Plan
5
- {explain how this has been tested, and what additional testing should be done}
6
-
7
- ## Master Issue
8
- Closes https://go.mparticle.com/work/REPLACEME
@@ -1,12 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: gradle
4
- directory: "/android"
5
- schedule:
6
- interval: daily
7
- labels: ["dependabot"]
8
- open-pull-requests-limit: 10
9
- ignore:
10
- - dependency-name: "com.google.firebase:firebase-messaging"
11
- commit-message:
12
- prefix: "chore"
@@ -1,19 +0,0 @@
1
- name: "Daily"
2
-
3
- on:
4
-
5
- schedule:
6
- - cron: "0 0 * * *"
7
-
8
- # Allow workflow to be manually run from the GitHub UI
9
- workflow_dispatch:
10
-
11
- jobs:
12
-
13
- # daily-job:
14
- # name: "Daily Common Repo Checks"
15
- # uses: mParticle/mparticle-workflows/.github/workflows/daily-cron.yml@main
16
-
17
- daily-local-job:
18
- name: "Daily Local Repo Checks"
19
- uses: mParticle/react-native-mparticle/.github/workflows/pull-request.yml@main
@@ -1,12 +0,0 @@
1
- name: "Dependabot Automerge"
2
-
3
- on:
4
- workflow_run:
5
- workflows: ["Build and Test"]
6
- types:
7
- - completed
8
-
9
- jobs:
10
- automerge-dependabot:
11
- name: "Automerge Dependabot PR"
12
- uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@main
@@ -1,60 +0,0 @@
1
- name: "Build and Test"
2
-
3
- on:
4
- pull_request:
5
- push:
6
- workflow_call:
7
- workflow_dispatch:
8
-
9
- jobs:
10
- js-tests:
11
- name: "JS Tests"
12
- runs-on: macOS-latest
13
- steps:
14
- - name: "Checkout"
15
- uses: actions/checkout@v4
16
- - uses: actions/setup-node@master
17
- - uses: c-hive/gha-yarn-cache@v2
18
-
19
- - name: "Install node modules"
20
- run: |
21
- yarn install
22
-
23
- - name: "Run test"
24
- run: |
25
- yarn test
26
-
27
- android-unit-tests:
28
- name: "Android Unit Tests"
29
- runs-on: ubuntu-latest
30
- steps:
31
- - name: "Checkout"
32
- uses: actions/checkout@v4
33
- - name: "Run Android Unit Tests"
34
- working-directory: android
35
- run: ./gradlew test
36
-
37
- android-lint:
38
- name: "Android Unit Tests"
39
- runs-on: ubuntu-latest
40
- steps:
41
- - name: "Checkout"
42
- uses: actions/checkout@v4
43
- - name: "Run Android Unit Tests"
44
- working-directory: android
45
- run: ./gradlew lint
46
-
47
- android-kotlin-lint:
48
- name: "Android Unit Tests"
49
- runs-on: ubuntu-latest
50
- steps:
51
- - name: "Checkout"
52
- uses: actions/checkout@v4
53
- - name: "Run Android Unit Tests"
54
- working-directory: android
55
- run: ./gradlew ktlintCheck
56
-
57
- automerge-dependabot:
58
- name: "Save PR Number for Dependabot Automerge"
59
- needs: [ js-tests, android-unit-tests, android-lint, android-kotlin-lint ]
60
- uses: mParticle/mparticle-workflows/.github/workflows/dependabot-save-pr-number.yml@main