@adobe/react-native-aepmessaging 7.2.1 → 7.4.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 (293) hide show
  1. package/RCTAEPMessaging.podspec +1 -1
  2. package/README.md +145 -16
  3. package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingConstants.java +3 -0
  4. package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingModule.java +103 -33
  5. package/babel.config.js +3 -0
  6. package/dist/module/Messaging.js +334 -0
  7. package/dist/module/Messaging.js.map +1 -0
  8. package/dist/module/index.js +30 -0
  9. package/dist/module/index.js.map +1 -0
  10. package/dist/module/models/ContentCard.js +24 -0
  11. package/dist/module/models/ContentCard.js.map +1 -0
  12. package/dist/{models → module/models}/HTMLProposition.js +8 -9
  13. package/dist/module/models/HTMLProposition.js.map +1 -0
  14. package/dist/module/models/InAppMessage.js +4 -0
  15. package/dist/module/models/InAppMessage.js.map +1 -0
  16. package/dist/module/models/JSONProposition.js +22 -0
  17. package/dist/module/models/JSONProposition.js.map +1 -0
  18. package/dist/module/models/Message.js +182 -0
  19. package/dist/module/models/Message.js.map +1 -0
  20. package/dist/module/models/MessagingDelegate.js +4 -0
  21. package/dist/module/models/MessagingDelegate.js.map +1 -0
  22. package/dist/module/models/MessagingEdgeEventType.js +24 -0
  23. package/dist/module/models/MessagingEdgeEventType.js.map +1 -0
  24. package/dist/module/models/MessagingProposition.js +57 -0
  25. package/dist/module/models/MessagingProposition.js.map +1 -0
  26. package/dist/module/models/MessagingPropositionItem.js +4 -0
  27. package/dist/module/models/MessagingPropositionItem.js.map +1 -0
  28. package/dist/module/models/PersonalizationSchema.js +26 -0
  29. package/dist/module/models/PersonalizationSchema.js.map +1 -0
  30. package/dist/module/models/PropositionItem.js +113 -0
  31. package/dist/module/models/PropositionItem.js.map +1 -0
  32. package/dist/module/models/ScopeDetails.js +2 -0
  33. package/dist/module/models/ScopeDetails.js.map +1 -0
  34. package/dist/{models/JSONProposition.js → module/models/index.js} +14 -12
  35. package/dist/module/models/index.js.map +1 -0
  36. package/dist/module/ui/components/Button/Button.js +57 -0
  37. package/dist/module/ui/components/Button/Button.js.map +1 -0
  38. package/dist/module/ui/components/Button/Button.spec.js +476 -0
  39. package/dist/module/ui/components/Button/Button.spec.js.map +1 -0
  40. package/dist/module/ui/components/ContentCardView/ContentCardView.js +257 -0
  41. package/dist/module/ui/components/ContentCardView/ContentCardView.js.map +1 -0
  42. package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js +363 -0
  43. package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js.map +1 -0
  44. package/dist/module/ui/components/DismissButton/DismissButton.js +70 -0
  45. package/dist/module/ui/components/DismissButton/DismissButton.js.map +1 -0
  46. package/dist/module/ui/components/DismissButton/DismissButton.spec.js +279 -0
  47. package/dist/module/ui/components/DismissButton/DismissButton.spec.js.map +1 -0
  48. package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js +34 -0
  49. package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js.map +1 -0
  50. package/dist/module/ui/components/Inbox/EmptyState.js +64 -0
  51. package/dist/module/ui/components/Inbox/EmptyState.js.map +1 -0
  52. package/dist/module/ui/components/Inbox/Inbox.js +235 -0
  53. package/dist/module/ui/components/Inbox/Inbox.js.map +1 -0
  54. package/dist/module/ui/components/Inbox/Inbox.spec.js +847 -0
  55. package/dist/module/ui/components/Inbox/Inbox.spec.js.map +1 -0
  56. package/dist/module/ui/components/Pagination/Pagination.js +176 -0
  57. package/dist/module/ui/components/Pagination/Pagination.js.map +1 -0
  58. package/dist/module/ui/components/Pagination/Pagination.spec.js +193 -0
  59. package/dist/module/ui/components/Pagination/Pagination.spec.js.map +1 -0
  60. package/dist/module/ui/components/UnreadIcon/UnreadIcon.js +184 -0
  61. package/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map +1 -0
  62. package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js +815 -0
  63. package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map +1 -0
  64. package/dist/{models/ContentCard.js → module/ui/components/index.js} +12 -12
  65. package/dist/module/ui/components/index.js.map +1 -0
  66. package/dist/module/ui/hooks/index.js +18 -0
  67. package/dist/module/ui/hooks/index.js.map +1 -0
  68. package/dist/module/ui/hooks/useAspectRatio.js +33 -0
  69. package/dist/module/ui/hooks/useAspectRatio.js.map +1 -0
  70. package/dist/module/ui/hooks/useAspectRatio.spec.js +65 -0
  71. package/dist/module/ui/hooks/useAspectRatio.spec.js.map +1 -0
  72. package/dist/module/ui/hooks/useContentCardUI.js +51 -0
  73. package/dist/module/ui/hooks/useContentCardUI.js.map +1 -0
  74. package/dist/module/ui/hooks/useContentCardUI.spec.js +85 -0
  75. package/dist/module/ui/hooks/useContentCardUI.spec.js.map +1 -0
  76. package/dist/module/ui/hooks/useInbox.js +49 -0
  77. package/dist/module/ui/hooks/useInbox.js.map +1 -0
  78. package/dist/module/ui/hooks/useInbox.spec.js +93 -0
  79. package/dist/module/ui/hooks/useInbox.spec.js.map +1 -0
  80. package/dist/module/ui/hooks/useInboxSettings.js +26 -0
  81. package/dist/module/ui/hooks/useInboxSettings.js.map +1 -0
  82. package/dist/module/ui/hooks/useInboxSettings.spec.js +50 -0
  83. package/dist/module/ui/hooks/useInboxSettings.spec.js.map +1 -0
  84. package/dist/module/ui/index.js +10 -0
  85. package/dist/module/ui/index.js.map +1 -0
  86. package/dist/module/ui/providers/InboxProvider.js +27 -0
  87. package/dist/module/ui/providers/InboxProvider.js.map +1 -0
  88. package/dist/module/ui/theme/Theme.js +2 -0
  89. package/dist/module/ui/theme/Theme.js.map +1 -0
  90. package/dist/module/ui/theme/ThemeProvider.js +112 -0
  91. package/dist/module/ui/theme/ThemeProvider.js.map +1 -0
  92. package/dist/{models/InAppMessage.js → module/ui/theme/index.js} +6 -3
  93. package/dist/module/ui/theme/index.js.map +1 -0
  94. package/dist/module/ui/types/ContentViewEvent.js +2 -0
  95. package/dist/module/ui/types/ContentViewEvent.js.map +1 -0
  96. package/dist/module/ui/types/Templates.js +26 -0
  97. package/dist/module/ui/types/Templates.js.map +1 -0
  98. package/dist/{models/ScopeDetails.js → module/ui/types/index.js} +6 -3
  99. package/dist/module/ui/types/index.js.map +1 -0
  100. package/dist/module/ui/utils/generateCardHash.js +50 -0
  101. package/dist/module/ui/utils/generateCardHash.js.map +1 -0
  102. package/dist/module/ui/utils/generateCardHash.spec.js +103 -0
  103. package/dist/module/ui/utils/generateCardHash.spec.js.map +1 -0
  104. package/dist/module/ui/utils/inboxStorage.js +65 -0
  105. package/dist/module/ui/utils/inboxStorage.js.map +1 -0
  106. package/dist/module/ui/utils/inboxStorage.spec.js +123 -0
  107. package/dist/module/ui/utils/inboxStorage.spec.js.map +1 -0
  108. package/dist/module/ui/utils/index.js +5 -0
  109. package/dist/module/ui/utils/index.js.map +1 -0
  110. package/dist/{Messaging.d.ts → typescript/Messaging.d.ts} +23 -7
  111. package/dist/typescript/Messaging.d.ts.map +1 -0
  112. package/dist/{index.d.ts → typescript/index.d.ts} +4 -2
  113. package/dist/typescript/index.d.ts.map +1 -0
  114. package/dist/typescript/models/ContentCard.d.ts +57 -0
  115. package/dist/typescript/models/ContentCard.d.ts.map +1 -0
  116. package/dist/{models → typescript/models}/HTMLProposition.d.ts +1 -0
  117. package/dist/typescript/models/HTMLProposition.d.ts.map +1 -0
  118. package/dist/{models → typescript/models}/InAppMessage.d.ts +1 -0
  119. package/dist/typescript/models/InAppMessage.d.ts.map +1 -0
  120. package/dist/{models → typescript/models}/JSONProposition.d.ts +1 -0
  121. package/dist/typescript/models/JSONProposition.d.ts.map +1 -0
  122. package/dist/{models → typescript/models}/Message.d.ts +14 -0
  123. package/dist/typescript/models/Message.d.ts.map +1 -0
  124. package/dist/{models → typescript/models}/MessagingDelegate.d.ts +1 -0
  125. package/dist/typescript/models/MessagingDelegate.d.ts.map +1 -0
  126. package/dist/{models → typescript/models}/MessagingEdgeEventType.d.ts +1 -0
  127. package/dist/typescript/models/MessagingEdgeEventType.d.ts.map +1 -0
  128. package/dist/{models → typescript/models}/MessagingProposition.d.ts +1 -0
  129. package/dist/typescript/models/MessagingProposition.d.ts.map +1 -0
  130. package/dist/{models → typescript/models}/MessagingPropositionItem.d.ts +1 -0
  131. package/dist/typescript/models/MessagingPropositionItem.d.ts.map +1 -0
  132. package/dist/{models → typescript/models}/PersonalizationSchema.d.ts +2 -0
  133. package/dist/typescript/models/PersonalizationSchema.d.ts.map +1 -0
  134. package/dist/{models → typescript/models}/PropositionItem.d.ts +1 -0
  135. package/dist/typescript/models/PropositionItem.d.ts.map +1 -0
  136. package/dist/{models → typescript/models}/ScopeDetails.d.ts +1 -0
  137. package/dist/typescript/models/ScopeDetails.d.ts.map +1 -0
  138. package/dist/typescript/models/index.d.ts +11 -0
  139. package/dist/typescript/models/index.d.ts.map +1 -0
  140. package/dist/typescript/ui/components/Button/Button.d.ts +14 -0
  141. package/dist/typescript/ui/components/Button/Button.d.ts.map +1 -0
  142. package/dist/typescript/ui/components/Button/Button.spec.d.ts +2 -0
  143. package/dist/typescript/ui/components/Button/Button.spec.d.ts.map +1 -0
  144. package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts +39 -0
  145. package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map +1 -0
  146. package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts +2 -0
  147. package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts.map +1 -0
  148. package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts +13 -0
  149. package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map +1 -0
  150. package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts +2 -0
  151. package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts.map +1 -0
  152. package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts +5 -0
  153. package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts.map +1 -0
  154. package/dist/typescript/ui/components/Inbox/EmptyState.d.ts +19 -0
  155. package/dist/typescript/ui/components/Inbox/EmptyState.d.ts.map +1 -0
  156. package/dist/typescript/ui/components/Inbox/Inbox.d.ts +21 -0
  157. package/dist/typescript/ui/components/Inbox/Inbox.d.ts.map +1 -0
  158. package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts +2 -0
  159. package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts.map +1 -0
  160. package/dist/typescript/ui/components/Pagination/Pagination.d.ts +14 -0
  161. package/dist/typescript/ui/components/Pagination/Pagination.d.ts.map +1 -0
  162. package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts +2 -0
  163. package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts.map +1 -0
  164. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts +14 -0
  165. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map +1 -0
  166. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts +2 -0
  167. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map +1 -0
  168. package/dist/typescript/ui/components/index.d.ts +10 -0
  169. package/dist/typescript/ui/components/index.d.ts.map +1 -0
  170. package/dist/typescript/ui/hooks/index.d.ts +4 -0
  171. package/dist/typescript/ui/hooks/index.d.ts.map +1 -0
  172. package/dist/typescript/ui/hooks/useAspectRatio.d.ts +3 -0
  173. package/dist/typescript/ui/hooks/useAspectRatio.d.ts.map +1 -0
  174. package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts +2 -0
  175. package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts.map +1 -0
  176. package/dist/typescript/ui/hooks/useContentCardUI.d.ts +14 -0
  177. package/dist/typescript/ui/hooks/useContentCardUI.d.ts.map +1 -0
  178. package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts +2 -0
  179. package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts.map +1 -0
  180. package/dist/typescript/ui/hooks/useInbox.d.ts +12 -0
  181. package/dist/typescript/ui/hooks/useInbox.d.ts.map +1 -0
  182. package/dist/typescript/ui/hooks/useInbox.spec.d.ts +2 -0
  183. package/dist/typescript/ui/hooks/useInbox.spec.d.ts.map +1 -0
  184. package/dist/typescript/ui/hooks/useInboxSettings.d.ts +7 -0
  185. package/dist/typescript/ui/hooks/useInboxSettings.d.ts.map +1 -0
  186. package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts +2 -0
  187. package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts.map +1 -0
  188. package/dist/typescript/ui/index.d.ts +8 -0
  189. package/dist/typescript/ui/index.d.ts.map +1 -0
  190. package/dist/typescript/ui/providers/InboxProvider.d.ts +56 -0
  191. package/dist/typescript/ui/providers/InboxProvider.d.ts.map +1 -0
  192. package/dist/typescript/ui/theme/Theme.d.ts +44 -0
  193. package/dist/typescript/ui/theme/Theme.d.ts.map +1 -0
  194. package/dist/typescript/ui/theme/ThemeProvider.d.ts +21 -0
  195. package/dist/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
  196. package/dist/typescript/ui/theme/index.d.ts +3 -0
  197. package/dist/typescript/ui/theme/index.d.ts.map +1 -0
  198. package/dist/typescript/ui/types/ContentViewEvent.d.ts +9 -0
  199. package/dist/typescript/ui/types/ContentViewEvent.d.ts.map +1 -0
  200. package/dist/typescript/ui/types/Templates.d.ts +43 -0
  201. package/dist/typescript/ui/types/Templates.d.ts.map +1 -0
  202. package/dist/typescript/ui/types/index.d.ts +3 -0
  203. package/dist/typescript/ui/types/index.d.ts.map +1 -0
  204. package/dist/typescript/ui/utils/generateCardHash.d.ts +21 -0
  205. package/dist/typescript/ui/utils/generateCardHash.d.ts.map +1 -0
  206. package/dist/typescript/ui/utils/generateCardHash.spec.d.ts +2 -0
  207. package/dist/typescript/ui/utils/generateCardHash.spec.d.ts.map +1 -0
  208. package/dist/typescript/ui/utils/inboxStorage.d.ts +20 -0
  209. package/dist/typescript/ui/utils/inboxStorage.d.ts.map +1 -0
  210. package/dist/typescript/ui/utils/inboxStorage.spec.d.ts +2 -0
  211. package/dist/typescript/ui/utils/inboxStorage.spec.d.ts.map +1 -0
  212. package/dist/typescript/ui/utils/index.d.ts +3 -0
  213. package/dist/typescript/ui/utils/index.d.ts.map +1 -0
  214. package/ios/src/RCTAEPMessaging.mm +15 -0
  215. package/ios/src/RCTAEPMessaging.swift +61 -3
  216. package/ios/src/RCTAEPMessagingConstants.swift +4 -1
  217. package/jest.config.js +15 -0
  218. package/package.json +33 -5
  219. package/src/Messaging.ts +288 -32
  220. package/src/index.ts +3 -3
  221. package/src/models/ContentCard.ts +52 -27
  222. package/src/models/HTMLProposition.ts +1 -1
  223. package/src/models/JSONProposition.ts +1 -1
  224. package/src/models/Message.ts +50 -0
  225. package/src/models/PersonalizationSchema.ts +1 -0
  226. package/src/models/index.ts +22 -0
  227. package/src/ui/components/Button/Button.spec.tsx +496 -0
  228. package/src/ui/components/Button/Button.tsx +76 -0
  229. package/src/ui/components/ContentCardView/ContentCardView.spec.tsx +278 -0
  230. package/src/ui/components/ContentCardView/ContentCardView.tsx +400 -0
  231. package/src/ui/components/DismissButton/DismissButton.spec.tsx +314 -0
  232. package/src/ui/components/DismissButton/DismissButton.tsx +100 -0
  233. package/src/ui/components/FullScreenCenterView/FullScreenCenterView.tsx +32 -0
  234. package/src/ui/components/Inbox/EmptyState.tsx +89 -0
  235. package/src/ui/components/Inbox/Inbox.spec.tsx +478 -0
  236. package/src/ui/components/Inbox/Inbox.tsx +275 -0
  237. package/src/ui/components/Pagination/Pagination.spec.tsx +159 -0
  238. package/src/ui/components/Pagination/Pagination.tsx +222 -0
  239. package/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx +878 -0
  240. package/src/ui/components/UnreadIcon/UnreadIcon.tsx +234 -0
  241. package/src/ui/components/index.ts +22 -0
  242. package/{dist/models/MessagingPropositionItem.js → src/ui/hooks/index.ts} +5 -4
  243. package/src/ui/hooks/useAspectRatio.spec.tsx +66 -0
  244. package/src/ui/hooks/useAspectRatio.tsx +39 -0
  245. package/src/ui/hooks/useContentCardUI.spec.tsx +82 -0
  246. package/src/ui/hooks/useContentCardUI.ts +48 -0
  247. package/src/ui/hooks/useInbox.spec.tsx +87 -0
  248. package/src/ui/hooks/useInbox.ts +46 -0
  249. package/src/ui/hooks/useInboxSettings.spec.tsx +41 -0
  250. package/src/ui/hooks/useInboxSettings.ts +24 -0
  251. package/src/ui/index.ts +7 -0
  252. package/src/ui/providers/InboxProvider.tsx +79 -0
  253. package/src/ui/theme/Theme.ts +57 -0
  254. package/src/ui/theme/ThemeProvider.tsx +120 -0
  255. package/src/ui/theme/index.ts +14 -0
  256. package/src/ui/types/ContentViewEvent.ts +20 -0
  257. package/src/ui/types/Templates.ts +77 -0
  258. package/src/ui/types/index.ts +14 -0
  259. package/src/ui/utils/generateCardHash.spec.tsx +86 -0
  260. package/src/ui/utils/generateCardHash.ts +59 -0
  261. package/src/ui/utils/inboxStorage.spec.tsx +136 -0
  262. package/src/ui/utils/inboxStorage.ts +64 -0
  263. package/src/ui/utils/index.ts +3 -0
  264. package/tutorials/ContentCardCustomizationGuide.md +661 -0
  265. package/tutorials/ContentCards.md +419 -0
  266. package/tutorials/In-App Messaging.md +31 -0
  267. package/tutorials/Inbox.md +515 -0
  268. package/tutorials/resources/image-only-template.png +0 -0
  269. package/tutorials/resources/large-image-template.png +0 -0
  270. package/tutorials/resources/small-image-template.png +0 -0
  271. package/dist/Messaging.js +0 -151
  272. package/dist/Messaging.js.map +0 -1
  273. package/dist/index.js +0 -34
  274. package/dist/index.js.map +0 -1
  275. package/dist/models/ContentCard.d.ts +0 -51
  276. package/dist/models/ContentCard.js.map +0 -1
  277. package/dist/models/HTMLProposition.js.map +0 -1
  278. package/dist/models/InAppMessage.js.map +0 -1
  279. package/dist/models/JSONProposition.js.map +0 -1
  280. package/dist/models/Message.js +0 -114
  281. package/dist/models/Message.js.map +0 -1
  282. package/dist/models/MessagingDelegate.js +0 -14
  283. package/dist/models/MessagingDelegate.js.map +0 -1
  284. package/dist/models/MessagingEdgeEventType.js +0 -24
  285. package/dist/models/MessagingEdgeEventType.js.map +0 -1
  286. package/dist/models/MessagingProposition.js +0 -59
  287. package/dist/models/MessagingProposition.js.map +0 -1
  288. package/dist/models/MessagingPropositionItem.js.map +0 -1
  289. package/dist/models/PersonalizationSchema.js +0 -25
  290. package/dist/models/PersonalizationSchema.js.map +0 -1
  291. package/dist/models/PropositionItem.js +0 -78
  292. package/dist/models/PropositionItem.js.map +0 -1
  293. package/dist/models/ScopeDetails.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContentCardUI.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useContentCardUI.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { InboxSettings } from "../providers/InboxProvider";
