@adobe/react-native-aepmessaging 7.3.0 → 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 (289) 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/RCTAEPMessagingModule.java +82 -32
  4. package/babel.config.js +3 -0
  5. package/dist/module/Messaging.js +334 -0
  6. package/dist/module/Messaging.js.map +1 -0
  7. package/dist/module/index.js +30 -0
  8. package/dist/module/index.js.map +1 -0
  9. package/dist/module/models/ContentCard.js +24 -0
  10. package/dist/module/models/ContentCard.js.map +1 -0
  11. package/dist/{models → module/models}/HTMLProposition.js +8 -9
  12. package/dist/module/models/HTMLProposition.js.map +1 -0
  13. package/dist/module/models/InAppMessage.js +4 -0
  14. package/dist/module/models/InAppMessage.js.map +1 -0
  15. package/dist/module/models/JSONProposition.js +22 -0
  16. package/dist/module/models/JSONProposition.js.map +1 -0
  17. package/dist/module/models/Message.js +182 -0
  18. package/dist/module/models/Message.js.map +1 -0
  19. package/dist/module/models/MessagingDelegate.js +4 -0
  20. package/dist/module/models/MessagingDelegate.js.map +1 -0
  21. package/dist/module/models/MessagingEdgeEventType.js +24 -0
  22. package/dist/module/models/MessagingEdgeEventType.js.map +1 -0
  23. package/dist/module/models/MessagingProposition.js +57 -0
  24. package/dist/module/models/MessagingProposition.js.map +1 -0
  25. package/dist/module/models/MessagingPropositionItem.js +4 -0
  26. package/dist/module/models/MessagingPropositionItem.js.map +1 -0
  27. package/dist/module/models/PersonalizationSchema.js +26 -0
  28. package/dist/module/models/PersonalizationSchema.js.map +1 -0
  29. package/dist/module/models/PropositionItem.js +113 -0
  30. package/dist/module/models/PropositionItem.js.map +1 -0
  31. package/dist/module/models/ScopeDetails.js +2 -0
  32. package/dist/module/models/ScopeDetails.js.map +1 -0
  33. package/dist/{models/JSONProposition.js → module/models/index.js} +14 -12
  34. package/dist/module/models/index.js.map +1 -0
  35. package/dist/module/ui/components/Button/Button.js +57 -0
  36. package/dist/module/ui/components/Button/Button.js.map +1 -0
  37. package/dist/module/ui/components/Button/Button.spec.js +476 -0
  38. package/dist/module/ui/components/Button/Button.spec.js.map +1 -0
  39. package/dist/module/ui/components/ContentCardView/ContentCardView.js +257 -0
  40. package/dist/module/ui/components/ContentCardView/ContentCardView.js.map +1 -0
  41. package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js +363 -0
  42. package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js.map +1 -0
  43. package/dist/module/ui/components/DismissButton/DismissButton.js +70 -0
  44. package/dist/module/ui/components/DismissButton/DismissButton.js.map +1 -0
  45. package/dist/module/ui/components/DismissButton/DismissButton.spec.js +279 -0
  46. package/dist/module/ui/components/DismissButton/DismissButton.spec.js.map +1 -0
  47. package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js +34 -0
  48. package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js.map +1 -0
  49. package/dist/module/ui/components/Inbox/EmptyState.js +64 -0
  50. package/dist/module/ui/components/Inbox/EmptyState.js.map +1 -0
  51. package/dist/module/ui/components/Inbox/Inbox.js +235 -0
  52. package/dist/module/ui/components/Inbox/Inbox.js.map +1 -0
  53. package/dist/module/ui/components/Inbox/Inbox.spec.js +847 -0
  54. package/dist/module/ui/components/Inbox/Inbox.spec.js.map +1 -0
  55. package/dist/module/ui/components/Pagination/Pagination.js +176 -0
  56. package/dist/module/ui/components/Pagination/Pagination.js.map +1 -0
  57. package/dist/module/ui/components/Pagination/Pagination.spec.js +193 -0
  58. package/dist/module/ui/components/Pagination/Pagination.spec.js.map +1 -0
  59. package/dist/module/ui/components/UnreadIcon/UnreadIcon.js +184 -0
  60. package/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map +1 -0
  61. package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js +815 -0
  62. package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map +1 -0
  63. package/dist/{models/ContentCard.js → module/ui/components/index.js} +12 -12
  64. package/dist/module/ui/components/index.js.map +1 -0
  65. package/dist/module/ui/hooks/index.js +18 -0
  66. package/dist/module/ui/hooks/index.js.map +1 -0
  67. package/dist/module/ui/hooks/useAspectRatio.js +33 -0
  68. package/dist/module/ui/hooks/useAspectRatio.js.map +1 -0
  69. package/dist/module/ui/hooks/useAspectRatio.spec.js +65 -0
  70. package/dist/module/ui/hooks/useAspectRatio.spec.js.map +1 -0
  71. package/dist/module/ui/hooks/useContentCardUI.js +51 -0
  72. package/dist/module/ui/hooks/useContentCardUI.js.map +1 -0
  73. package/dist/module/ui/hooks/useContentCardUI.spec.js +85 -0
  74. package/dist/module/ui/hooks/useContentCardUI.spec.js.map +1 -0
  75. package/dist/module/ui/hooks/useInbox.js +49 -0
  76. package/dist/module/ui/hooks/useInbox.js.map +1 -0
  77. package/dist/module/ui/hooks/useInbox.spec.js +93 -0
  78. package/dist/module/ui/hooks/useInbox.spec.js.map +1 -0
  79. package/dist/module/ui/hooks/useInboxSettings.js +26 -0
  80. package/dist/module/ui/hooks/useInboxSettings.js.map +1 -0
  81. package/dist/module/ui/hooks/useInboxSettings.spec.js +50 -0
  82. package/dist/module/ui/hooks/useInboxSettings.spec.js.map +1 -0
  83. package/dist/module/ui/index.js +10 -0
  84. package/dist/module/ui/index.js.map +1 -0
  85. package/dist/module/ui/providers/InboxProvider.js +27 -0
  86. package/dist/module/ui/providers/InboxProvider.js.map +1 -0
  87. package/dist/module/ui/theme/Theme.js +2 -0
  88. package/dist/module/ui/theme/Theme.js.map +1 -0
  89. package/dist/module/ui/theme/ThemeProvider.js +112 -0
  90. package/dist/module/ui/theme/ThemeProvider.js.map +1 -0
  91. package/dist/{models/InAppMessage.js → module/ui/theme/index.js} +6 -3
  92. package/dist/module/ui/theme/index.js.map +1 -0
  93. package/dist/module/ui/types/ContentViewEvent.js +2 -0
  94. package/dist/module/ui/types/ContentViewEvent.js.map +1 -0
  95. package/dist/module/ui/types/Templates.js +26 -0
  96. package/dist/module/ui/types/Templates.js.map +1 -0
  97. package/dist/{models/ScopeDetails.js → module/ui/types/index.js} +6 -3
  98. package/dist/module/ui/types/index.js.map +1 -0
  99. package/dist/module/ui/utils/generateCardHash.js +50 -0
  100. package/dist/module/ui/utils/generateCardHash.js.map +1 -0
  101. package/dist/module/ui/utils/generateCardHash.spec.js +103 -0
  102. package/dist/module/ui/utils/generateCardHash.spec.js.map +1 -0
  103. package/dist/module/ui/utils/inboxStorage.js +65 -0
  104. package/dist/module/ui/utils/inboxStorage.js.map +1 -0
  105. package/dist/module/ui/utils/inboxStorage.spec.js +123 -0
  106. package/dist/module/ui/utils/inboxStorage.spec.js.map +1 -0
  107. package/dist/module/ui/utils/index.js +5 -0
  108. package/dist/module/ui/utils/index.js.map +1 -0
  109. package/dist/{Messaging.d.ts → typescript/Messaging.d.ts} +23 -7
  110. package/dist/typescript/Messaging.d.ts.map +1 -0
  111. package/dist/{index.d.ts → typescript/index.d.ts} +4 -2
  112. package/dist/typescript/index.d.ts.map +1 -0
  113. package/dist/typescript/models/ContentCard.d.ts +57 -0
  114. package/dist/typescript/models/ContentCard.d.ts.map +1 -0
  115. package/dist/{models → typescript/models}/HTMLProposition.d.ts +1 -0
  116. package/dist/typescript/models/HTMLProposition.d.ts.map +1 -0
  117. package/dist/{models → typescript/models}/InAppMessage.d.ts +1 -0
  118. package/dist/typescript/models/InAppMessage.d.ts.map +1 -0
  119. package/dist/{models → typescript/models}/JSONProposition.d.ts +1 -0
  120. package/dist/typescript/models/JSONProposition.d.ts.map +1 -0
  121. package/dist/{models → typescript/models}/Message.d.ts +1 -0
  122. package/dist/typescript/models/Message.d.ts.map +1 -0
  123. package/dist/{models → typescript/models}/MessagingDelegate.d.ts +1 -0
  124. package/dist/typescript/models/MessagingDelegate.d.ts.map +1 -0
  125. package/dist/{models → typescript/models}/MessagingEdgeEventType.d.ts +1 -0
  126. package/dist/typescript/models/MessagingEdgeEventType.d.ts.map +1 -0
  127. package/dist/{models → typescript/models}/MessagingProposition.d.ts +1 -0
  128. package/dist/typescript/models/MessagingProposition.d.ts.map +1 -0
  129. package/dist/{models → typescript/models}/MessagingPropositionItem.d.ts +1 -0
  130. package/dist/typescript/models/MessagingPropositionItem.d.ts.map +1 -0
  131. package/dist/{models → typescript/models}/PersonalizationSchema.d.ts +2 -0
  132. package/dist/typescript/models/PersonalizationSchema.d.ts.map +1 -0
  133. package/dist/{models → typescript/models}/PropositionItem.d.ts +1 -0
  134. package/dist/typescript/models/PropositionItem.d.ts.map +1 -0
  135. package/dist/{models → typescript/models}/ScopeDetails.d.ts +1 -0
  136. package/dist/typescript/models/ScopeDetails.d.ts.map +1 -0
  137. package/dist/typescript/models/index.d.ts +11 -0
  138. package/dist/typescript/models/index.d.ts.map +1 -0
  139. package/dist/typescript/ui/components/Button/Button.d.ts +14 -0
  140. package/dist/typescript/ui/components/Button/Button.d.ts.map +1 -0
  141. package/dist/typescript/ui/components/Button/Button.spec.d.ts +2 -0
  142. package/dist/typescript/ui/components/Button/Button.spec.d.ts.map +1 -0
  143. package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts +39 -0
  144. package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map +1 -0
  145. package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts +2 -0
  146. package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts.map +1 -0
  147. package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts +13 -0
  148. package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map +1 -0
  149. package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts +2 -0
  150. package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts.map +1 -0
  151. package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts +5 -0
  152. package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts.map +1 -0
  153. package/dist/typescript/ui/components/Inbox/EmptyState.d.ts +19 -0
  154. package/dist/typescript/ui/components/Inbox/EmptyState.d.ts.map +1 -0
  155. package/dist/typescript/ui/components/Inbox/Inbox.d.ts +21 -0
  156. package/dist/typescript/ui/components/Inbox/Inbox.d.ts.map +1 -0
  157. package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts +2 -0
  158. package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts.map +1 -0
  159. package/dist/typescript/ui/components/Pagination/Pagination.d.ts +14 -0
  160. package/dist/typescript/ui/components/Pagination/Pagination.d.ts.map +1 -0
  161. package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts +2 -0
  162. package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts.map +1 -0
  163. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts +14 -0
  164. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map +1 -0
  165. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts +2 -0
  166. package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map +1 -0
  167. package/dist/typescript/ui/components/index.d.ts +10 -0
  168. package/dist/typescript/ui/components/index.d.ts.map +1 -0
  169. package/dist/typescript/ui/hooks/index.d.ts +4 -0
  170. package/dist/typescript/ui/hooks/index.d.ts.map +1 -0
  171. package/dist/typescript/ui/hooks/useAspectRatio.d.ts +3 -0
  172. package/dist/typescript/ui/hooks/useAspectRatio.d.ts.map +1 -0
  173. package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts +2 -0
  174. package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts.map +1 -0
  175. package/dist/typescript/ui/hooks/useContentCardUI.d.ts +14 -0
  176. package/dist/typescript/ui/hooks/useContentCardUI.d.ts.map +1 -0
  177. package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts +2 -0
  178. package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts.map +1 -0
  179. package/dist/typescript/ui/hooks/useInbox.d.ts +12 -0
  180. package/dist/typescript/ui/hooks/useInbox.d.ts.map +1 -0
  181. package/dist/typescript/ui/hooks/useInbox.spec.d.ts +2 -0
  182. package/dist/typescript/ui/hooks/useInbox.spec.d.ts.map +1 -0
  183. package/dist/typescript/ui/hooks/useInboxSettings.d.ts +7 -0
  184. package/dist/typescript/ui/hooks/useInboxSettings.d.ts.map +1 -0
  185. package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts +2 -0
  186. package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts.map +1 -0
  187. package/dist/typescript/ui/index.d.ts +8 -0
  188. package/dist/typescript/ui/index.d.ts.map +1 -0
  189. package/dist/typescript/ui/providers/InboxProvider.d.ts +56 -0
  190. package/dist/typescript/ui/providers/InboxProvider.d.ts.map +1 -0
  191. package/dist/typescript/ui/theme/Theme.d.ts +44 -0
  192. package/dist/typescript/ui/theme/Theme.d.ts.map +1 -0
  193. package/dist/typescript/ui/theme/ThemeProvider.d.ts +21 -0
  194. package/dist/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
  195. package/dist/typescript/ui/theme/index.d.ts +3 -0
  196. package/dist/typescript/ui/theme/index.d.ts.map +1 -0
  197. package/dist/typescript/ui/types/ContentViewEvent.d.ts +9 -0
  198. package/dist/typescript/ui/types/ContentViewEvent.d.ts.map +1 -0
  199. package/dist/typescript/ui/types/Templates.d.ts +43 -0
  200. package/dist/typescript/ui/types/Templates.d.ts.map +1 -0
  201. package/dist/typescript/ui/types/index.d.ts +3 -0
  202. package/dist/typescript/ui/types/index.d.ts.map +1 -0
  203. package/dist/typescript/ui/utils/generateCardHash.d.ts +21 -0
  204. package/dist/typescript/ui/utils/generateCardHash.d.ts.map +1 -0
  205. package/dist/typescript/ui/utils/generateCardHash.spec.d.ts +2 -0
  206. package/dist/typescript/ui/utils/generateCardHash.spec.d.ts.map +1 -0
  207. package/dist/typescript/ui/utils/inboxStorage.d.ts +20 -0
  208. package/dist/typescript/ui/utils/inboxStorage.d.ts.map +1 -0
  209. package/dist/typescript/ui/utils/inboxStorage.spec.d.ts +2 -0
  210. package/dist/typescript/ui/utils/inboxStorage.spec.d.ts.map +1 -0
  211. package/dist/typescript/ui/utils/index.d.ts +3 -0
  212. package/dist/typescript/ui/utils/index.d.ts.map +1 -0
  213. package/ios/src/RCTAEPMessaging.mm +11 -0
  214. package/ios/src/RCTAEPMessaging.swift +30 -3
  215. package/jest.config.js +15 -0
  216. package/package.json +33 -5
  217. package/src/Messaging.ts +287 -32
  218. package/src/index.ts +3 -3
  219. package/src/models/ContentCard.ts +52 -27
  220. package/src/models/HTMLProposition.ts +1 -1
  221. package/src/models/JSONProposition.ts +1 -1
  222. package/src/models/PersonalizationSchema.ts +1 -0
  223. package/src/models/index.ts +22 -0
  224. package/src/ui/components/Button/Button.spec.tsx +496 -0
  225. package/src/ui/components/Button/Button.tsx +76 -0
  226. package/src/ui/components/ContentCardView/ContentCardView.spec.tsx +278 -0
  227. package/src/ui/components/ContentCardView/ContentCardView.tsx +400 -0
  228. package/src/ui/components/DismissButton/DismissButton.spec.tsx +314 -0
  229. package/src/ui/components/DismissButton/DismissButton.tsx +100 -0
  230. package/src/ui/components/FullScreenCenterView/FullScreenCenterView.tsx +32 -0
  231. package/src/ui/components/Inbox/EmptyState.tsx +89 -0
  232. package/src/ui/components/Inbox/Inbox.spec.tsx +478 -0
  233. package/src/ui/components/Inbox/Inbox.tsx +275 -0
  234. package/src/ui/components/Pagination/Pagination.spec.tsx +159 -0
  235. package/src/ui/components/Pagination/Pagination.tsx +222 -0
  236. package/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx +878 -0
  237. package/src/ui/components/UnreadIcon/UnreadIcon.tsx +234 -0
  238. package/src/ui/components/index.ts +22 -0
  239. package/{dist/models/MessagingPropositionItem.js → src/ui/hooks/index.ts} +5 -4
  240. package/src/ui/hooks/useAspectRatio.spec.tsx +66 -0
  241. package/src/ui/hooks/useAspectRatio.tsx +39 -0
  242. package/src/ui/hooks/useContentCardUI.spec.tsx +82 -0
  243. package/src/ui/hooks/useContentCardUI.ts +48 -0
  244. package/src/ui/hooks/useInbox.spec.tsx +87 -0
  245. package/src/ui/hooks/useInbox.ts +46 -0
  246. package/src/ui/hooks/useInboxSettings.spec.tsx +41 -0
  247. package/src/ui/hooks/useInboxSettings.ts +24 -0
  248. package/src/ui/index.ts +7 -0
  249. package/src/ui/providers/InboxProvider.tsx +79 -0
  250. package/src/ui/theme/Theme.ts +57 -0
  251. package/src/ui/theme/ThemeProvider.tsx +120 -0
  252. package/src/ui/theme/index.ts +14 -0
  253. package/src/ui/types/ContentViewEvent.ts +20 -0
  254. package/src/ui/types/Templates.ts +77 -0
  255. package/src/ui/types/index.ts +14 -0
  256. package/src/ui/utils/generateCardHash.spec.tsx +86 -0
  257. package/src/ui/utils/generateCardHash.ts +59 -0
  258. package/src/ui/utils/inboxStorage.spec.tsx +136 -0
  259. package/src/ui/utils/inboxStorage.ts +64 -0
  260. package/src/ui/utils/index.ts +3 -0
  261. package/tutorials/ContentCardCustomizationGuide.md +661 -0
  262. package/tutorials/ContentCards.md +419 -0
  263. package/tutorials/Inbox.md +515 -0
  264. package/tutorials/resources/image-only-template.png +0 -0
  265. package/tutorials/resources/large-image-template.png +0 -0
  266. package/tutorials/resources/small-image-template.png +0 -0
  267. package/dist/Messaging.js +0 -152
  268. package/dist/Messaging.js.map +0 -1
  269. package/dist/index.js +0 -34
  270. package/dist/index.js.map +0 -1
  271. package/dist/models/ContentCard.d.ts +0 -51
  272. package/dist/models/ContentCard.js.map +0 -1
  273. package/dist/models/HTMLProposition.js.map +0 -1
  274. package/dist/models/InAppMessage.js.map +0 -1
  275. package/dist/models/JSONProposition.js.map +0 -1
  276. package/dist/models/Message.js +0 -156
  277. package/dist/models/Message.js.map +0 -1
  278. package/dist/models/MessagingDelegate.js +0 -14
  279. package/dist/models/MessagingDelegate.js.map +0 -1
  280. package/dist/models/MessagingEdgeEventType.js +0 -24
  281. package/dist/models/MessagingEdgeEventType.js.map +0 -1
  282. package/dist/models/MessagingProposition.js +0 -59
  283. package/dist/models/MessagingProposition.js.map +0 -1
  284. package/dist/models/MessagingPropositionItem.js.map +0 -1
  285. package/dist/models/PersonalizationSchema.js +0 -25
  286. package/dist/models/PersonalizationSchema.js.map +0 -1
  287. package/dist/models/PropositionItem.js +0 -78
  288. package/dist/models/PropositionItem.js.map +0 -1
  289. package/dist/models/ScopeDetails.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { useContext } from "react";
