@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.
- package/RCTAEPMessaging.podspec +1 -1
- package/README.md +145 -16
- package/android/src/main/java/com/adobe/marketing/mobile/reactnative/messaging/RCTAEPMessagingModule.java +82 -32
- package/babel.config.js +3 -0
- package/dist/module/Messaging.js +334 -0
- package/dist/module/Messaging.js.map +1 -0
- package/dist/module/index.js +30 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/models/ContentCard.js +24 -0
- package/dist/module/models/ContentCard.js.map +1 -0
- package/dist/{models → module/models}/HTMLProposition.js +8 -9
- package/dist/module/models/HTMLProposition.js.map +1 -0
- package/dist/module/models/InAppMessage.js +4 -0
- package/dist/module/models/InAppMessage.js.map +1 -0
- package/dist/module/models/JSONProposition.js +22 -0
- package/dist/module/models/JSONProposition.js.map +1 -0
- package/dist/module/models/Message.js +182 -0
- package/dist/module/models/Message.js.map +1 -0
- package/dist/module/models/MessagingDelegate.js +4 -0
- package/dist/module/models/MessagingDelegate.js.map +1 -0
- package/dist/module/models/MessagingEdgeEventType.js +24 -0
- package/dist/module/models/MessagingEdgeEventType.js.map +1 -0
- package/dist/module/models/MessagingProposition.js +57 -0
- package/dist/module/models/MessagingProposition.js.map +1 -0
- package/dist/module/models/MessagingPropositionItem.js +4 -0
- package/dist/module/models/MessagingPropositionItem.js.map +1 -0
- package/dist/module/models/PersonalizationSchema.js +26 -0
- package/dist/module/models/PersonalizationSchema.js.map +1 -0
- package/dist/module/models/PropositionItem.js +113 -0
- package/dist/module/models/PropositionItem.js.map +1 -0
- package/dist/module/models/ScopeDetails.js +2 -0
- package/dist/module/models/ScopeDetails.js.map +1 -0
- package/dist/{models/JSONProposition.js → module/models/index.js} +14 -12
- package/dist/module/models/index.js.map +1 -0
- package/dist/module/ui/components/Button/Button.js +57 -0
- package/dist/module/ui/components/Button/Button.js.map +1 -0
- package/dist/module/ui/components/Button/Button.spec.js +476 -0
- package/dist/module/ui/components/Button/Button.spec.js.map +1 -0
- package/dist/module/ui/components/ContentCardView/ContentCardView.js +257 -0
- package/dist/module/ui/components/ContentCardView/ContentCardView.js.map +1 -0
- package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js +363 -0
- package/dist/module/ui/components/ContentCardView/ContentCardView.spec.js.map +1 -0
- package/dist/module/ui/components/DismissButton/DismissButton.js +70 -0
- package/dist/module/ui/components/DismissButton/DismissButton.js.map +1 -0
- package/dist/module/ui/components/DismissButton/DismissButton.spec.js +279 -0
- package/dist/module/ui/components/DismissButton/DismissButton.spec.js.map +1 -0
- package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js +34 -0
- package/dist/module/ui/components/FullScreenCenterView/FullScreenCenterView.js.map +1 -0
- package/dist/module/ui/components/Inbox/EmptyState.js +64 -0
- package/dist/module/ui/components/Inbox/EmptyState.js.map +1 -0
- package/dist/module/ui/components/Inbox/Inbox.js +235 -0
- package/dist/module/ui/components/Inbox/Inbox.js.map +1 -0
- package/dist/module/ui/components/Inbox/Inbox.spec.js +847 -0
- package/dist/module/ui/components/Inbox/Inbox.spec.js.map +1 -0
- package/dist/module/ui/components/Pagination/Pagination.js +176 -0
- package/dist/module/ui/components/Pagination/Pagination.js.map +1 -0
- package/dist/module/ui/components/Pagination/Pagination.spec.js +193 -0
- package/dist/module/ui/components/Pagination/Pagination.spec.js.map +1 -0
- package/dist/module/ui/components/UnreadIcon/UnreadIcon.js +184 -0
- package/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map +1 -0
- package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js +815 -0
- package/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map +1 -0
- package/dist/{models/ContentCard.js → module/ui/components/index.js} +12 -12
- package/dist/module/ui/components/index.js.map +1 -0
- package/dist/module/ui/hooks/index.js +18 -0
- package/dist/module/ui/hooks/index.js.map +1 -0
- package/dist/module/ui/hooks/useAspectRatio.js +33 -0
- package/dist/module/ui/hooks/useAspectRatio.js.map +1 -0
- package/dist/module/ui/hooks/useAspectRatio.spec.js +65 -0
- package/dist/module/ui/hooks/useAspectRatio.spec.js.map +1 -0
- package/dist/module/ui/hooks/useContentCardUI.js +51 -0
- package/dist/module/ui/hooks/useContentCardUI.js.map +1 -0
- package/dist/module/ui/hooks/useContentCardUI.spec.js +85 -0
- package/dist/module/ui/hooks/useContentCardUI.spec.js.map +1 -0
- package/dist/module/ui/hooks/useInbox.js +49 -0
- package/dist/module/ui/hooks/useInbox.js.map +1 -0
- package/dist/module/ui/hooks/useInbox.spec.js +93 -0
- package/dist/module/ui/hooks/useInbox.spec.js.map +1 -0
- package/dist/module/ui/hooks/useInboxSettings.js +26 -0
- package/dist/module/ui/hooks/useInboxSettings.js.map +1 -0
- package/dist/module/ui/hooks/useInboxSettings.spec.js +50 -0
- package/dist/module/ui/hooks/useInboxSettings.spec.js.map +1 -0
- package/dist/module/ui/index.js +10 -0
- package/dist/module/ui/index.js.map +1 -0
- package/dist/module/ui/providers/InboxProvider.js +27 -0
- package/dist/module/ui/providers/InboxProvider.js.map +1 -0
- package/dist/module/ui/theme/Theme.js +2 -0
- package/dist/module/ui/theme/Theme.js.map +1 -0
- package/dist/module/ui/theme/ThemeProvider.js +112 -0
- package/dist/module/ui/theme/ThemeProvider.js.map +1 -0
- package/dist/{models/InAppMessage.js → module/ui/theme/index.js} +6 -3
- package/dist/module/ui/theme/index.js.map +1 -0
- package/dist/module/ui/types/ContentViewEvent.js +2 -0
- package/dist/module/ui/types/ContentViewEvent.js.map +1 -0
- package/dist/module/ui/types/Templates.js +26 -0
- package/dist/module/ui/types/Templates.js.map +1 -0
- package/dist/{models/ScopeDetails.js → module/ui/types/index.js} +6 -3
- package/dist/module/ui/types/index.js.map +1 -0
- package/dist/module/ui/utils/generateCardHash.js +50 -0
- package/dist/module/ui/utils/generateCardHash.js.map +1 -0
- package/dist/module/ui/utils/generateCardHash.spec.js +103 -0
- package/dist/module/ui/utils/generateCardHash.spec.js.map +1 -0
- package/dist/module/ui/utils/inboxStorage.js +65 -0
- package/dist/module/ui/utils/inboxStorage.js.map +1 -0
- package/dist/module/ui/utils/inboxStorage.spec.js +123 -0
- package/dist/module/ui/utils/inboxStorage.spec.js.map +1 -0
- package/dist/module/ui/utils/index.js +5 -0
- package/dist/module/ui/utils/index.js.map +1 -0
- package/dist/{Messaging.d.ts → typescript/Messaging.d.ts} +23 -7
- package/dist/typescript/Messaging.d.ts.map +1 -0
- package/dist/{index.d.ts → typescript/index.d.ts} +4 -2
- package/dist/typescript/index.d.ts.map +1 -0
- package/dist/typescript/models/ContentCard.d.ts +57 -0
- package/dist/typescript/models/ContentCard.d.ts.map +1 -0
- package/dist/{models → typescript/models}/HTMLProposition.d.ts +1 -0
- package/dist/typescript/models/HTMLProposition.d.ts.map +1 -0
- package/dist/{models → typescript/models}/InAppMessage.d.ts +1 -0
- package/dist/typescript/models/InAppMessage.d.ts.map +1 -0
- package/dist/{models → typescript/models}/JSONProposition.d.ts +1 -0
- package/dist/typescript/models/JSONProposition.d.ts.map +1 -0
- package/dist/{models → typescript/models}/Message.d.ts +1 -0
- package/dist/typescript/models/Message.d.ts.map +1 -0
- package/dist/{models → typescript/models}/MessagingDelegate.d.ts +1 -0
- package/dist/typescript/models/MessagingDelegate.d.ts.map +1 -0
- package/dist/{models → typescript/models}/MessagingEdgeEventType.d.ts +1 -0
- package/dist/typescript/models/MessagingEdgeEventType.d.ts.map +1 -0
- package/dist/{models → typescript/models}/MessagingProposition.d.ts +1 -0
- package/dist/typescript/models/MessagingProposition.d.ts.map +1 -0
- package/dist/{models → typescript/models}/MessagingPropositionItem.d.ts +1 -0
- package/dist/typescript/models/MessagingPropositionItem.d.ts.map +1 -0
- package/dist/{models → typescript/models}/PersonalizationSchema.d.ts +2 -0
- package/dist/typescript/models/PersonalizationSchema.d.ts.map +1 -0
- package/dist/{models → typescript/models}/PropositionItem.d.ts +1 -0
- package/dist/typescript/models/PropositionItem.d.ts.map +1 -0
- package/dist/{models → typescript/models}/ScopeDetails.d.ts +1 -0
- package/dist/typescript/models/ScopeDetails.d.ts.map +1 -0
- package/dist/typescript/models/index.d.ts +11 -0
- package/dist/typescript/models/index.d.ts.map +1 -0
- package/dist/typescript/ui/components/Button/Button.d.ts +14 -0
- package/dist/typescript/ui/components/Button/Button.d.ts.map +1 -0
- package/dist/typescript/ui/components/Button/Button.spec.d.ts +2 -0
- package/dist/typescript/ui/components/Button/Button.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts +39 -0
- package/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map +1 -0
- package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts +2 -0
- package/dist/typescript/ui/components/ContentCardView/ContentCardView.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts +13 -0
- package/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map +1 -0
- package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts +2 -0
- package/dist/typescript/ui/components/DismissButton/DismissButton.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts +5 -0
- package/dist/typescript/ui/components/FullScreenCenterView/FullScreenCenterView.d.ts.map +1 -0
- package/dist/typescript/ui/components/Inbox/EmptyState.d.ts +19 -0
- package/dist/typescript/ui/components/Inbox/EmptyState.d.ts.map +1 -0
- package/dist/typescript/ui/components/Inbox/Inbox.d.ts +21 -0
- package/dist/typescript/ui/components/Inbox/Inbox.d.ts.map +1 -0
- package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts +2 -0
- package/dist/typescript/ui/components/Inbox/Inbox.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/Pagination/Pagination.d.ts +14 -0
- package/dist/typescript/ui/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts +2 -0
- package/dist/typescript/ui/components/Pagination/Pagination.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts +14 -0
- package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map +1 -0
- package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts +2 -0
- package/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map +1 -0
- package/dist/typescript/ui/components/index.d.ts +10 -0
- package/dist/typescript/ui/components/index.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/index.d.ts +4 -0
- package/dist/typescript/ui/hooks/index.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useAspectRatio.d.ts +3 -0
- package/dist/typescript/ui/hooks/useAspectRatio.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts +2 -0
- package/dist/typescript/ui/hooks/useAspectRatio.spec.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useContentCardUI.d.ts +14 -0
- package/dist/typescript/ui/hooks/useContentCardUI.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts +2 -0
- package/dist/typescript/ui/hooks/useContentCardUI.spec.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useInbox.d.ts +12 -0
- package/dist/typescript/ui/hooks/useInbox.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useInbox.spec.d.ts +2 -0
- package/dist/typescript/ui/hooks/useInbox.spec.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useInboxSettings.d.ts +7 -0
- package/dist/typescript/ui/hooks/useInboxSettings.d.ts.map +1 -0
- package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts +2 -0
- package/dist/typescript/ui/hooks/useInboxSettings.spec.d.ts.map +1 -0
- package/dist/typescript/ui/index.d.ts +8 -0
- package/dist/typescript/ui/index.d.ts.map +1 -0
- package/dist/typescript/ui/providers/InboxProvider.d.ts +56 -0
- package/dist/typescript/ui/providers/InboxProvider.d.ts.map +1 -0
- package/dist/typescript/ui/theme/Theme.d.ts +44 -0
- package/dist/typescript/ui/theme/Theme.d.ts.map +1 -0
- package/dist/typescript/ui/theme/ThemeProvider.d.ts +21 -0
- package/dist/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/typescript/ui/theme/index.d.ts +3 -0
- package/dist/typescript/ui/theme/index.d.ts.map +1 -0
- package/dist/typescript/ui/types/ContentViewEvent.d.ts +9 -0
- package/dist/typescript/ui/types/ContentViewEvent.d.ts.map +1 -0
- package/dist/typescript/ui/types/Templates.d.ts +43 -0
- package/dist/typescript/ui/types/Templates.d.ts.map +1 -0
- package/dist/typescript/ui/types/index.d.ts +3 -0
- package/dist/typescript/ui/types/index.d.ts.map +1 -0
- package/dist/typescript/ui/utils/generateCardHash.d.ts +21 -0
- package/dist/typescript/ui/utils/generateCardHash.d.ts.map +1 -0
- package/dist/typescript/ui/utils/generateCardHash.spec.d.ts +2 -0
- package/dist/typescript/ui/utils/generateCardHash.spec.d.ts.map +1 -0
- package/dist/typescript/ui/utils/inboxStorage.d.ts +20 -0
- package/dist/typescript/ui/utils/inboxStorage.d.ts.map +1 -0
- package/dist/typescript/ui/utils/inboxStorage.spec.d.ts +2 -0
- package/dist/typescript/ui/utils/inboxStorage.spec.d.ts.map +1 -0
- package/dist/typescript/ui/utils/index.d.ts +3 -0
- package/dist/typescript/ui/utils/index.d.ts.map +1 -0
- package/ios/src/RCTAEPMessaging.mm +11 -0
- package/ios/src/RCTAEPMessaging.swift +30 -3
- package/jest.config.js +15 -0
- package/package.json +33 -5
- package/src/Messaging.ts +287 -32
- package/src/index.ts +3 -3
- package/src/models/ContentCard.ts +52 -27
- package/src/models/HTMLProposition.ts +1 -1
- package/src/models/JSONProposition.ts +1 -1
- package/src/models/PersonalizationSchema.ts +1 -0
- package/src/models/index.ts +22 -0
- package/src/ui/components/Button/Button.spec.tsx +496 -0
- package/src/ui/components/Button/Button.tsx +76 -0
- package/src/ui/components/ContentCardView/ContentCardView.spec.tsx +278 -0
- package/src/ui/components/ContentCardView/ContentCardView.tsx +400 -0
- package/src/ui/components/DismissButton/DismissButton.spec.tsx +314 -0
- package/src/ui/components/DismissButton/DismissButton.tsx +100 -0
- package/src/ui/components/FullScreenCenterView/FullScreenCenterView.tsx +32 -0
- package/src/ui/components/Inbox/EmptyState.tsx +89 -0
- package/src/ui/components/Inbox/Inbox.spec.tsx +478 -0
- package/src/ui/components/Inbox/Inbox.tsx +275 -0
- package/src/ui/components/Pagination/Pagination.spec.tsx +159 -0
- package/src/ui/components/Pagination/Pagination.tsx +222 -0
- package/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx +878 -0
- package/src/ui/components/UnreadIcon/UnreadIcon.tsx +234 -0
- package/src/ui/components/index.ts +22 -0
- package/{dist/models/MessagingPropositionItem.js → src/ui/hooks/index.ts} +5 -4
- package/src/ui/hooks/useAspectRatio.spec.tsx +66 -0
- package/src/ui/hooks/useAspectRatio.tsx +39 -0
- package/src/ui/hooks/useContentCardUI.spec.tsx +82 -0
- package/src/ui/hooks/useContentCardUI.ts +48 -0
- package/src/ui/hooks/useInbox.spec.tsx +87 -0
- package/src/ui/hooks/useInbox.ts +46 -0
- package/src/ui/hooks/useInboxSettings.spec.tsx +41 -0
- package/src/ui/hooks/useInboxSettings.ts +24 -0
- package/src/ui/index.ts +7 -0
- package/src/ui/providers/InboxProvider.tsx +79 -0
- package/src/ui/theme/Theme.ts +57 -0
- package/src/ui/theme/ThemeProvider.tsx +120 -0
- package/src/ui/theme/index.ts +14 -0
- package/src/ui/types/ContentViewEvent.ts +20 -0
- package/src/ui/types/Templates.ts +77 -0
- package/src/ui/types/index.ts +14 -0
- package/src/ui/utils/generateCardHash.spec.tsx +86 -0
- package/src/ui/utils/generateCardHash.ts +59 -0
- package/src/ui/utils/inboxStorage.spec.tsx +136 -0
- package/src/ui/utils/inboxStorage.ts +64 -0
- package/src/ui/utils/index.ts +3 -0
- package/tutorials/ContentCardCustomizationGuide.md +661 -0
- package/tutorials/ContentCards.md +419 -0
- package/tutorials/Inbox.md +515 -0
- package/tutorials/resources/image-only-template.png +0 -0
- package/tutorials/resources/large-image-template.png +0 -0
- package/tutorials/resources/small-image-template.png +0 -0
- package/dist/Messaging.js +0 -152
- package/dist/Messaging.js.map +0 -1
- package/dist/index.js +0 -34
- package/dist/index.js.map +0 -1
- package/dist/models/ContentCard.d.ts +0 -51
- package/dist/models/ContentCard.js.map +0 -1
- package/dist/models/HTMLProposition.js.map +0 -1
- package/dist/models/InAppMessage.js.map +0 -1
- package/dist/models/JSONProposition.js.map +0 -1
- package/dist/models/Message.js +0 -156
- package/dist/models/Message.js.map +0 -1
- package/dist/models/MessagingDelegate.js +0 -14
- package/dist/models/MessagingDelegate.js.map +0 -1
- package/dist/models/MessagingEdgeEventType.js +0 -24
- package/dist/models/MessagingEdgeEventType.js.map +0 -1
- package/dist/models/MessagingProposition.js +0 -59
- package/dist/models/MessagingProposition.js.map +0 -1
- package/dist/models/MessagingPropositionItem.js.map +0 -1
- package/dist/models/PersonalizationSchema.js +0 -25
- package/dist/models/PersonalizationSchema.js.map +0 -1
- package/dist/models/PropositionItem.js +0 -78
- package/dist/models/PropositionItem.js.map +0 -1
- package/dist/models/ScopeDetails.js.map +0 -1
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"inboxStorage.spec.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/inboxStorage.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -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"}
|
|
@@ -72,6 +72,17 @@ RCT_EXTERN_METHOD(trackPropositionItem
|
|
|
72
72
|
: (RCTPromiseResolveBlock)resolve withRejecter
|
|
73
73
|
: (RCTPromiseRejectBlock)reject);
|
|
74
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
|
+
|
|
75
86
|
RCT_EXTERN_METHOD(setAutoTrack
|
|
76
87
|
: (NSString *)messageId autoTrack
|
|
77
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
|
-
|
|
131
|
-
|
|
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
|
|
@@ -361,7 +366,29 @@ public class RCTAEPMessaging: RCTEventEmitter, MessagingDelegate {
|
|
|
361
366
|
resolve(nil)
|
|
362
367
|
}
|
|
363
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
|
+
}
|
|
364
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
|
+
}
|
|
365
392
|
|
|
366
393
|
// Map uuid (scopeDetails.activity.id) -> parent Proposition
|
|
367
394
|
private var propositionByUuid = [String: Proposition]()
|
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.
|
|
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": "
|
|
8
|
-
"
|
|
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": "
|
|
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
|
-
"
|
|
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
|
}
|