2
+ /**
3
+ * @experimental
4
+ * Fetches inbox UI settings for a surface via `Messaging.getInbox`.
5
+ */
6
+ export declare function useInbox(surface: string): {
7
+ settings: InboxSettings | null;
8
+ error: any;
9
+ isLoading: boolean;
10
+ refetch: () => Promise<void>;
11
+ };
12
+ //# sourceMappingURL=useInbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInbox.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useInbox.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM;;;;;EAyBvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useInbox.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInbox.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useInbox.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { InboxSettings } from "../providers/InboxProvider";
2
+ /**
3
+ * @experimental First React Native inbox UI — subject to change while we expand testing.
4
+ */
5
+ declare function useInboxSettings(): InboxSettings | null;
6
+ export default useInboxSettings;
7
+ //# sourceMappingURL=useInboxSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInboxSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useInboxSettings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAgB,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEzE;;GAEG;AACH,iBAAS,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAGhD;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useInboxSettings.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInboxSettings.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useInboxSettings.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ export * from './theme';
4
+ export * from './types';
5
+ export * from './utils';
6
+ export * from './providers/InboxProvider';
7
+ export { default as InboxProvider } from './providers/InboxProvider';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,56 @@
1
+ import React from "react";
2
+ export type SettingsPlacement = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
3
+ export interface InboxSettings {
4
+ activityId?: string;
5
+ content: {
6
+ heading: {
7
+ content: string;
8
+ };
9
+ layout: {
10
+ orientation: 'horizontal' | 'vertical';
11
+ };
12
+ capacity: number;
13
+ emptyStateSettings?: {
14
+ message: {
15
+ content: string;
16
+ };
17
+ image?: {
18
+ url?: string;
19
+ darkUrl?: string;
20
+ light?: {
21
+ url?: string;
22
+ };
23
+ dark?: {
24
+ url?: string;
25
+ };
26
+ };
27
+ };
28
+ unread_indicator?: {
29
+ unread_bg: {
30
+ clr: {
31
+ light: string;
32
+ dark: string;
33
+ };
34
+ };
35
+ unread_icon: {
36
+ placement: SettingsPlacement;
37
+ image: {
38
+ url: string;
39
+ darkUrl?: string;
40
+ };
41
+ };
42
+ };
43
+ /** Whether the unread feature is enabled. Defaults to true. */
44
+ isUnreadEnabled?: boolean;
45
+ };
46
+ showPagination?: boolean;
47
+ }
48
+ export declare const InboxContext: React.Context<InboxSettings | null>;
49
+ export interface InboxProviderProps {
50
+ children: React.ReactNode;
51
+ settings: InboxSettings;
52
+ }
53
+ /** @experimental */
54
+ declare function InboxProvider({ children, settings, }: InboxProviderProps): React.JSX.Element;
55
+ export default InboxProvider;
56
+ //# sourceMappingURL=InboxProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InboxProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/providers/InboxProvider.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACP,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,MAAM,EAAE;YACN,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;SACxC,CAAC;QACF,QAAQ,EAAE,MAAM,CAAC;QACjB,kBAAkB,CAAC,EAAE;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE,MAAM,CAAC;aACjB,CAAC;YACF,KAAK,CAAC,EAAE;gBACN,GAAG,CAAC,EAAE,MAAM,CAAC;gBACb,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,KAAK,CAAC,EAAE;oBAAE,GAAG,CAAC,EAAE,MAAM,CAAA;iBAAE,CAAC;gBACzB,IAAI,CAAC,EAAG;oBAAE,GAAG,CAAC,EAAE,MAAM,CAAA;iBAAE,CAAC;aAC1B,CAAC;SACH,CAAC;QACF,gBAAgB,CAAC,EAAE;YACjB,SAAS,EAAE;gBACT,GAAG,EAAE;oBACH,KAAK,EAAE,MAAM,CAAC;oBACd,IAAI,EAAE,MAAM,CAAC;iBACd,CAAC;aACH,CAAC;YACF,WAAW,EAAE;gBACX,SAAS,EAAE,iBAAiB,CAAC;gBAC7B,KAAK,EAAE;oBACL,GAAG,EAAE,MAAM,CAAC;oBACZ,OAAO,CAAC,EAAE,MAAM,CAAC;iBAClB,CAAC;aACH,CAAC;SACH,CAAC;QACF,+DAA+D;QAC/D,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,qCACkB,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,oBAAoB;AACpB,iBAAS,aAAa,CAAC,EACrB,QAAQ,EACR,QAAQ,GACT,EAAE,kBAAkB,qBAMpB;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Represents the themes for the messaging UI.
3
+ * @interface Themes
4
+ * @property {Theme} light - The light theme.
5
+ * @property {Theme} dark - The dark theme.
6
+ */
7
+ export interface Themes {
8
+ light: Theme;
9
+ dark: Theme;
10
+ }
11
+ /**
12
+ * Represents the theme for the messaging UI.
13
+ * @interface Theme
14
+ * @property {Colors} colors - The colors for the theme.
15
+ */
16
+ export interface Theme {
17
+ colors: Colors;
18
+ isDark: boolean;
19
+ }
20
+ /**
21
+ * Represents the colors for the theme.
22
+ * @interface Colors
23
+ * @property {string} primary - The primary color.
24
+ * @property {string} secondary - The secondary color.
25
+ * @property {string} background - The background color.
26
+ * @property {string} textPrimary - The primary text color.
27
+ * @property {string} textSecondary - The secondary text color.
28
+ * @property {string} imagePlaceholder - The image placeholder color.
29
+ * @property {string} buttonTextColor - The button text color.
30
+ */
31
+ export interface Colors {
32
+ primary?: string;
33
+ secondary?: string;
34
+ background?: string;
35
+ textPrimary?: string;
36
+ textSecondary?: string;
37
+ imagePlaceholder?: string;
38
+ buttonTextColor?: string;
39
+ activeColor?: string;
40
+ inactiveColor?: string;
41
+ dotColor?: string;
42
+ imageContainerColor?: string;
43
+ }
44
+ //# sourceMappingURL=Theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../src/ui/theme/Theme.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import { Theme, Themes } from './Theme';
3
+ interface ThemeProviderProps {
4
+ children: ReactNode;
5
+ customThemes: Themes;
6
+ }
7
+ /**
8
+ * ThemeProvider component that provides the theme to the children components.
9
+ *
10
+ * @param children - The children components.
11
+ * @param customThemes - The custom themes to override the default themes.
12
+ * @returns The ThemeProvider component.
13
+ */
14
+ export declare const ThemeProvider: ({ children, customThemes }: ThemeProviderProps) => import("react").JSX.Element;
15
+ /**
16
+ * useTheme hook that returns the theme context.
17
+ * @returns The theme context.
18
+ */
19
+ export declare const useTheme: () => Theme;
20
+ export {};
21
+ //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA6B,SAAS,EAAW,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAuCD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,4BAG3B,kBAAkB,gCAqCpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAO,KAO3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './Theme';
2
+ export * from './ThemeProvider';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/theme/index.ts"],"names":[],"mappings":"AAYA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The event types for the ContentView component.
3
+ *
4
+ * @property {string} onDismiss - The event type for the onDismiss event when the dismiss button is pressed.
5
+ * @property {string} onDisplay - The event type for the onDisplay event when the content card is displayed.
6
+ * @property {string} onInteract - The event type for the interact event when the content is pressed.
7
+ */
8
+ export type ContentViewEvent = 'onDismiss' | 'onDisplay' | 'onInteract';
9
+ //# sourceMappingURL=ContentViewEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentViewEvent.d.ts","sourceRoot":"","sources":["../../../../src/ui/types/ContentViewEvent.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { ButtonProps, ImageProps, ImageStyle, PressableProps, TextProps, TextStyle, ViewStyle } from 'react-native';
2
+ import { ViewProps } from 'react-native';
3
+ import { ContentCard, ContentCardData, ContentCardTemplate } from '../../models/ContentCard';
4
+ import { DismissButtonProps } from '../components/DismissButton/DismissButton';
5
+ export declare class ContentTemplate extends ContentCard {
6
+ readonly type: ContentCardTemplate;
7
+ constructor(data: ContentCardData, type: ContentCardTemplate, isRead?: boolean);
8
+ }
9
+ /** Overrides for the structural pieces of the content card */
10
+ export interface ComponentOverrideProps {
11
+ BodyProps?: Partial<TextProps>;
12
+ ButtonContainerProps?: Partial<ViewProps>;
13
+ ButtonProps?: Partial<Omit<ButtonProps, 'onPress'>>;
14
+ ContainerProps?: Partial<ViewProps>;
15
+ ContentContainerProps?: Partial<ViewProps>;
16
+ DismissButtonProps?: DismissButtonProps;
17
+ ImageContainerProps?: Partial<ViewProps>;
18
+ ImageProps?: Partial<ImageProps>;
19
+ TextProps?: Partial<TextProps>;
20
+ TitleProps?: Partial<TextProps>;
21
+ }
22
+ /** The base style overrides available for content cards */
23
+ export interface ContentCardStyles {
24
+ /** Applies to the root of the content card */
25
+ card?: ViewStyle;
26
+ /** Applies to the container inside the content card, applied inside the card Pressable */
27
+ container?: ViewStyle;
28
+ imageContainer?: ViewStyle;
29
+ image?: ImageStyle;
30
+ contentContainer?: ViewStyle;
31
+ /** Applies to title and body properties, will be overridden by title and body styles */
32
+ text?: TextStyle;
33
+ title?: TextStyle;
34
+ body?: TextStyle;
35
+ buttonContainer?: ViewStyle;
36
+ button?: PressableProps['style'];
37
+ buttonText?: TextStyle;
38
+ dismissButton?: PressableProps['style'];
39
+ }
40
+ export type SmallImageContentStyle = ContentCardStyles;
41
+ export type LargeImageContentStyle = ContentCardStyles;
42
+ export type ImageOnlyContentStyle = Pick<ContentCardStyles, 'card' | 'imageContainer' | 'image' | 'dismissButton'>;
43
+ //# sourceMappingURL=Templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Templates.d.ts","sourceRoot":"","sources":["../../../../src/ui/types/Templates.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;gBAEvB,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,GAAE,OAAe;CAItF;AAED,8DAA8D;AAC9D,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,mBAAmB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CACjC;AAED,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,wFAAwF;IACxF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,aAAa,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACvD,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACvD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,iBAAiB,EACjB,MAAM,GAAG,gBAAgB,GAAG,OAAO,GAAG,eAAe,CACtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './ContentViewEvent';
2
+ export * from './Templates';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/types/index.ts"],"names":[],"mappings":"AAYA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ContentTemplate } from '../types/Templates';
2
+ /**
3
+ * @experimental First React Native inbox / content-card UI
4
+ * Generate a stable identifier (hash) for a card based on its content
5
+ * This ensures the same card is identified even if the ID changes between refetches
6
+ *
7
+ * Priority: content hash (most stable) > uuid > id
8
+ *
9
+ * @param card - The content card template
10
+ * @returns A stable identifier string with a prefix indicating the source (content:, uuid:, or id:)
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const cardHash = generateCardHash(card);
15
+ * // Returns: "content:https://example.com|Title|Body|image.jpg|SmallImage"
16
+ * // or: "uuid:123e4567-e89b-12d3-a456-426614174000"
17
+ * // or: "id:card-123"
18
+ * ```
19
+ */
20
+ export declare const generateCardHash: (card: ContentTemplate | any) => string;
21
+ //# sourceMappingURL=generateCardHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateCardHash.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/generateCardHash.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,eAAe,GAAG,GAAG,KAAG,MAyB9D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generateCardHash.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateCardHash.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/generateCardHash.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export interface InboxPersistedState {
2
+ dismissed: string[];
3
+ interacted: string[];
4
+ }
5
+ /**
6
+ * Load persisted inbox state (dismissed and read card IDs) from native storage.
7
+ * Uses scopeDetails.activity.id as the key - this is constant across server responses.
8
+ * Persists via SharedPreferences (Android) / UserDefaults (iOS) - no AsyncStorage needed.
9
+ * @param activityId - From scopeDetails.activity in the inbox proposition
10
+ * @returns Persisted state or empty defaults if not found
11
+ */
12
+ export declare function loadInboxState(activityId: string): Promise<InboxPersistedState>;
13
+ /**
14
+ * @experimental First React Native inbox UI — subject to change while we expand testing.
15
+ * Save inbox state to native storage for persistence across app launches.
16
+ * @param activityId - From scopeDetails.activity in the inbox proposition
17
+ * @param state - Dismissed and interacted card IDs to persist
18
+ */
19
+ export declare function saveInboxState(activityId: string, state: InboxPersistedState): Promise<void>;
20
+ //# sourceMappingURL=inboxStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inboxStorage.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/inboxStorage.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAID;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAe9B;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=inboxStorage.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inboxStorage.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/inboxStorage.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { generateCardHash } from './generateCardHash';
2
+ export { loadInboxState, saveInboxState } from './inboxStorage';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -60,6 +60,10 @@ RCT_EXTERN_METHOD(handleJavascriptMessage
60
60
  : (NSString *)messageId handlerName
61
61
  : (NSString *)handlerName)