14
+ import { InboxContext, InboxSettings } from "../providers/InboxProvider";
15
+
16
+ /**
17
+ * @experimental First React Native inbox UI — subject to change while we expand testing.
18
+ */
19
+ function useInboxSettings(): InboxSettings | null {
20
+ const settings = useContext(InboxContext);
21
+ return settings;
22
+ }
23
+
24
+ export default useInboxSettings;
@@ -0,0 +1,7 @@
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';
@@ -0,0 +1,79 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import React, { createContext } from "react";
14
+
15
+ export type SettingsPlacement = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
16
+
17
+ export interface InboxSettings {
18
+ activityId?: string;
19
+ content: {
20
+ heading: {
21
+ content: string;
22
+ };
23
+ layout: {
24
+ orientation: 'horizontal' | 'vertical';
25
+ };
26
+ capacity: number;
27
+ emptyStateSettings?: {
28
+ message: {
29
+ content: string;
30
+ };
31
+ image?: {
32
+ url?: string; // flat (light)
33
+ darkUrl?: string; // flat (dark)
34
+ light?: { url?: string }; // nested (light)
35
+ dark?: { url?: string }; // nested (dark)
36
+ };
37
+ };
38
+ unread_indicator?: {
39
+ unread_bg: {
40
+ clr: {
41
+ light: string;
42
+ dark: string;
43
+ };
44
+ };
45
+ unread_icon: {
46
+ placement: SettingsPlacement;
47
+ image: {
48
+ url: string;
49
+ darkUrl?: string;
50
+ };
51
+ };
52
+ };
53
+ /** Whether the unread feature is enabled. Defaults to true. */
54
+ isUnreadEnabled?: boolean;
55
+ };
56
+ showPagination?: boolean;
57
+ }
58
+
59
+ export const InboxContext =
60
+ createContext<InboxSettings | null>(null);
61
+
62
+ export interface InboxProviderProps {
63
+ children: React.ReactNode;
64
+ settings: InboxSettings;
65
+ }
66
+
67
+ /** @experimental */
68
+ function InboxProvider({
69
+ children,
70
+ settings,
71
+ }: InboxProviderProps) {
72
+ return (
73
+ <InboxContext.Provider value={settings}>
74
+ {children}
75
+ </InboxContext.Provider>
76
+ );
77
+ }
78
+
79
+ export default InboxProvider;
@@ -0,0 +1,57 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ /**
14
+ * Represents the themes for the messaging UI.
15
+ * @interface Themes
16
+ * @property {Theme} light - The light theme.
17
+ * @property {Theme} dark - The dark theme.
18
+ */
19
+ export interface Themes {
20
+ light: Theme;
21
+ dark: Theme;
22
+ }
23
+
24
+ /**
25
+ * Represents the theme for the messaging UI.
26
+ * @interface Theme
27
+ * @property {Colors} colors - The colors for the theme.
28
+ */
29
+ export interface Theme {
30
+ colors: Colors;
31
+ isDark: boolean;
32
+ }
33
+
34
+ /**
35
+ * Represents the colors for the theme.
36
+ * @interface Colors
37
+ * @property {string} primary - The primary color.
38
+ * @property {string} secondary - The secondary color.
39
+ * @property {string} background - The background color.
40
+ * @property {string} textPrimary - The primary text color.
41
+ * @property {string} textSecondary - The secondary text color.
42
+ * @property {string} imagePlaceholder - The image placeholder color.
43
+ * @property {string} buttonTextColor - The button text color.
44
+ */
45
+ export interface Colors {
46
+ primary?: string;
47
+ secondary?: string;
48
+ background?: string;
49
+ textPrimary?: string;
50
+ textSecondary?: string;
51
+ imagePlaceholder?: string;
52
+ buttonTextColor?: string;
53
+ activeColor?: string;
54
+ inactiveColor?: string;
55
+ dotColor?: string;
56
+ imageContainerColor?: string;
57
+ }
@@ -0,0 +1,120 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8
+ or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
10
+ ANY KIND, either express or implied. See the License for the specific
11
+ language governing permissions and limitations under the License.
12
+ */
13
+
14
+ import { createContext, useContext, ReactNode, useMemo } from 'react';
15
+ import { useColorScheme } from 'react-native';
16
+ import { Theme, Themes } from './Theme';
17
+
18
+ interface ThemeProviderProps {
19
+ children: ReactNode;
20
+ customThemes: Themes;
21
+ }
22
+
23
+ const defaultTheme: Themes = {
24
+ light: {
25
+ isDark: false,
26
+ colors: {
27
+ primary: '#007AFF',
28
+ secondary: '#5856D6',
29
+ background: '#FFFFFF',
30
+ textPrimary: '#000000',
31
+ textSecondary: '#8E8E93',
32
+ imagePlaceholder: '#C7C7CC',
33
+ buttonTextColor: 'dodgerblue',
34
+ activeColor: '#0a7ea4',
35
+ inactiveColor: '#687076',
36
+ dotColor: '#FF4444',
37
+ imageContainerColor: '#f0f0f0'
38
+ }
39
+ },
40
+ dark: {
41
+ isDark: true,
42
+ colors: {
43
+ primary: '#0A84FF',
44
+ secondary: '#5E5CE6',
45
+ background: '#262626',
46
+ textPrimary: '#FFFFFF',
47
+ textSecondary: '#8E8E93',
48
+ imagePlaceholder: '#48484A',
49
+ buttonTextColor: 'dodgerblue',
50
+ activeColor: '#fff',
51
+ inactiveColor: '#9BA1A6',
52
+ dotColor: '#FF6B6B',
53
+ imageContainerColor: '#f0f0f0'
54
+ }
55
+ }
56
+ };
57
+
58
+ const ThemeContext = createContext<Theme | undefined>(undefined);
59
+
60
+ /**
61
+ * ThemeProvider component that provides the theme to the children components.
62
+ *
63
+ * @param children - The children components.
64
+ * @param customThemes - The custom themes to override the default themes.
65
+ * @returns The ThemeProvider component.
66
+ */
67
+ export const ThemeProvider = ({
68
+ children,
69
+ customThemes
70
+ }: ThemeProviderProps) => {
71
+ const systemColorScheme = useColorScheme();
72
+
73
+ // Memoize the merged themes to avoid recreation on every render
74
+ const mergedThemes: Themes = useMemo(() => {
75
+ return {
76
+ light: {
77
+ ...defaultTheme.light,
78
+ colors: {
79
+ ...defaultTheme.light.colors,
80
+ ...(customThemes?.light?.colors || {})
81
+ }
82
+ },
83
+ dark: {
84
+ ...defaultTheme.dark,
85
+ colors: {
86
+ ...defaultTheme.dark.colors,
87
+ ...(customThemes?.dark?.colors || {})
88
+ }
89
+ }
90
+ };
91
+ }, [customThemes]);
92
+
93
+ // Memoize the active theme
94
+ const activeTheme = useMemo(() => {
95
+ const scheme = systemColorScheme ?? 'light';
96
+ return mergedThemes[scheme];
97
+ }, [mergedThemes, systemColorScheme]);
98
+
99
+ // Memoize the context value to prevent unnecessary re-renders
100
+ const contextValue: Theme = useMemo(() => activeTheme, [activeTheme]);
101
+
102
+ return (
103
+ <ThemeContext.Provider value={contextValue}>
104
+ {children}
105
+ </ThemeContext.Provider>
106
+ );
107
+ };
108
+
109
+ /**
110
+ * useTheme hook that returns the theme context.
111
+ * @returns The theme context.
112
+ */
113
+ export const useTheme = (): Theme => {
114
+ const context = useContext(ThemeContext);
115
+ const systemColorScheme = useColorScheme();
116
+ if (context === undefined) {
117
+ return defaultTheme[systemColorScheme ?? 'light'];
118
+ }
119
+ return context;
120
+ };
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from './Theme';
14
+ export * from './ThemeProvider';
@@ -0,0 +1,20 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ /**
14
+ * The event types for the ContentView component.
15
+ *
16
+ * @property {string} onDismiss - The event type for the onDismiss event when the dismiss button is pressed.
17
+ * @property {string} onDisplay - The event type for the onDisplay event when the content card is displayed.
18
+ * @property {string} onInteract - The event type for the interact event when the content is pressed.
19
+ */
20
+ export type ContentViewEvent = 'onDismiss' | 'onDisplay' | 'onInteract';
@@ -0,0 +1,77 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ ButtonProps,
15
+ ImageProps,
16
+ ImageStyle,
17
+ PressableProps,
18
+ TextProps,
19
+ TextStyle,
20
+ ViewStyle
21
+ } from 'react-native';
22
+ import { ViewProps } from 'react-native';
23
+ import {
24
+ ContentCard,
25
+ ContentCardData,
26
+ ContentCardTemplate
27
+ } from '../../models/ContentCard';
28
+ import { DismissButtonProps } from '../components/DismissButton/DismissButton';
29
+
30
+ export class ContentTemplate extends ContentCard {
31
+ readonly type: ContentCardTemplate;
32
+
33
+ constructor(data: ContentCardData, type: ContentCardTemplate, isRead: boolean = false) {
34
+ super(data, isRead);
35
+ this.type = type;
36
+ }
37
+ }
38
+
39
+ /** Overrides for the structural pieces of the content card */
40
+ export interface ComponentOverrideProps {
41
+ BodyProps?: Partial<TextProps>;
42
+ ButtonContainerProps?: Partial<ViewProps>;
43
+ ButtonProps?: Partial<Omit<ButtonProps, 'onPress'>>;
44
+ ContainerProps?: Partial<ViewProps>;
45
+ ContentContainerProps?: Partial<ViewProps>;
46
+ DismissButtonProps?: DismissButtonProps;
47
+ ImageContainerProps?: Partial<ViewProps>;
48
+ ImageProps?: Partial<ImageProps>;
49
+ TextProps?: Partial<TextProps>;
50
+ TitleProps?: Partial<TextProps>;
51
+ }
52
+
53
+ /** The base style overrides available for content cards */
54
+ export interface ContentCardStyles {
55
+ /** Applies to the root of the content card */
56
+ card?: ViewStyle;
57
+ /** Applies to the container inside the content card, applied inside the card Pressable */
58
+ container?: ViewStyle;
59
+ imageContainer?: ViewStyle;
60
+ image?: ImageStyle;
61
+ contentContainer?: ViewStyle;
62
+ /** Applies to title and body properties, will be overridden by title and body styles */
63
+ text?: TextStyle;
64
+ title?: TextStyle;
65
+ body?: TextStyle;
66
+ buttonContainer?: ViewStyle;
67
+ button?: PressableProps['style'];
68
+ buttonText?: TextStyle;
69
+ dismissButton?: PressableProps['style'];
70
+ }
71
+
72
+ export type SmallImageContentStyle = ContentCardStyles;
73
+ export type LargeImageContentStyle = ContentCardStyles;
74
+ export type ImageOnlyContentStyle = Pick<
75
+ ContentCardStyles,
76
+ 'card' | 'imageContainer' | 'image' | 'dismissButton'
77
+ >;
@@ -0,0 +1,14 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export * from './ContentViewEvent';
14
+ export * from './Templates';
@@ -0,0 +1,86 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { generateCardHash } from './generateCardHash';
14
+
15
+ describe('generateCardHash', () => {
16
+ it('returns content: hash from title, body, image, actionUrl, and type', () => {
17
+ const card = {
18
+ id: 'ignored-when-content',
19
+ type: 'LargeImage',
20
+ data: {
21
+ content: {
22
+ actionUrl: 'https://go',
23
+ title: { content: 'T' },
24
+ body: { content: 'B' },
25
+ image: { url: 'https://img' },
26
+ },
27
+ },
28
+ };
29
+ expect(generateCardHash(card as any)).toBe(
30
+ 'content:https://go|T|B|https://img|LargeImage'
31
+ );
32
+ });
33
+
34
+ it('uses meta.adobe.template when type is missing', () => {
35
+ const card = {
36
+ data: {
37
+ meta: { adobe: { template: 'SmallImage' } },
38
+ content: {
39
+ title: { content: 'X' },
40
+ },
41
+ },
42
+ };
43
+ expect(generateCardHash(card as any)).toContain('|SmallImage');
44
+ });
45
+
46
+ it('uses darkUrl when url is missing', () => {
47
+ const card = {
48
+ type: 'SmallImage',
49
+ data: {
50
+ content: {
51
+ title: { content: 'T' },
52
+ image: { darkUrl: 'https://dark.png' },
53
+ },
54
+ },
55
+ };
56
+ expect(generateCardHash(card as any)).toContain('https://dark.png');
57
+ });
58
+
59
+ it('uses uuid when content is present but all parts are empty', () => {
60
+ const card = {
61
+ uuid: 'u-1',
62
+ data: {
63
+ content: {
64
+ title: { content: '' },
65
+ body: { content: '' },
66
+ },
67
+ },
68
+ };
69
+ expect(generateCardHash(card as any)).toBe('uuid:u-1');
70
+ });
71
+
72
+ it('uses id when no usable content hash and no uuid', () => {
73
+ const card = {
74
+ id: 'card-99',
75
+ data: {},
76
+ };
77
+ expect(generateCardHash(card as any)).toBe('id:card-99');
78
+ });
79
+
80
+ it('uses fallback with Math.random when no content, uuid, or id', () => {
81
+ jest.spyOn(Math, 'random').mockReturnValue(0.25);
82
+ const card = { data: {} };
83
+ expect(generateCardHash(card as any)).toBe('fallback:0.25');
84
+ jest.restoreAllMocks();
85
+ });
86
+ });
@@ -0,0 +1,59 @@
1
+ /*
2
+ Copyright 2026 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the
4
+ "License"); you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
7
+ or agreed to in writing, software distributed under the License is
8
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
9
+ ANY KIND, either express or implied. See the License for the specific
10
+ language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { ContentTemplate } from '../types/Templates';
14
+
15
+ /**
16
+ * @experimental First React Native inbox / content-card UI
17
+ * Generate a stable identifier (hash) for a card based on its content
18
+ * This ensures the same card is identified even if the ID changes between refetches
19
+ *
20
+ * Priority: content hash (most stable) > uuid > id
21
+ *
22
+ * @param card - The content card template
23
+ * @returns A stable identifier string with a prefix indicating the source (content:, uuid:, or id:)
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * const cardHash = generateCardHash(card);
28
+ * // Returns: "content:https://example.com|Title|Body|image.jpg|SmallImage"
29
+ * // or: "uuid:123e4567-e89b-12d3-a456-426614174000"
30
+ * // or: "id:card-123"
31
+ * ```
32
+ */
33
+ export const generateCardHash = (card: ContentTemplate | any): string => {
34
+ const content = card.data?.content;
35
+ if (content) {
36
+ const parts = [
37
+ content.actionUrl || '',
38
+ content.title?.content || '',
39
+ content.body?.content || '',
40
+ content.image?.url || content.image?.darkUrl || '',
41
+ card.type || card.data?.meta?.adobe?.template || '',
42
+ ];
43
+ const contentHash = parts.join('|');
44
+ if (parts.some(p => p.trim().length > 0)) {
45
+ return `content:${contentHash}`;
46
+ }
47
+ }
48
+
49
+ if (card.uuid) {
50
+ return `uuid:${card.uuid}`;
51
+ }
52
+
53
+ if (card.id) {
54
+ return `id:${card.id}`;
55
+ }
56
+
57
+ return `fallback:${String(Math.random())}`;
58
+ };
59
+