@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,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
/*
|
|
5
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
6
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
10
|
+
or agreed to in writing, software distributed under the License is
|
|
11
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
12
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
13
|
+
language governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import React, { useEffect, useCallback, useState, useRef, useMemo } from "react";
|
|
17
|
+
import { Image, Linking, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
18
|
+
import MessagingEdgeEventType from "../../../models/MessagingEdgeEventType.js";
|
|
19
|
+
import DismissButton from "../DismissButton/DismissButton.js";
|
|
20
|
+
import UnreadIcon from "../UnreadIcon/UnreadIcon.js";
|
|
21
|
+
import { useTheme } from "../../theme/index.js";
|
|
22
|
+
import useAspectRatio from "../../hooks/useAspectRatio.js";
|
|
23
|
+
import Button from "../Button/Button.js";
|
|
24
|
+
import useInboxSettings from "../../hooks/useInboxSettings.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Callback function that is called when a content card event occurs.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** Props for the ContentCardView component */
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @experimental
|
|
34
|
+
* Renders a content card view.
|
|
35
|
+
*/
|
|
36
|
+
export const ContentCardView = ({
|
|
37
|
+
template,
|
|
38
|
+
listener,
|
|
39
|
+
variant,
|
|
40
|
+
styleOverrides: _styleOverrides,
|
|
41
|
+
style,
|
|
42
|
+
ContainerProps,
|
|
43
|
+
ImageContainerProps,
|
|
44
|
+
ImageProps,
|
|
45
|
+
ContentContainerProps,
|
|
46
|
+
TextProps,
|
|
47
|
+
TitleProps,
|
|
48
|
+
BodyProps,
|
|
49
|
+
ButtonContainerProps,
|
|
50
|
+
ButtonProps,
|
|
51
|
+
DismissButtonProps,
|
|
52
|
+
...props
|
|
53
|
+
}) => {
|
|
54
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
55
|
+
const isDisplayedRef = useRef(false);
|
|
56
|
+
const {
|
|
57
|
+
colors,
|
|
58
|
+
isDark
|
|
59
|
+
} = useTheme();
|
|
60
|
+
const containerSettings = useInboxSettings();
|
|
61
|
+
const isRead = template.isRead ?? false;
|
|
62
|
+
|
|
63
|
+
// Default to true if not specified
|
|
64
|
+
const isUnreadEnabled = containerSettings?.content?.isUnreadEnabled ?? true;
|
|
65
|
+
|
|
66
|
+
// Get unread background color based on theme
|
|
67
|
+
const unreadBackgroundColor = useMemo(() => {
|
|
68
|
+
if (!isUnreadEnabled || isRead || !containerSettings?.content?.unread_indicator?.unread_bg) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const unreadBg = containerSettings.content.unread_indicator.unread_bg;
|
|
72
|
+
return isDark ? unreadBg.clr.dark : unreadBg.clr.light;
|
|
73
|
+
}, [isUnreadEnabled, isRead, containerSettings, isDark]);
|
|
74
|
+
const cardVariant = useMemo(() => variant ?? template.type ?? "SmallImage", [variant, template.type]);
|
|
75
|
+
const onDismiss = useCallback(() => {
|
|
76
|
+
listener?.("onDismiss", template);
|
|
77
|
+
|
|
78
|
+
// Track dismiss event using propositionItem
|
|
79
|
+
template.track?.(MessagingEdgeEventType.DISMISS);
|
|
80
|
+
setIsVisible(false);
|
|
81
|
+
}, [listener, template]);
|
|
82
|
+
const onPress = useCallback(async () => {
|
|
83
|
+
listener?.("onInteract", template);
|
|
84
|
+
|
|
85
|
+
// Track interaction event using propositionItem
|
|
86
|
+
template.track?.("content_clicked", MessagingEdgeEventType.INTERACT, null);
|
|
87
|
+
const actionUrl = template.data.content.actionUrl;
|
|
88
|
+
if (actionUrl) {
|
|
89
|
+
try {
|
|
90
|
+
const supported = await Linking.canOpenURL(actionUrl);
|
|
91
|
+
if (supported) {
|
|
92
|
+
await Linking.openURL(actionUrl);
|
|
93
|
+
} else {
|
|
94
|
+
console.warn(`Cannot open URL: ${actionUrl}`);
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.warn(`Failed to open URL: ${actionUrl}`, error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, [template, listener]);
|
|
101
|
+
const onButtonPress = useCallback(buttonId => {
|
|
102
|
+
listener?.("onInteract", template, {
|
|
103
|
+
buttonId
|
|
104
|
+
});
|
|
105
|
+
}, [listener, template]);
|
|
106
|
+
const imageUri = useMemo(() => {
|
|
107
|
+
if (isDark && template.data?.content?.image?.darkUrl) {
|
|
108
|
+
return template.data.content.image.darkUrl;
|
|
109
|
+
}
|
|
110
|
+
return template.data.content.image?.url;
|
|
111
|
+
}, [isDark, template.data?.content?.image?.darkUrl, template.data?.content?.image?.url]);
|
|
112
|
+
const imageAspectRatio = useAspectRatio(imageUri);
|
|
113
|
+
const styleOverrides = useMemo(() => {
|
|
114
|
+
switch (cardVariant) {
|
|
115
|
+
case "SmallImage":
|
|
116
|
+
return _styleOverrides?.smallImageStyle;
|
|
117
|
+
case "LargeImage":
|
|
118
|
+
return _styleOverrides?.largeImageStyle;
|
|
119
|
+
case "ImageOnly":
|
|
120
|
+
return _styleOverrides?.imageOnlyStyle;
|
|
121
|
+
default:
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}, [_styleOverrides, cardVariant]);
|
|
125
|
+
|
|
126
|
+
// Call listener on mount to signal view display (only once to prevent duplicates)
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (!isDisplayedRef.current) {
|
|
129
|
+
listener?.("onDisplay", template);
|
|
130
|
+
// Track display event using propositionItem
|
|
131
|
+
template.track?.(MessagingEdgeEventType.DISPLAY);
|
|
132
|
+
isDisplayedRef.current = true;
|
|
133
|
+
}
|
|
134
|
+
}, [listener, template]);
|
|
135
|
+
|
|
136
|
+
// If not visible, return null to hide the entire view
|
|
137
|
+
if (!isVisible) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
if (!template.data) return null;
|
|
141
|
+
const content = template?.data?.content;
|
|
142
|
+
if (!content) return null;
|
|
143
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
144
|
+
accessibilityLabel: content?.title?.content ?? 'Content Card',
|
|
145
|
+
onPress: onPress,
|
|
146
|
+
style: state => [styles.card, styleOverrides?.card, typeof style === "function" ? style(state) : style]
|
|
147
|
+
}, props), /*#__PURE__*/React.createElement(View, _extends({
|
|
148
|
+
style: [cardVariant === "SmallImage" ? smallImageStyles.container : styles.container, styleOverrides?.container, unreadBackgroundColor && {
|
|
149
|
+
backgroundColor: unreadBackgroundColor
|
|
150
|
+
}]
|
|
151
|
+
}, ContainerProps), imageUri && /*#__PURE__*/React.createElement(View, _extends({
|
|
152
|
+
style: [cardVariant === "SmallImage" ? smallImageStyles.imageContainer : [styles.imageContainer, {
|
|
153
|
+
backgroundColor: colors.imageContainerColor
|
|
154
|
+
}], styleOverrides?.imageContainer]
|
|
155
|
+
}, ImageContainerProps), /*#__PURE__*/React.createElement(Image, _extends({
|
|
156
|
+
source: {
|
|
157
|
+
uri: imageUri
|
|
158
|
+
},
|
|
159
|
+
style: [cardVariant === "SmallImage" ? smallImageStyles.image : styles.image, {
|
|
160
|
+
aspectRatio: imageAspectRatio
|
|
161
|
+
}, styleOverrides?.image],
|
|
162
|
+
resizeMode: "contain"
|
|
163
|
+
}, ImageProps))), cardVariant !== "ImageOnly" && /*#__PURE__*/React.createElement(View, _extends({
|
|
164
|
+
style: [cardVariant === "SmallImage" ? smallImageStyles.contentContainer : styles.contentContainer, styleOverrides?.contentContainer]
|
|
165
|
+
}, ContentContainerProps), content?.title?.content && /*#__PURE__*/React.createElement(Text, _extends({
|
|
166
|
+
style: [styles.title, {
|
|
167
|
+
color: colors.textPrimary
|
|
168
|
+
}, styleOverrides?.text, styleOverrides?.title]
|
|
169
|
+
}, TextProps, TitleProps), content.title.content), content?.body?.content && /*#__PURE__*/React.createElement(Text, _extends({
|
|
170
|
+
style: [styles.body, {
|
|
171
|
+
color: colors.textPrimary
|
|
172
|
+
}, styleOverrides?.text, styleOverrides?.body]
|
|
173
|
+
}, TextProps, BodyProps), content.body.content), /*#__PURE__*/React.createElement(View, _extends({
|
|
174
|
+
style: [styles.buttonContainer, styleOverrides?.buttonContainer]
|
|
175
|
+
}, ButtonContainerProps), Array.isArray(content?.buttons) && content.buttons.length > 0 && content.buttons.map(button => /*#__PURE__*/React.createElement(Button, _extends({
|
|
176
|
+
key: button.id,
|
|
177
|
+
interactId: button.id,
|
|
178
|
+
actionUrl: button.actionUrl,
|
|
179
|
+
title: button.text.content,
|
|
180
|
+
onPress: onButtonPress,
|
|
181
|
+
style: styleOverrides?.button,
|
|
182
|
+
textStyle: [styleOverrides?.text, styleOverrides?.buttonText]
|
|
183
|
+
}, ButtonProps))))), content?.dismissBtn && content.dismissBtn?.style !== "none" && /*#__PURE__*/React.createElement(DismissButton, _extends({
|
|
184
|
+
onPress: onDismiss,
|
|
185
|
+
type: content.dismissBtn.style
|
|
186
|
+
}, DismissButtonProps)), isUnreadEnabled && !isRead && /*#__PURE__*/React.createElement(UnreadIcon, {
|
|
187
|
+
accessibilityLabel: "Unread Icon"
|
|
188
|
+
})));
|
|
189
|
+
};
|
|
190
|
+
const styles = StyleSheet.create({
|
|
191
|
+
card: {
|
|
192
|
+
margin: 15,
|
|
193
|
+
flex: 1
|
|
194
|
+
},
|
|
195
|
+
container: {
|
|
196
|
+
flexDirection: "column"
|
|
197
|
+
},
|
|
198
|
+
imageContainer: {
|
|
199
|
+
alignItems: "center",
|
|
200
|
+
borderRadius: 12
|
|
201
|
+
},
|
|
202
|
+
image: {
|
|
203
|
+
width: "100%",
|
|
204
|
+
resizeMode: "contain"
|
|
205
|
+
},
|
|
206
|
+
contentContainer: {
|
|
207
|
+
paddingVertical: 16,
|
|
208
|
+
paddingHorizontal: 16,
|
|
209
|
+
justifyContent: "flex-start"
|
|
210
|
+
},
|
|
211
|
+
title: {
|
|
212
|
+
fontSize: 16,
|
|
213
|
+
fontWeight: "600",
|
|
214
|
+
marginBottom: 8,
|
|
215
|
+
marginRight: 16
|
|
216
|
+
},
|
|
217
|
+
body: {
|
|
218
|
+
fontSize: 14,
|
|
219
|
+
lineHeight: 18
|
|
220
|
+
},
|
|
221
|
+
buttonContainer: {
|
|
222
|
+
flexDirection: "row",
|
|
223
|
+
justifyContent: "flex-start",
|
|
224
|
+
flexWrap: "wrap",
|
|
225
|
+
paddingTop: 8,
|
|
226
|
+
gap: 8
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
const smallImageStyles = StyleSheet.create({
|
|
230
|
+
card: {
|
|
231
|
+
borderRadius: 12,
|
|
232
|
+
flexDirection: "row",
|
|
233
|
+
gap: 8,
|
|
234
|
+
maxWidth: "100%",
|
|
235
|
+
alignItems: "center"
|
|
236
|
+
},
|
|
237
|
+
container: {
|
|
238
|
+
flexDirection: "row"
|
|
239
|
+
},
|
|
240
|
+
contentContainer: {
|
|
241
|
+
flex: 1,
|
|
242
|
+
paddingVertical: 16,
|
|
243
|
+
paddingHorizontal: 16,
|
|
244
|
+
justifyContent: "flex-start"
|
|
245
|
+
},
|
|
246
|
+
imageContainer: {
|
|
247
|
+
borderRadius: 12,
|
|
248
|
+
maxWidth: "35%",
|
|
249
|
+
alignSelf: "center"
|
|
250
|
+
},
|
|
251
|
+
image: {
|
|
252
|
+
resizeMode: "contain",
|
|
253
|
+
width: "100%",
|
|
254
|
+
maxWidth: "100%"
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
//# sourceMappingURL=ContentCardView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useCallback","useState","useRef","useMemo","Image","Linking","Pressable","StyleSheet","Text","View","MessagingEdgeEventType","DismissButton","UnreadIcon","useTheme","useAspectRatio","Button","useInboxSettings","ContentCardView","template","listener","variant","styleOverrides","_styleOverrides","style","ContainerProps","ImageContainerProps","ImageProps","ContentContainerProps","TextProps","TitleProps","BodyProps","ButtonContainerProps","ButtonProps","DismissButtonProps","props","isVisible","setIsVisible","isDisplayedRef","colors","isDark","containerSettings","isRead","isUnreadEnabled","content","unreadBackgroundColor","unread_indicator","unread_bg","undefined","unreadBg","clr","dark","light","cardVariant","type","onDismiss","track","DISMISS","onPress","INTERACT","actionUrl","data","supported","canOpenURL","openURL","console","warn","error","onButtonPress","buttonId","imageUri","image","darkUrl","url","imageAspectRatio","smallImageStyle","largeImageStyle","imageOnlyStyle","current","DISPLAY","createElement","_extends","accessibilityLabel","title","state","styles","card","smallImageStyles","container","backgroundColor","imageContainer","imageContainerColor","source","uri","aspectRatio","resizeMode","contentContainer","color","textPrimary","text","body","buttonContainer","Array","isArray","buttons","length","map","button","key","id","interactId","textStyle","buttonText","dismissBtn","create","margin","flex","flexDirection","alignItems","borderRadius","width","paddingVertical","paddingHorizontal","justifyContent","fontSize","fontWeight","marginBottom","marginRight","lineHeight","flexWrap","paddingTop","gap","maxWidth","alignSelf"],"sourceRoot":"../../../../../src","sources":["ui/components/ContentCardView/ContentCardView.tsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IACVC,SAAS,EACTC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACF,OAAO;AASd,SACEC,KAAK,EACLC,OAAO,EACPC,SAAS,EAETC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,OAAOC,sBAAsB,MAAM,2CAAwC;AAC3E,OAAOC,aAAa,MAAM,mCAAgC;AAC1D,OAAOC,UAAU,MAAM,6BAA0B;AACjD,SAASC,QAAQ,QAAQ,sBAAa;AACtC,OAAOC,cAAc,MAAM,+BAA4B;AAEvD,OAAOC,MAAM,MAAM,qBAAkB;AACrC,OAAOC,gBAAgB,MAAM,iCAA8B;;AAE3D;AACA;AACA;;AAUA;;AAqBA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAA2C,GAAGA,CAAC;EAC1DC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,cAAc,EAAEC,eAAe;EAC/BC,KAAK;EACLC,cAAc;EACdC,mBAAmB;EACn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AK,EAAE;IACLyC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACD3B,IAAI,EAAE;IACJwB,QAAQ,EAAE,EAAE;IACZI,UAAU,EAAE;EACd,CAAC;EACD3B,eAAe,EAAE;IACfgB,aAAa,EAAE,KAAK;IACpBM,cAAc,EAAE,YAAY;IAC5BM,QAAQ,EAAE,MAAM;IAChBC,UAAU,EAAE,CAAC;IACbC,GAAG,EAAE;EACP;AACF,CAAC,CAAC;AAEF,MAAM5C,gBAAgB,GAAG/E,UAAU,CAAC0G,MAAM,CAAC;EACzC5B,IAAI,EAAE;IACJiC,YAAY,EAAE,EAAE;IAChBF,aAAa,EAAE,KAAK;IACpBc,GAAG,EAAE,CAAC;IACNC,QAAQ,EAAE,MAAM;IAChBd,UAAU,EAAE;EACd,CAAC;EACD9B,SAAS,EAAE;IACT6B,aAAa,EAAE;EACjB,CAAC;EACDrB,gBAAgB,EAAE;IAChBoB,IAAI,EAAE,CAAC;IACPK,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,cAAc,EAAE;EAClB,CAAC;EACDjC,cAAc,EAAE;IACd6B,YAAY,EAAE,EAAE;IAChBa,QAAQ,EAAE,KAAK;IACfC,SAAS,EAAE;EACb,CAAC;EACD9D,KAAK,EAAE;IACLwB,UAAU,EAAE,SAAS;IACrByB,KAAK,EAAE,MAAM;IACbY,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
5
|
+
This file is licensed to you under the Apache License, Version 2.0 (the
|
|
6
|
+
"License"); you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
|
|
9
|
+
or agreed to in writing, software distributed under the License is
|
|
10
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF
|
|
11
|
+
ANY KIND, either express or implied. See the License for the specific
|
|
12
|
+
language governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { fireEvent, render, waitFor } from '@testing-library/react-native';
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import { Image, Linking } from 'react-native';
|
|
18
|
+
import MessagingEdgeEventType from "../../../models/MessagingEdgeEventType.js";
|
|
19
|
+
import UnreadIcon from "../UnreadIcon/UnreadIcon.js";
|
|
20
|
+
import { ContentCardView } from "./ContentCardView.js";
|
|
21
|
+
|
|
22
|
+
// Mock aspect ratio hook to a stable value
|
|
23
|
+
jest.mock('../../hooks/useAspectRatio', () => ({
|
|
24
|
+
__esModule: true,
|
|
25
|
+
default: () => 1.5
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
// Mock inbox settings (unread enabled)
|
|
29
|
+
jest.mock('../../hooks/useInboxSettings', () => {
|
|
30
|
+
const fn = jest.fn(() => ({
|
|
31
|
+
content: {
|
|
32
|
+
isUnreadEnabled: true,
|
|
33
|
+
unread_indicator: {
|
|
34
|
+
unread_bg: {
|
|
35
|
+
clr: {
|
|
36
|
+
light: '#EEE',
|
|
37
|
+
dark: '#111'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
return {
|
|
44
|
+
__esModule: true,
|
|
45
|
+
default: fn
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
const makeTemplate = (overrides = {}) => ({
|
|
49
|
+
id: 'card-1',
|
|
50
|
+
type: 'SmallImage',
|
|
51
|
+
isRead: false,
|
|
52
|
+
data: {
|
|
53
|
+
content: {
|
|
54
|
+
title: {
|
|
55
|
+
content: 'Title'
|
|
56
|
+
},
|
|
57
|
+
body: {
|
|
58
|
+
content: 'Body'
|
|
59
|
+
},
|
|
60
|
+
image: {
|
|
61
|
+
url: 'https://example.com/img.png'
|
|
62
|
+
},
|
|
63
|
+
dismissBtn: {
|
|
64
|
+
style: 'close'
|
|
65
|
+
},
|
|
66
|
+
actionUrl: 'https://adobe.com'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
track: jest.fn(),
|
|
70
|
+
...overrides
|
|
71
|
+
});
|
|
72
|
+
describe('ContentCardView - rendering variants', () => {
|
|
73
|
+
it('renders SmallImage with title and body', () => {
|
|
74
|
+
const template = makeTemplate({
|
|
75
|
+
type: 'SmallImage'
|
|
76
|
+
});
|
|
77
|
+
const {
|
|
78
|
+
getByText
|
|
79
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
80
|
+
template: template
|
|
81
|
+
}));
|
|
82
|
+
expect(getByText('Title')).toBeTruthy();
|
|
83
|
+
expect(getByText('Body')).toBeTruthy();
|
|
84
|
+
});
|
|
85
|
+
it('falls back to SmallImage when variant and template.type are missing', () => {
|
|
86
|
+
const template = makeTemplate({
|
|
87
|
+
type: undefined
|
|
88
|
+
});
|
|
89
|
+
// remove variant prop
|
|
90
|
+
const {
|
|
91
|
+
getByText
|
|
92
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
93
|
+
template: template
|
|
94
|
+
}));
|
|
95
|
+
expect(getByText('Title')).toBeTruthy();
|
|
96
|
+
expect(getByText('Body')).toBeTruthy();
|
|
97
|
+
});
|
|
98
|
+
it('renders LargeImage with title, body, and buttons', () => {
|
|
99
|
+
const template = makeTemplate({
|
|
100
|
+
type: 'LargeImage',
|
|
101
|
+
data: {
|
|
102
|
+
content: {
|
|
103
|
+
title: {
|
|
104
|
+
content: 'Title'
|
|
105
|
+
},
|
|
106
|
+
body: {
|
|
107
|
+
content: 'Body'
|
|
108
|
+
},
|
|
109
|
+
image: {
|
|
110
|
+
url: 'https://example.com/img.png'
|
|
111
|
+
},
|
|
112
|
+
dismissBtn: {
|
|
113
|
+
style: 'close'
|
|
114
|
+
},
|
|
115
|
+
buttons: [{
|
|
116
|
+
id: 'btn1',
|
|
117
|
+
text: {
|
|
118
|
+
content: 'Go'
|
|
119
|
+
},
|
|
120
|
+
actionUrl: 'https://example.com/go'
|
|
121
|
+
}]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const {
|
|
126
|
+
getByText
|
|
127
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
128
|
+
template: template
|
|
129
|
+
}));
|
|
130
|
+
expect(getByText('Title')).toBeTruthy();
|
|
131
|
+
expect(getByText('Body')).toBeTruthy();
|
|
132
|
+
// Button rendered from buttons map
|
|
133
|
+
expect(getByText('Go')).toBeTruthy();
|
|
134
|
+
});
|
|
135
|
+
it('renders ImageOnly without text sections but with image', () => {
|
|
136
|
+
const template = makeTemplate({
|
|
137
|
+
type: 'ImageOnly'
|
|
138
|
+
});
|
|
139
|
+
const {
|
|
140
|
+
queryByText,
|
|
141
|
+
UNSAFE_getAllByType
|
|
142
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
143
|
+
template: template
|
|
144
|
+
}));
|
|
145
|
+
expect(queryByText('Title')).toBeNull();
|
|
146
|
+
expect(queryByText('Body')).toBeNull();
|
|
147
|
+
// Ensure an Image is rendered
|
|
148
|
+
const images = UNSAFE_getAllByType(Image);
|
|
149
|
+
expect(images.length).toBeGreaterThan(0);
|
|
150
|
+
});
|
|
151
|
+
it('uses darkUrl for images when in dark mode', () => {
|
|
152
|
+
const rn = require('react-native');
|
|
153
|
+
const colorSpy = jest.spyOn(rn, 'useColorScheme');
|
|
154
|
+
colorSpy.mockReturnValue('dark');
|
|
155
|
+
const template = makeTemplate({
|
|
156
|
+
data: {
|
|
157
|
+
content: {
|
|
158
|
+
image: {
|
|
159
|
+
url: 'https://light.png',
|
|
160
|
+
darkUrl: 'https://dark.png'
|
|
161
|
+
},
|
|
162
|
+
title: {
|
|
163
|
+
content: 'Title'
|
|
164
|
+
},
|
|
165
|
+
body: {
|
|
166
|
+
content: 'Body'
|
|
167
|
+
},
|
|
168
|
+
dismissBtn: {
|
|
169
|
+
style: 'close'
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const {
|
|
175
|
+
UNSAFE_getAllByType
|
|
176
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
177
|
+
template: template
|
|
178
|
+
}));
|
|
179
|
+
const images = UNSAFE_getAllByType(Image);
|
|
180
|
+
expect(images[0].props.source.uri).toBe('https://dark.png');
|
|
181
|
+
colorSpy.mockRestore();
|
|
182
|
+
});
|
|
183
|
+
it('falls back gracefully for unknown variant (default case)', () => {
|
|
184
|
+
const template = makeTemplate({
|
|
185
|
+
type: 'UnknownVariant'
|
|
186
|
+
});
|
|
187
|
+
const {
|
|
188
|
+
getByText
|
|
189
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
190
|
+
template: template
|
|
191
|
+
}));
|
|
192
|
+
// Should still render content without throwing
|
|
193
|
+
expect(getByText('Title')).toBeTruthy();
|
|
194
|
+
expect(getByText('Body')).toBeTruthy();
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('ContentCardView - interactions and tracking', () => {
|
|
198
|
+
afterEach(() => {
|
|
199
|
+
jest.restoreAllMocks();
|
|
200
|
+
});
|
|
201
|
+
it('does not crash if Linking.openURL throws (error case)', async () => {
|
|
202
|
+
jest.spyOn(Linking, 'canOpenURL').mockResolvedValueOnce(true);
|
|
203
|
+
const openSpy = jest.spyOn(Linking, 'openURL').mockImplementationOnce(() => Promise.reject(new Error('open failed')));
|
|
204
|
+
const template = makeTemplate();
|
|
205
|
+
const listener = jest.fn();
|
|
206
|
+
const {
|
|
207
|
+
getByTestId
|
|
208
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
209
|
+
template: template,
|
|
210
|
+
listener: listener,
|
|
211
|
+
testID: "card"
|
|
212
|
+
}));
|
|
213
|
+
expect(() => fireEvent.press(getByTestId('card'))).not.toThrow();
|
|
214
|
+
await waitFor(() => expect(openSpy).toHaveBeenCalled());
|
|
215
|
+
expect(listener).toHaveBeenCalledWith('onInteract', template);
|
|
216
|
+
});
|
|
217
|
+
it('onPress with no track and no actionUrl does not throw or open URL', () => {
|
|
218
|
+
const openSpy = jest.spyOn(Linking, 'openURL').mockClear();
|
|
219
|
+
const base = makeTemplate();
|
|
220
|
+
const tpl = JSON.parse(JSON.stringify(base));
|
|
221
|
+
tpl.track = undefined;
|
|
222
|
+
delete tpl.data.content.actionUrl;
|
|
223
|
+
const {
|
|
224
|
+
getByTestId
|
|
225
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
226
|
+
template: tpl,
|
|
227
|
+
testID: "card"
|
|
228
|
+
}));
|
|
229
|
+
expect(() => fireEvent.press(getByTestId('card'))).not.toThrow();
|
|
230
|
+
expect(openSpy).not.toHaveBeenCalled();
|
|
231
|
+
});
|
|
232
|
+
it('calls onDisplay once and tracks DISPLAY', () => {
|
|
233
|
+
const template = makeTemplate();
|
|
234
|
+
const listener = jest.fn();
|
|
235
|
+
render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
236
|
+
template: template,
|
|
237
|
+
listener: listener,
|
|
238
|
+
testID: "card"
|
|
239
|
+
}));
|
|
240
|
+
expect(listener).toHaveBeenCalledWith('onDisplay', template);
|
|
241
|
+
expect(template.track).toHaveBeenCalledWith(MessagingEdgeEventType.DISPLAY);
|
|
242
|
+
});
|
|
243
|
+
it('tracks INTERACT and opens URL on press', async () => {
|
|
244
|
+
const template = makeTemplate();
|
|
245
|
+
const listener = jest.fn();
|
|
246
|
+
jest.spyOn(Linking, 'canOpenURL').mockResolvedValueOnce(true);
|
|
247
|
+
jest.spyOn(Linking, 'openURL').mockResolvedValueOnce(undefined);
|
|
248
|
+
const {
|
|
249
|
+
getByTestId
|
|
250
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
251
|
+
template: template,
|
|
252
|
+
listener: listener,
|
|
253
|
+
testID: "card"
|
|
254
|
+
}));
|
|
255
|
+
fireEvent.press(getByTestId('card'));
|
|
256
|
+
expect(listener).toHaveBeenCalledWith('onInteract', template);
|
|
257
|
+
expect(template.track).toHaveBeenCalledWith('content_clicked', MessagingEdgeEventType.INTERACT, null);
|
|
258
|
+
await waitFor(() => expect(Linking.openURL).toHaveBeenCalledWith('https://adobe.com'));
|
|
259
|
+
});
|
|
260
|
+
it('warns when card actionUrl cannot be opened (canOpenURL returns false)', async () => {
|
|
261
|
+
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
|
262
|
+
const canOpenSpy = jest.spyOn(Linking, 'canOpenURL').mockResolvedValue(false);
|
|
263
|
+
jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined);
|
|
264
|
+
const template = makeTemplate();
|
|
265
|
+
const listener = jest.fn();
|
|
266
|
+
const {
|
|
267
|
+
getByTestId
|
|
268
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
269
|
+
template: template,
|
|
270
|
+
listener: listener,
|
|
271
|
+
testID: "card"
|
|
272
|
+
}));
|
|
273
|
+
fireEvent.press(getByTestId('card'));
|
|
274
|
+
await waitFor(() => {
|
|
275
|
+
expect(canOpenSpy).toHaveBeenCalledWith('https://adobe.com');
|
|
276
|
+
expect(warnSpy).toHaveBeenCalledWith('Cannot open URL: https://adobe.com');
|
|
277
|
+
});
|
|
278
|
+
warnSpy.mockRestore();
|
|
279
|
+
});
|
|
280
|
+
it('calls listener with onInteract, template, and buttonId when a CTA button is pressed', async () => {
|
|
281
|
+
const template = makeTemplate({
|
|
282
|
+
type: 'LargeImage',
|
|
283
|
+
data: {
|
|
284
|
+
content: {
|
|
285
|
+
title: {
|
|
286
|
+
content: 'Title'
|
|
287
|
+
},
|
|
288
|
+
body: {
|
|
289
|
+
content: 'Body'
|
|
290
|
+
},
|
|
291
|
+
image: {
|
|
292
|
+
url: 'https://example.com/img.png'
|
|
293
|
+
},
|
|
294
|
+
dismissBtn: {
|
|
295
|
+
style: 'close'
|
|
296
|
+
},
|
|
297
|
+
buttons: [{
|
|
298
|
+
id: 'btn1',
|
|
299
|
+
text: {
|
|
300
|
+
content: 'Go'
|
|
301
|
+
},
|
|
302
|
+
actionUrl: 'https://example.com/go'
|
|
303
|
+
}]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const listener = jest.fn();
|
|
308
|
+
jest.spyOn(Linking, 'canOpenURL').mockResolvedValue(true);
|
|
309
|
+
jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined);
|
|
310
|
+
const {
|
|
311
|
+
getByText
|
|
312
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
313
|
+
template: template,
|
|
314
|
+
listener: listener
|
|
315
|
+
}));
|
|
316
|
+
fireEvent.press(getByText('Go'));
|
|
317
|
+
expect(listener).toHaveBeenCalledWith('onInteract', template, {
|
|
318
|
+
buttonId: 'btn1'
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
it('calls onDismiss, tracks DISMISS, and hides the card', () => {
|
|
322
|
+
const template = makeTemplate();
|
|
323
|
+
const listener = jest.fn();
|
|
324
|
+
const {
|
|
325
|
+
queryByText,
|
|
326
|
+
getByText
|
|
327
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
328
|
+
template: template,
|
|
329
|
+
listener: listener
|
|
330
|
+
}));
|
|
331
|
+
// Dismiss button renders as 'x'
|
|
332
|
+
fireEvent.press(getByText('\u00D7'));
|
|
333
|
+
expect(listener).toHaveBeenCalledWith('onDismiss', template);
|
|
334
|
+
expect(template.track).toHaveBeenCalledWith(MessagingEdgeEventType.DISMISS);
|
|
335
|
+
// Card should no longer render title after dismiss
|
|
336
|
+
expect(queryByText('Title')).toBeNull();
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
describe('ContentCardView - unread indicator and styles', () => {
|
|
340
|
+
it('renders UnreadIcon by default when settings are missing', () => {
|
|
341
|
+
const useInboxSettings = require('../../hooks/useInboxSettings').default;
|
|
342
|
+
useInboxSettings.mockReturnValueOnce({});
|
|
343
|
+
const template = makeTemplate({
|
|
344
|
+
isRead: false
|
|
345
|
+
});
|
|
346
|
+
const {
|
|
347
|
+
UNSAFE_getAllByType
|
|
348
|
+
} = render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
349
|
+
template: template
|
|
350
|
+
}));
|
|
351
|
+
expect(UNSAFE_getAllByType(UnreadIcon).length).toBeGreaterThan(0);
|
|
352
|
+
});
|
|
353
|
+
it('applies dynamic Pressable style function', () => {
|
|
354
|
+
const tpl = makeTemplate();
|
|
355
|
+
const styleFn = jest.fn(() => ({}));
|
|
356
|
+
render(/*#__PURE__*/React.createElement(ContentCardView, {
|
|
357
|
+
template: tpl,
|
|
358
|
+
style: styleFn
|
|
359
|
+
}));
|
|
360
|
+
expect(styleFn).toHaveBeenCalled();
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
//# sourceMappingURL=ContentCardView.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fireEvent","render","waitFor","React","Image","Linking","MessagingEdgeEventType","UnreadIcon","ContentCardView","jest","mock","__esModule","default","fn","content","isUnreadEnabled","unread_indicator","unread_bg","clr","light","dark","makeTemplate","overrides","id","type","isRead","data","title","body","image","url","dismissBtn","style","actionUrl","track","describe","it","template","getByText","createElement","expect","toBeTruthy","undefined","buttons","text","queryByText","UNSAFE_getAllByType","toBeNull","images","length","toBeGreaterThan","rn","require","colorSpy","spyOn","mockReturnValue","darkUrl","props","source","uri","toBe","mockRestore","afterEach","restoreAllMocks","mockResolvedValueOnce","openSpy","mockImplementationOnce","Promise","reject","Error","listener","getByTestId","testID","press","not","toThrow","toHaveBeenCalled","toHaveBeenCalledWith","mockClear","base","tpl","JSON","parse","stringify","DISPLAY","INTERACT","openURL","warnSpy","console","mockImplementation","canOpenSpy","mockResolvedValue","buttonId","DISMISS","useInboxSettings","mockReturnValueOnce","styleFn"],"sourceRoot":"../../../../../src","sources":["ui/components/ContentCardView/ContentCardView.spec.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,OAAO,QAAQ,+BAA+B;AAC1E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,OAAO,QAAQ,cAAc;AAC7C,OAAOC,sBAAsB,MAAM,2CAAwC;AAC3E,OAAOC,UAAU,MAAM,6BAA0B;AACjD,SAASC,eAAe,QAAQ,sBAAmB;;AAEnD;AACAC,IAAI,CAACC,IAAI,CAAC,4BAA4B,EAAE,OAAO;EAAEC,UAAU,EAAE,IAAI;EAAEC,OAAO,EAAEA,CAAA,KAAM;AAAI,CAAC,CAAC,CAAC;;AAEzF;AACAH,IAAI,CAACC,IAAI,CAAC,8BAA8B,EAAE,MAAM;EAC9C,MAAMG,EAAE,GAAGJ,IAAI,CAACI,EAAE,CAAC,OAAO;IACxBC,OAAO,EAAE;MACPC,eAAe,EAAE,IAAI;MACrBC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;UAAEC,GAAG,EAAE;YAAEC,KAAK,EAAE,MAAM;YAAEC,IAAI,EAAE;UAAO;QAAE;MAAE;IAC1E;EACF,CAAC,CAAC,CAAC;EACH,OAAO;IAAET,UAAU,EAAE,IAAI;IAAEC,OAAO,EAAEC;EAAG,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAMQ,YAAY,GAAGA,CAACC,SAAuB,GAAG,CAAC,CAAC,MAAM;EACtDC,EAAE,EAAE,QAAQ;EACZC,IAAI,EAAE,YAAY;EAClBC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;IACJZ,OAAO,EAAE;MACPa,KAAK,EAAE;QAAEb,OAAO,EAAE;MAAQ,CAAC;MAC3Bc,IAAI,EAAE;QAAEd,OAAO,EAAE;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