62
62
 
63
+ RCT_EXTERN_METHOD(evaluateJavascript
64
+ : (NSString *)messageId javascriptString
65
+ : (NSString *)javascriptString)
66
+
63
67
  RCT_EXTERN_METHOD(trackPropositionItem
64
68
  : (NSString *)uuid interaction
65
69
  : (NSString * _Nullable)interaction eventType
@@ -68,6 +72,17 @@ RCT_EXTERN_METHOD(trackPropositionItem
68
72
  : (RCTPromiseResolveBlock)resolve withRejecter
69
73
  : (RCTPromiseRejectBlock)reject);
70
74
 
75
+ RCT_EXTERN_METHOD(getInboxState
76
+ : (NSString *)activityId withResolver
77
+ : (RCTPromiseResolveBlock)resolve withRejecter
78
+ : (RCTPromiseRejectBlock)reject);
79
+
80
+ RCT_EXTERN_METHOD(setInboxState
81
+ : (NSString *)activityId stateJson
82
+ : (NSString *)stateJson withResolver
83
+ : (RCTPromiseResolveBlock)resolve withRejecter
84
+ : (RCTPromiseRejectBlock)reject);
85
+
71
86
  RCT_EXTERN_METHOD(setAutoTrack
72
87
  : (NSString *)messageId autoTrack
73
88
  : (BOOL)autoTrack);
@@ -126,9 +126,14 @@ public class RCTAEPMessaging: RCTEventEmitter, MessagingDelegate {
126
126
  withRejecter reject: @escaping RCTPromiseRejectBlock
127
127
  ) {
128
128
  let mapped = surfaces.map { Surface(path: $0) }
129
- Messaging.updatePropositionsForSurfaces(mapped)
130
- propositionByUuid.removeAll()
131
- resolve(nil)
129
+ Messaging.updatePropositionsForSurfaces(mapped) { success in
130
+ if success {
131
+ self.propositionByUuid.removeAll()
132
+ resolve(nil)
133
+ } else {
134
+ reject("Unable to update propositions for surfaces", nil, nil)
135
+ }
136
+ }
132
137
  }
133
138
 
134
139
  /// Message Class Methods
@@ -274,6 +279,37 @@ public class RCTAEPMessaging: RCTEventEmitter, MessagingDelegate {
274
279
  }
275
280
  }
276
281
 
282
+ @objc
283
+ func evaluateJavascript(
284
+ _ messageId: String,
285
+ javascriptString: String
286
+ ) {
287
+ guard let message = jsHandlerMessageCache[messageId] else {
288
+ print("[RCTAEPMessaging] evaluateJavascript: No message found in cache for messageId: \(messageId)")
289
+ return
290
+ }
291
+
292
+ guard let messageWebView = message.view as? WKWebView else {
293
+ print("[RCTAEPMessaging] evaluateJavascript: Could not get WKWebView from message")
294
+ return
295
+ }
296
+
297
+ messageWebView.evaluateJavaScript(javascriptString) { [weak self] result, error in
298
+ if let error = error {
299
+ print("[RCTAEPMessaging] evaluateJavascript error: \(error)")
300
+ }
301
+
302
+ self?.emitNativeEvent(
303
+ name: Constants.ON_JAVASCRIPT_RESULT_EVENT,
304
+ body: [
305
+ Constants.MESSAGE_ID_KEY: messageId,
306
+ Constants.JAVASCRIPT_STRING_KEY: javascriptString,
307
+ Constants.RESULT_KEY: result ?? NSNull()
308
+ ]
309
+ )
310
+ }
311
+ }
312
+
277
313
  /// MARK: - Unified PropositionItem Tracking Methods
278
314
 
279
315
  /**
@@ -330,7 +366,29 @@ public class RCTAEPMessaging: RCTEventEmitter, MessagingDelegate {
330
366
  resolve(nil)
331
367
  }
332
368
 
369
+ private static let inboxKeyPrefix = "aep_messaging_inbox_"
370
+
371
+ @objc
372
+ func getInboxState(_ activityId: String, withResolver resolve: @escaping RCTPromiseResolveBlock, withRejecter reject: @escaping RCTPromiseRejectBlock) {
373
+ guard !activityId.isEmpty else {
374
+ resolve(nil)
375
+ return
376
+ }
377
+ let key = RCTAEPMessaging.inboxKeyPrefix + activityId
378
+ let value = UserDefaults.standard.string(forKey: key)
379
+ resolve(value)
380
+ }
333
381
 
382
+ @objc
383
+ func setInboxState(_ activityId: String, stateJson: String, withResolver resolve: @escaping RCTPromiseResolveBlock, withRejecter reject: @escaping RCTPromiseRejectBlock) {
384
+ guard !activityId.isEmpty else {
385
+ resolve(nil)
386
+ return
387
+ }
388
+ let key = RCTAEPMessaging.inboxKeyPrefix + activityId
389
+ UserDefaults.standard.set(stateJson, forKey: key)
390
+ resolve(nil)
391
+ }
334
392
 
335
393
  // Map uuid (scopeDetails.activity.id) -> parent Proposition
336
394
  private var propositionByUuid = [String: Proposition]()
@@ -17,10 +17,13 @@ class Constants {
17
17
  static let SHOULD_SHOW_MESSAGE_EVENT = "shouldShowMessage"
18
18
  static let URL_LOADED_EVENT = "urlLoaded"
19
19
  static let ON_JAVASCRIPT_MESSAGE_EVENT = "onJavascriptMessage"
20
+ static let ON_JAVASCRIPT_RESULT_EVENT = "onJavascriptResult"
20
21
  static let SUPPORTED_EVENTS = [
21
- ON_DISMISS_EVENT, ON_SHOW_EVENT, SHOULD_SHOW_MESSAGE_EVENT, URL_LOADED_EVENT, ON_JAVASCRIPT_MESSAGE_EVENT
22
+ ON_DISMISS_EVENT, ON_SHOW_EVENT, SHOULD_SHOW_MESSAGE_EVENT, URL_LOADED_EVENT, ON_JAVASCRIPT_MESSAGE_EVENT, ON_JAVASCRIPT_RESULT_EVENT
22
23
  ]
23
24
  static let MESSAGE_ID_KEY = "messageId"
24
25
  static let HANDLER_NAME_KEY = "handlerName"
26
+ static let JAVASCRIPT_STRING_KEY = "javascriptString"
25
27
  static let CONTENT_KEY = "content"
28
+ static let RESULT_KEY = "result"
26
29
  }
package/jest.config.js ADDED
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ preset: "react-native",
3
+ testMatch: ["<rootDir>/src/ui/**/*.spec.tsx"],
4
+ collectCoverage: true,
5
+ collectCoverageFrom: [
6
+ "<rootDir>/src/ui/components/**/*.{ts,tsx}",
7
+ "<rootDir>/src/ui/utils/**/*.{ts,tsx}",
8
+ "<rootDir>/src/ui/hooks/**/*.{ts,tsx}",
9
+ "<rootDir>/src/ui/providers/**/*.{ts,tsx}",
10
+ "!**/*.spec.tsx",
11
+ "!**/__tests__/**",
12
+ ],
13
+ coverageReporters: ["text", "text-summary", "html", "lcov"],
14
+ coverageDirectory: "<rootDir>/coverage",
15
+ };
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@adobe/react-native-aepmessaging",
3
- "version": "7.2.1",
3
+ "version": "7.4.0",
4
4
  "description": "Adobe Experience Platform support for React Native apps.",
5
5
  "homepage": "https://developer.adobe.com/client-sdks/documentation/",
6
6
  "license": "Apache-2.0",
7
- "main": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
7
+ "main": "dist/module/index",
8
+ "module": "dist/module/index",
9
+ "react-native": "src/index",
10
+ "source": "src/index",
11
+ "types": "dist/typescript/index.d.ts",
9
12
  "scripts": {
10
13
  "cleanup": "rm -rf node_modules",
11
- "tsc": "tsc"
14
+ "tsc": "bob build",
15
+ "test:ui": "../../node_modules/.bin/jest --config jest.config.js"
12
16
  },
13
17
  "repository": {
14
18
  "type": "git",
@@ -31,13 +35,37 @@
31
35
  "@adobe/react-native-aepcore": "^7.0.0",
32
36
  "@adobe/react-native-aepedge": "^7.0.0",
33
37
  "@adobe/react-native-aepedgeidentity": "^7.0.0",
38
+ "react": "*",
34
39
  "react-native": ">=0.60.0"
35
40
  },
41
+ "devDependencies": {
42
+ "@testing-library/react-native": "^13.3.3",
43
+ "@types/react-test-renderer": "^19",
44
+ "react": "19.1.0",
45
+ "react-native": "^0.81.0",
46
+ "react-native-builder-bob": "0.33.1",
47
+ "react-test-renderer": "19.1.0",
48
+ "typescript": "^5.9.3"
49
+ },
36
50
  "publishConfig": {
37
51
  "access": "public"
38
52
  },
39
53
  "installConfig": {
40
54
  "hoistingLimits": "dependencies"
41
55
  },
42
- "gitHead": "9e1fa8cd101f66602d9f9250fe8aa1f32b341da9"
56
+ "react-native-builder-bob": {
57
+ "source": "src",
58
+ "output": "dist",
59
+ "targets": [
60
+ [
61
+ "module",
62
+ {
63
+ "esm": true,
64
+ "jsxRuntime": "classic"
65
+ }
66
+ ],
67
+ "typescript"
68
+ ]
69
+ },
70
+ "gitHead": "c33f85fd0e6efcdd44ace089adcf9f126fa11971"
43
71
  }